12 Jan, 2017

40 commits

  • commit 91a45f71078a6569ec3ca5bef74e1ab58121d80e upstream.

    Patch series "mm: workingset: radix tree subtleties & single-page file
    refaults", v3.

    This is another revision of the radix tree / workingset patches based on
    feedback from Jan and Kirill.

    This is a follow-up to d3798ae8c6f3 ("mm: filemap: don't plant shadow
    entries without radix tree node"). That patch fixed an issue that was
    caused mainly by the page cache sneaking special shadow page entries
    into the radix tree and relying on subtleties in the radix tree code to
    make that work. The fix also had to stop tracking refaults for
    single-page files because shadow pages stored as direct pointers in
    radix_tree_root->rnode weren't properly handled during tree extension.

    These patches make the radix tree code explicitely support and track
    such special entries, to eliminate the subtleties and to restore the
    thrash detection for single-page files.

    This patch (of 9):

    When a radix tree iteration drops the tree lock, another thread might
    swoop in and free the node holding the current slot. The iteration
    needs to do another tree lookup from the current index to continue.

    [kirill.shutemov@linux.intel.com: re-lookup for replacement]
    Fixes: f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages")
    Link: http://lkml.kernel.org/r/20161117191138.22769-2-hannes@cmpxchg.org
    Signed-off-by: Johannes Weiner
    Acked-by: Kirill A. Shutemov
    Reviewed-by: Jan Kara
    Cc: Hugh Dickins
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Johannes Weiner
     
  • commit e2a91f4f42018994d7424d405900d17eba6555d0 upstream.

    PDF build on Kernel 4.9-rc? returns an error with Sphinx 1.3.x
    and Sphinx 1.4.x, when trying to solve some cross-references.

    The solution is to redefine the \DURole macro.

    However, this is redefined too late. Move such redefinition to
    LaTeX preamble and bind it to just the Sphinx versions where the
    error is known to be present.

    Tested by building the documentation on interactive mode:
    make PDFLATEX=xelatex -C Documentation/output/./latex

    Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x")
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet
    Signed-off-by: Greg Kroah-Hartman

    Mauro Carvalho Chehab
     
  • commit 3999f52e3198e76607446ab1a4610c1ddc406c56 upstream.

    We cannot use the pte value used in set_pte_at for pte_same comparison,
    because archs like ppc64, filter/add new pte flag in set_pte_at.
    Instead fetch the pte value inside hugetlb_cow. We are comparing pte
    value to make sure the pte didn't change since we dropped the page table
    lock. hugetlb_cow get called with page table lock held, and we can take
    a copy of the pte value before we drop the page table lock.

    With hugetlbfs, we optimize the MAP_PRIVATE write fault path with no
    previous mapping (huge_pte_none entries), by forcing a cow in the fault
    path. This avoid take an addition fault to covert a read-only mapping
    to read/write. Here we were comparing a recently instantiated pte (via
    set_pte_at) to the pte values from linux page table. As explained above
    on ppc64 such pte_same check returned wrong result, resulting in us
    taking an additional fault on ppc64.

    Fixes: 6a119eae942c ("powerpc/mm: Add a _PAGE_PTE bit")
    Link: http://lkml.kernel.org/r/20161018154245.18023-1-aneesh.kumar@linux.vnet.ibm.com
    Signed-off-by: Aneesh Kumar K.V
    Reported-by: Jan Stancek
    Acked-by: Hillf Danton
    Cc: Mike Kravetz
    Cc: Scott Wood
    Cc: Michael Ellerman
    Cc: Kirill A. Shutemov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Aneesh Kumar K.V
     
  • commit 1d74e7ed5dc1903ac081574a9b6aa94e7ba4ad45 upstream.

    qcom_smd_send() should return -EAGAIN for non-blocking channels with
    insufficient space, so that we can propagate this event to user space.

    Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Bjorn Andersson
     
  • commit 16652a936e96f5dae53c3fbd38a570497baadaa8 upstream.

    We never set "ret" to RESULT_OK.

    Fixes: 9f9c4180f88d ("mmc: mmc_test: add test for non-blocking transfers")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit c0af52437254fda8b0cdbaae5a9b6d9327f1fcd5 upstream.

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

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

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

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

    Fixes: 34c3d9819fda ("genirq/affinity: Provide smarter irq spreading infrastructure")
    Reported-by: Gabriel Krisman Bertazi
    Signed-off-by: Guilherme G. Piccoli
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Gabriel Krisman Bertazi
    Reviewed-by: Gavin Shan
    Cc: linux-pci@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: hch@lst.de
    Link: http://lkml.kernel.org/r/1481738472-2671-1-git-send-email-gpiccoli@linux.vnet.ibm.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Guilherme G. Piccoli
     
  • commit bed570307ed78f21b77cb04a1df781dee4a8f05a upstream.

    I noticed some wakeirq flakeyness with consumer drivers not using
    autosuspend. For drivers not using autosuspend, the wakeirq may never
    get unmasked in rpm_suspend() because of irq desc->depth.

    We are configuring dedicated wakeirqs to start with IRQ_NOAUTOEN as we
    naturally don't want them running until rpm_suspend() is called.

    However, when a consumer driver initially calls pm_runtime_get(), we
    now wrongly start with disable_irq_nosync() call on the dedicated
    wakeirq that is disabled to start with.

    This causes desc->depth to toggle between 1 and 2 instead of the usual
    0 and 1. This can prevent enable_irq() from unmasking the wakeirq as
    that only happens at desc->depth 1.

    This does not necessarily show up with drivers using autosuspend as
    there is time for disable_irq_nosync() before rpm_suspend() gets called
    after the autosuspend timeout.

    Let's fix the issue by adding wirq->status that lazily gets set on
    the first rpm_suspend(). We also need PM runtime core private functions
    for dev_pm_enable_wake_irq_check() and dev_pm_disable_wake_irq_check()
    so we can enable the dedicated wakeirq on the first rpm_suspend().

    While at it, let's also fix the comments for dev_pm_enable_wake_irq()
    and dev_pm_disable_wake_irq(). Those can still be used by the consumer
    drivers as needed because the IRQ core manages the interrupt usecount
    for us.

    Fixes: 4990d4fe327b (PM / Wakeirq: Add automated device wake IRQ handling)
    Signed-off-by: Tony Lindgren
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     
  • commit 34c535793bcbf9263cf22f8a52101f796cdfab8e upstream.

    We did not implement an irq_cpu_offline callback for our irqchip, yet we
    support setting a given IRQ's affinity. This resulted in interrupts
    whose affinity mask included CPUs being taken offline not to work
    correctly once the CPU had been put offline.

    Fixes: 5f7f0317ed28 ("IRQCHIP: Add new driver for BCM7038-style level 1 interrupt controllers")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Cc: cernekee@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: ralf@linux-mips.org
    Cc: justinpopo6@gmail.com
    Link: http://lkml.kernel.org/r/1477948656-12966-2-git-send-email-f.fainelli@gmail.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Florian Fainelli
     
  • commit d1d111e073840b8dbc1ae90ba3fc274736451bdc upstream.

    If msi_setup_entry() fails to allocate an affinity mask, it logs a message
    but continues on and allocates an MSI entry with entry->affinity == NULL.

    Check for this case in pci_irq_get_affinity() so we don't try to
    dereference a NULL pointer.

    [bhelgaas: changelog]
    Fixes: ee8d41e53efe "pci/msi: Retrieve affinity for a vector"
    Signed-off-by: Jan Beulich
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Christoph Hellwig
    CC: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Jan Beulich
     
  • commit 9a11a18902bc3b904353063763d06480620245a6 upstream.

    When the "policy" securityfs file is opened for read, it is opened as a
    sequential file. However, when it is eventually released, there is no
    cleanup for the sequential file, therefore some memory is leaked.

    This patch adds a call to seq_release() in ima_release_policy() to clean up
    the memory when the file is opened for read.

    Fixes: 80eae209d63a IMA: allow reading back the current policy
    Reported-by: Colin Ian King
    Signed-off-by: Eric Richter
    Tested-by: Colin Ian King
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Eric Richter
     
  • commit 9a29d0fbc2d9ad99fb8a981ab72548cc360e9d4c upstream.

    Smatch complains that we started using the array offset before we
    checked that it was valid.

    Fixes: 017c59c042d0 ('relay: Use per CPU constructs for the relay channel buffer pointers')
    Link: http://lkml.kernel.org/r/20161013084947.GC16198@mwanda
    Signed-off-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 8456066a57940b3884aa080c58b166567dc9de39 upstream.

    Pass a task state as second argument to percpu_ida_alloc().

    Fixes: commit 5a3ee221b543 ("sbp-target: Conversion to percpu_ida tag pre-allocation")
    Signed-off-by: Bart Van Assche
    Cc: Chris Boot
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     
  • commit a91918cd3ea11f91c68e08e1e8ce1b560447a80e upstream.

    This iscsit_tpg_add_portal_group() function is only called from
    lio_target_tiqn_addtpg(). Both functions free the "tpg" pointer on
    error so it's a double free bug. The memory is allocated in the caller
    so it should be freed in the caller and not here.

    Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
    Signed-off-by: Dan Carpenter
    Reviewed-by: David Disseldorp
    [ bvanassche: Added "Fix" at start of patch title ]
    Signed-off-by: Bart Van Assche
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit af15769ffab13d777e55fdef09d0762bf0c249c4 upstream.

    gcc-7 notices that the condition in mvs_94xx_command_active looks
    suspicious:

    drivers/scsi/mvsas/mv_94xx.c: In function 'mvs_94xx_command_active':
    drivers/scsi/mvsas/mv_94xx.c:671:15: error: '<
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 7b93ca43b7e21fbe6fb1a6f4ecce4a2f70f424a0 upstream.

    When a SW-configurable card is specified but not found, the driver
    releases wrong region, causing the following message in kernel log:
    Trying to free nonexistent resource

    Fix it by assigning base earlier.

    Signed-off-by: Ondrej Zary
    Fixes: a8cfbcaec0c1 ("scsi: g_NCR5380: Stop using scsi_module.c")
    Signed-off-by: Finn Thain
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Ondrej Zary
     
  • commit 5faf071d08ddd1c1be66deaa93a09ccf43f5b538 upstream.

    Unfortunately, I seem to have missed a case where an IRQ safe spinlock was
    required, in samsung_i2s_dai_remove, when I fixed up the other calls in
    this patch:

    316fa9e09ad7 ("ASoC: samsung: Use IRQ safe spin lock calls")

    This causes a lockdep warning when unbinding and rebinding the audio card:

    [ 104.357664] CPU0 CPU1
    [ 104.362174] ---- ----
    [ 104.366692] lock(&(&pri_dai->spinlock)->rlock);
    [ 104.371372] local_irq_disable();
    [ 104.377283] lock(&(&substream->self_group.lock)->rlock);
    [ 104.385259] lock(&(&pri_dai->spinlock)->rlock);
    [ 104.392469]
    [ 104.395072] lock(&(&substream->self_group.lock)->rlock);
    [ 104.400710]
    [ 104.400710] *** DEADLOCK ***

    Fixes: ce8bcdbb61d9 ("ASoC: samsung: i2s: Protect more registers with a spinlock")
    Signed-off-by: Charles Keepax
    Reviewed-by: Krzysztof Kozlowski
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     
  • commit c8eabf821cac120afb78ca251b07cbf520406a7e upstream.

    "*val" is a u64. It definitely looks like we intend to use the high 32
    bits as well.

    Fixes: 700a9a63f9c1 ("ASoC: Intel: Skylake: Add module instance id generation APIs")
    Signed-off-by: Dan Carpenter
    Acked-by: Vinod Koul
    Tested-by: Kranthi G
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit a823a17981a73faa115bc0f7eda0190763075e2c upstream.

    cht_bsw_rt5645 driver allocates the own codec_id string but doesn't
    release it. For simplicity, put the string in cht_mc_private; then
    the string is allocated in a shot and released altogether.

    Fixes: c8560b7c917f ("ASoC: cht_bsw_rt5645: Fix writing to string literal")
    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 3b89e4b77ef9c2f985964fab17032db98f074ed0 upstream.

    A bugfix accidentally removed the implicit initialization of the
    dma channel number, causing undefined behavior when
    v->alloc_dma_channel is NULL:

    sound/soc/qcom/lpass-platform.c: In function ‘lpass_platform_pcmops_open’:
    sound/soc/qcom/lpass-platform.c:83:29: error: ‘dma_ch’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    This adds back an explicit initialization to zero, restoring the
    previous behavior for that case.

    Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")
    Signed-off-by: Arnd Bergmann
    Acked-by: Kenneth Westfield
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit aec0e86172a79eb5e44aff1055bb953fe4d47c59 upstream.

    We met the DMAR fault both on hpsa P420i and P421 SmartArray controllers
    under kdump, it can be steadily reproduced on several different machines,
    the dmesg log is like:
    HP HPSA Driver (v 3.4.16-0)
    hpsa 0000:02:00.0: using doorbell to reset controller
    hpsa 0000:02:00.0: board ready after hard reset.
    hpsa 0000:02:00.0: Waiting for controller to respond to no-op
    DMAR: Setting identity map for device 0000:02:00.0 [0xe8000 - 0xe8fff]
    DMAR: Setting identity map for device 0000:02:00.0 [0xf4000 - 0xf4fff]
    DMAR: Setting identity map for device 0000:02:00.0 [0xbdf6e000 - 0xbdf6efff]
    DMAR: Setting identity map for device 0000:02:00.0 [0xbdf6f000 - 0xbdf7efff]
    DMAR: Setting identity map for device 0000:02:00.0 [0xbdf7f000 - 0xbdf82fff]
    DMAR: Setting identity map for device 0000:02:00.0 [0xbdf83000 - 0xbdf84fff]
    DMAR: DRHD: handling fault status reg 2
    DMAR: [DMA Read] Request device [02:00.0] fault addr fffff000 [fault reason 06] PTE Read access is not set
    hpsa 0000:02:00.0: controller message 03:00 timed out
    hpsa 0000:02:00.0: no-op failed; re-trying

    After some debugging, we found that the fault addr is from DMA initiated at
    the driver probe stage after reset(not in-flight DMA), and the corresponding
    pte entry value is correct, the fault is likely due to the old iommu caches
    of the in-flight DMA before it.

    Thus we need to flush the old cache after context mapping is setup for the
    device, where the device is supposed to finish reset at its driver probe
    stage and no in-flight DMA exists hereafter.

    I'm not sure if the hardware is responsible for invalidating all the related
    caches allocated in the iommu hardware before, but seems not the case for hpsa,
    actually many device drivers have problems in properly resetting the hardware.
    Anyway flushing (again) by software in kdump kernel when the device gets context
    mapped which is a quite infrequent operation does little harm.

    With this patch, the problematic machine can survive the kdump tests.

    CC: Myron Stowe
    CC: Joseph Szczypek
    CC: Don Brace
    CC: Baoquan He
    CC: Dave Young
    Fixes: 091d42e43d21 ("iommu/vt-d: Copy translation tables from old kernel")
    Fixes: dbcd861f252d ("iommu/vt-d: Do not re-use domain-ids from the old kernel")
    Fixes: cf484d0e6939 ("iommu/vt-d: Mark copied context entries")
    Signed-off-by: Xunlei Pang
    Tested-by: Don Brace
    Signed-off-by: Joerg Roedel
    Signed-off-by: Greg Kroah-Hartman

    Xunlei Pang
     
  • commit 65ca7f5f7d1cdde6c25172fe6107cd16902f826f upstream.

    Different encodings are used to represent supported PASID bits
    and number of PASID table entries.
    The current code assigns ecap_pss directly to extended context
    table entry PTS which is wrong and could result in writing
    non-zero bits to the reserved fields. IOMMU fault reason
    11 will be reported when reserved bits are nonzero.
    This patch converts ecap_pss to extend context entry pts encoding
    based on VT-d spec. Chapter 9.4 as follows:
    - number of PASID bits = ecap_pss + 1
    - number of PASID table entries = 2^(pts + 5)
    Software assigned limit of pasid_max value is also respected to
    match the allocation limitation of PASID table.

    cc: Mika Kuoppala
    cc: Ashok Raj
    Signed-off-by: Jacob Pan
    Tested-by: Mika Kuoppala
    Fixes: 2f26e0a9c9860 ('iommu/vt-d: Add basic SVM PASID support')
    Signed-off-by: Joerg Roedel
    Signed-off-by: Greg Kroah-Hartman

    Jacob Pan
     
  • commit 432abf68a79332282329286d190e21fe3ac02a31 upstream.

    The generic command buffer entry is 128 bits (16 bytes), so the offset
    of tail and head pointer should be 16 bytes aligned and increased with
    0x10 per command.

    When cmd buf is full, head = (tail + 0x10) % CMD_BUFFER_SIZE.

    So when left space of cmd buf should be able to store only two
    command, we should be issued one COMPLETE_WAIT additionally to wait
    all older commands completed. Then the left space should be increased
    after IOMMU fetching from cmd buf.

    So left check value should be left
    Fixes: ac0ea6e92b222 ('x86/amd-iommu: Improve handling of full command buffer')
    Signed-off-by: Joerg Roedel
    Signed-off-by: Greg Kroah-Hartman

    Huang Rui
     
  • commit 24c790fbf5d8f54c8c82979db11edea8855b74bf upstream.

    We should set "ret" to -EINVAL if iommu_group_get() fails.

    Fixes: 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Joerg Roedel
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit e2a33c34ddff22ee208d80abdd12b88a98d6cb60 upstream.

    The RZ/A1 is different than the other Renesas SOCs because the MSTP
    registers are 8-bit instead of 32-bit and if you try writing values as
    32-bit nothing happens...meaning this driver never worked for r7s72100.

    Fixes: b6face404f38 ("ARM: shmobile: r7s72100: add essential clock nodes to dtsi")
    Signed-off-by: Chris Brandt
    Reviewed-by: Geert Uytterhoeven
    Tested-by: Geert Uytterhoeven
    Acked-by: Kuninori Morimoto
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Chris Brandt
     
  • commit bae203d58b7dce89664071b3fafe20cedaa3e4f6 upstream.

    Function mx31_clocks_init() is called during clock intialization on
    legacy boards with reference clock frequency passed as its input
    argument, this can be verified by examination of the function
    declaration found in arch/arm/mach-imx/common.h and actual function
    users which include that header file.

    Inside CCF driver the function ignores its input argument, by chance
    the used value in the function body is the same as input arguments on
    side of all callers.

    Fixes: d9388c843237 ("clk: imx31: Do not call mxc_timer_init twice when booting with DT")
    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Uwe Kleine-König
    Acked-by: Stephen Boyd
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Vladimir Zapolskiy
     
  • commit 0f6f9302b819ca352cfd4f42c18ec08d521f9cae upstream.

    The audio module clocks are supposed to be set according to the sample
    rate of the audio stream. The audio PLL provides the clock signal for
    these module clocks, and only it is freely tunable.

    Set CLK_SET_RATE_PARENT for the audio module clocks so their users can
    properly tune the clock rate.

    Fixes: 0577e4853bfb ("clk: sunxi-ng: Add H3 clocks")
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Maxime Ripard
    Signed-off-by: Greg Kroah-Hartman

    Chen-Yu Tsai
     
  • commit 937ff9ded8b6ebe8963ade55bdd77a61ded88075 upstream.

    The audio module clocks are supposed to be set according to the sample
    rate of the audio stream. The audio PLL provides the clock signal for
    these module clocks, and only it is freely tunable.

    Set CLK_SET_RATE_PARENT for the audio module clocks so their users can
    properly tune the clock rate.

    Fixes: 5690879d93e8 ("clk: sunxi-ng: Add A23 CCU")
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Maxime Ripard
    Signed-off-by: Greg Kroah-Hartman

    Chen-Yu Tsai
     
  • commit f8d17344a60921c2387759fc0a85aa64299d1ec6 upstream.

    Prevent creating clk alias for non existing gmac_gmii_ref_clk_div clock and,
    this way, eliminate excessive error message during boot:

    "ti_dt_clocks_register: failed to lookup clock node gmac_gmii_ref_clk_div"

    Fixes: c097338ebd3f ("ARM: dts: dra7: cpsw: fix clocks tree")
    Signed-off-by: Grygorii Strashko
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Grygorii Strashko
     
  • commit 20979202ee6e4c68dab7bcf408787225a656d18e upstream.

    Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188561. Function
    wm831x_clkout_is_prepared() returns "true" when it fails to read
    CLOCK_CONTROL_1. "true" means the device is already prepared. So
    return "true" on the read failure seems improper.

    Signed-off-by: Pan Bian
    Acked-by: Charles Keepax
    Fixes: f05259a6ffa4 ("clk: wm831x: Add initial WM831x clock driver")
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Pan Bian
     
  • commit cbf2e548ca8ad4bb274d014e9a70bd841d29948e upstream.

    The clocks on these boards run at 25 MHz, not 19.2 and 27 like
    other platforms. Unfortunately I copy/pasted from other similar
    SoCs but forgot this one is different. Fix it.

    Fixes: a085f877a882 ("clk: qcom: Move cxo/pxo/xo into dt files")
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     
  • commit 792f497b22afd0563b94dd8fa129a05f762a2c25 upstream.

    We should unlock before returning on this error path.

    Fixes: 3a762dbd5347 ('[media] Input: synaptics-rmi4 - add support for F54 diagnostics')
    Signed-off-by: Dan Carpenter
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit e9572fdd13e299cfba03abbfd2786c84ac055249 upstream.

    Since commit commit eb1c8f4325d5 ("hwmon: (lm90) Convert to use new hwmon
    registration API") the temp1_max_alarm and temp1_crit_alarm attributes are
    mapped to the same alarm bit. Fix the typo.

    Fixes: eb1c8f4325d5 ("hwmon: (lm90) Convert to use new hwmon registration API")
    Signed-off-by: Micehael Walle
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Michael Walle
     
  • commit 4fccd4a1e8944033bcd7693ea4e8fb478cd2059a upstream.

    Fix overflows seen when writing into fan speed limit attributes.
    Also fix crash due to division by zero, seen when certain very
    large values (such as 2147483648, or 0x80000000) are written
    into fan speed limit attributes.

    Fixes: 594fbe713bf60 ("Add support for GMT G762/G763 PWM fan controllers")
    Cc: Arnaud Ebalard
    Reviewed-by: Jean Delvare
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit c0d04e9112ad59d73f23f3b0f6726c5e798dfcbf upstream.

    Fix overflows seen when writing voltage and temperature limit attributes.

    The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the
    value parameter passed to nct7802_write_fan_min() is an unsigned long.

    Also, writing values larger than 2700000 into a fan limit attribute results
    in writing 0 into the chip's limit registers. The exact behavior when
    writing this value is unspecified. For consistency, report a limit of
    1350000 if the chip register reads 0. This may be wrong, and the chip
    behavior should be verified with the actual chip, but it is better than
    reporting a value of 0 (which, when written, results in writing a value
    of 0x1fff into the chip register).

    Fixes: 3434f3783580 ("hwmon: Driver for Nuvoton NCT7802Y")
    Reviewed-by: Jean Delvare
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit e36ce99ee0815d7919a7b589bfb66f3de50b6bc7 upstream.

    Module test reports:

    temp1_max: Suspected overflow: [160000 vs. 0]
    temp1_min: Suspected overflow: [160000 vs. 0]

    This is seen because the values passed when writing temperature limits
    are unbound.

    Reviewed-by: Jean Delvare
    Fixes: 6099469805c2 ("hwmon: Support for Dallas Semiconductor DS620")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit 4538bfbf2d9f1fc48c07ac0cc0ee58716fe7fe96 upstream.

    Converts the unsigned temperature values from the i2c read
    to be sign extended as defined in the datasheet so that
    negative temperatures are properly read.

    Fixes: 28e6274d8fa67 ("hwmon: (amc6821) Avoid forward declaration")
    Signed-off-by: Jared Bents
    Signed-off-by: Matt Weber
    [groeck: Dropped unnecessary continuation line]
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Jared Bents
     
  • commit 13edb767aa609b6efb7c0c2b57fbd72a6ded0eed upstream.

    If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
    alias: of:N*T*Carm,scpi-sensorsC*
    alias: of:N*T*Carm,scpi-sensors

    Signed-off-by: Javier Martinez Canillas
    Fixes: ea98b29a05e9c ("hwmon: Support sensors exported via ARM SCP interface")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit a608a9d52fa4168efd478d684039ed545a69dbcd upstream.

    All LED-setting functions in fujitsu-laptop are currently assigned to
    the brightness_set callback, which is incorrect because they can sleep
    (due to their use of call_fext_func(), which in turn issues ACPI calls)
    and the documentation (in include/linux/leds.h) clearly states they must
    not. Assign them to brightness_set_blocking instead and change them to
    match the expected function prototype.

    This change makes it possible to use Fujitsu-specific LEDs with "heavy"
    triggers, like disk-activity or phy0rx.

    Fixes: 3a407086090b ("fujitsu-laptop: Add BL power, LED control and radio state information")
    Fixes: 4f62568c1fcf ("fujitsu-laptop: Support radio LED")
    Fixes: d6b88f64b0d4 ("fujitsu-laptop: Add support for eco LED")
    Signed-off-by: Michał Kępień
    Acked-by: Jonathan Woithe
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Micha? K?pie?
     
  • commit 3df8d9208569ef0b2313e516566222d745f3b94b upstream.

    A typo (or mis-merge?) resulted in leaf 6 only being probed if
    cpuid_level >= 7.

    Fixes: 2ccd71f1b278 ("x86/cpufeature: Move some of the scattered feature bits to x86_capability")
    Signed-off-by: Andy Lutomirski
    Acked-by: Borislav Petkov
    Cc: Brian Gerst
    Link: http://lkml.kernel.org/r/6ea30c0e9daec21e488b54761881a6dfcf3e04d0.1481825597.git.luto@kernel.org
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Andy Lutomirski
     
  • commit a01aa6c9f40fe03c82032e7f8b3bcf1e6c93ac0e upstream.

    As userspace knows nothing about kernel config, thus #ifdefs
    around ABI prctl constants makes them invisible to userspace.

    Let it be clean'n'simple: remove #ifdefs.

    If kernel has CONFIG_CHECKPOINT_RESTORE disabled, sys_prctl()
    will return -EINVAL for those prctls.

    Reported-by: Paul Bolle
    Signed-off-by: Dmitry Safonov
    Acked-by: Andy Lutomirski
    Cc: 0x7f454c46@gmail.com
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Cyrill Gorcunov
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-mm@kvack.org
    Cc: oleg@redhat.com
    Fixes: 2eefd8789698 ("x86/arch_prctl/vdso: Add ARCH_MAP_VDSO_*")
    Link: http://lkml.kernel.org/r/20161027141516.28447-2-dsafonov@virtuozzo.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Safonov