]> Git Repo - linux.git/log
linux.git
8 years agoDocumentation/sparse: drop __bitwise__
Michael S. Tsirkin [Sun, 11 Dec 2016 04:28:41 +0000 (06:28 +0200)]
Documentation/sparse: drop __bitwise__

We dropped __CHECK_ENDIAN__ so __bitwise__ is now an implementation
detail. People should use __bitwise everywhere.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agotools: enable endian checks for all sparse builds
Michael S. Tsirkin [Sun, 11 Dec 2016 04:27:21 +0000 (06:27 +0200)]
tools: enable endian checks for all sparse builds

We dropped need for __CHECK_ENDIAN__ for linux,
this mirrors this for tools.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agolinux/types.h: enable endian checks for all sparse builds
Michael S. Tsirkin [Thu, 8 Dec 2016 02:19:29 +0000 (04:19 +0200)]
linux/types.h: enable endian checks for all sparse builds

By now, linux is mostly endian-clean. Enabling endian-ness
checks for everyone produces about 200 new sparse warnings for me -
less than 10% over the 2000 sparse warnings already there.

Not a big deal, OTOH enabling this helps people notice
they are introducing new bugs.

So let's just drop __CHECK_ENDIAN__. Follow-up patches
can drop distinction between __bitwise and __bitwise__.

Cc: Linus Torvalds <[email protected]>
Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_mmio: Set dev.release() to avoid warning
Yuan Liu [Thu, 24 Nov 2016 00:31:00 +0000 (16:31 -0800)]
virtio_mmio: Set dev.release() to avoid warning

Fix a warning thrown from virtio_mmio_remove():
Device 'virtio0' does not have a release() function

The fix is according to virtio_pci_probe() of
drivers/virtio/virtio_pci_common.c

Signed-off-by: Yuan Liu <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovhost: remove unused feature bit
Jason Wang [Fri, 18 Nov 2016 07:58:39 +0000 (15:58 +0800)]
vhost: remove unused feature bit

Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_ring: fix description of virtqueue_get_buf
Felipe Franciosi [Mon, 14 Nov 2016 14:16:15 +0000 (06:16 -0800)]
virtio_ring: fix description of virtqueue_get_buf

The device (not the driver) populates the used ring and includes the len
of how much data was written.

Signed-off-by: Felipe Franciosi <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovhost/scsi: Remove unused but set variable
Tobias Klauser [Fri, 11 Nov 2016 13:27:10 +0000 (14:27 +0100)]
vhost/scsi: Remove unused but set variable

Remove the unused but set variable se_tpg in vhost_scsi_nexus_cb() to
fix the following GCC warning when building with 'W=1':

  drivers/vhost/scsi.c:1752:26: warning: variable ‘se_tpg’ set but not used

Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agotools/virtio: use {READ,WRITE}_ONCE() in uaccess.h
Mark Rutland [Thu, 24 Nov 2016 10:25:14 +0000 (10:25 +0000)]
tools/virtio: use {READ,WRITE}_ONCE() in uaccess.h

As a step towards killing off ACCESS_ONCE, use {READ,WRITE}_ONCE() for the
virtio tools uaccess primitives, pulling these in from <linux/compiler.h>.

With this done, we can kill off the now-unused ACCESS_ONCE() definition.

Signed-off-by: Mark Rutland <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Jason Wang <[email protected]>
8 years agovringh: kill off ACCESS_ONCE()
Mark Rutland [Thu, 24 Nov 2016 10:25:13 +0000 (10:25 +0000)]
vringh: kill off ACCESS_ONCE()

Despite living under drivers/ vringh.c is also used as part of the userspace
virtio tools. Before we can kill off the ACCESS_ONCE()definition in the tools,
we must convert vringh.c to use {READ,WRITE}_ONCE().

This patch does so, along with the required include of <linux/compiler.h> for
the relevant definitions. The userspace tools provide their own definitions in
their own <linux/compiler.h>.

Signed-off-by: Mark Rutland <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Christian Borntraeger <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Jason Wang <[email protected]>
8 years agotools/virtio: fix READ_ONCE()
Mark Rutland [Thu, 24 Nov 2016 10:25:12 +0000 (10:25 +0000)]
tools/virtio: fix READ_ONCE()

The virtio tools implementation of READ_ONCE() has a single parameter called
'var', but erroneously refers to 'val' for its cast, and thus won't work unless
there's a variable of the correct type that happens to be called 'var'.

Fix this with s/var/val/, making READ_ONCE() work as expected regardless.

Fixes: a7c490333df3cff5 ("tools/virtio: use virt_xxx barriers")
Signed-off-by: Mark Rutland <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Jason Wang <[email protected]>
8 years agocrypto: add virtio-crypto driver
Gonglei [Thu, 15 Dec 2016 02:03:16 +0000 (10:03 +0800)]
crypto: add virtio-crypto driver

This patch introduces virtio-crypto driver for Linux Kernel.

The virtio crypto device is a virtual cryptography device
as well as a kind of virtual hardware accelerator for
virtual machines. The encryption anddecryption requests
are placed in the data queue and are ultimately handled by
thebackend crypto accelerators. The second queue is the
control queue used to create or destroy sessions for
symmetric algorithms and will control some advanced features
in the future. The virtio crypto device provides the following
cryptoservices: CIPHER, MAC, HASH, and AEAD.

For more information about virtio-crypto device, please see:
  http://qemu-project.org/Features/VirtioCrypto

CC: Michael S. Tsirkin <[email protected]>
CC: Cornelia Huck <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: Herbert Xu <[email protected]>
CC: Halil Pasic <[email protected]>
CC: David S. Miller <[email protected]>
CC: Zeng Xin <[email protected]>
Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovhost: cache used event for better performance
Jason Wang [Mon, 12 Dec 2016 06:46:49 +0000 (14:46 +0800)]
vhost: cache used event for better performance

When event index was enabled, we need to fetch used event from
userspace memory each time. This userspace fetch (with memory
barrier) could be saved sometime when 1) caching used event and 2)
if used event is ahead of new and old to new updating does not cross
it, we're sure there's no need to notify guest.

This will be useful for heavy tx load e.g guest pktgen test with Linux
driver shows ~3.5% improvement.

Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovsock: lookup and setup guest_cid inside vhost_vsock_lock
Gao feng [Wed, 14 Dec 2016 11:24:36 +0000 (19:24 +0800)]
vsock: lookup and setup guest_cid inside vhost_vsock_lock

Multi vsocks may setup the same cid at the same time.

Signed-off-by: Gao feng <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
8 years agovirtio_pci: split vp_try_to_find_vqs into INTx and MSI-X variants
Christoph Hellwig [Thu, 17 Nov 2016 10:43:16 +0000 (11:43 +0100)]
virtio_pci: split vp_try_to_find_vqs into INTx and MSI-X variants

There is basically no shared logic between the INTx and MSI-X case in
vp_try_to_find_vqs, so split the function into two and clean them up
a little bit.

Also remove the fairly pointless vp_request_intx wrapper while we're at it.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_pci: merge vp_free_vectors into vp_del_vqs
Christoph Hellwig [Thu, 17 Nov 2016 10:43:15 +0000 (11:43 +0100)]
virtio_pci: merge vp_free_vectors into vp_del_vqs

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_pci: remove the call to vp_free_vectors in vp_request_msix_vectors
Christoph Hellwig [Thu, 17 Nov 2016 10:43:14 +0000 (11:43 +0100)]
virtio_pci: remove the call to vp_free_vectors in vp_request_msix_vectors

vp_request_msix_vectors is only called by vp_try_to_find_vqs, which already
calls vp_free_vectors through vp_del_vqs in the failure case.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_pci: use pci_alloc_irq_vectors
Christoph Hellwig [Thu, 17 Nov 2016 10:43:13 +0000 (11:43 +0100)]
virtio_pci: use pci_alloc_irq_vectors

This avoids the separate allocation for the msix_entries structures, and
instead allows us to use pci_irq_vector to find a given IRQ vector.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio: clean up handling of request_irq failure
Michael S. Tsirkin [Thu, 15 Dec 2016 21:58:13 +0000 (23:58 +0200)]
virtio: clean up handling of request_irq failure

We call del_vqs twice when request_irq fails, this
makes no sense.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agoMerge tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Thu, 15 Dec 2016 21:49:34 +0000 (13:49 -0800)]
Merge tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing updates from Steven Rostedt:
 "This release has a few updates:

   - STM can hook into the function tracer
   - Function filtering now supports more advance glob matching
   - Ftrace selftests updates and added tests
   - Softirq tag in traces now show only softirqs
   - ARM nop added to non traced locations at compile time
   - New trace_marker_raw file that allows for binary input
   - Optimizations to the ring buffer
   - Removal of kmap in trace_marker
   - Wakeup and irqsoff tracers now adhere to the set_graph_notrace file
   - Other various fixes and clean ups"

* tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (42 commits)
  selftests: ftrace: Shift down default message verbosity
  kprobes/trace: Fix kprobe selftest for newer gcc
  tracing/kprobes: Add a helper method to return number of probe hits
  tracing/rb: Init the CPU mask on allocation
  tracing: Use SOFTIRQ_OFFSET for softirq dectection for more accurate results
  tracing/fgraph: Have wakeup and irqsoff tracers ignore graph functions too
  fgraph: Handle a case where a tracer ignores set_graph_notrace
  tracing: Replace kmap with copy_from_user() in trace_marker writing
  ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it
  tracing: Allow benchmark to be enabled at early_initcall()
  tracing: Have system enable return error if one of the events fail
  tracing: Do not start benchmark on boot up
  tracing: Have the reg function allow to fail
  ring-buffer: Force rb_end_commit() and rb_set_commit_to_write() inline
  ring-buffer: Froce rb_update_write_stamp() to be inlined
  ring-buffer: Force inline of hotpath helper functions
  tracing: Make __buffer_unlock_commit() always_inline
  tracing: Make tracepoint_printk a static_key
  ring-buffer: Always inline rb_event_data()
  ring-buffer: Make rb_reserve_next_event() always inlined
  ...

8 years agoMerge tag 'for-linus-4.10-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 15 Dec 2016 21:41:55 +0000 (13:41 -0800)]
Merge tag 'for-linus-4.10-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux

Pull orangefs updates from Mike Marshall:
 "Two small fixes sent in by other developers:

   - axe some dead code (Christophe Jaillet)

   - fix memory leak (Colin Ian King, found by Coverity)"

* tag 'for-linus-4.10-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
  orangefs: Axe some dead code
  orangefs: fix memory leak of string 'new' on exit path

8 years agoMerge tag 'upstream-4.10-rc1' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Thu, 15 Dec 2016 21:37:08 +0000 (13:37 -0800)]
Merge tag 'upstream-4.10-rc1' of git://git.infradead.org/linux-ubifs

Pull ubifs updates from Richard Weinberger:

 - file encryption for UBIFS using the fscrypt framework

 - a fix to honor the dirty_writeback_interval sysctl

 - removal of dead code

* tag 'upstream-4.10-rc1' of git://git.infradead.org/linux-ubifs: (30 commits)
  ubifs: Initialize fstr_real_len
  ubifs: Use fscrypt ioctl() helpers
  ubifs: Use FS_CFLG_OWN_PAGES
  ubifs: Raise write version to 5
  ubifs: Implement UBIFS_FLG_ENCRYPTION
  ubifs: Implement UBIFS_FLG_DOUBLE_HASH
  ubifs: Use a random number for cookies
  ubifs: Add full hash lookup support
  ubifs: Rename tnc_read_node_nm
  ubifs: Add support for encrypted symlinks
  ubifs: Implement encrypted filenames
  ubifs: Make r5 hash binary string aware
  ubifs: Relax checks in ubifs_validate_entry()
  ubifs: Implement encrypt/decrypt for all IO
  ubifs: Constify struct inode pointer in ubifs_crypt_is_encrypted()
  ubifs: Introduce new data node field, compr_size
  ubifs: Enforce crypto policy in mmap
  ubifs: Massage assert in ubifs_xattr_set() wrt. fscrypto
  ubifs: Preload crypto context in ->lookup()
  ubifs: Enforce crypto policy in ->link and ->rename
  ...

8 years agoMerge tag 'platform-drivers-x86-v4.10-1' of git://git.infradead.org/users/dvhart...
Linus Torvalds [Thu, 15 Dec 2016 21:31:25 +0000 (13:31 -0800)]
Merge tag 'platform-drivers-x86-v4.10-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver updates from Darrent Hart:
 "Introduce one new driver for Mellanox platforms. Add support for
  various new models to existing drivers via quirks, hotkeys, etc.
  Significant updates to intel_pmc_core in support of Kabylake and
  Sunrise Point PCH power management debug. Some cleanup and refactoring
  across various drivers.

  Detailed summary:

  dell-laptop:
   - Use brightness_set_blocking for kbd_led_level_set

  thinkpad_acpi:
   - Initialize local in_tablet_mode and type
   - Fix old style declaration GCC warning
   - Adding new hotkey ID for Lenovo thinkpad
   - Add support for X1 Yoga (2016) Tablet Mode
   - Move tablet detection into separate function

  asus-nb-wmi:
   - Add X45U quirk
   - Make use of dmi->ident

  asus-wmi:
   - Set specified XUSB2PR value for X550LB

  intel_mid_thermal:
   - Fix suspend handlers unused warning

  intel-vbtn:
   - Switch to use devm_input_allocate_device

  dell-wmi:
   - Add events created by Dell Rugged 2-in-1s
   - Adjust wifi catcher to emit KEY_WLAN

  intel_pmc_core:
   - Add KBL CPUID support
   - Add LTR IGNORE debug feature
   - Add MPHY PLL clock gating status
   - ModPhy core lanes pg status
   - Add PCH IP Power Gating Status
   - Fix PWRMBASE mask and mmio reg len

  acer-wmi:
   - Only supports AMW0_GUID1 on acer family

  mlx-platform:
   - Introduce support for Mellanox hotplug driver

  platform/x86:
   - Use ACPI_FAILURE at appropriate places"

* tag 'platform-drivers-x86-v4.10-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (22 commits)
  platform/x86: thinkpad_acpi: Initialize local in_tablet_mode and type
  platform/x86: dell-laptop: Use brightness_set_blocking for kbd_led_level_set
  platform/x86: thinkpad_acpi: Fix old style declaration GCC warning
  platform/x86: thinkpad_acpi: Adding new hotkey ID for Lenovo thinkpad
  platform/x86: thinkpad_acpi: Add support for X1 Yoga (2016) Tablet Mode
  platform/x86: thinkpad_acpi: Move tablet detection into separate function
  platform/x86: asus-nb-wmi.c: Add X45U quirk
  platform/x86: asus-nb-wmi: Make use of dmi->ident
  platform/x86: asus-wmi: Set specified XUSB2PR value for X550LB
  platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
  platform/x86: intel-vbtn: Switch to use devm_input_allocate_device
  platform/x86: Use ACPI_FAILURE at appropriate places
  platform/x86: dell-wmi: Add events created by Dell Rugged 2-in-1s
  platform/x86: dell-wmi: Adjust wifi catcher to emit KEY_WLAN
  platform/x86: intel_pmc_core: Add KBL CPUID support
  platform/x86: intel_pmc_core: Add LTR IGNORE debug feature
  platform/x86: intel_pmc_core: Add MPHY PLL clock gating status
  platform/x86: intel_pmc_core: ModPhy core lanes pg status
  platform/x86: intel_pmc_core: Add PCH IP Power Gating Status
  platform/x86: intel_pmc_core: Fix PWRMBASE mask and mmio reg len
  ...

8 years agoMerge branch 'i2c/for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Thu, 15 Dec 2016 20:56:35 +0000 (12:56 -0800)]
Merge branch 'i2c/for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:

 - the first series of making i2c_device_id optional instead of
   mandatory (in favor of alternatives like of_device_id).

   This involves adding a new probe callback (probe_new) which removes
   some peculiarities I2C had for a long time now. The new probe is
   matching the other subsystems now and the old one will be removed
   once all users are converted. It is expected to take a while but
   there is ongoing interest in that.

 - SMBus Host Notify introduced 4.9 got refactored. They are now using
   interrupts instead of the alert callback which solves multiple
   issues.

 - new drivers for iMX LowPower I2C, Mellanox CPLD and its I2C mux

 - significant refactoring for bcm2835 driver

 - the usual set of driver updates and improvements

* 'i2c/for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (46 commits)
  i2c: fsl-lpi2c: read lpi2c fifo size in probe()
  i2c: octeon: thunderx: Remove double-check after interrupt
  i2c: octeon: thunderx: TWSI software reset in recovery
  i2c: cadence: Allow Cadence I2C to be selected for Cadence Xtensa CPUs
  i2c: sh_mobile: Add per-Generation fallback bindings
  i2c: rcar: Add per-Generation fallback bindings
  i2c: imx-lpi2c: add low power i2c bus driver
  dt-bindings: i2c: imx-lpi2c: add devicetree bindings
  i2c: designware-pcidrv: Add 10bit address feature to medfield/merrifield
  i2c: pxa: Add support for the I2C units found in Armada 3700
  i2c: pxa: Add definition of fast and high speed modes via the regs layout
  dt-bindings: i2c: pxa: Update the documentation for the Armada 3700
  i2c: qup: support SMBus block read
  i2c: qup: add ACPI support
  i2c: designware: Consolidate default functionality bits
  i2c: i2c-mux-gpio: update mux with gpiod_set_array_value_cansleep
  i2c: mux: pca954x: Add ACPI support for pca954x
  i2c: use an IRQ to report Host Notify events, not alert
  i2c: i801: remove SMBNTFDDAT reads as they always seem to return 0
  i2c: i801: use the BIT() macro for FEATURES_* also
  ...

8 years agoMerge tag 'pci-v4.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
Linus Torvalds [Thu, 15 Dec 2016 20:46:48 +0000 (12:46 -0800)]
Merge tag 'pci-v4.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI updates from Bjorn Helgaas:
 "PCI changes:

   - add support for PCI on ARM64 boxes with ACPI. We already had this
     for theoretical spec-compliant hardware; now we're adding quirks
     for the actual hardware (Cavium, HiSilicon, Qualcomm, X-Gene)

   - add runtime PM support for hotplug ports

   - enable runtime suspend for Intel UHCI that uses platform-specific
     wakeup signaling

   - add yet another host bridge registration interface. We hope this is
     extensible enough to subsume the others

   - expose device revision in sysfs for DRM

   - to avoid device conflicts, make sure any VF BAR updates are done
     before enabling the VF

   - avoid unnecessary link retrains for ASPM

   - allow INTx masking on Mellanox devices that support it

   - allow access to non-standard VPD for Chelsio devices

   - update Broadcom iProc support for PAXB v2, PAXC v2, inbound DMA,
     etc

   - update Rockchip support for max-link-speed

   - add NVIDIA Tegra210 support

   - add Layerscape LS1046a support

   - update R-Car compatibility strings

   - add Qualcomm MSM8996 support

   - remove some uninformative bootup messages"

* tag 'pci-v4.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (115 commits)
  PCI: Enable access to non-standard VPD for Chelsio devices (cxgb3)
  PCI: Expand "VPD access disabled" quirk message
  PCI: pciehp: Remove loading message
  PCI: hotplug: Remove hotplug core message
  PCI: Remove service driver load/unload messages
  PCI/AER: Log AER IRQ when claiming Root Port
  PCI/AER: Log errors with PCI device, not PCIe service device
  PCI/AER: Remove unused version macros
  PCI/PME: Log PME IRQ when claiming Root Port
  PCI/PME: Drop unused support for PMEs from Root Complex Event Collectors
  PCI: Move config space size macros to pci_regs.h
  x86/platform/intel-mid: Constify mid_pci_platform_pm
  PCI/ASPM: Don't retrain link if ASPM not possible
  PCI: iproc: Skip check for legacy IRQ on PAXC buses
  PCI: pciehp: Leave power indicator on when enabling already-enabled slot
  PCI: pciehp: Prioritize data-link event over presence detect
  PCI: rcar: Add gen3 fallback compatibility string for pcie-rcar
  PCI: rcar: Use gen2 fallback compatibility last
  PCI: rcar-gen2: Use gen2 fallback compatibility last
  PCI: rockchip: Move the deassert of pm/aclk/pclk after phy_init()
  ..

8 years agoplatform/x86: thinkpad_acpi: Initialize local in_tablet_mode and type
Darren Hart [Wed, 14 Dec 2016 22:45:48 +0000 (14:45 -0800)]
platform/x86: thinkpad_acpi: Initialize local in_tablet_mode and type

linux-next reported in_tablet_mode and type may be used uninitialized
after:

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

This turns out to be a false positive as the pr_info call cannot be
reached if tp_features.hotkey_tablet (global scope) is 0, and
in_tablet_mode and type are assigned in both places
tp_features.hotkey_tablet is assigned.

Regardless, to make it explicit and avoid further reports, initialize
in_tablet_mode to 0 and type to NULL.

Signed-off-by: Darren Hart <[email protected]>
Acked-by: Henrique de Moraes Holschuh <[email protected]>
Cc: Lyude <[email protected]>
8 years agoMerge tag 'iommu-updates-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 15 Dec 2016 20:24:14 +0000 (12:24 -0800)]
Merge tag 'iommu-updates-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU updates from Joerg Roedel:
 "These changes include:

   - support for the ACPI IORT table on ARM systems and patches to make
     the ARM-SMMU driver make use of it

   - conversion of the Exynos IOMMU driver to device dependency links
     and implementation of runtime pm support based on that conversion

   - update the Mediatek IOMMU driver to use the new struct
     device->iommu_fwspec member

   - implementation of dma_map/unmap_resource in the generic ARM
     dma-iommu layer

   - a number of smaller fixes and improvements all over the place"

* tag 'iommu-updates-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (44 commits)
  ACPI/IORT: Make dma masks set-up IORT specific
  iommu/amd: Missing error code in amd_iommu_init_device()
  iommu/s390: Drop duplicate header pci.h
  ACPI/IORT: Introduce iort_iommu_configure
  ACPI/IORT: Add single mapping function
  ACPI/IORT: Replace rid map type with type mask
  iommu/arm-smmu: Add IORT configuration
  iommu/arm-smmu: Split probe functions into DT/generic portions
  iommu/arm-smmu-v3: Add IORT configuration
  iommu/arm-smmu-v3: Split probe functions into DT/generic portions
  ACPI/IORT: Add support for ARM SMMU platform devices creation
  ACPI/IORT: Add node match function
  ACPI: Implement acpi_dma_configure
  iommu/arm-smmu-v3: Convert struct device of_node to fwnode usage
  iommu/arm-smmu: Convert struct device of_node to fwnode usage
  iommu: Make of_iommu_set/get_ops() DT agnostic
  ACPI/IORT: Add support for IOMMU fwnode registration
  ACPI/IORT: Introduce linker section for IORT entries probing
  ACPI: Add FWNODE_ACPI_STATIC fwnode type
  iommu/arm-smmu: Set SMTNMB_TLBEN in ACR to enable caching of bypass entries
  ...

8 years agordma: fix buggy code that the compiler warns about
Linus Torvalds [Thu, 15 Dec 2016 20:18:42 +0000 (12:18 -0800)]
rdma: fix buggy code that the compiler warns about

Get rid of this warning:

  drivers/infiniband/sw/rdmavt/cq.c: In function ‘rvt_cq_exit’:
  drivers/infiniband/sw/rdmavt/cq.c:542:2: warning: ‘worker’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    kthread_destroy_worker(worker);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by fixing the function to actually work.

Fixes: 6efaf10f163d ("IB/rdmavt: Avoid queuing work into a destroyed cq kthread worker")
Cc: Petr Mladek <[email protected]>
Cc: Doug Ledford <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Linus Torvalds [Thu, 15 Dec 2016 20:03:32 +0000 (12:03 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma updates from Doug Ledford:
 "This is the complete update for the rdma stack for this release cycle.

  Most of it is typical driver and core updates, but there is the
  entirely new VMWare pvrdma driver. You may have noticed that there
  were changes in DaveM's pull request to the bnxt Ethernet driver to
  support a RoCE RDMA driver. The bnxt_re driver was tentatively set to
  be pulled in this release cycle, but it simply wasn't ready in time
  and was dropped (a few review comments still to address, and some
  multi-arch build issues like prefetch() not working across all
  arches).

  Summary:

   - shared mlx5 updates with net stack (will drop out on merge if
     Dave's tree has already been merged)

   - driver updates: cxgb4, hfi1, hns-roce, i40iw, mlx4, mlx5, qedr, rxe

   - debug cleanups

   - new connection rejection helpers

   - SRP updates

   - various misc fixes

   - new paravirt driver from vmware"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (210 commits)
  IB: Add vmw_pvrdma driver
  IB/mlx4: fix improper return value
  IB/ocrdma: fix bad initialization
  infiniband: nes: return value of skb_linearize should be handled
  MAINTAINERS: Update Intel RDMA RNIC driver maintainers
  MAINTAINERS: Remove Mitesh Ahuja from emulex maintainers
  IB/core: fix unmap_sg argument
  qede: fix general protection fault may occur on probe
  IB/mthca: Replace pci_pool_alloc by pci_pool_zalloc
  mlx5, calc_sq_size(): Make a debug message more informative
  mlx5: Remove a set-but-not-used variable
  mlx5: Use { } instead of { 0 } to init struct
  IB/srp: Make writing the add_target sysfs attr interruptible
  IB/srp: Make mapping failures easier to debug
  IB/srp: Make login failures easier to debug
  IB/srp: Introduce a local variable in srp_add_one()
  IB/srp: Fix CONFIG_DYNAMIC_DEBUG=n build
  IB/multicast: Check ib_find_pkey() return value
  IPoIB: Avoid reading an uninitialized member variable
  IB/mad: Fix an array index check
  ...

8 years agoMerge tag 'devicetree-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 15 Dec 2016 19:49:41 +0000 (11:49 -0800)]
Merge tag 'devicetree-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull DeviceTree updates from Rob Herring:

 - add various vendor prefixes.

 - fix NUMA node handling when "numa=off" is passed on kernel command
   line.

 - coding style Clean-up of overlay handling code.

 - DocBook fixes in DT platform driver code

 - Altera SoCFPGA binding addtions for freeze bridge, arria10 FPGA
   manager and FPGA bridges.

 - a couple of printk message fixes.

* tag 'devicetree-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (33 commits)
  dt: pwm: bcm2835: fix typo in clocks property name
  devicetree: add vendor prefix for National Instruments
  Revert "of: base: add support to get machine model name"
  of: Fix issue where code would fall through to error case.
  drivers/of: fix missing pr_cont()s in of_print_phandle_args
  devicetree: bindings: Add vendor prefix for Oki
  devicetree: bindings: Add vendor prefix for Andes Technology Corporation
  dt-bindings: add MYIR Tech hardware vendor prefix
  add bindings document for altera freeze bridge
  ARM: socfpga: add bindings doc for arria10 fpga manager
  ARM: socfpga: add bindings document for fpga bridge drivers
  of: base: add support to get machine model name
  of/platform: clarify of_find_device_by_node refcounting
  of/platform: fix of_platform_device_destroy comment
  of: Remove unused variable overlay_symbols
  of: Move setting of pointer to beside test for non-null
  of: Add back an error message, restructured
  of: Update comments to reflect changes and increase clarity
  of: Remove redundant size check
  of: Update structure of code to be clearer, also remove BUG_ON()
  ...

8 years agoMerge tag 'pwm/for-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
Linus Torvalds [Thu, 15 Dec 2016 19:45:13 +0000 (11:45 -0800)]
Merge tag 'pwm/for-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm updates from Thierry Reding:
 "This is a very tiny pull request, with just a new driver for HiSilicon
  BVT SoCs and a cleanup for the Amlogic Meson driver.

  There are other patches on the list, but my timing was really bad this
  time and I ended up not having the time to look at them in enough
  detail to be comfortable merging them"

* tag 'pwm/for-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: Add PWM driver for HiSilicon BVT SOCs
  pwm: meson: Remove unneeded platform MODULE_ALIAS

8 years agoMerge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 15 Dec 2016 19:41:37 +0000 (11:41 -0800)]
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - a crash regression in the new skcipher walker

   - incorrect return value in public_key_verify_signature

   - fix for in-place signing in the sign-file utility"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: skcipher - fix crash in virtual walk
  sign-file: Fix inplace signing when src and dst names are both specified
  crypto: asymmetric_keys - set error code on failure

8 years agoafs, rxrpc: Update the MAINTAINERS file
David Howells [Thu, 15 Dec 2016 13:59:50 +0000 (13:59 +0000)]
afs, rxrpc: Update the MAINTAINERS file

Update the MAINTAINERS file for AFS and AF_RXRPC to include a website
pointer.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoredo: radix tree test suite: fix compilation
Matthew Wilcox [Wed, 7 Dec 2016 22:44:33 +0000 (14:44 -0800)]
redo: radix tree test suite: fix compilation

[ This resurrects commit 53855d10f456, which was reverted in
  2b41226b39b6.  It depended on commit d544abd5ff7d ("lib/radix-tree:
  Convert to hotplug state machine") so now it is correct to apply ]

Patch "lib/radix-tree: Convert to hotplug state machine" breaks the test
suite as it adds a call to cpuhp_setup_state_nocalls() which is not
currently emulated in the test suite.  Add it, and delete the emulation
of the old CPU hotplug mechanism.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoprintk: Remove no longer used second struct cont
Geert Uytterhoeven [Thu, 15 Dec 2016 12:53:58 +0000 (13:53 +0100)]
printk: Remove no longer used second struct cont

If CONFIG_PRINTK=n:

    kernel/printk/printk.c:1893: warning: ‘cont’ defined but not used

Note that there are actually two different struct cont definitions and
objects: the first one is used if CONFIG_PRINTK=y, the second one became
unused by removing console_cont_flush().

Fixes: 5c2992ee7fd8 ("printk: remove console flushing special cases for partial buffered lines")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Acked-by: Petr Mladek <[email protected]>
[ I do the occasional "allnoconfig" builds, but apparently not often
  enough  - Linus ]
Signed-off-by: Linus Torvalds <[email protected]>
8 years agocpu/hotplug: Clarify description of __cpuhp_setup_state() return value
Boris Ostrovsky [Thu, 15 Dec 2016 15:00:57 +0000 (10:00 -0500)]
cpu/hotplug: Clarify description of __cpuhp_setup_state() return value

When invoked with CPUHP_AP_ONLINE_DYN state __cpuhp_setup_state()
is expected to return positive value which is the hotplug state that
the routine assigns.

Signed-off-by: Boris Ostrovsky <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agoKVM: x86: Expose Intel AVX512IFMA/AVX512VBMI/SHA features to guest.
Yi Sun [Wed, 14 Dec 2016 02:42:29 +0000 (10:42 +0800)]
KVM: x86: Expose Intel AVX512IFMA/AVX512VBMI/SHA features to guest.

Expose AVX512IFMA/AVX512VBMI/SHA features to guest.

AVX512 spec can be found at:
https://software.intel.com/sites/default/files/managed/26/40/319433-026.pdf

SHA spec can be found at:
https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf

This patch depends on below patch.
http://marc.info/?l=linux-kernel&m=147932800828178&w=2

Signed-off-by: Yi Sun <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agokvm: nVMX: Correct a VMX instruction error code for VMPTRLD
GanShun [Wed, 30 Nov 2016 18:28:19 +0000 (10:28 -0800)]
kvm: nVMX: Correct a VMX instruction error code for VMPTRLD

When the operand passed to VMPTRLD matches the address of the VMXON
region, the VMX instruction error code should be
VMXERR_VMPTRLD_VMXON_POINTER rather than VMXERR_VMCLEAR_VMXON_POINTER.

Signed-off-by: GanShun <[email protected]>
Signed-off-by: Jim Mattson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agox86/mm: Drop unused argument 'removed' from sync_global_pgds()
Kirill A. Shutemov [Wed, 14 Dec 2016 23:44:03 +0000 (02:44 +0300)]
x86/mm: Drop unused argument 'removed' from sync_global_pgds()

Since commit af2cf278ef4f ("x86/mm/hotplug: Don't remove PGD entries in
remove_pagetable()") there are no callers of sync_global_pgds() which set
the 'removed' argument to 1.

Remove the argument and the related conditionals in the function.

Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agogenirq/affinity: Fix node generation from cpumask
Guilherme G. Piccoli [Wed, 14 Dec 2016 18:01:12 +0000 (16:01 -0200)]
genirq/affinity: Fix node generation from cpumask

Commit 34c3d9819fda ("genirq/affinity: Provide smarter irq spreading
infrastructure") introduced a better IRQ spreading mechanism, taking
account of the available NUMA nodes in the machine.

Problem is that the algorithm of retrieving the nodemask iterates
"linearly" based on the number of online nodes - some architectures
present non-linear node distribution among the nodemask, like PowerPC.
If this is the case, the algorithm lead to a wrong node count number
and therefore to a bad/incomplete IRQ affinity distribution.

For example, this problem were found in a machine with 128 CPUs and two
nodes, namely nodes 0 and 8 (instead of 0 and 1, if it was linearly
distributed). This led to a wrong affinity distribution which then led to
a bad mq allocation for nvme driver.

Finally, we take the opportunity to fix a comment regarding the affinity
distribution when we have _more_ nodes than vectors.

Fixes: 34c3d9819fda ("genirq/affinity: Provide smarter irq spreading infrastructure")
Reported-by: Gabriel Krisman Bertazi <[email protected]>
Signed-off-by: Guilherme G. Piccoli <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Gabriel Krisman Bertazi <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agotick/broadcast: Prevent NULL pointer dereference
Thomas Gleixner [Thu, 15 Dec 2016 11:10:37 +0000 (12:10 +0100)]
tick/broadcast: Prevent NULL pointer dereference

When a disfunctional timer, e.g. dummy timer, is installed, the tick core
tries to setup the broadcast timer.

If no broadcast device is installed, the kernel crashes with a NULL pointer
dereference in tick_broadcast_setup_oneshot() because the function has no
sanity check.

Reported-by: Mason <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Anna-Maria Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: Peter Zijlstra <[email protected]>,
Cc: Sebastian Frias <[email protected]>
Cc: Thibaud Cornic <[email protected]>
Cc: Robin Murphy <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
8 years agoclocksource/dummy_timer: Move hotplug callback after the real timers
Thomas Gleixner [Thu, 15 Dec 2016 11:01:05 +0000 (12:01 +0100)]
clocksource/dummy_timer: Move hotplug callback after the real timers

When the dummy timer callback is invoked before the real timer callbacks,
then it tries to install that timer for the starting CPU. If the platform
does not have a broadcast timer installed the installation fails with a
kernel crash. The crash happens due to a unconditional deference of the non
available broadcast device. This needs to be fixed in the timer core code.

But even when this is fixed in the core code then installing the dummy
timer before the real timers is a pointless exercise.

Move it to the end of the callback list.

Fixes: 00c1d17aab51 ("clocksource/dummy_timer: Convert to hotplug state machine")
Reported-and-tested-by: Mason <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Anna-Maria Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: Peter Zijlstra <[email protected]>,
Cc: Sebastian Frias <[email protected]>
Cc: Thibaud Cornic <[email protected]>
Cc: Robin Murphy <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
8 years agoEDAC: Document HW_EVENT_ERR_DEFERRED type
Yazen Ghannam [Thu, 1 Dec 2016 20:24:53 +0000 (14:24 -0600)]
EDAC: Document HW_EVENT_ERR_DEFERRED type

Add a description of the HW_EVENT_ERR_DEFERRED type that wasn't included
with commit d12a969ebbfc ("EDAC, amd64: Add Deferred Error type").

Signed-off-by: Yazen Ghannam <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.rst: move concepts dictionary from edac.h
Mauro Carvalho Chehab [Sat, 29 Oct 2016 18:13:23 +0000 (16:13 -0200)]
edac.rst: move concepts dictionary from edac.h

Instead of storing the concepts dictionary inside header file,
move it to the subsystem documentation.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: fix kenel-doc markups at edac.h
Mauro Carvalho Chehab [Fri, 28 Oct 2016 17:04:52 +0000 (15:04 -0200)]
edac: fix kenel-doc markups at edac.h

As this file was never added to the driver-api, the kernel-doc
markups there were never tested. Some of them have issues.
Fix them.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: fix kernel-doc tags at the drivers/edac_*.h
Mauro Carvalho Chehab [Sat, 29 Oct 2016 12:35:23 +0000 (10:35 -0200)]
edac: fix kernel-doc tags at the drivers/edac_*.h

Some kernel-doc tags don't provide good descriptions or use
a different style. Adjust them.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: adjust docs location at MAINTAINERS and 00-INDEX
Mauro Carvalho Chehab [Thu, 27 Oct 2016 08:35:16 +0000 (06:35 -0200)]
edac: adjust docs location at MAINTAINERS and 00-INDEX

Update MAINTAINERS to reflect the location of edac.rst and ras.rst.

In the case of 00-INDEX, there's already an entry to the admin-guide,
so all we need to do is to remove the entry there.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agodriver-api: create an edac.rst file with EDAC documentation
Mauro Carvalho Chehab [Wed, 26 Oct 2016 16:14:45 +0000 (14:14 -0200)]
driver-api: create an edac.rst file with EDAC documentation

Currently, there's no device driver documentation for the EDAC
subsystem at the driver-api book. Fill in the blanks for the
structures and functions that misses documentation, uniform
the word on the existing ones, and add a new edac.rst file at
driver-api, in order to document the EDAC subsystem.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: move documentation from edac_mc.c to edac_core.h
Mauro Carvalho Chehab [Wed, 26 Oct 2016 17:47:55 +0000 (15:47 -0200)]
edac: move documentation from edac_mc.c to edac_core.h

Several functions are documented at edac_mc.c.

As we'll be including edac_core.h at drivers-api book, move
those, in order for the kernel-doc markups be part of the API
documentation book.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: move documentation from edac_pci*.c to edac_pci.h
Mauro Carvalho Chehab [Wed, 26 Oct 2016 18:13:43 +0000 (16:13 -0200)]
edac: move documentation from edac_pci*.c to edac_pci.h

Several functions are documented at edac_pci.c and edac_pci_sysfs.c.

As we'll be including edac_pci.h at drivers-api book, move those,
in order for the kernel-doc markups be part of the API
documentation book.

As several of those kernel-doc macros are not in the right format,
fix them.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: move documentation from edac_device to edac_core.h
Mauro Carvalho Chehab [Wed, 26 Oct 2016 18:01:47 +0000 (16:01 -0200)]
edac: move documentation from edac_device to edac_core.h

Several functions are documented at edac_device.c.

As we'll be including edac_core.h at drivers-api book, move those,
in order for the kernel-doc markups be part of the API
documentation book.

As several of those kernel-doc macros are not in the right format,
fix them.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: rename edac_core.h to edac_mc.h
Mauro Carvalho Chehab [Sat, 29 Oct 2016 17:16:34 +0000 (15:16 -0200)]
edac: rename edac_core.h to edac_mc.h

Now, all left at edac_core.h are at drivers/edac/edac_mc.c,
so rename it to edac_mc.h.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: move EDAC device definitions to drivers/edac/edac_device.h
Mauro Carvalho Chehab [Sat, 29 Oct 2016 12:01:41 +0000 (10:01 -0200)]
edac: move EDAC device definitions to drivers/edac/edac_device.h

The edac_core.h header contain data structures and function
definitions for both EDAC MC and EDAC device.

Let's move the devices ones to a separate header file, as part
of a header reorganization.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: move EDAC PCI definitions to drivers/edac/edac_pci.h
Mauro Carvalho Chehab [Sat, 29 Oct 2016 11:56:00 +0000 (09:56 -0200)]
edac: move EDAC PCI definitions to drivers/edac/edac_pci.h

The edac_core.h header contain data structures and function
definitions for the 3 parts of EDAC: MC, PCI and device.

Let's move the PCI ones to a separate header file, as part
of a header reorganization.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agodocs-rst: admin-guide: add documentation for EDAC
Mauro Carvalho Chehab [Wed, 26 Oct 2016 18:24:41 +0000 (16:24 -0200)]
docs-rst: admin-guide: add documentation for EDAC

EDAC is part of the Kernel's RAS facilities, with is useful for
system admins to detect errors. So, add it to the admin's guide.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.txt: Improve documentation, adding RAS introduction
Mauro Carvalho Chehab [Thu, 27 Oct 2016 11:26:36 +0000 (09:26 -0200)]
edac.txt: Improve documentation, adding RAS introduction

The edac.txt assumes that the reader has already deep knowledge
on RAS features. However, this may not be the case. So, add an
introduction chapter explaining the main concepts that are used by
the EDAC subsystem and by other RAS drivers within the Kernel.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.txt: update information about newer Intel CPUs
Mauro Carvalho Chehab [Wed, 26 Oct 2016 10:43:58 +0000 (08:43 -0200)]
edac.txt: update information about newer Intel CPUs

There's a chapter at edac.rst written by the time Nehalem
support was added. Such information is used not only by the
Nehalem driver (i7core_edac), but by all newer Intel CPU
architectures that are supported by i7core_edac, sb_edac
and sbx_edac drivers.

Update the information to reflect that.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.txt: remove info that the Nehalem EDAC is experimental
Mauro Carvalho Chehab [Wed, 26 Oct 2016 10:19:57 +0000 (08:19 -0200)]
edac.txt: remove info that the Nehalem EDAC is experimental

This driver has been there for almost 3 years, without any
conceptual changes. So, it is not experimental anymore, and
won't likely have any changes at the API or on log outputs.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.txt: convert EDAC documentation to ReST
Mauro Carvalho Chehab [Wed, 26 Oct 2016 10:14:12 +0000 (08:14 -0200)]
edac.txt: convert EDAC documentation to ReST

Converts the EDAC driver subsystem documentation to ReST:

- Put paragraph titles in lower case;
- Add code blocks where needed;
- Convert tables to ReST markup;
- Mark filesystem and module names as verbatim;
- Adjust document to be properly displayed in html.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac.txt: add a section explaining the dimmX and rankX directories
Mauro Carvalho Chehab [Thu, 27 Oct 2016 12:00:46 +0000 (10:00 -0200)]
edac.txt: add a section explaining the dimmX and rankX directories

Documentation for those are missing at the EDAC description.

I guess we end by moving such descriptions in the past to the
ABI document (or only added it there), but it means that the
EDAC documentation is incomplete. So, add it there.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: edac_core.h: remove prototype for edac_pci_reset_delay_period()
Mauro Carvalho Chehab [Wed, 26 Oct 2016 18:15:02 +0000 (16:15 -0200)]
edac: edac_core.h: remove prototype for edac_pci_reset_delay_period()

This function doesn't exist. So, remove its prototype.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agoedac: edac_core.h: get rid of unused kobj_complete
Mauro Carvalho Chehab [Wed, 26 Oct 2016 17:25:23 +0000 (15:25 -0200)]
edac: edac_core.h: get rid of unused kobj_complete

This element of struct edac_pci_ctl_info is never used. So,
get rid of it.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
8 years agox86/tsc: Force TSC_ADJUST register to value >= zero
Thomas Gleixner [Tue, 13 Dec 2016 13:14:17 +0000 (13:14 +0000)]
x86/tsc: Force TSC_ADJUST register to value >= zero

Roland reported that his DELL T5810 sports a value add BIOS which
completely wreckages the TSC. The squirmware [(TM) Ingo Molnar] boots with
random negative TSC_ADJUST values, different on all CPUs. That renders the
TSC useless because the sycnchronization check fails.

Roland tested the new TSC_ADJUST mechanism. While it manages to readjust
the TSCs he needs to disable the TSC deadline timer, otherwise the machine
just stops booting.

Deeper investigation unearthed that the TSC deadline timer is sensitive to
the TSC_ADJUST value. Writing TSC_ADJUST to a negative value results in an
interrupt storm caused by the TSC deadline timer.

This does not make any sense and it's hard to imagine what kind of hardware
wreckage is behind that misfeature, but it's reliably reproducible on other
systems which have TSC_ADJUST and TSC deadline timer.

While it would be understandable that a big enough negative value which
moves the resulting TSC readout into the negative space could have the
described effect, this happens even with a adjust value of -1, which keeps
the TSC readout definitely in the positive space. The compare register for
the TSC deadline timer is set to a positive value larger than the TSC, but
despite not having reached the deadline the interrupt is raised
immediately. If this happens on the boot CPU, then the machine dies
silently because this setup happens before the NMI watchdog is armed.

Further experiments showed that any other adjustment of TSC_ADJUST works as
expected as long as it stays in the positive range. The direction of the
adjustment has no influence either. See the lkml link for further analysis.

Yet another proof for the theory that timers are designed by janitors and
the underlying (obviously undocumented) mechanisms which allow BIOSes to
wreckage them are considered a feature. Well done Intel - NOT!

To address this wreckage add the following sanity measures:

- If the TSC_ADJUST value on the boot cpu is not 0, set it to 0

- If the TSC_ADJUST value on any cpu is negative, set it to 0

- Prevent the cross package synchronization mechanism from setting negative
  TSC_ADJUST values.

Reported-and-tested-by: Roland Scheidegger <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Bruce Schlobohm <[email protected]>
Cc: Kevin Stanton <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Allen Hung <[email protected]>
Cc: Borislav Petkov <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agox86/tsc: Validate TSC_ADJUST after resume
Thomas Gleixner [Tue, 13 Dec 2016 13:14:17 +0000 (13:14 +0000)]
x86/tsc: Validate TSC_ADJUST after resume

Some 'feature' BIOSes fiddle with the TSC_ADJUST register during
suspend/resume which renders the TSC unusable.

Add sanity checks into the resume path and restore the
original value if it was adjusted.

Reported-and-tested-by: Roland Scheidegger <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Bruce Schlobohm <[email protected]>
Cc: Kevin Stanton <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Allen Hung <[email protected]>
Cc: Borislav Petkov <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agoMerge branch 'patchwork' into v4l_for_linus
Mauro Carvalho Chehab [Thu, 15 Dec 2016 10:38:35 +0000 (08:38 -0200)]
Merge branch 'patchwork' into v4l_for_linus

* patchwork: (496 commits)
  [media] v4l: tvp5150: Add missing break in set control handler
  [media] v4l: tvp5150: Don't inline the tvp5150_selmux() function
  [media] v4l: tvp5150: Compile tvp5150_link_setup out if !CONFIG_MEDIA_CONTROLLER
  [media] em28xx: don't store usb_device at struct em28xx
  [media] em28xx: use usb_interface for dev_foo() calls
  [media] em28xx: don't change the device's name
  [media] mn88472: fix chip id check on probe
  [media] mn88473: fix chip id check on probe
  [media] lirc: fix error paths in lirc_cdev_add()
  [media] s5p-mfc: Add support for MFC v8 available in Exynos 5433 SoCs
  [media] s5p-mfc: Rework clock handling
  [media] s5p-mfc: Don't keep clock prepared all the time
  [media] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management code
  [media] s5p-mfc: Remove dead conditional code
  [media] s5p-mfc: Ensure that clock is disabled before turning power off
  [media] s5p-mfc: Remove special clock rate management
  [media] s5p-mfc: Use printk_ratelimited for reporting ioctl errors
  [media] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGES
  [media] vivid: Set color_enc on HSV formats
  [media] v4l2-tpg: Init hv_enc field with a valid value
  ...

8 years agoACPI/NUMA: Do not map pxm to node when NUMA is turned off
Boris Ostrovsky [Tue, 13 Dec 2016 04:18:29 +0000 (23:18 -0500)]
ACPI/NUMA: Do not map pxm to node when NUMA is turned off

acpi_map_pxm_to_node() unconditially maps nodes even when NUMA is turned
off. So acpi_get_node() might return a node > 0, which is fatal when NUMA
is disabled as the rest of the kernel assumes that only node 0 exists.

Expose numa_off to the acpi code and return NUMA_NO_NODE when it's set.

Signed-off-by: Boris Ostrovsky <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agox86/acpi: Use proper macro for invalid node
Boris Ostrovsky [Mon, 12 Dec 2016 19:29:52 +0000 (14:29 -0500)]
x86/acpi: Use proper macro for invalid node

Use NUMA_NO_NODE instead of -1.

Signed-off-by: Boris Ostrovsky <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agox86/smpboot: Prevent false positive out of bounds cpumask access warning
Thomas Gleixner [Tue, 13 Dec 2016 18:32:28 +0000 (19:32 +0100)]
x86/smpboot: Prevent false positive out of bounds cpumask access warning

prefill_possible_map() reinitializes the cpu_possible_map by setting the
possible cpu bits and clearing all other bits up to NR_CPUS.

This is technically always correct because cpu_possible_map is statically
allocated and sized NR_CPUS. With CPUMASK_OFFSTACK and DEBUG_PER_CPU_MAPS
enabled the bounds check of cpu masks happens on nr_cpu_ids. nr_cpu_ids is
initialized to NR_CPUS and only limited after the set/clear bit loops have
been executed.

But if the system was booted with "nr_cpus=N" on the command line, where N
is < NR_CPUS then nr_cpu_ids is limited in the parameter parsing function
before prefill_possible_map() is invoked. As a consequence the cpumask
bounds check triggers when clearing the bits past nr_cpu_ids.

Add a helper which allows to reset cpu_possible_map w/o the bounds check
and then set only the possible bits which are well inside bounds.

Reported-by: Dmitry Safonov <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: [email protected]
Cc: Jan Beulich <[email protected]>
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1612131836050.3415@nanos
Signed-off-by: Thomas Gleixner <[email protected]>
8 years agomac80211: fix legacy and invalid rx-rate report
Ben Greear [Wed, 14 Dec 2016 19:30:38 +0000 (11:30 -0800)]
mac80211: fix legacy and invalid rx-rate report

This fixes obtaining the rate info via sta_set_sinfo
when the rx rate is invalid (for instance, on IBSS
interface that has received no frames from one of its
peers).

Also initialize rinfo->flags for legacy rates, to not
rely on the whole sinfo being initialized to zero.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
8 years agoMerge branches 'work.namei', 'work.dcache' and 'work.iov_iter' into for-linus
Al Viro [Thu, 15 Dec 2016 06:07:29 +0000 (01:07 -0500)]
Merge branches 'work.namei', 'work.dcache' and 'work.iov_iter' into for-linus

8 years agoMerge tag 'xfs-for-linus-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 15 Dec 2016 05:35:31 +0000 (21:35 -0800)]
Merge tag 'xfs-for-linus-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs

Pull xfs updates from Dave Chinner:
 "There is quite a varied bunch of stuff in this update, and some of it
  you will have already merged through the ext4 tree which imported the
  dax-4.10-iomap-pmd topic branch from the XFS tree.

  There is also a new direct IO implementation that uses the iomap
  infrastructure. It's much simpler, faster, and has lower IO latency
  than the existing direct IO infrastructure.

  Summary:
   - DAX PMD faults via iomap infrastructure
   - Direct-io support in iomap infrastructure
   - removal of now-redundant XFS inode iolock, replaced with VFS
     i_rwsem
   - synchronisation with fixes and changes in userspace libxfs code
   - extent tree lookup helpers
   - lots of little corruption detection improvements to verifiers
   - optimised CRC calculations
   - faster buffer cache lookups
   - deprecation of barrier/nobarrier mount options - we always use
     REQ_FUA/REQ_FLUSH where appropriate for data integrity now
   - cleanups to speculative preallocation
   - miscellaneous minor bug fixes and cleanups"

* tag 'xfs-for-linus-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs: (63 commits)
  xfs: nuke unused tracepoint definitions
  xfs: use GPF_NOFS when allocating btree cursors
  xfs: use xfs_vn_setattr_size to check on new size
  xfs: deprecate barrier/nobarrier mount option
  xfs: Always flush caches when integrity is required
  xfs: ignore leaf attr ichdr.count in verifier during log replay
  xfs: use rhashtable to track buffer cache
  xfs: optimise CRC updates
  xfs: make xfs btree stats less huge
  xfs: don't cap maximum dedupe request length
  xfs: don't allow di_size with high bit set
  xfs: error out if trying to add attrs and anextents > 0
  xfs: don't crash if reading a directory results in an unexpected hole
  xfs: complain if we don't get nextents bmap records
  xfs: check for bogus values in btree block headers
  xfs: forbid AG btrees with level == 0
  xfs: several xattr functions can be void
  xfs: handle cow fork in xfs_bmap_trace_exlist
  xfs: pass state not whichfork to trace_xfs_extlist
  xfs: Move AGI buffer type setting to xfs_read_agi
  ...

8 years agoprintk: remove console flushing special cases for partial buffered lines
Linus Torvalds [Tue, 25 Oct 2016 18:27:31 +0000 (11:27 -0700)]
printk: remove console flushing special cases for partial buffered lines

It actively hurts proper merging, and makes for a lot of special cases.
There was a good(ish) reason for doing it originally, but it's getting
too painful to maintain.  And most of the original reasons for it are
long gone.

So instead of having special code to flush partial lines to the console
(as opposed to the record buffers), do _all_ the console writing from
the record buffer, and be done with it.

If an oops happens (or some other synchronous event), we will flush the
partial lines due to the oops printing activity, so this does not affect
that.  It does mean that if you have a completely hung machine, a
partial preceding line may not have been printed out.

That was some of the original reason for this complexity, in fact, back
when we used to test for the historical i386 "halt" instruction problem
by doing

pr_info("Checking 'hlt' instruction... ");

if (!boot_cpu_data.hlt_works_ok) {
pr_cont("disabled\n");
return;
}
halt();
halt();
halt();
halt();
pr_cont("OK\n");

and that model no longer works (it the 'hlt' instruction kills the
machine, the partial line won't have been flushed, so you won't even see
it).

Of course, that was also back in the days when people actually had
textual console output rather than a graphical splash-screen at bootup.
How times change..

Cc: Sergey Senozhatsky <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Steven Rostedt <[email protected]>
Tested-by: Petr Mladek <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Tested-by: Mark Rutland <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoprintk: remove games with previous record flags
Linus Torvalds [Tue, 25 Oct 2016 18:27:31 +0000 (11:27 -0700)]
printk: remove games with previous record flags

The record logging code looks at the previous record flags in various
ways, and they are all wrong.

You can't use the previous record flags to determine anything about the
next record, because they may simply not be related.  In particular, the
reason the previous record was a continuation record may well be exactly
_because_ the new record was printed by a different process, which is
why the previous record was flushed.

So all those games are simply wrong, and make the code hard to
understand (because the code fundamentally cdoes not make sense).

So remove it.

Signed-off-by: Linus Torvalds <[email protected]>
8 years agovsock/virtio: fix src/dst cid format
Michael S. Tsirkin [Tue, 6 Dec 2016 04:07:15 +0000 (06:07 +0200)]
vsock/virtio: fix src/dst cid format

These fields are 64 bit, using le32_to_cpu and friends
on these will not do the right thing.
Fix this up.

Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovsock/virtio: mark an internal function static
Michael S. Tsirkin [Tue, 6 Dec 2016 04:06:06 +0000 (06:06 +0200)]
vsock/virtio: mark an internal function static

virtio_transport_alloc_pkt is only used locally, make it static.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovsock/virtio: add a missing __le annotation
Michael S. Tsirkin [Tue, 6 Dec 2016 04:03:34 +0000 (06:03 +0200)]
vsock/virtio: add a missing __le annotation

guest cid is read from config space, therefore it's in little endian
format and is treated as such, annotate it accordingly.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovhost: add missing __user annotations
Michael S. Tsirkin [Tue, 6 Dec 2016 04:01:41 +0000 (06:01 +0200)]
vhost: add missing __user annotations

Several vhost functions were missing __user annotations
on pointers, causing sparse warnings. Fix this up.

sparse also warns about vhost_process_iotlb_msg which
is local and should be static. Fix that up as well.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovhost: make interval tree static inline
Michael S. Tsirkin [Tue, 6 Dec 2016 03:57:54 +0000 (05:57 +0200)]
vhost: make interval tree static inline

vhost_umem_interval_tree is only used locally within vhost.c, mark it
static. As some functions generated go unused, this triggers warnings
unless we also mark it inline.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agodrm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked
Michael S. Tsirkin [Mon, 5 Dec 2016 20:39:30 +0000 (22:39 +0200)]
drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked

virtio_gpu_queue_ctrl_buffer_locked is called with ctrlq.qlock taken, it
releases and acquires this lock.  This causes a sparse warning.  Add
appropriate annotations for sparse context checking.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agodrm/virtio: fix lock context imbalance
Michael S. Tsirkin [Mon, 5 Dec 2016 20:36:56 +0000 (22:36 +0200)]
drm/virtio: fix lock context imbalance

When virtio_gpu_free_vbufs exits due to list empty, it does not
drop the free_vbufs lock that it took.
list empty is not expected to happen anyway, but it can't hurt to fix
this and drop the lock.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agodrm/virtio: fix endianness in primary_plane_update
Michael S. Tsirkin [Mon, 5 Dec 2016 19:44:39 +0000 (21:44 +0200)]
drm/virtio: fix endianness in primary_plane_update

virtio_gpu_cmd_transfer_to_host_2d expects x and y
parameters in LE, but virtio_gpu_primary_plane_update
passes in the CPU format instead.

Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_console: drop unused config fields
Michael S. Tsirkin [Mon, 5 Dec 2016 19:39:42 +0000 (21:39 +0200)]
virtio_console: drop unused config fields

struct ports_device includes a config field including the whole
virtio_console_config, but only max_nr_ports in there is ever updated or
used. The rest is unused and in fact does not even mirror the
device config. Drop everything except max_nr_ports,
saving some memory.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Jason Wang <[email protected]>
8 years agoMerge tag 'for-linus-4.10' of git://git.code.sf.net/p/openipmi/linux-ipmi
Linus Torvalds [Thu, 15 Dec 2016 04:54:33 +0000 (20:54 -0800)]
Merge tag 'for-linus-4.10' of git://git.code.sf.net/p/openipmi/linux-ipmi

Pull IPMI updates from Corey Minyard:
 "Various small fixes for IPMI. Cleanups in the documentation and
  convertion printk() to pr_xxx() and removal of an unused module
  parameter. Some small bug fixes and enhancements.

  This also adds a post softdep from the IPMI core module to the IPMI
  device interface. Many people have complained that the device
  interface isn't automatically avaiable when IPMI is loaded. I don't
  want to make the device interface mandatory, though, plenty of people
  use IPMI internally (like with ACPI) and don't need a device interface
  or the added possible security entry. A softdep should make it work
  'out of the box' but allow people to not have it if they don't want
  it"

* tag 'for-linus-4.10' of git://git.code.sf.net/p/openipmi/linux-ipmi:
  ipmi: create hardware-independent softdep for ipmi_devintf
  ipmi: Fix sequence number handling
  ipmi: Pick up slave address from SMBIOS on an ACPI device
  ipmi_si: Clean up printks
  Move platform device creation earlier in the initialization
  ipmi: Update documentation
  ipmi_ssif: Remove an unused module parameter
  ipmi: Periodically check for events, not messages

8 years agologfs: remove from tree
Christoph Hellwig [Sun, 11 Sep 2016 14:04:46 +0000 (09:04 -0500)]
logfs: remove from tree

Logfs was introduced to the kernel in 2009, and hasn't seen any non
drive-by changes since 2012, while having lots of unsolved issues
including the complete lack of error handling, with more and more
issues popping up without any fixes.

The logfs.org domain has been bouncing from a mail, and the maintainer
on the non-logfs.org domain hasn't repsonded to past queries either.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
8 years agoMerge tag 'dmaengine-4.10-rc1' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 15 Dec 2016 04:42:45 +0000 (20:42 -0800)]
Merge tag 'dmaengine-4.10-rc1' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine updates from Vinod Koul:
 "Fairly routine update this time around with all changes specific to
  drivers:

   - New driver for STMicroelectronics FDMA
   - Memory-to-memory transfers on dw dmac
   - Support for slave maps on pl08x devices
   - Bunch of driver fixes to use dma_pool_zalloc
   - Bunch of compile and warning fixes spread across drivers"

[ The ST FDMA driver already came in earlier through the remoteproc tree ]

* tag 'dmaengine-4.10-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (68 commits)
  dmaengine: sirf-dma: remove unused ‘sdesc’
  dmaengine: pl330: remove unused ‘regs’
  dmaengine: s3c24xx: remove unused ‘cdata’
  dmaengine: stm32-dma: remove unused ‘src_addr’
  dmaengine: stm32-dma: remove unused ‘dst_addr’
  dmaengine: stm32-dma: remove unused ‘sfcr’
  dmaengine: pch_dma: remove unused ‘cookie’
  dmaengine: mic_x100_dma: remove unused ‘data’
  dmaengine: img-mdc: remove unused ‘prev_phys’
  dmaengine: usb-dmac: remove unused ‘uchan’
  dmaengine: ioat: remove unused ‘res’
  dmaengine: ioat: remove unused ‘ioat_dma’
  dmaengine: ioat: remove unused ‘is_raid_device’
  dmaengine: pl330: do not generate unaligned access
  dmaengine: k3dma: move to dma_pool_zalloc
  dmaengine: at_hdmac: move to dma_pool_zalloc
  dmaengine: at_xdmac: don't restore unsaved status
  dmaengine: ioat: set error code on failures
  dmaengine: ioat: set error code on failures
  dmaengine: DW DMAC: add multi-block property to device tree
  ...

8 years agovirtio_ring: fix complaint by sparse
Gonglei [Tue, 22 Nov 2016 05:51:50 +0000 (13:51 +0800)]
virtio_ring: fix complaint by sparse

 # make C=2 CF="-D__CHECK_ENDIAN__" ./drivers/virtio/

drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
drivers/virtio/virtio_ring.c:604:39: warning: incorrect type in initializer (different base types)
drivers/virtio/virtio_ring.c:604:39:    expected unsigned short [unsigned] [usertype] nextflag
drivers/virtio/virtio_ring.c:604:39:    got restricted __virtio16
drivers/virtio/virtio_ring.c:612:33: warning: restricted __virtio16 degrades to integer

Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agovirtio_pci_modern: fix complaint by sparse
Gonglei [Tue, 22 Nov 2016 05:51:49 +0000 (13:51 +0800)]
virtio_pci_modern: fix complaint by sparse

drivers/virtio/virtio_pci_modern.c:66:40: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:66:40:    expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:66:40:    got restricted __le32 [noderef] [usertype] <asn:2>*lo
drivers/virtio/virtio_pci_modern.c:67:33: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:67:33:    expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:67:33:    got restricted __le32 [noderef] [usertype] <asn:2>*hi
drivers/virtio/virtio_pci_modern.c:150:32: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:150:32:    expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:150:32:    got restricted __le32 [noderef] <asn:2>*<noident>
drivers/virtio/virtio_pci_modern.c:151:39: warning: incorrect type in argument 1 (different base types)
drivers/virtio/virtio_pci_modern.c:151:39:    expected unsigned int [noderef] [usertype] <asn:2>*addr
drivers/virtio/virtio_pci_modern.c:151:39:    got restricted __le32 [noderef] <asn:2>*<noident>
drivers/virtio/virtio_pci_modern.c:152:32: warning: incorrect type in argument 2 (different base types)
drivers/virtio/virtio_pci_modern.c:152:32:    expected unsigned int [noderef] [usertype] <asn:2>*addr

Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
8 years agoMerge tag 'modules-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu...
Linus Torvalds [Thu, 15 Dec 2016 04:12:43 +0000 (20:12 -0800)]
Merge tag 'modules-for-v4.10' 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.10 merge window:

   - The rodata= cmdline parameter has been extended to additionally
     apply to module mappings

   - Fix a hard to hit race between module loader error/clean up
     handling and ftrace registration

   - Some code cleanups, notably panic.c and modules code use a unified
     taint_flags table now. This is much cleaner than duplicating the
     taint flag code in modules.c"

* tag 'modules-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: fix DEBUG_SET_MODULE_RONX typo
  module: extend 'rodata=off' boot cmdline parameter to module mappings
  module: Fix a comment above strong_try_module_get()
  module: When modifying a module's text ignore modules which are going away too
  module: Ensure a module's state is set accordingly during module coming cleanup code
  module: remove trailing whitespace
  taint/module: Clean up global and module taint flags handling
  modpost: free allocated memory

8 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Thu, 15 Dec 2016 01:25:18 +0000 (17:25 -0800)]
Merge branch 'akpm' (patches from Andrew)

Merge more updates from Andrew Morton:

 - a few misc things

 - kexec updates

 - DMA-mapping updates to better support networking DMA operations

 - IPC updates

 - various MM changes to improve DAX fault handling

 - lots of radix-tree changes, mainly to the test suite. All leading up
   to reimplementing the IDA/IDR code to be a wrapper layer over the
   radix-tree. However the final trigger-pulling patch is held off for
   4.11.

* emailed patches from Andrew Morton <[email protected]>: (114 commits)
  radix tree test suite: delete unused rcupdate.c
  radix tree test suite: add new tag check
  radix-tree: ensure counts are initialised
  radix tree test suite: cache recently freed objects
  radix tree test suite: add some more functionality
  idr: reduce the number of bits per level from 8 to 6
  rxrpc: abstract away knowledge of IDR internals
  tpm: use idr_find(), not idr_find_slowpath()
  idr: add ida_is_empty
  radix tree test suite: check multiorder iteration
  radix-tree: fix replacement for multiorder entries
  radix-tree: add radix_tree_split_preload()
  radix-tree: add radix_tree_split
  radix-tree: add radix_tree_join
  radix-tree: delete radix_tree_range_tag_if_tagged()
  radix-tree: delete radix_tree_locate_item()
  radix-tree: improve multiorder iterators
  btrfs: fix race in btrfs_free_dummy_fs_info()
  radix-tree: improve dump output
  radix-tree: make radix_tree_find_next_bit more useful
  ...

8 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Thu, 15 Dec 2016 01:21:53 +0000 (17:21 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block IO fixes from Jens Axboe:
 "A few fixes that I collected as post-merge.

  I was going to wait a bit with sending this out, but the O_DIRECT fix
  should really go in sooner rather than later"

* 'for-linus' of git://git.kernel.dk/linux-block:
  blk-mq: Fix failed allocation path when mapping queues
  blk-mq: Avoid memory reclaim when remapping queues
  block_dev: don't update file access position for sync direct IO
  nvme/pci: Log PCI_STATUS when the controller dies
  block_dev: don't test bdev->bd_contains when it is not stable

8 years agoMerge branch 'for-4.10/fs-unmap' of git://git.kernel.dk/linux-block
Linus Torvalds [Thu, 15 Dec 2016 01:09:00 +0000 (17:09 -0800)]
Merge branch 'for-4.10/fs-unmap' of git://git.kernel.dk/linux-block

Pull fs meta data unmap optimization from Jens Axboe:
 "A series from Jan Kara, providing a more efficient way for unmapping
  meta data from in the buffer cache than doing it block-by-block.

  Provide a general helper that existing callers can use"

* 'for-4.10/fs-unmap' of git://git.kernel.dk/linux-block:
  fs: Remove unmap_underlying_metadata
  fs: Add helper to clean bdev aliases under a bh and use it
  ext2: Use clean_bdev_aliases() instead of iteration
  ext4: Use clean_bdev_aliases() instead of iteration
  direct-io: Use clean_bdev_aliases() instead of handmade iteration
  fs: Provide function to unmap metadata for a range of blocks

8 years agodocs: add back 'Documentation/Changes' file (as symlink)
Linus Torvalds [Thu, 15 Dec 2016 00:30:12 +0000 (16:30 -0800)]
docs: add back 'Documentation/Changes' file (as symlink)

Jaegeuk Kim reports that the debian kernel package build gets confused
by the lack of Documentation/Changes file.  We also refer to that path
name in ver_linux and various how-to files and Kconfig files.

The file got renamed away in commit 186128f75392 ("docs-rst: add
documents to development-process"), and as Jaegeuk Kim points out, the
commit message for that change says "use symlinks instead of renames",
but then the commit itself actually does renames after all.

Maybe we should do the other files too, but for now this just adds the
minimal symlink back to the historical name, so that people looking for
Documentation/Changes will actually find what they are looking for, and
the debian scripts continue to work.

Reported-by: Jaegeuk Kim <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoradix tree test suite: delete unused rcupdate.c
Matthew Wilcox [Wed, 14 Dec 2016 23:09:36 +0000 (15:09 -0800)]
radix tree test suite: delete unused rcupdate.c

This file was used to implement call_rcu() before liburcu implemented
that function.  It hasn't even been compiled since before the test suite
was added to the kernel.  Remove it to reduce confusion.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoradix tree test suite: add new tag check
Matthew Wilcox [Wed, 14 Dec 2016 23:09:34 +0000 (15:09 -0800)]
radix tree test suite: add new tag check

We have a check that setting a tag on a single entry at root succeeds,
but we were missing a check that clearing a tag on that same entry also
succeeds.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoradix-tree: ensure counts are initialised
Matthew Wilcox [Wed, 14 Dec 2016 23:09:31 +0000 (15:09 -0800)]
radix-tree: ensure counts are initialised

radix_tree_join() was freeing nodes with a non-zero ->exceptional count,
and radix_tree_split() wasn't zeroing ->exceptional when it allocated
the new node.  Fix this by making all callers of radix_tree_node_alloc()
pass in the new counts (and some other always-initialised fields), which
will prevent the problem recurring if in future we decide to do
something similar.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoradix tree test suite: cache recently freed objects
Matthew Wilcox [Wed, 14 Dec 2016 23:09:28 +0000 (15:09 -0800)]
radix tree test suite: cache recently freed objects

The kmem_cache_alloc implementation simply allocates new memory from
malloc() and calls the ctor, which zeroes out the entire object.  This
means it cannot spot bugs where the object isn't properly reinitialised
before being freed.

Add a small (11 objects) cache before freeing objects back to malloc.
This is enough to let us write a test to catch it, although the memory
allocator is now aware of the structure of the radix tree node, since it
chains free objects through ->private_data (like the percpu cache does).

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoradix tree test suite: add some more functionality
Matthew Wilcox [Wed, 14 Dec 2016 23:09:25 +0000 (15:09 -0800)]
radix tree test suite: add some more functionality

IDR needs more functionality from the kernel: kmalloc()/kfree(), and
xchg().

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoidr: reduce the number of bits per level from 8 to 6
Matthew Wilcox [Wed, 14 Dec 2016 23:09:22 +0000 (15:09 -0800)]
idr: reduce the number of bits per level from 8 to 6

In preparation for merging the IDR and radix tree, reduce the fanout at
each level from 256 to 64.  If this causes a performance problem then a
bisect will point to this commit, and we'll have a better idea about
what we might do to fix it.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agorxrpc: abstract away knowledge of IDR internals
Matthew Wilcox [Wed, 14 Dec 2016 23:09:19 +0000 (15:09 -0800)]
rxrpc: abstract away knowledge of IDR internals

Add idr_get_cursor() / idr_set_cursor() APIs, and remove the reference
to IDR_SIZE.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Reviewed-by: David Howells <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agotpm: use idr_find(), not idr_find_slowpath()
Matthew Wilcox [Wed, 14 Dec 2016 23:09:16 +0000 (15:09 -0800)]
tpm: use idr_find(), not idr_find_slowpath()

idr_find_slowpath() is not intended to be part of the public API, it's
an implementation detail.  There's no reason to skip straight to the
slowpath here.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Peter Huewe <[email protected]>
Cc: Marcel Selhorst <[email protected]>
Cc: Jarkko Sakkinen <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
8 years agoidr: add ida_is_empty
Matthew Wilcox [Wed, 14 Dec 2016 23:09:13 +0000 (15:09 -0800)]
idr: add ida_is_empty

Two of the USB Gadgets were poking around in the internals of struct ida
in order to determine if it is empty.  Add the appropriate abstraction.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Acked-by: Konstantin Khlebnikov <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This page took 0.154625 seconds and 4 git commands to generate.