1. 30 Jan, 2017 10 commits
    • Gautham R. Shenoy's avatar
      powernv: Pass PSSCR value and mask to power9_idle_stop · 09206b60
      Gautham R. Shenoy authored
      The power9_idle_stop method currently takes only the requested stop
      level as a parameter and picks up the rest of the PSSCR bits from a
      hand-coded macro. This is not a very flexible design, especially when
      the firmware has the capability to communicate the psscr value and the
      mask associated with a particular stop state via device tree.
      
      This patch modifies the power9_idle_stop API to take as parameters the
      PSSCR value and the PSSCR mask corresponding to the stop state that
      needs to be set. These PSSCR value and mask are respectively obtained
      by parsing the "ibm,cpu-idle-state-psscr" and
      "ibm,cpu-idle-state-psscr-mask" fields from the device tree.
      
      In addition to this, the patch adds support for handling stop states
      for which ESL and EC bits in the PSSCR are zero. As per the
      architecture, a wakeup from these stop states resumes execution from
      the subsequent instruction as opposed to waking up at the System
      Vector.
      
      The older firmware sets only the Requested Level (RL) field in the
      psscr and psscr-mask exposed in the device tree. For older firmware
      where psscr-mask=0xf, this patch will set the default sane values that
      the set for for remaining PSSCR fields (i.e PSLL, MTL, ESL, EC, and
      TR). For the new firmware, the patch will validate that the invariants
      required by the ISA for the psscr values are maintained by the
      firmware.
      
      This skiboot patch that exports fully populated PSSCR values and the
      mask for all the stop states can be found here:
      https://lists.ozlabs.org/pipermail/skiboot/2016-September/004869.html
      
      [Optimize the number of instructions before entering STOP with
      ESL=EC=0, validate the PSSCR values provided by the firimware
      maintains the invariants required as per the ISA suggested by Balbir
      Singh]
      Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      09206b60
    • Gautham R. Shenoy's avatar
      cpuidle:powernv: Add helper function to populate powernv idle states. · 9e9fc6f0
      Gautham R. Shenoy authored
      In the current code for powernv_add_idle_states, there is a lot of code
      duplication while initializing an idle state in powernv_states table.
      
      Add an inline helper function to populate the powernv_states[] table
      for a given idle state. Invoke this for populating the "Nap",
      "Fastsleep" and the stop states in powernv_add_idle_states.
      Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9e9fc6f0
    • Gautham R. Shenoy's avatar
      powernv:stop: Rename pnv_arch300_idle_init to pnv_power9_idle_init · dd34c74c
      Gautham R. Shenoy authored
      Balbir pointed out that the name of the function pnv_arch300_idle_init
      was inconsistent with the names of the variables and functions
      pertaining to POWER9 features in book3s_idle.S.
      
      This patch renames pnv_arch300_idle_init to pnv_power9_idle_init.
      
      This patch does not change any behaviour.
      Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      dd34c74c
    • Gautham R. Shenoy's avatar
      powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro · 823b7bd5
      Gautham R. Shenoy authored
      Currently all the low-power idle states are expected to wake up
      at reset vector 0x100. Which is why the macro IDLE_STATE_ENTER_SEQ
      that puts the CPU to an idle state and never returns.
      
      On ISA v3.0, when the ESL and EC bits in the PSSCR are zero, the CPU
      is expected to wake up at the next instruction of the idle
      instruction.
      
      This patch adds a new macro named IDLE_STATE_ENTER_SEQ_NORET for the
      no-return variant and reuses the name IDLE_STATE_ENTER_SEQ
      for a variant that allows resuming operation at the instruction next
      to the idle-instruction.
      Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      823b7bd5
    • Alistair Popple's avatar
      powerpc/powernv: Use OPAL call for TCE kill on NVLink2 · 616badd2
      Alistair Popple authored
      Add detection of NPU2 PHBs. NPU2/NVLink2 has a different register
      layout for the TCE kill register therefore TCE invalidation should be
      done via the OPAL call rather than using the register directly as it
      is for PHB3 and NVLink1. This changes TCE invalidation to use the OPAL
      call in the case of a NPU2 PHB model.
      Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      616badd2
    • Alistair Popple's avatar
      powerpc/powernv: Initialise nest mmu · 1d0761d2
      Alistair Popple authored
      POWER9 contains an off core mmu called the nest mmu (NMMU). This is
      used by other hardware units on the chip to translate virtual
      addresses into real addresses. The unit attempting an address
      translation provides the majority of the context required for the
      translation request except for the base address of the partition table
      (ie. the PTCR) which needs to be programmed into the NMMU.
      
      This patch adds a call to OPAL to set the PTCR for the nest mmu in
      opal_init().
      Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1d0761d2
    • Reza Arbab's avatar
      powerpc/mm: Allow memory hotplug into an offline node · 2a8628d4
      Reza Arbab authored
      Relax the check preventing us from hotplugging into an offline node.
      
      This limitation was added in commit 482ec7c4 ("[PATCH] powerpc numa:
      Support sparse online node map") to prevent adding resources to an
      uninitialized node.
      
      These days, there is no harm in doing so. The addition will actually
      cause the node to be initialized and onlined; add_memory_resource()
      calls hotadd_new_pgdat() (if necessary) and node_set_online().
      Signed-off-by: default avatarReza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      2a8628d4
    • Reza Arbab's avatar
      powerpc/mm: Simplify loop control in parse_numa_properties() · 7656cd8e
      Reza Arbab authored
      The flow of the main loop in parse_numa_properties() is overly
      complicated. Simplify it to be less confusing and easier to read.
      No functional change.
      
      The end of the main loop in parse_numa_properties() looks like this:
      
      	for_each_node_by_type(...) {
      		...
      		if (!condition) {
      			if (--ranges)
      				goto new_range;
      			else
      				continue;
      		}
      
      		statement();
      
      		if (--ranges)
      			goto new_range;
      		/* else
      		 *	continue; <- implicit, this is the end of the loop
      		 */
      	}
      
      The only effect of !condition is to skip execution of statement(). This
      can be rewritten in a simpler way:
      
      	for_each_node_by_type(...) {
      		...
      		if (condition)
      			statement();
      
      		if (--ranges)
      			goto new_range;
      	}
      Signed-off-by: default avatarReza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      7656cd8e
    • Mahesh Salgaonkar's avatar
      powerpc/fadump: Fix the race in crash_fadump(). · f2a5e8f0
      Mahesh Salgaonkar authored
      There are chances that multiple CPUs can call crash_fadump() simultaneously
      and would start duplicating same info to vmcoreinfo ELF note section. This
      causes makedumpfile to fail during kdump capture. One example is,
      triggering dumprestart from HMC which sends system reset to all the CPUs at
      once.
      
      makedumpfile --dump-dmesg /proc/vmcore
      read_vmcoreinfo_basic_info: Invalid data in /tmp/vmcoreinfoyjgxlL: CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971
      makedumpfile Failed.
      Running makedumpfile --dump-dmesg /proc/vmcore failed (1).
      
      makedumpfile  -d 31 -l /proc/vmcore
      read_vmcoreinfo_basic_info: Invalid data in /tmp/vmcoreinfo1mmVdO: CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971CRASHTIME=1475605971
      makedumpfile Failed.
      Running makedumpfile  -d 31 -l /proc/vmcore failed (1).
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f2a5e8f0
    • Aneesh Kumar K.V's avatar
      powerpc/mm/hash: Properly mask the ESID bits when building proto VSID · 79270e0a
      Aneesh Kumar K.V authored
      The proto VSID is built using both the MMU context id and effective
      segment ID (ESID). We should not have overlapping bits between those.
      That could result in us having a VSID collision. With the current code
      we missed masking the top bits of the ESID. This implies for kernel
      address we ended up using the top 4 bits of the ESID as part of the
      proto VSID, which is wrong.
      
      The current code use the top 4 context values (0x7fffc - 0x7ffff) for
      the kernel. With those context IDs used for the kernel, we don't run
      into VSID collisions because we get the same proto VSID irrespective of
      whether we mask the ESID bits or not. eg:
      
        ea         = 0xf000000000000000
        context    = 0x7ffff
      
        w/out masking:
        proto_vsid = (0x7ffff << 6 | 0xf000000000000000 >> 40)
      	     = (0x1ffffc0 | 0xf00000)
      	     =  0x1ffffc0
      
        with masking:
        proto_vsid = (0x7ffff << 6 | ((0xf000000000000000 >> 40) & 0x3f))
      	     = (0x1ffffc0 | (0xf00000 & 0x3f))
      	     =  0x1ffffc0 | 0)
      	     =  0x1ffffc0
      
      So although there is no bug, the code is still overly subtle, so fix it
      to save ourselves pain in future.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      79270e0a
  2. 25 Jan, 2017 15 commits
  3. 23 Jan, 2017 2 commits
  4. 22 Jan, 2017 10 commits
    • Linus Torvalds's avatar
      Linux 4.10-rc5 · 7a308bb3
      Linus Torvalds authored
      7a308bb3
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 095cbe66
      Linus Torvalds authored
      Pull x86 fix from Thomas Gleixner:
       "Restore the retrigger callbacks in the IO APIC irq chips. That
        addresses a long standing regression which got introduced with the
        rewrite of the x86 irq subsystem two years ago and went unnoticed so
        far"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ioapic: Restore IO-APIC irq_chip retrigger callback
      095cbe66
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 24b86839
      Linus Torvalds authored
      Pull smp/hotplug fix from Thomas Gleixner:
       "Remove an unused variable which is a leftover from the notifier
        removal"
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Remove unused but set variable in _cpu_down()
      24b86839
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 585457fc
      Linus Torvalds authored
      Pull virtio/vhost fixes from Michael Tsirkin:
       "Random fixes and cleanups that accumulated over the time"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio/s390: virtio: constify virtio_config_ops structures
        virtio/s390: add missing \n to end of dev_err message
        virtio/s390: support READ_STATUS command for virtio-ccw
        tools/virtio/ringtest: tweaks for s390
        tools/virtio/ringtest: fix run-on-all.sh for offline cpus
        virtio_console: fix a crash in config_work_handler
        vhost/scsi: silence uninitialized variable warning
        vhost: scsi: constify target_core_fabric_ops structures
      585457fc
    • Linus Torvalds's avatar
      Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · bb6c01c2
      Linus Torvalds authored
      Pull thermal management fixes from Zhang Rui:
      
       - fix a regression that thermal zone dynamically allocated sysfs
         attributes are freed before they're removed, which is introduced in
         4.10-rc1 (Jacob von Chorus)
      
       - fix a boot warning because deprecated hwmon API is used (Fabio
         Estevam)
      
       - a couple of fixes for rockchip thermal driver (Brian Norris, Caesar
         Wang)
      
      * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        thermal: rockchip: fixes the conversion table
        thermal: core: move tz->device.groups cleanup to thermal_release
        thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
        thermal: rockchip: handle set_trips without the trip points
        thermal: rockchip: optimize the conversion table
        thermal: rockchip: fixes invalid temperature case
        thermal: rockchip: don't pass table structs by value
        thermal: rockchip: improve conversion error messages
      bb6c01c2
    • Linus Torvalds's avatar
      Merge tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · c497f8d1
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a few small USB fixes for 4.10-rc5.
      
        Most of these are gadget/dwc2 fixes for reported issues, all of these
        have been in linux-next for a while. The last one is a single xhci
        WARN_ON removal to handle an issue that the dwc3 driver is hitting in
        the 4.10-rc tree. The warning is harmless and needs to be removed, and
        a "real" fix that is more complex will show up in 4.11-rc1 for this
        device.
      
        That last patch hasn't been in linux-next yet due to the weekend
        timing, but it's a "simple" WARN_ON() removal so what could go wrong?
        :)"
      
      Famous last words.
      
      * tag 'usb-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        xhci: remove WARN_ON if dma mask is not set for platform devices
        usb: dwc2: host: fix Wmaybe-uninitialized warning
        usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value
        usb: gadget: udc: atmel: remove memory leak
        usb: dwc3: exynos fix axius clock error path to do cleanup
        usb: dwc2: Avoid suspending if we're in gadget mode
        usb: dwc2: use u32 for DT binding parameters
        usb: gadget: f_fs: Fix iterations on endpoints.
        usb: dwc2: gadget: Fix DMA memory freeing
        usb: gadget: composite: Fix function used to free memory
      c497f8d1
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · f68d8531
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
       "Two fixes:
      
         - a regression fix for the multiple-pmem-namespace-per-region support
           added in 4.9. Even if an existing environment is not using that
           feature the act of creating and a destroying a single namespace
           with the ndctl utility will lead to the proliferation of extra
           unwanted namespace devices.
      
         - a fix for the error code returned from the pmem driver when the
           memcpy_mcsafe() routine returns -EFAULT. Btrfs seems to be the only
           block I/O consumer that tries to parse the meaning of the error
           code when it is non-zero.
      
        Neither of these fixes are critical, the namespace leak is awkward in
        that it can cause device naming to change and complicates debugging
        namespace initialization issues. The error code fix is included out of
        caution for what other consumers might be expecting -EIO for block I/O
        errors"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero
        pmem: return EIO on read_pmem() failure
      f68d8531
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · f5e8c0ff
      Linus Torvalds authored
      Pull clk fix from Stephen Boyd:
       "One fix for Samsung Exynos524x SoCs where recent IOMMU patches have
        caused some of these clocks to turn off when they were always left on
        before"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk/samsung: exynos542x: mark some clocks as critical
      f5e8c0ff
    • Linus Torvalds's avatar
      Merge tag 'arc-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 455a70cb
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta:
      
       - more intc updates [Yuriv]
      
       - fix module build when unwinder is turned off
      
       - IO Coherency Programming model updates
      
       - other miscellaneous
      
      * tag 'arc-4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: Revert "ARC: mm: IOC: Don't enable IOC by default"
        ARC: mm: split arc_cache_init to allow __init reaping of bulk
        ARCv2: IOC: Use actual memory size to setup aperture size
        ARCv2: IOC: Adhere to progamming model guidelines to avoid DMA corruption
        ARCv2: IOC: refactor the IOC and SLC operations into own functions
        ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
        ARCv2: save r30 on kernel entry as gcc uses it for code-gen
        ARCv2: IRQ: Call entry/exit functions for chained handlers in MCIP
        ARC: IRQ: Use hwirq instead of virq in mask/unmask
        ARC: mmu: clarify the MMUv3 programming model
      455a70cb
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 83fd57a7
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Two fixes for fallout from the hugetlb changes we merged this cycle.
      
        Ten other fixes, four only affect Power9, and the rest are a bit of a
        mixture though nothing terrible.
      
        Thanks to: Aneesh Kumar K.V, Anton Blanchard, Benjamin Herrenschmidt,
        Dave Martin, Gavin Shan, Madhavan Srinivasan, Nicholas Piggin, Reza
        Arbab"
      
      * tag 'powerpc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Ignore reserved field in DCSR and PVR reads and writes
        powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write
        powerpc/ptrace: Preserve previous fprs/vsrs on short regset write
        powerpc/perf: Use MSR to report privilege level on P9 DD1
        selftest/powerpc: Wrong PMC initialized in pmc56_overflow test
        powerpc/eeh: Enable IO path on permanent error
        powerpc/perf: Fix PM_BRU_CMPL event code for power9
        powerpc/mm: Fix little-endian 4K hugetlb
        powerpc/mm/hugetlb: Don't panic when we don't find the default huge page size
        powerpc: Fix pgtable pmd cache init
        powerpc/icp-opal: Fix missing KVM case and harden replay
        powerpc/mm: Fix memory hotplug BUG() on radix
      83fd57a7
  5. 20 Jan, 2017 3 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 4c9eff7a
      Linus Torvalds authored
      Pull KVM fixes from Radim Krčmář:
       "ARM:
         - Fix for timer setup on VHE machines
         - Drop spurious warning when the timer races against the vcpu running
           again
         - Prevent a vgic deadlock when the initialization fails (for stable)
      
        s390:
         - Fix a kernel memory exposure (for stable)
      
        x86:
         - Fix exception injection when hypercall instruction cannot be
           patched"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: s390: do not expose random data via facility bitmap
        KVM: x86: fix fixing of hypercalls
        KVM: arm/arm64: vgic: Fix deadlock on error handling
        KVM: arm64: Access CNTHCTL_EL2 bit fields correctly on VHE systems
        KVM: arm/arm64: Fix occasional warning from the timer work function
      4c9eff7a
    • Linus Torvalds's avatar
      Merge branch 'scsi-target-for-v4.10' of... · 51162264
      Linus Torvalds authored
      Merge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux
      
      Pull SCSI target fixes from Bart Van Assche:
      
       - two small fixes for the ibmvscsis driver
      
       - ten patches with bug fixes for the target mode of the qla2xxx driver
      
       - four patches that avoid that the "sparse" and "smatch" static
         analyzer tools report false positives for the qla2xxx code base
      
      * 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux:
        qla2xxx: Disable out-of-order processing by default in firmware
        qla2xxx: Fix erroneous invalid handle message
        qla2xxx: Reduce exess wait during chip reset
        qla2xxx: Terminate exchange if corrupted
        qla2xxx: Fix crash due to null pointer access
        qla2xxx: Collect additional information to debug fw dump
        qla2xxx: Reset reserved field in firmware options to 0
        qla2xxx: Set tcm_qla2xxx version to automatically track qla2xxx version
        qla2xxx: Include ATIO queue in firmware dump when in target mode
        qla2xxx: Fix wrong IOCB type assumption
        qla2xxx: Avoid that building with W=1 triggers complaints about set-but-not-used variables
        qla2xxx: Move two arrays from header files to .c files
        qla2xxx: Declare an array with file scope static
        qla2xxx: Fix indentation
        ibmvscsis: Fix sleeping in interrupt context
        ibmvscsis: Fix max transfer length
      51162264
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · e3737b91
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Just two small fixes for this -rc.
      
        One is just killing an unused variable from Keith, but the other
        fixes a performance regression for nbd in this series, where we
        inadvertently flipped when we set MSG_MORE when outputting data"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        nbd: only set MSG_MORE when we have more to send
        blk-mq: Remove unused variable
      e3737b91