Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slave support for inv_mpu6050 #94

Closed
wants to merge 666 commits into from
Closed

Conversation

klekkala
Copy link

patchset made by jic23 for slave support for inv_mpu6050 device.

Texas Instruments Auto Merger and others added 30 commits April 7, 2016 13:32
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: keystone-k2g: whitespace cleanup
  usb: dwc3: gadget: don't leave locks held

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: am57xx-beagle-x15-revb1: fix HDMI LS_OE gpio
  drm/omap: fix copy_timings_drm_to_omap()
  ARM: dts: keystone-k2g-evm: Audio support
  Doc: DT: add binding doc for K2G DSS
  ARM: dts: k2g-evm: add HDMI
  ARM: dts: k2g: add DSS

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
…kernel/git/rt/linux-rt-devel into ti-rt-linux-4.4.y

TI-Feature: linux_rt-4-4
TI-Tree: http://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
TI-Branch: linux-4.4.y-rt

* 'linux-4.4.y-rt' of http://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel:
  v4.4.6-rt14
  drivers/block/zram: fixup compile for !RT
  ARM: imx: always use TWD on IMX6Q

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  serial: 8250/keystone: fix building with SERIAL_8250=m
  usb: dwc3: gadget: reinitialize endpoints on suspend
  usb: dwc3: core: Fix dual-role state change during suspend/resume
  extcon: usb-gpio: Don't miss event during suspend/resume
  usb: dwc3: omap: fix up error path on probe()
  ti_config_fragments/connectivity: enable usb gadget options
  ti_config_fragments/connectivity.cfg: Enable PWM related drivers
  ARM: dts: DRA7: Add dt nodes for PWMSS
  ARM: dts: DRA7: Add TBCLK for PWMSS
  ARM: OMAP2+: DRA7: Add hwmod entries for PWMSS
  ARM: AM335x/AM437x: hwmod: Remove eQEP, ePWM and eCAP hwmod entries
  ARM: dts: am437x/am33xx: Remove eCAP and ePWM hwmod properties
  pwms: pwm-ti*: Get the clock from the PWMSS (parent)
  pwm: pwm-tiehrpwm: Update dt binding document to use generic node name
  ARM: DTS: da850/am4372/am33xx: Use generic node name for ehrpwm
  ARM: dts: am335x/am437x: Add TBCLK to PWM node
  pwms: pwm-ti*: Remove support for local clock gating
  ARM: dts: am57xx: remove extcon_usb1

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (210 commits)
  Linux 4.4.7
  perf/x86/intel: Fix PEBS data source interpretation on Nehalem/Westmere
  perf/x86/intel: Use PAGE_SIZE for PEBS buffer size on Core2
  perf/x86/intel: Fix PEBS warning by only restoring active PMU in pmi
  perf/x86/pebs: Add workaround for broken OVFL status on HSW+
  sched/cputime: Fix steal time accounting vs. CPU hotplug
  scsi_common: do not clobber fixed sense information
  PM / sleep: Clear pm_suspend_global_flags upon hibernate
  intel_idle: prevent SKL-H boot failure when C8+C9+C10 enabled
  mtd: onenand: fix deadlock in onenand_block_markbad
  mm/page_alloc: prevent merging between isolated and other pageblocks
  ocfs2/dlm: fix BUG in dlm_move_lockres_to_recovery_list
  ocfs2/dlm: fix race between convert and recovery
  Input: ati_remote2 - fix crashes on detecting device with invalid descriptor
  Input: ims-pcu - sanity check against missing interfaces
  Input: synaptics - handle spurious release of trackstick buttons, again
  writeback, cgroup: fix use of the wrong bdi_writeback which mismatches the inode
  writeback, cgroup: fix premature wb_put() in locked_inode_to_wb_and_lock_list()
  ACPI / PM: Runtime resume devices when waking from hibernate
  ARM: dts: at91: sama5d4 Xplained: don't disable hsmci regulator
  ...

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ASoC: davinci-mcasp: Calculate AUXCLK divider when setting up master clocks
  ASoC: davinci-mcasp: Restructure the davinci_mcasp_calc_clk_div()
  ASoC: davinci-mcasp: Change __davinci_mcasp_set_clkdiv() first parameter
  ASoC: davinci-mcasp: Do not allow multiple streams in one direction
  ARM: DTS: am57xx-idk: Add support for touchscreen controller
  ARM: dts: am571x-idk: Add OSD101T2045-53TS LCD support for AM571x IDK
  ARM: dts: am572x-idk: Add OSD101T2045-53TS LCD support for AM572x IDK
  ARM: dts: am57xx-idk: Add common OSD101T2045-53TS LCD support
  ARM: dts: am57xx-evm: add touchscreen support
  ARM: dts: am57xx-evm: add LCD backlight
  ARM: dts: am57xx-evm: add LCD support

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: keystone-k2g: Fixup QSPI node after incorrect merge

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
This is the 4.4.7 stable release
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: k2g: qmss: correct interrupt property
  soc: ti: knav_qmss_queue: fix Linking RAM 0 Size register configuration
  net: netcp: store network statistics in 64 bits
  soc: ti: qmss: fix the case when !SMP
  net: netcp: pa: add missing of_node_put() on bail out

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
If panic on NMI happens just after panic() on the same CPU, panic() is
recursively called. Kernel stalls, as a result, after failing to acquire
panic_lock.

To avoid this problem, don't call panic() in NMI context if we've
already entered panic().

For that, introduce nmi_panic() macro to reduce code duplication. In
the case of panic on NMI, don't return from NMI handlers if another CPU
already panicked.

Signed-off-by: Hidehiro Kawai <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Gobinda Charan Maji <[email protected]>
Cc: HATAYAMA Daisuke <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Javi Merino <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: lkml <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Nicolas Iooss <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Seth Jennings <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ulrich Obergfell <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: Vivek Goyal <[email protected]>
Link: http://lkml.kernel.org/r/20151210014626.25437.13302.stgit@softrs
[ Cleanup comments, fixup formatting. ]
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Currently, kdump_nmi_shootdown_cpus(), a subroutine of crash_kexec(),
sends an NMI IPI to CPUs which haven't called panic() to stop them,
save their register information and do some cleanups for crash dumping.
However, if such a CPU is infinitely looping in NMI context, we fail to
save its register information into the crash dump.

For example, this can happen when unknown NMIs are broadcast to all
CPUs as follows:

  CPU 0                             CPU 1
  ===========================       ==========================
  receive an unknown NMI
  unknown_nmi_error()
    panic()                         receive an unknown NMI
      spin_trylock(&panic_lock)     unknown_nmi_error()
      crash_kexec()                   panic()
                                        spin_trylock(&panic_lock)
                                        panic_smp_self_stop()
                                          infinite loop
        kdump_nmi_shootdown_cpus()
          issue NMI IPI -----------> blocked until IRET
                                          infinite loop...

Here, since CPU 1 is in NMI context, the second NMI from CPU 0 is
blocked until CPU 1 executes IRET. However, CPU 1 never executes IRET,
so the NMI is not handled and the callback function to save registers is
never called.

In practice, this can happen on some servers which broadcast NMIs to all
CPUs when the NMI button is pushed.

To save registers in this case, we need to:

  a) Return from NMI handler instead of looping infinitely
  or
  b) Call the callback function directly from the infinite loop

Inherently, a) is risky because NMI is also used to prevent corrupted
data from being propagated to devices.  So, we chose b).

This patch does the following:

1. Move the infinite looping of CPUs which haven't called panic() in NMI
   context (actually done by panic_smp_self_stop()) outside of panic() to
   enable us to refer pt_regs. Please note that panic_smp_self_stop() is
   still used for normal context.

2. Call a callback of kdump_nmi_shootdown_cpus() directly to save
   registers and do some cleanups after setting waiting_for_crash_ipi which
   is used for counting down the number of CPUs which handled the callback

Signed-off-by: Hidehiro Kawai <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Dave Young <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Gobinda Charan Maji <[email protected]>
Cc: HATAYAMA Daisuke <[email protected]>
Cc: Hidehiro Kawai <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Javi Merino <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: lkml <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Nicolas Iooss <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Seth Jennings <[email protected]>
Cc: Stefan Lippers-Hollmann <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ulrich Obergfell <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: Vivek Goyal <[email protected]>
Cc: Yasuaki Ishimatsu <[email protected]>
Link: http://lkml.kernel.org/r/20151210014628.25437.75256.stgit@softrs
[ Cleanup comments, fixup formatting. ]
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Commit 1717f20 ("panic, x86: Fix re-entrance problem due to panic
on NMI") and commit 58c5661 ("panic, x86: Allow CPUs to save
registers even if looping in NMI context") introduced nmi_panic() which
prevents concurrent/recursive execution of panic().  It also saves
registers for the crash dump on x86.

However, there are some cases where NMI handlers still use panic().
This patch set partially replaces them with nmi_panic() in those cases.

Even this patchset is applied, some NMI or similar handlers (e.g.  MCE
handler) continue to use panic().  This is because I can't test them
well and actual problems won't happen.  For example, the possibility
that normal panic and panic on MCE happen simultaneously is very low.

This patch (of 3):

Convert nmi_panic() to a proper function and export it instead of
exporting internal implementation details to modules, for obvious
reasons.

Signed-off-by: Hidehiro Kawai <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Acked-by: Michal Nazarewicz <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Nicolas Iooss <[email protected]>
Cc: Javi Merino <[email protected]>
Cc: Gobinda Charan Maji <[email protected]>
Cc: "Steven Rostedt (Red Hat)" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: HATAYAMA Daisuke <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
An oops with irqs off (panic() from irqsafe hrtimer like the watchdog
timer) will lead to a lockdep warning on each invocation and as such
never completes.
Therefore we skip the trylock in the oops case.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
This reverts commit f9b9ebddb16501de52ac6384b012148996fde77f.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
VTIME_SLEEPING state happens either when:

1) The task is sleeping and no tickless delta is to be added on the task
   cputime stats.
2) The CPU isn't running vtime at all, so the same properties of 1) applies.

Lets rename the vtime symbol to reflect both states.

Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Hiroshi Shimamoto <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Luiz Capitulino <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul E . McKenney <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
The cputime can only be updated by the current task itself, even in
vtime case. So we can safely use seqcount instead of seqlock as there
is no writer concurrency involved.

[ bigeasy: safe since 6a61671 ("cputime: Safely read cputime of
full dynticks CPUs") ]

Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Hiroshi Shimamoto <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Luiz Capitulino <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul E . McKenney <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
…kernel/git/rt/linux-rt-devel into ti-rt-linux-4.4.y

TI-Feature: linux_rt-4-4
TI-Tree: http://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
TI-Branch: linux-4.4.y-rt

* 'linux-4.4.y-rt' of http://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel:
  v4.4.7-rt16
  sched/cputime: Convert vtime_seqlock to seqcount
  sched/cputime: Clarify vtime symbols and document them
  Revert "vtime: Split lock and seqcount"
  tty: serial: 8250: don't take the trylock during oops
  panic: change nmi_panic from macro to function
  panic, x86: Allow CPUs to save registers even if looping in NMI context
  panic, x86: Fix re-entrance problem due to panic on NMI
  v4.4.7-rt15

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (137 commits)
  Linux 4.4.8
  Revert "usb: hub: do not clear BOS field during reset device"
  usbvision: fix crash on detecting device with invalid configuration
  staging: android: ion: Set the length of the DMA sg entries in buffer
  Revert "PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()"
  Revert "PCI: Add helpers to manage pci_dev->irq and pci_dev->irq_managed"
  Revert "x86/PCI: Don't alloc pcibios-irq when MSI is enabled"
  HID: usbhid: fix inconsistent reset/resume/reset-resume behavior
  HID: wacom: fix Bamboo ONE oops
  ALSA: usb-audio: Skip volume controls triggers hangup on Dell USB Dock
  ALSA: usb-audio: Add a quirk for Plantronics BT300
  ALSA: usb-audio: Add a sample rate quirk for Phoenix Audio TMX320
  ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T460s
  ALSA: hda - fix front mic problem for a HP desktop
  ALSA: hda - Fix headset support and noise on HP EliteBook 755 G2
  ALSA: hda - Fixup speaker pass-through control for nid 0x14 on ALC225
  mmc: sdhci-pci: Add support and PCI IDs for more Broxton host controllers
  perf: Cure event->pending_disable race
  perf: Do not double free
  arm64: replace read_lock to rcu lock in call_step_hook
  ...

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  regulator: core: remove lockdep assert from suspend_prepare
  ARM: configs: keystone: Add CPU Hotplug related options
  keystone: dts: add psci command definition
  PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs
  pinctrl: pinctrl-single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs
  ARM: dts: keystone-k2l: Add pinctrl node

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  tty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ti_config_fragments: add k2g-only fragment
  ARM: dts: dra7: Add ti,secure-ram node to ocmcram1 node
  ARM: dts: dra7: Add ocmcram nodes
  gpio: omap: fix irq triggering in smart-idle wakeup mode
  ARM: dts: AM57xx/DRA7: Update SoC voltage rail limits to match data sheet

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ti_config_fragments: Add lpae.cfg to SDK keystone release
  ti_config_fragments: Remove keystone support for SoC only configs
  ti_config_fragments: Change SDK release to multi_v7

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: OMAP2+: hwmod: fix _idle() hwmod state sanity check sequence
  HACK: ARM: dts: AM4372: Add non-caching OCMC RAM node
  HACK: ARM: dts: AM33xx: Split OCMC RAM node to allow non-cached mapping
  pinctrl: Move am4372 and dra7 macros to the the SoC header files

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (22 commits)
  net: netcp: rearrange variable in struct for better cache line use
  phy: omap-usb2: fix abort exception
  net: netcp: ale: update to support unknown vlan controls for NU switch
  ARM: dts: am335x-icev2: Add ADC support
  ARM: dts: am335x-icev2: Add Industrial input support
  ARM: dts: am437x-idk: Add Industrial input support
  ARM: dts: am57xx-idk-common: Add dcan support
  ARM: dts: dra7: workaround silicon limitation i845
  dt-bindings: phy: ti: add documentation for ti,dra7x-usb2
  ARM: dts: am4372/dra7/omap5: Use "syscon-phy-power" instead of "ctrl-module"
  ARM: dts: dra7: Use "ti,dra7x-usb2-phy2" compatible string for USB2 PHY2
  ARM: dts: dra7: Use "syscon-phy-power" and "syscon-pcs" in PCIe PHY node
  ARM: dts: dra7: Add dt node for the sycon pcie
  phy: omap-usb2: use *syscon* framework API to power on/off the PHY
  phy: omap-usb2: use omap_usb_power_off to power off the PHY during probe
  phy: ti-pipe3: use *syscon* framework API to set PCS value of the PHY
  phy: ti-pipe3: use *syscon* framework API to power on/off the PHY
  phy: ti-pipe3: use ti_pipe3_power_off to power off the PHY during probe
  phy: ti-pipe3: move mem resource initialization to a separate function
  phy: ti-pipe3: move sysctrl initialization to a separate function
  ...

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (35 commits)
  PM / OPP: Rename structures for clarity
  PM / OPP: Fix incorrect comments
  PM / OPP: Initialize regulator pointer to an error value
  PM / OPP: Initialize u_volt_min/max to a valid value
  PM / OPP: Fix NULL pointer dereference crash when disabling OPPs
  cpufreq: dt: No need to allocate resources anymore
  cpufreq: dt: No need to fetch voltage-tolerance
  cpufreq: dt: Use dev_pm_opp_set_rate() to switch frequency
  cpufreq: dt: Reuse dev_pm_opp_get_max_transition_latency()
  cpufreq: dt: Unsupported OPPs are already disabled
  cpufreq: dt: Pass regulator name to the OPP core
  cpufreq: dt: OPP layers handles clock-latency for V1 bindings as well
  cpufreq: dt: Rename 'need_update' to 'opp_v1'
  cpufreq: dt: Convert few pr_debug/err() calls to dev_dbg/err()
  PM / OPP: Add dev_pm_opp_set_rate()
  PM / OPP: Manage device clk
  PM / OPP: Parse clock-latency and voltage-tolerance for v1 bindings
  PM / OPP: Introduce dev_pm_opp_get_max_transition_latency()
  PM / OPP: Introduce dev_pm_opp_get_max_volt_latency()
  PM / OPP: Disable OPPs that aren't supported by the regulator
  ...

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
…kernel into ti-rt-linux-4.4.y

TI-Feature: ti_linux_base_rt
TI-Tree: [email protected]:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.4.y

* 'ti-linux-4.4.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: DRA7: use new dra7-specific compatible string
  ARM: dts: am57xx-evm-reva3: enable higher speed MMC1/2 modes
  ARM: dts: am57xx-beagle-x15: disable HS200 mode for MMC1
  ARM: dts: am57xx-beagle-x15: disable UHS modes for MMC1
  ARM: dts: am57xx-beagle-x15: Add pinmux configuration for MMC2
  ARM: dts: am57xx-beagle-x15: workaround errata i843
  ARM: dts: am57xx-beagle-x15: Add pinmux configuration for MMC1
  ARM: dts: keystone: enable all dma channels for NetCP
  net: netcp: use hw capability to remove FCS word from rx packets
  extcon: usb-gpio: switch to use pm wakeirq apis
  usb: dwc3: omap: drop dma_mask configuration
  usb: dwc3: keystone: drop dma_mask configuration
  net: netcp: ethss: get phy-handle only if link interface is MAC-to-PHY

Signed-off-by: Texas Instruments Auto Merger <[email protected]>
@RobertCNelson
Copy link
Member

Closing, please re-submit, when cleaned up.

Currently this triggers the auto-builder:

http://rcn-ee.online:8080/job/beagleboard_kernel_builder/view/change-requests/job/PR-94/

Regards,

crow-misia pushed a commit to crow-misia/linux that referenced this pull request Dec 15, 2019
commit ad5996d upstream.

Acquire kvm->srcu for the duration of ->set_nested_state() to fix a bug
where nVMX derefences ->memslots without holding ->srcu or ->slots_lock.

The other half of nested migration, ->get_nested_state(), does not need
to acquire ->srcu as it is a purely a dump of internal KVM (and CPU)
state to userspace.

Detected as an RCU lockdep splat that is 100% reproducible by running
KVM's state_test selftest with CONFIG_PROVE_LOCKING=y.  Note that the
failing function, kvm_is_visible_gfn(), is only checking the validity of
a gfn, it's not actually accessing guest memory (which is more or less
unsupported during vmx_set_nested_state() due to incorrect MMU state),
i.e. vmx_set_nested_state() itself isn't fundamentally broken.  In any
case, setting nested state isn't a fast path so there's no reason to go
out of our way to avoid taking ->srcu.

  =============================
  WARNING: suspicious RCU usage
  5.4.0-rc7+ beagleboard#94 Not tainted
  -----------------------------
  include/linux/kvm_host.h:626 suspicious rcu_dereference_check() usage!

               other info that might help us debug this:

  rcu_scheduler_active = 2, debug_locks = 1
  1 lock held by evmcs_test/10939:
   #0: ffff88826ffcb800 (&vcpu->mutex){+.+.}, at: kvm_vcpu_ioctl+0x85/0x630 [kvm]

  stack backtrace:
  CPU: 1 PID: 10939 Comm: evmcs_test Not tainted 5.4.0-rc7+ beagleboard#94
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
  Call Trace:
   dump_stack+0x68/0x9b
   kvm_is_visible_gfn+0x179/0x180 [kvm]
   mmu_check_root+0x11/0x30 [kvm]
   fast_cr3_switch+0x40/0x120 [kvm]
   kvm_mmu_new_cr3+0x34/0x60 [kvm]
   nested_vmx_load_cr3+0xbd/0x1f0 [kvm_intel]
   nested_vmx_enter_non_root_mode+0xab8/0x1d60 [kvm_intel]
   vmx_set_nested_state+0x256/0x340 [kvm_intel]
   kvm_arch_vcpu_ioctl+0x491/0x11a0 [kvm]
   kvm_vcpu_ioctl+0xde/0x630 [kvm]
   do_vfs_ioctl+0xa2/0x6c0
   ksys_ioctl+0x66/0x70
   __x64_sys_ioctl+0x16/0x20
   do_syscall_64+0x54/0x200
   entry_SYSCALL_64_after_hwframe+0x49/0xbe
  RIP: 0033:0x7f59a2b95f47

Fixes: 8fcc4b5 ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
Cc: [email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
RobertCNelson pushed a commit that referenced this pull request May 14, 2021
[ Upstream commit 62e69bc ]

lmc set sc->lmc_media pointer when there is a matching device.
However, when no matching device is found, this pointer is NULL
and the following dereference will result in a null-ptr-deref.

To fix this issue, unregister the hdlc device and return an error.

[    4.569359] BUG: KASAN: null-ptr-deref in lmc_init_one.cold+0x2b6/0x55d [lmc]
[    4.569748] Read of size 8 at addr 0000000000000008 by task modprobe/95
[    4.570102]
[    4.570187] CPU: 0 PID: 95 Comm: modprobe Not tainted 5.11.0-rc7 #94
[    4.570527] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-48-gd9c812dda519-preb4
[    4.571125] Call Trace:
[    4.571261]  dump_stack+0x7d/0xa3
[    4.571445]  kasan_report.cold+0x10c/0x10e
[    4.571667]  ? lmc_init_one.cold+0x2b6/0x55d [lmc]
[    4.571932]  lmc_init_one.cold+0x2b6/0x55d [lmc]
[    4.572186]  ? lmc_mii_readreg+0xa0/0xa0 [lmc]
[    4.572432]  local_pci_probe+0x6f/0xb0
[    4.572639]  pci_device_probe+0x171/0x240
[    4.572857]  ? pci_device_remove+0xe0/0xe0
[    4.573080]  ? kernfs_create_link+0xb6/0x110
[    4.573315]  ? sysfs_do_create_link_sd.isra.0+0x76/0xe0
[    4.573598]  really_probe+0x161/0x420
[    4.573799]  driver_probe_device+0x6d/0xd0
[    4.574022]  device_driver_attach+0x82/0x90
[    4.574249]  ? device_driver_attach+0x90/0x90
[    4.574485]  __driver_attach+0x60/0x100
[    4.574694]  ? device_driver_attach+0x90/0x90
[    4.574931]  bus_for_each_dev+0xe1/0x140
[    4.575146]  ? subsys_dev_iter_exit+0x10/0x10
[    4.575387]  ? klist_node_init+0x61/0x80
[    4.575602]  bus_add_driver+0x254/0x2a0
[    4.575812]  driver_register+0xd3/0x150
[    4.576021]  ? 0xffffffffc0018000
[    4.576202]  do_one_initcall+0x84/0x250
[    4.576411]  ? trace_event_raw_event_initcall_finish+0x150/0x150
[    4.576733]  ? unpoison_range+0xf/0x30
[    4.576938]  ? ____kasan_kmalloc.constprop.0+0x84/0xa0
[    4.577219]  ? unpoison_range+0xf/0x30
[    4.577423]  ? unpoison_range+0xf/0x30
[    4.577628]  do_init_module+0xf8/0x350
[    4.577833]  load_module+0x3fe6/0x4340
[    4.578038]  ? vm_unmap_ram+0x1d0/0x1d0
[    4.578247]  ? ____kasan_kmalloc.constprop.0+0x84/0xa0
[    4.578526]  ? module_frob_arch_sections+0x20/0x20
[    4.578787]  ? __do_sys_finit_module+0x108/0x170
[    4.579037]  __do_sys_finit_module+0x108/0x170
[    4.579278]  ? __ia32_sys_init_module+0x40/0x40
[    4.579523]  ? file_open_root+0x200/0x200
[    4.579742]  ? do_sys_open+0x85/0xe0
[    4.579938]  ? filp_open+0x50/0x50
[    4.580125]  ? exit_to_user_mode_prepare+0xfc/0x130
[    4.580390]  do_syscall_64+0x33/0x40
[    4.580586]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[    4.580859] RIP: 0033:0x7f1a724c3cf7
[    4.581054] Code: 48 89 57 30 48 8b 04 24 48 89 47 38 e9 1d a0 02 00 48 89 f8 48 89 f7 48 89 d6 48 891
[    4.582043] RSP: 002b:00007fff44941c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[    4.582447] RAX: ffffffffffffffda RBX: 00000000012ada70 RCX: 00007f1a724c3cf7
[    4.582827] RDX: 0000000000000000 RSI: 00000000012ac9e0 RDI: 0000000000000003
[    4.583207] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000001
[    4.583587] R10: 00007f1a72527300 R11: 0000000000000246 R12: 00000000012ac9e0
[    4.583968] R13: 0000000000000000 R14: 00000000012acc90 R15: 0000000000000001
[    4.584349] ==================================================================

Signed-off-by: Tong Zhang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.