15 Feb, 2017

1 commit

  • commit e471486c13b82b1338d49c798f78bb62b1ed0a9e upstream.

    We queue an on-stack work item to 'nfit_wq' and wait for it to complete
    as part of a 'flush_probe' request. However, if the user cancels the
    wait we need to make sure the item is flushed from the queue otherwise
    we are leaving an out-of-scope stack address on the work list.

    BUG: unable to handle kernel paging request at ffffbcb3c72f7cd0
    IP: [] __list_add+0x1b/0xb0
    [..]
    RIP: 0010:[] [] __list_add+0x1b/0xb0
    RSP: 0018:ffffbcb3c7ba7c00 EFLAGS: 00010046
    [..]
    Call Trace:
    [] insert_work+0x3a/0xc0
    [] ? seq_open+0x5a/0xa0
    [] __queue_work+0x16a/0x460
    [] queue_work_on+0x38/0x40
    [] acpi_nfit_flush_probe+0x95/0xc0 [nfit]
    [] ? nfit_visible+0x40/0x40 [nfit]
    [] wait_probe_show+0x25/0x60
    [] dev_attr_show+0x20/0x50

    Fixes: 7ae0fa439faf ("nfit, libnvdimm: async region scrub workqueue")
    Reviewed-by: Vishal Verma
    Signed-off-by: Dan Williams
    Signed-off-by: Greg Kroah-Hartman

    Dan Williams
     

20 Jan, 2017

2 commits

  • commit a545715d2dae8d071c5b06af947b07ffa846b288 upstream.

    When removing and adding cpu 0 on a system with GHES NMI the following stack
    trace is seen when re-adding the cpu:

    WARNING: CPU: 0 PID: 0 at arch/x86/kernel/apic/apic.c:1349 setup_local_APIC+
    Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 nfs fscache coretemp intel_ra
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc6+ #2
    Call Trace:
    dump_stack+0x63/0x8e
    __warn+0xd1/0xf0
    warn_slowpath_null+0x1d/0x20
    setup_local_APIC+0x275/0x370
    apic_ap_setup+0xe/0x20
    start_secondary+0x48/0x180
    set_init_arg+0x55/0x55
    early_idt_handler_array+0x120/0x120
    x86_64_start_reservations+0x2a/0x2c
    x86_64_start_kernel+0x13d/0x14c

    During the cpu bringup, wakeup_cpu_via_init_nmi() is called and issues an
    NMI on CPU 0. The GHES NMI handler, ghes_notify_nmi() runs the
    ghes_proc_irq_work work queue which ends up setting IRQ_WORK_VECTOR
    (0xf6). The "faulty" IR line set at arch/x86/kernel/apic/apic.c:1349 is also
    0xf6 (specifically APIC IRR for irqs 255 to 224 is 0x400000) which confirms
    that something has set the IRQ_WORK_VECTOR line prior to the APIC being
    initialized.

    Commit 2383844d4850 ("GHES: Elliminate double-loop in the NMI handler")
    incorrectly modified the behavior such that the handler returns
    NMI_HANDLED only if an error was processed, and incorrectly runs the ghes
    work queue for every NMI.

    This patch modifies the ghes_proc_irq_work() to run as it did prior to
    2383844d4850 ("GHES: Elliminate double-loop in the NMI handler") by
    properly returning NMI_HANDLED and only calling the work queue if
    NMI_HANDLED has been set.

    Fixes: 2383844d4850 (GHES: Elliminate double-loop in the NMI handler)
    Signed-off-by: Prarit Bhargava
    Reviewed-by: Borislav Petkov
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Prarit Bhargava
     
  • commit 501634759d55a5b56967de6d9465acf02bbc3565 upstream.

    We should return -EINVAL (instead of 0) if get_cpu_device() fails.

    Fixes: 158c998ea44b (ACPI / CPPC: add sysfs support to compute delivered performance)
    Signed-off-by: Dan Carpenter
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

09 Jan, 2017

2 commits

  • commit 6276e53fa8c06a3a5cf7b95b77b079966de9ad66 upstream.

    The HP Pavilion dv6 has a non-working acpi_video0 backlight interface
    and an intel_backlight interface which works fine. Add a force_native
    quirk for it so that the non-working acpi_video0 interface does not get
    registered.

    Note that there are quite a few HP Pavilion dv6 variants, some
    woth ATI and some with NVIDIA hybrid gfx, both seem to need this
    quirk to have working backlight control. There are also some versions
    with only Intel integrated gfx, these may not need this quirk, but it
    should not hurt there.

    Link: https://bugzilla.redhat.com/show_bug.cgi?id=1204476
    Link: https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940
    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit 350fa038c31b056fc509624efb66348ac2c1e3d0 upstream.

    The Dell XPS 17 L702X has a non-working acpi_video0 backlight interface
    and an intel_backlight interface which works fine. Add a force_native
    quirk for it so that the non-working acpi_video0 interface does not get
    registered.

    Note that there also is an issue with the brightnesskeys on this laptop,
    they do not generate key-press events in anyway. That is not solved by
    this patch.

    Link: https://bugzilla.redhat.com/show_bug.cgi?id=1123661
    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

07 Dec, 2016

5 commits

  • A recent flurry of bug discoveries in the nfit driver's DSM marshalling
    routine has highlighted the fact that we do not have unit test coverage
    for this routine. Add a self-test of acpi_nfit_ctl() routine before
    probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl()
    and if any of the tests fail "nfit_test.0" will be unavailable causing
    the rest of the tests to not run / fail.

    This unit test will also be a place to land reproductions of quirky BIOS
    behavior discovered in the field and ensure the kernel does not regress
    against implementations it has seen in practice.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Given dimms and bus commands share the same command number space we need
    to be careful that we are translating status in the correct context.
    Otherwise we can, for example, fail an ND_CMD_GET_CONFIG_SIZE command
    because max_xfer is zero. It fails because that condition erroneously
    correlates with the 'cleared == 0' failure of ND_CMD_CLEAR_ERROR.

    Cc:
    Fixes: aef253382266 ("libnvdimm, nfit: centralize command status translation")
    Signed-off-by: Dan Williams

    Dan Williams
     
  • If an ARS Status command returns truncated output, do not process
    partial records or otherwise consume non-status fields.

    Cc:
    Fixes: 0caeef63e6d2 ("libnvdimm: Add a poison list and export badblocks")
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Given ambiguities in the ACPI 6.1 definition of the "Output (Size)"
    field of the ARS (Address Range Scrub) Status command, a firmware
    implementation may in practice return 0, 4, or 8 to indicate that there
    is no output payload to process.

    The specification states "Size of Output Buffer in bytes, including this
    field.". However, 'Output Buffer' is also the name of the entire
    payload, and earlier in the specification it states "Max Query ARS
    Status Output Buffer Size: Maximum size of buffer (including the Status
    and Extended Status fields)".

    Without this fix if the BIOS happens to return 0 it causes memory
    corruption as evidenced by this result from the acpi_nfit_ctl() unit
    test.

    ars_status00000000: 00020000 00000000 ........
    BUG: stack guard page was hit at ffffc90001750000 (stack is ffffc9000174c000..ffffc9000174ffff)
    kernel stack overflow (page fault): 0000 [#1] SMP DEBUG_PAGEALLOC
    task: ffff8803332d2ec0 task.stack: ffffc9000174c000
    RIP: 0010:[] [] __memcpy+0x12/0x20
    RSP: 0018:ffffc9000174f9a8 EFLAGS: 00010246
    RAX: ffffc9000174fab8 RBX: 0000000000000000 RCX: 000000001fffff56
    RDX: 0000000000000000 RSI: ffff8803231f5a08 RDI: ffffc90001750000
    RBP: ffffc9000174fa88 R08: ffffc9000174fab0 R09: ffff8803231f54b8
    R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000000
    R13: 0000000000000000 R14: 0000000000000003 R15: ffff8803231f54a0
    FS: 00007f3a611af640(0000) GS:ffff88033ed00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffffc90001750000 CR3: 0000000325b20000 CR4: 00000000000406e0
    Stack:
    ffffffffa00bc60d 0000000000000008 ffffc90000000001 ffffc9000174faac
    0000000000000292 ffffffffa00c24e4 ffffffffa00c2914 0000000000000000
    0000000000000000 ffffffff00000003 ffff880331ae8ad0 0000000800000246
    Call Trace:
    [] ? acpi_nfit_ctl+0x49d/0x750 [nfit]
    [] nfit_test_probe+0x670/0xb1b [nfit_test]

    Cc:
    Fixes: 747ffe11b440 ("libnvdimm, tools/testing/nvdimm: fix 'ars_status' output buffer sizing")
    Signed-off-by: Dan Williams

    Dan Williams
     
  • ACPI DSMs can have an 'extended' status which can be non-zero to convey
    additional information about the command. In the xlat_status routine,
    where we translate the command statuses, we were returning an error for
    a non-zero extended status, even if the primary status indicated success.

    Return from each command's 'case' once we have verified both its status
    and extend status are good.

    Cc:
    Fixes: 11294d63ac91 ("nfit: fail DSMs that return non-zero status by default")
    Signed-off-by: Vishal Verma
    Signed-off-by: Dan Williams

    Vishal Verma
     

26 Nov, 2016

1 commit


21 Nov, 2016

1 commit


15 Nov, 2016

1 commit

  • Pavel Machek reports that commit 6ea8c546f365 (ACPICA: FADT support
    cleanup) breaks thermal management on his Thinkpad X60 and T40p, so
    revert it.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=187311
    Fixes: 6ea8c546f365 (ACPICA: FADT support cleanup)
    Reported-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

12 Nov, 2016

1 commit


10 Nov, 2016

1 commit

  • We have a couple of drivers, acpi_apd.c and acpi_lpss.c,
    that need to pass extra build-in properties to the devices
    they create. Previously the drivers added those properties
    to the struct device which is member of the struct
    acpi_device, but that does not work. Those properties need
    to be assigned to the struct device of the platform device
    instead in order for them to become available to the
    drivers.

    To fix this, this patch changes acpi_create_platform_device
    function to take struct property_entry pointer as parameter.

    Fixes: 20a875e2e86e (serial: 8250_dw: Add quirk for APM X-Gene SoC)
    Signed-off-by: Heikki Krogerus
    Tested-by: Yazen Ghannam
    Tested-by: Jérôme de Bretagne
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Heikki Krogerus
     

29 Oct, 2016

4 commits

  • * acpica-fixes:
    ACPICA: Dispatcher: Fix interpreter locking around acpi_ev_initialize_region()
    ACPICA: Dispatcher: Fix an unbalanced lock exit path in acpi_ds_auto_serialize_method()
    ACPICA: Dispatcher: Fix order issue of method termination

    * acpi-pci-fixes:
    ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs
    ACPI/PCI: pci_link: penalize SCI correctly
    ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages

    * acpi-apei-fixes:
    ACPI / APEI: Fix incorrect return value of ghes_proc()

    Rafael J. Wysocki
     
  • In the code path of acpi_ev_initialize_region(), there is namespace
    modification code unlocked. This patch tunes the code to make sure
    such modification are always locked.

    Fixes: 74f51b80a0c4 (ACPICA: Namespace: Fix dynamic table loading issues)
    Tested-by: Imre Deak
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • There is a lock unbalanced exit path in acpi_ds_initialize_method(),
    this patch corrects it.

    Fixes: 441ad11d078f (ACPICA: Dispatcher: Fix a mutex issue for method auto serialization)
    Tested-by: Imre Deak
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • The last step of the method termination should be the end of the method
    serialization. Otherwise, the steps happening after it will face the race
    issues that cannot be protected by the method serialization mechanism.

    This patch fixes this issue by moving the per-method-object deletion code
    prior than the end of the method serialization. Otherwise, the possible
    race issues may result in AE_ALREADY_EXISTS error in a parallel
    environment.

    Fixes: 74f51b80a0c4 (ACPICA: Namespace: Fix dynamic table loading issues)
    Reported-and-tested-by: Imre Deak
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

24 Oct, 2016

4 commits

  • Although ghes_proc() tests for errors while reading the error status,
    it always return success (0). Fix this by propagating the return
    value.

    Fixes: d334a49113a4a33 (ACPI, APEI, Generic Hardware Error Source memory error support)
    Signed-of-by: Punit Agrawal
    Tested-by: Tyler Baicar
    Reviewed-by: Borislav Petkov
    [ rjw: Subject ]
    Signed-off-by: Rafael J. Wysocki

    Punit Agrawal
     
  • Commit 103544d86976 ("ACPI,PCI,IRQ: reduce resource requirements")
    replaced the addition of PIRQ_PENALTY_PCI_USING in acpi_pci_link_allocate()
    with an addition in acpi_irq_pci_sharing_penalty(), but f7eca374f000
    ("ACPI,PCI,IRQ: separate ISA penalty calculation") removed the use
    of acpi_irq_pci_sharing_penalty() for ISA IRQs.

    Therefore, PIRQ_PENALTY_PCI_USING is missing from ISA IRQs used by
    interrupt links. Include that penalty by adding it in the
    acpi_pci_link_allocate() path.

    Fixes: f7eca374f000 (ACPI,PCI,IRQ: separate ISA penalty calculation)
    Signed-off-by: Sinan Kaya
    Acked-by: Bjorn Helgaas
    Tested-by: Jonathan Liu
    Signed-off-by: Rafael J. Wysocki

    Sinan Kaya
     
  • Ondrej reported that IRQs stopped working in v4.7 on several
    platforms. A typical scenario, from Ondrej's VT82C694X/694X, is:

    ACPI: Using PIC for interrupt routing
    ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 *11 12 14 15)
    ACPI: No IRQ available for PCI Interrupt Link [LNKA]
    8139too 0000:00:0f.0: PCI INT A: no GSI

    We're using PIC routing, so acpi_irq_balance == 0, and LNKA is already
    active at IRQ 11. In that case, acpi_pci_link_allocate() only tries
    to use the active IRQ (IRQ 11) which also happens to be the SCI.

    We should penalize the SCI by PIRQ_PENALTY_PCI_USING, but
    irq_get_trigger_type(11) returns something other than
    IRQ_TYPE_LEVEL_LOW, so we penalize it by PIRQ_PENALTY_ISA_ALWAYS
    instead, which makes acpi_pci_link_allocate() assume the IRQ isn't
    available and give up.

    Add acpi_penalize_sci_irq() so platforms can tell us the SCI IRQ,
    trigger, and polarity directly and we don't have to depend on
    irq_get_trigger_type().

    Fixes: 103544d86976 (ACPI,PCI,IRQ: reduce resource requirements)
    Link: http://lkml.kernel.org/r/201609251512.05657.linux@rainbow-software.org
    Reported-by: Ondrej Zary
    Acked-by: Bjorn Helgaas
    Signed-off-by: Sinan Kaya
    Tested-by: Jonathan Liu
    Signed-off-by: Rafael J. Wysocki

    Sinan Kaya
     
  • We do not want to store the SCI penalty in the acpi_isa_irq_penalty[]
    table because acpi_isa_irq_penalty[] only holds ISA IRQ penalties and
    there's no guarantee that the SCI is an ISA IRQ. We add in the SCI
    penalty as a special case in acpi_irq_get_penalty().

    But if we called acpi_penalize_isa_irq() or acpi_irq_penalty_update()
    for an SCI that happened to be an ISA IRQ, they stored the SCI
    penalty (part of the acpi_irq_get_penalty() return value) in
    acpi_isa_irq_penalty[]. Subsequent calls to acpi_irq_get_penalty()
    returned a penalty that included *two* SCI penalties.

    Fixes: 103544d86976 (ACPI,PCI,IRQ: reduce resource requirements)
    Signed-off-by: Sinan Kaya
    Acked-by: Bjorn Helgaas
    Tested-by: Jonathan Liu
    Signed-off-by: Rafael J. Wysocki

    Sinan Kaya
     

15 Oct, 2016

1 commit

  • Pull more ACPI updates from Rafael Wysocki:
    "This includes a couple of fixes needed after recent changes, two ACPI
    driver fixes (fan and "Processor Aggregator"), an update of the ACPI
    device properties handling code and a new MAINTAINERS entry for ACPI
    on ARM64.

    Specifics:

    - Fix an unused function warning that started to appear after recent
    changes in the ACPI EC driver (Eric Biggers).

    - Fix the KERN_CONT usage in acpi_os_vprintf() that has become
    (particularly) annoying recently (Joe Perches).

    - Fix the fan status checking in the ACPI fan driver to avoid
    returning incorrect error codes sometimes (Srinivas Pandruvada).

    - Fix the ACPI Processor Aggregator driver (PAD) to always let the
    special processor_aggregator driver from Xen take over when running
    as Xen dom0 (Juergen Gross).

    - Update the handling of reference device properties in ACPI by
    allowing empty rows ("holes") to appear in reference property lists
    (Mika Westerberg).

    - Add a new MAINTAINERS entry for ACPI on ARM64 (Lorenzo Pieralisi)"

    * tag 'acpi-extra-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT
    ACPI / PAD: don't register acpi_pad driver if running as Xen dom0
    ACPI / property: Allow holes in reference properties
    MAINTAINERS: Add ARM64-specific ACPI maintainers entry
    ACPI / EC: Fix unused function warning when CONFIG_PM_SLEEP=n
    ACPI / fan: Fix error reading cur_state

    Linus Torvalds
     

14 Oct, 2016

2 commits


13 Oct, 2016

3 commits

  • acpi_os_vprintf currently always uses a KERN_CONT prefix which may be
    followed immediately by a proper KERN_. Check if the buffer
    already has a KERN_ at the start of the buffer and avoid the
    unnecessary KERN_CONT.

    Signed-off-by: Joe Perches
    Signed-off-by: Rafael J. Wysocki

    Joe Perches
     
  • When running as Xen dom0 a special processor_aggregator driver is
    needed. Don't register the standard driver in this case.

    Without that check an error message:

    "Error: Driver 'processor_aggregator' is already registered,
    aborting..."

    will be displayed.

    Signed-off-by: Juergen Gross
    [ rjw: Minor fixups ]
    Signed-off-by: Rafael J. Wysocki

    Juergen Gross
     
  • Pull thermal managament updates from Zhang Rui:

    - Enhance thermal "userspace" governor to export the reason when a
    thermal event is triggered and delivered to user space. From Srinivas
    Pandruvada

    - Introduce a single TSENS thermal driver for the different versions of
    the TSENS IP that exist, on different qcom msm/apq SoCs'. Support for
    msm8916, msm8960, msm8974 and msm8996 families is also added. From
    Rajendra Nayak

    - Introduce hardware-tracked trip points support to the device tree
    thermal sensor framework. The framework supports an arbitrary number
    of trip points. Whenever the current temperature is changed, the trip
    points immediately below and above the current temperature are found,
    driver callback is invoked to program the hardware to get notified
    when either of the two trip points are triggered. Hardware-tracked
    trip points support for rockchip thermal driver is also added at the
    same time. From Sascha Hauer, Caesar Wang

    - Introduce a new thermal driver, which enables TMU (Thermal Monitor
    Unit) on QorIQ platform. From Jia Hongtao

    - Introduce a new thermal driver for Maxim MAX77620. From Laxman
    Dewangan

    - Introduce a new thermal driver for Intel platforms using WhiskeyCove
    PMIC. From Bin Gao

    - Add mt2701 chip support to MTK thermal driver. From Dawei Chien

    - Enhance Tegra thermal driver to enable soctherm node and set
    "critical", "hot" trips, for Tegra124, Tegra132, Tegra210. From Wei
    Ni

    - Add resume support for tango thermal driver. From Marc Gonzalez

    - several small fixes and improvements for rockchip, qcom, imx, rcar,
    mtk thermal drivers and thermal core code. From Caesar Wang, Keerthy,
    Rocky Hao, Wei Yongjun, Peter Robinson, Bui Duc Phuc, Axel Lin, Hugh
    Kang

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (48 commits)
    thermal: int3403: Process trip change notification
    thermal: int340x: New Interface to read trip and notify
    thermal: user_space gov: Add additional information in uevent
    thermal: Enhance thermal_zone_device_update for events
    arm64: tegra: set hot trips for Tegra210
    arm64: tegra: set critical trips for Tegra210
    arm64: tegra: add soctherm node for Tegra210
    arm64: tegra: set hot trips for Tegra132
    arm64: tegra: set critical trips for Tegra132
    arm64: tegra: use tegra132-soctherm for Tegra132
    arm: tegra: set hot trips for Tegra124
    arm: tegra: set critical trips for Tegra124
    thermal: tegra: add hw-throttle for Tegra132
    thermal: tegra: add hw-throttle function
    of: Add bindings of hw throttle for Tegra soctherm
    thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
    thermal: Add Mediatek thermal driver for mt2701.
    dt-bindings: thermal: Add binding document for Mediatek thermal controller
    thermal: max77620: Add thermal driver for reporting junction temp
    thermal: max77620: Add DT binding doc for thermal driver
    ...

    Linus Torvalds
     

12 Oct, 2016

2 commits

  • DT allows holes or empty phandles for references. This is used for example
    in SPI subsystem where some chip selects are native and others are regular
    GPIOs. In ACPI _DSD we currently do not support this but instead the
    preceding reference consumes all following integer arguments.

    For example we would like to support something like the below ASL fragment
    for SPI:

    Package () {
    "cs-gpios",
    Package () {
    ^GPIO, 19, 0, 0, // GPIO CS0
    0, // Native CS
    ^GPIO, 20, 0, 0, // GPIO CS1
    }
    }

    The zero in the middle means "no entry" or NULL reference. To support this
    we change acpi_data_get_property_reference() to take firmware node and
    num_args as argument and rename it to __acpi_node_get_property_reference().
    The function returns -ENOENT if the given index resolves to "no entry"
    reference and -ENODATA when there are no more entries in the property.

    We then add static inline wrapper acpi_node_get_property_reference() that
    passes MAX_ACPI_REFERENCE_ARGS as num_args to support the existing
    behaviour which some drivers have been relying on.

    Signed-off-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Mika Westerberg
     
  • Pull libnvdimm updates from Dan Williams:
    "Aside from the recently added pmem sub-division support these have
    been in -next for several releases with no reported issues. The sub-
    division support was included in next-20161010 with no reported
    issues. It passes all unit tests including new tests for all the new
    functionality below.

    Summary:

    - PMEM sub-division support: Allow a single PMEM region to be divided
    into multiple namespaces. Originally, ~2 years ago, it was thought
    that partitions of a /dev/pmemX block device could handle
    sub-allocations of persistent memory for different use cases. With
    the decision to not support DAX mappings of raw block-devices, and
    the genesis of device-dax, the need for having multiple
    pmem-namespace per region has grown.

    - Device-DAX unified inode: In support of dynamic-resizing of a
    device-dax instance the kernel arranges for all mappings of a
    device-dax node to share the same inode. This allows unmap /
    truncate / invalidation events to affect all instances of the
    device similar to the behavior of mmap on block devices.

    - Hardware error scrubbing reworks: The original address-range-scrub
    and badblocks tracking solution allowed clearing entries at the
    individual namespace level, but it failed to clear the internal
    list of media errors maintained at the bus level. The result was
    that the next scrub or namespace disable/re-enable event would
    restore the cleared badblocks, but now that is fixed. The v4.8
    kernel introduced an auto-scrub-on-machine-check behavior to
    repopulate the badblocks list. Now, in v4.9, the auto-scrub
    behavior can be disabled and simply arrange for the error reported
    in the machine-check to be added to the list.

    - DIMM health-event notification support: ACPI 6.1 defines a
    notification event code that can be send to ACPI NVDIMM devices. A
    poll(2) capable file descriptor for these events can be obtained
    from the nmemX/nfit/flags sysfs-attribute of a libnvdimm memory
    device.

    - Miscellaneous fixes: NVDIMM-N probe error, device-dax build error,
    and a change to dedup the flush hint list to not flush the memory
    controller more than necessary"

    * tag 'libnvdimm-for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (39 commits)
    /dev/dax: fix Kconfig dependency build breakage
    dax: use correct dev_t value
    dax: convert devm_create_dax_dev to PTR_ERR
    libnvdimm, namespace: allow creation of multiple pmem-namespaces per region
    libnvdimm, namespace: lift single pmem limit in scan_labels()
    libnvdimm, namespace: filter out of range labels in scan_labels()
    libnvdimm, namespace: enable allocation of multiple pmem namespaces
    libnvdimm, namespace: update label implementation for multi-pmem
    libnvdimm, namespace: expand pmem device naming scheme for multi-pmem
    libnvdimm, region: update nd_region_available_dpa() for multi-pmem support
    libnvdimm, namespace: sort namespaces by dpa at init
    libnvdimm, namespace: allow multiple pmem-namespaces per region at scan time
    tools/testing/nvdimm: support for sub-dividing a pmem region
    libnvdimm, namespace: unify blk and pmem label scanning
    libnvdimm, namespace: refactor uuid_show() into a namespace_to_uuid() helper
    libnvdimm, label: convert label tracking to a linked list
    libnvdimm, region: move region-mapping input-paramters to nd_mapping_desc
    nvdimm: reduce duplicated wpq flushes
    libnvdimm: clear the internal poison_list when clearing badblocks
    pmem: reduce kmap_atomic sections to the memcpys only
    ...

    Linus Torvalds
     

10 Oct, 2016

2 commits

  • Signed-off-by: Eric Biggers
    Signed-off-by: Rafael J. Wysocki

    Eric Biggers
     
  • On some platforms with ACPI4 variable speed fan, reading cur_state from
    cooling device returns "invalid value" error. This confuses user space
    applications.

    This issue occurs as the current driver doesn't take account of
    "FineGrainControl" from _FIF(Fan Information). When the "FineGrainControl"
    is set, _FSL(FSL Set Level) takes argument as a percent, which doesn't
    have to match from any control value from _FPS(Fan Performance States).
    It is also possible that the Fan is not actually running at the requested
    speed returning a lower speed.
    On some platforms the BIOS is setting fan speed to a level during boot,
    which will not have an exact match to _FPS control values. The current
    implementation will treat this level as invalid value.

    The simple change is to atleast return state corresponding to a maximum
    control value in the _FPS compared to the current level.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki

    Srinivas Pandruvada
     

08 Oct, 2016

3 commits

  • When doing an nmi backtrace of many cores, most of which are idle, the
    output is a little overwhelming and very uninformative. Suppress
    messages for cpus that are idling when they are interrupted and just
    emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".

    We do this by grouping all the cpuidle code together into a new
    .cpuidle.text section, and then checking the address of the interrupted
    PC to see if it lies within that section.

    This commit suitably tags x86 and tile idle routines, and only adds in
    the minimal framework for other architectures.

    Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com
    Signed-off-by: Chris Metcalf
    Acked-by: Peter Zijlstra (Intel)
    Tested-by: Peter Zijlstra (Intel)
    Tested-by: Daniel Thompson [arm]
    Tested-by: Petr Mladek
    Cc: Aaron Tomlin
    Cc: Peter Zijlstra (Intel)
    Cc: "Rafael J. Wysocki"
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Dan Williams
     
  • Pull PCI updates from Bjorn Helgaas:
    "Summary of PCI changes for the v4.9 merge window:

    Enumeration:
    - microblaze: Add multidomain support for procfs (Bharat Kumar Gogada)

    Resource management:
    - Ignore requested alignment for PROBE_ONLY and fixed resources (Yongji Xie)
    - Ignore requested alignment for VF BARs (Yongji Xie)

    PCI device hotplug:
    - Make core explicitly non-modular (Paul Gortmaker)

    PCIe native device hotplug:
    - Rename pcie_isr() locals for clarity (Bjorn Helgaas)
    - Return IRQ_NONE when we can't read interrupt status (Bjorn Helgaas)
    - Remove unnecessary guard (Bjorn Helgaas)
    - Clean up dmesg "Slot(%s)" messages (Bjorn Helgaas)
    - Remove useless pciehp_get_latch_status() calls (Bjorn Helgaas)
    - Clear attention LED on device add (Keith Busch)
    - Allow exclusive userspace control of indicators (Keith Busch)
    - Process all hotplug events before looking for new ones (Mayurkumar Patel)
    - Don't re-read Slot Status when queuing hotplug event (Mayurkumar Patel)
    - Don't re-read Slot Status when handling surprise event (Mayurkumar Patel)
    - Make explicitly non-modular (Paul Gortmaker)

    Power management:
    - Afford direct-complete to devices with non-standard PM (Lukas Wunner)
    - Query platform firmware for device power state (Lukas Wunner)
    - Recognize D3cold in pci_update_current_state() (Lukas Wunner)
    - Avoid unnecessary resume after direct-complete (Lukas Wunner)
    - Make explicitly non-modular (Paul Gortmaker)

    Virtualization:
    - Mark Atheros AR9580 to avoid bus reset (Maik Broemme)
    - Check for pci_setup_device() failure in pci_iov_add_virtfn() (Po Liu)

    MSI:
    - Enable PCI_MSI_IRQ_DOMAIN support for ARC (Joao Pinto)

    AER:
    - Remove aerdriver.nosourceid kernel parameter (Bjorn Helgaas)
    - Remove aerdriver.forceload kernel parameter (Bjorn Helgaas)
    - Fix aer_probe() kernel-doc comment (Cao jin)
    - Add bus flag to skip source ID matching (Jon Derrick)
    - Avoid memory allocation in interrupt handling path (Jon Derrick)
    - Cache capability position (Keith Busch)
    - Make explicitly non-modular (Paul Gortmaker)
    - Remove duplicate AER severity translation (Tyler Baicar)
    - Send correct severity to calculate AER severity (Tyler Baicar)

    Precision Time Measurement:
    - Add Precision Time Measurement (PTM) support (Jonathan Yong)
    - Add PTM clock granularity information (Bjorn Helgaas)
    - Add pci_enable_ptm() for drivers to enable PTM on endpoints (Bjorn Helgaas)

    Generic host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)

    Altera host bridge driver:
    - Remove redundant platform_get_resource() return value check (Bjorn Helgaas)
    - Poll for link training status after retraining the link (Ley Foon Tan)
    - Rework config accessors for use without a struct pci_bus (Ley Foon Tan)
    - Move retrain from fixup to altera_pcie_host_init() (Ley Foon Tan)
    - Make MSI explicitly non-modular (Paul Gortmaker)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    ARM Versatile host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)

    Axis ARTPEC-6 host bridge driver:
    - Drop __init from artpec6_add_pcie_port() (Niklas Cassel)

    Freescale i.MX6 host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Intel VMD host bridge driver:
    - Add quirk for AER to ignore source ID (Jon Derrick)
    - Allocate IRQ lists with correct MSI-X count (Jon Derrick)
    - Convert to use pci_alloc_irq_vectors() API (Jon Derrick)
    - Eliminate vmd_vector member from list type (Jon Derrick)
    - Eliminate index member from IRQ list (Jon Derrick)
    - Synchronize with RCU freeing MSI IRQ descs (Keith Busch)
    - Request userspace control of PCIe hotplug indicators (Keith Busch)
    - Move VMD driver to drivers/pci/host (Keith Busch)

    Marvell Aardvark host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant dev_err call in advk_pcie_probe() (Wei Yongjun)

    Microsoft Hyper-V host bridge driver:
    - Use zero-length array in struct pci_packet (Dexuan Cui)
    - Use pci_function_description[0] in struct definitions (Dexuan Cui)
    - Remove the unused 'wrk' in struct hv_pcibus_device (Dexuan Cui)
    - Handle vmbus_sendpacket() failure in hv_compose_msi_msg() (Dexuan Cui)
    - Handle hv_pci_generic_compl() error case (Dexuan Cui)
    - Use list_move_tail() instead of list_del() + list_add_tail() (Wei Yongjun)

    NVIDIA Tegra host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant _data suffix (Thierry Reding)
    - Use of_device_get_match_data() (Thierry Reding)

    Qualcomm host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Renesas R-Car host bridge driver:
    - Consolidate register space lookup and ioremap (Bjorn Helgaas)
    - Don't disable/unprepare clocks on prepare/enable failure (Geert Uytterhoeven)
    - Add multi-MSI support (Grigory Kletsko)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Fix some checkpatch warnings (Sergei Shtylyov)
    - Try increasing PCIe link speed to 5 GT/s at boot (Sergei Shtylyov)

    Rockchip host bridge driver:
    - Add DT bindings for Rockchip PCIe controller (Shawn Lin)
    - Add Rockchip PCIe controller support (Shawn Lin)
    - Improve the deassert sequence of four reset pins (Shawn Lin)
    - Fix wrong transmitted FTS count (Shawn Lin)
    - Increase the Max Credit update interval (Rajat Jain)

    Samsung Exynos host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    ST Microelectronics SPEAr13xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Synopsys DesignWare host bridge driver:
    - Return data directly from dw_pcie_readl_rc() (Bjorn Helgaas)
    - Exchange viewport of `MEMORYs' and `CFGs/IOs' (Dong Bo)
    - Check LTSSM training bit before deciding link is up (Jisheng Zhang)
    - Move link wait definitions to .c file (Joao Pinto)
    - Wait for iATU enable (Joao Pinto)
    - Add iATU Unroll feature (Joao Pinto)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)
    - Keep viewport fixed for IO transaction if num_viewport > 2 (Pratyush Anand)
    - Remove redundant platform_get_resource() return value check (Wei Yongjun)

    TI DRA7xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    TI Keystone host bridge driver:
    - Propagate request_irq() failure (Wei Yongjun)

    Xilinx AXI host bridge driver:
    - Keep both legacy and MSI interrupt domain references (Bharat Kumar Gogada)
    - Clear interrupt register for invalid interrupt (Bharat Kumar Gogada)
    - Clear correct MSI set bit (Bharat Kumar Gogada)
    - Dispose of MSI virtual IRQ (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    Xilinx NWL host bridge driver:
    - Expand error logging (Bharat Kumar Gogada)
    - Enable all MSI interrupts using MSI mask (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)

    Miscellaneous:
    - Drop CONFIG_KEXEC_CORE ifdeffery (Lukas Wunner)
    - portdrv: Make explicitly non-modular (Paul Gortmaker)
    - Make DPC explicitly non-modular (Paul Gortmaker)"

    * tag 'pci-v4.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (105 commits)
    x86/PCI: VMD: Move VMD driver to drivers/pci/host
    PCI: rockchip: Fix wrong transmitted FTS count
    PCI: rockchip: Improve the deassert sequence of four reset pins
    PCI: rockchip: Increase the Max Credit update interval
    PCI: rcar: Try increasing PCIe link speed to 5 GT/s at boot
    PCI/AER: Fix aer_probe() kernel-doc comment
    PCI: Ignore requested alignment for VF BARs
    PCI: Ignore requested alignment for PROBE_ONLY and fixed resources
    PCI: Avoid unnecessary resume after direct-complete
    PCI: Recognize D3cold in pci_update_current_state()
    PCI: Query platform firmware for device power state
    PCI: Afford direct-complete to devices with non-standard PM
    PCI/AER: Cache capability position
    PCI/AER: Avoid memory allocation in interrupt handling path
    x86/PCI: VMD: Request userspace control of PCIe hotplug indicators
    PCI: pciehp: Allow exclusive userspace control of indicators
    ACPI / APEI: Send correct severity to calculate AER severity
    PCI/AER: Remove duplicate AER severity translation
    x86/PCI: VMD: Synchronize with RCU freeing MSI IRQ descs
    x86/PCI: VMD: Eliminate index member from IRQ list
    ...

    Linus Torvalds
     

07 Oct, 2016

1 commit

  • Pull pstore updates from Kees Cook:

    - Fix bug in module unloading

    - Switch to always using spinlock over cmpxchg

    - Explicitly define pstore backend's supported modes

    - Remove bounce buffer from pmsg

    - Switch to using memcpy_to/fromio()

    - Error checking improvements

    * tag 'pstore-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    ramoops: move spin_lock_init after kmalloc error checking
    pstore/ram: Use memcpy_fromio() to save old buffer
    pstore/ram: Use memcpy_toio instead of memcpy
    pstore/pmsg: drop bounce buffer
    pstore/ram: Set pstore flags dynamically
    pstore: Split pstore fragile flags
    pstore/core: drop cmpxchg based updates
    pstore/ramoops: fixup driver removal

    Linus Torvalds
     

04 Oct, 2016

3 commits

  • Pull tty and serial updates from Greg KH:
    "Here is the big tty and serial patch set for 4.9-rc1.

    It also includes some drivers/dma/ changes, as those were needed by
    some serial drivers, and they were all acked by the DMA maintainer.

    Also in here is the long-suffering ACPI SPCR patchset, which was
    passed around from maintainer to maintainer like a hot-potato. Seems I
    was the sucker^Wlucky one. All of those patches have been acked by the
    various subsystem maintainers as well.

    All of this has been in linux-next with no reported issues"

    * tag 'tty-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (111 commits)
    Revert "serial: pl011: add console matching function"
    MAINTAINERS: update entry for atmel_serial driver
    serial: pl011: add console matching function
    ARM64: ACPI: enable ACPI_SPCR_TABLE
    ACPI: parse SPCR and enable matching console
    of/serial: move earlycon early_param handling to serial
    Revert "drivers/tty: Explicitly pass current to show_stack"
    tty: amba-pl011: Don't complain on -EPROBE_DEFER when no irq
    nios2: dts: 10m50: Add tx-threshold parameter
    serial: 8250: Set Altera 16550 TX FIFO Threshold
    serial: 8250: of: Load TX FIFO Threshold from DT
    Documentation: dt: serial: Add TX FIFO threshold parameter
    drivers/tty: Explicitly pass current to show_stack
    serial: imx: Fix DCD reading
    serial: stm32: mark symbols static where possible
    serial: xuartps: Add some register initialisation to cdns_early_console_setup()
    serial: xuartps: Removed unwanted checks while reading the error conditions
    serial: xuartps: Rewrite the interrupt handling logic
    serial: stm32: use mapbase instead of membase for DMA
    tty/serial: atmel: fix fractional baud rate computation
    ...

    Linus Torvalds
     
  • Pull CPU hotplug updates from Thomas Gleixner:
    "Yet another batch of cpu hotplug core updates and conversions:

    - Provide core infrastructure for multi instance drivers so the
    drivers do not have to keep custom lists.

    - Convert custom lists to the new infrastructure. The block-mq custom
    list conversion comes through the block tree and makes the diffstat
    tip over to more lines removed than added.

    - Handle unbalanced hotplug enable/disable calls more gracefully.

    - Remove the obsolete CPU_STARTING/DYING notifier support.

    - Convert another batch of notifier users.

    The relayfs changes which conflicted with the conversion have been
    shipped to me by Andrew.

    The remaining lot is targeted for 4.10 so that we finally can remove
    the rest of the notifiers"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
    cpufreq: Fix up conversion to hotplug state machine
    blk/mq: Reserve hotplug states for block multiqueue
    x86/apic/uv: Convert to hotplug state machine
    s390/mm/pfault: Convert to hotplug state machine
    mips/loongson/smp: Convert to hotplug state machine
    mips/octeon/smp: Convert to hotplug state machine
    fault-injection/cpu: Convert to hotplug state machine
    padata: Convert to hotplug state machine
    cpufreq: Convert to hotplug state machine
    ACPI/processor: Convert to hotplug state machine
    virtio scsi: Convert to hotplug state machine
    oprofile/timer: Convert to hotplug state machine
    block/softirq: Convert to hotplug state machine
    lib/irq_poll: Convert to hotplug state machine
    x86/microcode: Convert to hotplug state machine
    sh/SH-X3 SMP: Convert to hotplug state machine
    ia64/mca: Convert to hotplug state machine
    ARM/OMAP/wakeupgen: Convert to hotplug state machine
    ARM/shmobile: Convert to hotplug state machine
    arm64/FP/SIMD: Convert to hotplug state machine
    ...

    Linus Torvalds
     
  • Pull irq updates from Thomas Gleixner:
    "The irq departement proudly presents:

    - A rework of the core infrastructure to optimally spread interrupt
    for multiqueue devices. The first version was a bit naive and
    failed to take thread siblings and other details into account.
    Developed in cooperation with Christoph and Keith.

    - Proper delegation of softirqs to ksoftirqd, so if ksoftirqd is
    active then no further softirq processsing on interrupt return
    happens. Otherwise we try to delegate and still run another batch
    of network packets in the irq return path, which then tries to
    delegate to ksoftirqd .....

    - A proper machine parseable sysfs based alternative for
    /proc/interrupts.

    - ACPI support for the GICV3-ITS and ARM interrupt remapping

    - Two new irq chips from the ARM SoC zoo: STM32-EXTI and MVEBU-PIC

    - A new irq chip for the JCore (SuperH)

    - The usual pile of small fixlets in core and irqchip drivers"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
    softirq: Let ksoftirqd do its job
    genirq: Make function __irq_do_set_handler() static
    ARM/dts: Add EXTI controller node to stm32f429
    ARM/STM32: Select external interrupts controller
    drivers/irqchip: Add STM32 external interrupts support
    Documentation/dt-bindings: Document STM32 EXTI controller bindings
    irqchip/mips-gic: Use for_each_set_bit to iterate over local IRQs
    pci/msi: Retrieve affinity for a vector
    genirq/affinity: Remove old irq spread infrastructure
    genirq/msi: Switch to new irq spreading infrastructure
    genirq/affinity: Provide smarter irq spreading infrastructure
    genirq/msi: Add cpumask allocation to alloc_msi_entry
    genirq: Expose interrupt information through sysfs
    irqchip/gicv3-its: Use MADT ITS subtable to do PCI/MSI domain initialization
    irqchip/gicv3-its: Factor out PCI-MSI part that might be reused for ACPI
    irqchip/gicv3-its: Probe ITS in the ACPI way
    irqchip/gicv3-its: Refactor ITS DT init code to prepare for ACPI
    irqchip/gicv3-its: Cleanup for ITS domain initialization
    PCI/MSI: Setup MSI domain on a per-device basis using IORT ACPI table
    ACPI: Add new IORT functions to support MSI domain handling
    ...

    Linus Torvalds