1. Jan 20, 2017
    • Stephen Boyd's avatar
      usb: chipidea: Handle extcon events properly · a89b94b5
      Stephen Boyd authored
      
      
      We're currently emulating the vbus and id interrupts in the OTGSC
      read API, but we also need to make sure that if we're handling
      the events with extcon that we don't enable the interrupts for
      those events in the hardware. Therefore, properly emulate this
      register if we're using extcon, but don't enable the interrupts.
      This allows me to get my cable connect/disconnect working
      properly without getting spurious interrupts on my device that
      uses an extcon for these two events.
      
      Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
      Fixes: 3ecb3e09
      
       ("usb: chipidea: Use extcon framework for VBUS and ID detect")
      Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      a89b94b5
    • Stephen Boyd's avatar
      usb: chipidea: Only read/write OTGSC from one place · f60f8ccd
      Stephen Boyd authored
      
      
      With the id and vbus detection done via extcon we need to make
      sure we poll the status of OTGSC properly by considering what the
      extcon is saying, and not just what the register is saying. Let's
      move this hw_wait_reg() function to the only place it's used and
      simplify it for polling the OTGSC register. Then we can make
      certain we only use the hw_read_otgsc() API to read OTGSC, which
      will make sure we properly handle extcon events.
      
      Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
      Fixes: 3ecb3e09
      
       ("usb: chipidea: Use extcon framework for VBUS and ID detect")
      Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      f60f8ccd
    • Stephen Boyd's avatar
      usb: ulpi: Support device discovery via DT · ef6a7bcf
      Stephen Boyd authored
      
      
      The qcom HSIC ULPI phy doesn't have any bits set in the vendor or
      product ID registers. This makes it impossible to make a ULPI
      driver match against the ID registers. Add support to discover
      the ULPI phys via DT help alleviate this problem. In the DT case,
      we'll look for a ULPI bus node underneath the device registering
      the ULPI viewport (or the parent of that device to support
      chipidea's device layout) and then match up the phy node
      underneath that with the ULPI device that's created.
      
      The side benefit of this is that we can use standard properties
      in the phy node like clks, regulators, gpios, etc. because we
      don't have firmware like ACPI to turn these things on for us. And
      we can use the DT phy binding to point our phy consumer to the
      phy provider.
      
      The ULPI bus code supports native enumeration by reading the
      vendor ID and product ID registers at device creation time, but
      we can't be certain that those register reads will succeed if the
      phy is not powered up. To avoid any problems with reading the ID
      registers before the phy is powered we fallback to DT matching
      when the ID reads fail.
      
      If the ULPI spec had some generic power sequencing for these
      registers we could put that into the ULPI bus layer and power up
      the device before reading the ID registers. Unfortunately this
      doesn't exist and the power sequence is usually device specific.
      By having the device matched up with DT we can avoid this
      problem.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: <devicetree@vger.kernel.org>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      ef6a7bcf
    • Stephen Boyd's avatar
      of: device: Export of_device_{get_modalias, uvent_modalias} to modules · 7a3b7cd3
      Stephen Boyd authored
      
      
      The ULPI bus can be built as a module, and it will soon be
      calling these functions when it supports probing devices from DT.
      Export them so they can be used by the ULPI module.
      
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Cc: <devicetree@vger.kernel.org>
      Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      7a3b7cd3
    • Stephen Boyd's avatar
      of: device: Support loading a module with OF based modalias · 9c829c09
      Stephen Boyd authored
      
      
      In the case of ULPI devices, we want to be able to load the
      driver before registering the device so that we don't get stuck
      in a loop waiting for the phy module to appear and failing usb
      controller probe. Currently we request the ulpi module via the
      ulpi ids, but in the DT case we might need to request it with the
      OF based modalias instead. Add a common function that allows
      anyone to request a module with the OF based modalias.
      
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Cc: <devicetree@vger.kernel.org>
      Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      9c829c09
    • Chanwoo Choi's avatar
      usb: chipdata: Replace the extcon API · 3f991aa0
      Chanwoo Choi authored
      
      
      This patch uses the resource-managed extcon API for extcon_register_notifier()
      and replaces the deprecated extcon API as following:
      - extcon_get_cable_state_() -> extcon_get_state()
      
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      3f991aa0
  2. Dec 26, 2016
    • Linus Torvalds's avatar
      Linux 4.10-rc1 · 7ce7d89f
      Linus Torvalds authored
      7ce7d89f
    • Larry Finger's avatar
      powerpc: Fix build warning on 32-bit PPC · 8ae679c4
      Larry Finger authored
      I am getting the following warning when I build kernel 4.9-git on my
      PowerBook G4 with a 32-bit PPC processor:
      
          AS      arch/powerpc/kernel/misc_32.o
        arch/powerpc/kernel/misc_32.S:299:7: warning: "CONFIG_FSL_BOOKE" is not defined [-Wundef]
      
      This problem is evident after commit 989cea5c ("kbuild: prevent
      lib-ksyms.o rebuilds"); however, this change in kbuild only exposes an
      error that has been in the code since 2005 when this source file was
      created.  That was with commit 9994a338 ("powerpc: Introduce
      entry_{32,64}.S, misc_{32,64}.S, systbl.S").
      
      The offending line does not make a lot of sense.  This error does not
      seem to cause any errors in the executable, thus I am not recommending
      that it be applied to any stable versions.
      
      Thanks to Nicholas Piggin for suggesting this solution.
      
      Fixes: 9994a338
      
       ("powerpc: Introduce entry_{32,64}.S, misc_{32,64}.S, systbl.S")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8ae679c4
    • Linus Torvalds's avatar
      avoid spurious "may be used uninitialized" warning · d33d5a6c
      Linus Torvalds authored
      
      
      The timer type simplifications caused a new gcc warning:
      
        drivers/base/power/domain.c: In function ‘genpd_runtime_suspend’:
        drivers/base/power/domain.c:562:14: warning: ‘time_start’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
      
      despite the actual use of "time_start" not having changed in any way.
      It appears that simply changing the type of ktime_t from a union to a
      plain scalar type made gcc check the use.
      
      The variable wasn't actually used uninitialized, but gcc apparently
      failed to notice that the conditional around the use was exactly the
      same as the conditional around the initialization of that variable.
      
      Add an unnecessary initialization just to shut up the compiler.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d33d5a6c
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3ddc76df
      Linus Torvalds authored
      Pull timer type cleanups from Thomas Gleixner:
       "This series does a tree wide cleanup of types related to
        timers/timekeeping.
      
         - Get rid of cycles_t and use a plain u64. The type is not really
           helpful and caused more confusion than clarity
      
         - Get rid of the ktime union. The union has become useless as we use
           the scalar nanoseconds storage unconditionally now. The 32bit
           timespec alike storage got removed due to the Y2038 limitations
           some time ago.
      
           That leaves the odd union access around for no reason. Clean it up.
      
        Both changes have been done with coccinelle and a small amount of
        manual mopping up"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ktime: Get rid of ktime_equal()
        ktime: Cleanup ktime_set() usage
        ktime: Get rid of the union
        clocksource: Use a plain u64 instead of cycle_t
      3ddc76df
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b272f732
      Linus Torvalds authored
      Pull SMP hotplug notifier removal from Thomas Gleixner:
       "This is the final cleanup of the hotplug notifier infrastructure. The
        series has been reintgrated in the last two days because there came a
        new driver using the old infrastructure via the SCSI tree.
      
        Summary:
      
         - convert the last leftover drivers utilizing notifiers
      
         - fixup for a completely broken hotplug user
      
         - prevent setup of already used states
      
         - removal of the notifiers
      
         - treewide cleanup of hotplug state names
      
         - consolidation of state space
      
        There is a sphinx based documentation pending, but that needs review
        from the documentation folks"
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/armada-xp: Consolidate hotplug state space
        irqchip/gic: Consolidate hotplug state space
        coresight/etm3/4x: Consolidate hotplug state space
        cpu/hotplug: Cleanup state names
        cpu/hotplug: Remove obsolete cpu hotplug register/unregister functions
        staging/lustre/libcfs: Convert to hotplug state machine
        scsi/bnx2i: Convert to hotplug state machine
        scsi/bnx2fc: Convert to hotplug state machine
        cpu/hotplug: Prevent overwriting of callbacks
        x86/msr: Remove bogus cleanup from the error path
        bus: arm-ccn: Prevent hotplug callback leak
        perf/x86/intel/cstate: Prevent hotplug callback leak
        ARM/imx/mmcd: Fix broken cpu hotplug handling
        scsi: qedi: Convert to hotplug state machine
      b272f732
    • Linus Torvalds's avatar
      Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · 10bbe759
      Linus Torvalds authored
      Pull turbostat updates from Len Brown.
      
      * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        tools/power turbostat: remove obsolete -M, -m, -C, -c options
        tools/power turbostat: Make extensible via the --add parameter
        tools/power turbostat: Denverton uses a 25 MHz crystal, not 19.2 MHz
        tools/power turbostat: line up headers when -M is used
        tools/power turbostat: fix SKX PKG_CSTATE_LIMIT decoding
        tools/power turbostat: Support Knights Mill (KNM)
        tools/power turbostat: Display HWP OOB status
        tools/power turbostat: fix Denverton BCLK
        tools/power turbostat: use intel-family.h model strings
        tools/power/turbostat: Add Denverton RAPL support
        tools/power/turbostat: Add Denverton support
        tools/power/turbostat: split core MSR support into status + limit
        tools/power turbostat: fix error case overflow read of slm_freq_table[]
        tools/power turbostat: Allocate correct amount of fd and irq entries
        tools/power turbostat: switch to tab delimited output
        tools/power turbostat: Gracefully handle ACPI S3
        tools/power turbostat: tidy up output on Joule counter overflow
      10bbe759
    • Nicholas Piggin's avatar
      mm: add PageWaiters indicating tasks are waiting for a page bit · 62906027
      Nicholas Piggin authored
      
      
      Add a new page flag, PageWaiters, to indicate the page waitqueue has
      tasks waiting. This can be tested rather than testing waitqueue_active
      which requires another cacheline load.
      
      This bit is always set when the page has tasks on page_waitqueue(page),
      and is set and cleared under the waitqueue lock. It may be set when
      there are no tasks on the waitqueue, which will cause a harmless extra
      wakeup check that will clears the bit.
      
      The generic bit-waitqueue infrastructure is no longer used for pages.
      Instead, waitqueues are used directly with a custom key type. The
      generic code was not flexible enough to have PageWaiters manipulation
      under the waitqueue lock (which simplifies concurrency).
      
      This improves the performance of page lock intensive microbenchmarks by
      2-3%.
      
      Putting two bits in the same word opens the opportunity to remove the
      memory barrier between clearing the lock bit and testing the waiters
      bit, after some work on the arch primitives (e.g., ensuring memory
      operand widths match and cover both bits).
      
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Bob Peterson <rpeterso@redhat.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Andrew Lutomirski <luto@kernel.org>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      62906027
    • Nicholas Piggin's avatar
      mm: Use owner_priv bit for PageSwapCache, valid when PageSwapBacked · 6326fec1
      Nicholas Piggin authored
      
      
      A page is not added to the swap cache without being swap backed,
      so PageSwapBacked mappings can use PG_owner_priv_1 for PageSwapCache.
      
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Bob Peterson <rpeterso@redhat.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Andrew Lutomirski <luto@kernel.org>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6326fec1
    • Thomas Gleixner's avatar
      ktime: Get rid of ktime_equal() · 1f3a8e49
      Thomas Gleixner authored
      
      
      No point in going through loops and hoops instead of just comparing the
      values.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      1f3a8e49
    • Thomas Gleixner's avatar
      ktime: Cleanup ktime_set() usage · 8b0e1953
      Thomas Gleixner authored
      
      
      ktime_set(S,N) was required for the timespec storage type and is still
      useful for situations where a Seconds and Nanoseconds part of a time value
      needs to be converted. For anything where the Seconds argument is 0, this
      is pointless and can be replaced with a simple assignment.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      8b0e1953
    • Thomas Gleixner's avatar
      ktime: Get rid of the union · 2456e855
      Thomas Gleixner authored
      
      
      ktime is a union because the initial implementation stored the time in
      scalar nanoseconds on 64 bit machine and in a endianess optimized timespec
      variant for 32bit machines. The Y2038 cleanup removed the timespec variant
      and switched everything to scalar nanoseconds. The union remained, but
      become completely pointless.
      
      Get rid of the union and just keep ktime_t as simple typedef of type s64.
      
      The conversion was done with coccinelle and some manual mopping up.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      2456e855
  3. Dec 25, 2016
  4. Dec 24, 2016
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6ac3bb16
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "There's a number of fixes:
      
         - a round of fixes for CPUID-less legacy CPUs
         - a number of microcode loader fixes
         - i8042 detection robustization fixes
         - stack dump/unwinder fixes
         - x86 SoC platform driver fixes
         - a GCC 7 warning fix
         - virtualization related fixes"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
        Revert "x86/unwind: Detect bad stack return address"
        x86/paravirt: Mark unused patch_default label
        x86/microcode/AMD: Reload proper initrd start address
        x86/platform/intel/quark: Add printf attribute to imr_self_test_result()
        x86/platform/intel-mid: Switch MPU3050 driver to IIO
        x86/alternatives: Do not use sync_core() to serialize I$
        x86/topology: Document cpu_llc_id
        x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic
        x86/asm: Rewrite sync_core() to use IRET-to-self
        x86/microcode/intel: Replace sync_core() with native_cpuid()
        Revert "x86/boot: Fail the boot if !M486 and CPUID is missing"
        x86/asm/32: Make sync_core() handle missing CPUID on all 32-bit kernels
        x86/cpu: Probe CPUID leaf 6 even when cpuid_level == 6
        x86/tools: Fix gcc-7 warning in relocs.c
        x86/unwind: Dump stack data on warnings
        x86/unwind: Adjust last frame check for aligned function stacks
        x86/init: Fix a couple of comment typos
        x86/init: Remove i8042_detect() from platform ops
        Input: i8042 - Trust firmware a bit more when probing on X86
        x86/init: Add i8042 state to the platform data
        ...
      6ac3bb16
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · eb3e8d9d
      Linus Torvalds authored
      Pull timer fix from Ingo Molnar:
       "ARM/MOXA SoC clocksource driver fixes"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/moxart: Plug memory and mapping leaks
      eb3e8d9d