]> Git Repo - linux.git/log
linux.git
10 years agorapidio/tsi721_dma: fix failure to obtain transaction descriptor
Alexandre Bounine [Wed, 30 Jul 2014 23:08:26 +0000 (16:08 -0700)]
rapidio/tsi721_dma: fix failure to obtain transaction descriptor

This is a bug fix for the situation when function tsi721_desc_get() fails
to obtain a free transaction descriptor.

The bug usually results in a memory access crash dump when data transfer
scatter-gather list has more entries than size of hardware buffer
descriptors ring.  This fix ensures that error is properly returned to a
caller instead of an invalid entry.

This patch is applicable to kernel versions starting from v3.5.

Signed-off-by: Alexandre Bounine <[email protected]>
Cc: Matt Porter <[email protected]>
Cc: Andre van Herk <[email protected]>
Cc: Stef van Os <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: <[email protected]> [3.5+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agomm, thp: do not allow thp faults to avoid cpuset restrictions
David Rientjes [Wed, 30 Jul 2014 23:08:24 +0000 (16:08 -0700)]
mm, thp: do not allow thp faults to avoid cpuset restrictions

The page allocator relies on __GFP_WAIT to determine if ALLOC_CPUSET
should be set in allocflags.  ALLOC_CPUSET controls if a page allocation
should be restricted only to the set of allowed cpuset mems.

Transparent hugepages clears __GFP_WAIT when defrag is disabled to prevent
the fault path from using memory compaction or direct reclaim.  Thus, it
is unfairly able to allocate outside of its cpuset mems restriction as a
side-effect.

This patch ensures that ALLOC_CPUSET is only cleared when the gfp mask is
truly GFP_ATOMIC by verifying it is also not a thp allocation.

Signed-off-by: David Rientjes <[email protected]>
Reported-by: Alex Thorlton <[email protected]>
Tested-by: Alex Thorlton <[email protected]>
Cc: Bob Liu <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Hedi Berriche <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Srivatsa S. Bhat <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agomm/page-writeback.c: fix divide by zero in bdi_dirty_limits()
Maxim Patlasov [Wed, 30 Jul 2014 23:08:21 +0000 (16:08 -0700)]
mm/page-writeback.c: fix divide by zero in bdi_dirty_limits()

Under memory pressure, it is possible for dirty_thresh, calculated by
global_dirty_limits() in balance_dirty_pages(), to equal zero.  Then, if
strictlimit is true, bdi_dirty_limits() tries to resolve the proportion:

  bdi_bg_thresh : bdi_thresh = background_thresh : dirty_thresh

by dividing by zero.

Signed-off-by: Maxim Patlasov <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Wu Fengguang <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agoMAINTAINERS: Update Tegra Git URL
Andreas Färber [Mon, 28 Jul 2014 18:06:26 +0000 (12:06 -0600)]
MAINTAINERS: Update Tegra Git URL

swarren/linux-tegra.git is a stale location; it has moved to
tegra/linux.git.

While the git protocol re-directs to the new location, HTTP does not.
Besides, MAINTAINERS should contain the canonical URL.

Signed-off-by: Andreas Färber <[email protected]>
[swarren, updated commit message]
Signed-off-by: Stephen Warren <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
10 years agoARM: nomadik: fix up double inversion in DT
Linus Walleij [Fri, 25 Jul 2014 10:18:42 +0000 (12:18 +0200)]
ARM: nomadik: fix up double inversion in DT

The GPIO pin connected to card detect was inverted twice: once by
the argument to the GPIO line itself where it was magically marked
as active low by the flag GPIO_ACTIVE_LOW (0x01) in the third cell,
and also marked active low AGAIN by explicitly stating
"cd-inverted" (a deprecated method).

After commit 78f87df2b4f8760954d7d80603d0cfcbd4759683
"mmc: mmci: Use the common mmc DT parser" this results in the
line being inverted twice so it was effectively uninverted, while
the old code would not have this effect, instead disregarding the
flag on the GPIO line altogether, which is a bug. I admit the
semantics may be unclear but inverting twice is as good a
definition as any on how this should work.

So fix up the buggy device tree. Use proper #includes so the DTS
is clear and readable.

Cc: Ulf Hansson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
10 years agoDocumentation: bindings: document the sub-nodes AHCI bindings
Antoine Ténart [Wed, 30 Jul 2014 18:13:59 +0000 (20:13 +0200)]
Documentation: bindings: document the sub-nodes AHCI bindings

The libahci now allows to use multiple PHYs and to represent each port
as a sub-node. Add these bindings to the documentation.

Signed-off-by: Antoine Ténart <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoata: ahci_platform: add a generic AHCI compatible
Antoine Ténart [Wed, 30 Jul 2014 18:13:58 +0000 (20:13 +0200)]
ata: ahci_platform: add a generic AHCI compatible

The ahci_platform driver is a generic driver using the libahci_platform
functions. Add a generic compatible to avoid having an endless list of
compatibles with no differences for the same driver.

Signed-off-by: Antoine Ténart <[email protected]>
10 years agoata: libahci: allow to use multiple PHYs
Antoine Ténart [Wed, 30 Jul 2014 18:13:57 +0000 (20:13 +0200)]
ata: libahci: allow to use multiple PHYs

The current implementation of the libahci does not allow to use multiple
PHYs. This patch adds the support of multiple PHYs by the libahci while
keeping the old bindings valid for device tree compatibility.

This introduce a new way of defining SATA ports in the device tree, with
one port per sub-node. This as the advantage of allowing a per port
configuration. Because some ports may be accessible but disabled in the
device tree, the port_map mask is computed automatically when using
this.

Signed-off-by: Antoine Ténart <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Acked-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoata: libahci_platform: move port_map parameters into the AHCI structure
Antoine Ténart [Wed, 30 Jul 2014 18:13:56 +0000 (20:13 +0200)]
ata: libahci_platform: move port_map parameters into the AHCI structure

This patch moves force_port_map and mask_port_map into the
ahci_host_priv structure. This allows to modify them into the AHCI
framework. This is needed by the new dt bindings representing ports as
the port_map mask is computed automatically.

Parameters modifying force_port_map, mask_port_map and flags have been
removed from the ahci_platform_init_host() function, and inputs in the
ahci_host_priv structure are now directly filed.

Signed-off-by: Antoine Ténart <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoKVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table
Paolo Bonzini [Wed, 30 Jul 2014 16:07:24 +0000 (18:07 +0200)]
KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table

Currently, the EOI exit bitmap (used for APICv) does not include
interrupts that are masked.  However, this can cause a bug that manifests
as an interrupt storm inside the guest.  Alex Williamson reported the
bug and is the one who really debugged this; I only wrote the patch. :)

The scenario involves a multi-function PCI device with OHCI and EHCI
USB functions and an audio function, all assigned to the guest, where
both USB functions use legacy INTx interrupts.

As soon as the guest boots, interrupts for these devices turn into an
interrupt storm in the guest; the host does not see the interrupt storm.
Basically the EOI path does not work, and the guest continues to see the
interrupt over and over, even after it attempts to mask it at the APIC.
The bug is only visible with older kernels (RHEL6.5, based on 2.6.32
with not many changes in the area of APIC/IOAPIC handling).

Alex then tried forcing bit 59 (corresponding to the USB functions' IRQ)
on in the eoi_exit_bitmap and TMR, and things then work.  What happens
is that VFIO asserts IRQ11, then KVM recomputes the EOI exit bitmap.
It does not have set bit 59 because the RTE was masked, so the IOAPIC
never sees the EOI and the interrupt continues to fire in the guest.

My guess was that the guest is masking the interrupt in the redirection
table in the interrupt routine, i.e. while the interrupt is set in a
LAPIC's ISR, The simplest fix is to ignore the masking state, we would
rather have an unnecessary exit rather than a missed IRQ ACK and anyway
IOAPIC interrupts are not as performance-sensitive as for example MSIs.
Alex tested this patch and it fixed his bug.

[Thanks to Alex for his precise description of the problem
 and initial debugging effort.  A lot of the text above is
 based on emails exchanged with him.]

Reported-by: Alex Williamson <[email protected]>
Tested-by: Alex Williamson <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
10 years agoMerge tag 'please-pull-apei' into x86/ras
H. Peter Anvin [Wed, 30 Jul 2014 17:48:00 +0000 (10:48 -0700)]
Merge tag 'please-pull-apei' into x86/ras

APEI is currently implemented so that it depends on x86 hardware.
The primary dependency is that GHES uses the x86 NMI for hardware
error notification and MCE for memory error handling. These patches
remove that dependency.

Other APEI features such as error reporting via external IRQ, error
serialization, or error injection, do not require changes to use them
on non-x86 architectures.

The following patch set eliminates the APEI Kconfig x86 dependency
by making these changes:
- treat NMI notification as GHES architecture - HAVE_ACPI_APEI_NMI
- group and wrap around #ifdef CONFIG_HAVE_ACPI_APEI_NMI code which
  is used only for NMI path
- identify architectural boxes and abstract it accordingly (tlb flush and MCE)
- rework ioremap for both IRQ and NMI context

NMI code is kept in ghes.c file since NMI and IRQ context are tightly coupled.

Note, these patches introduce no functional changes for x86. The NMI notification
feature is hard selected for x86. Architectures that want to use this
feature should also provide NMI code infrastructure.

10 years agox86/ras: Fix build warnings in <linux/aer.h>
Mike Qiu [Tue, 29 Jul 2014 17:49:25 +0000 (10:49 -0700)]
x86/ras: Fix build warnings in <linux/aer.h>

Fix build warning due to a missing forward declaration in
<linux/aer.h>.  We need struct pci_dev to be forward declared so we
can define pointers to it, but we don't need to pull in the whole
definition.

build log:

In file included from include/ras/ras_event.h:11:0,
                 from drivers/ras/ras.c:13:
include/linux/aer.h:42:129: warning: ‘struct pci_dev’
declared inside parameter list [enabled by default]

include/linux/aer.h:42:129: warning: its scope is only
this definition or declaration, which is probably not
what you want [enabled by default]

include/linux/aer.h:46:130: warning: ‘struct pci_dev’
declared inside parameter list [enabled by default]

include/linux/aer.h:50:136: warning: ‘struct pci_dev’
declared inside parameter list [enabled by default]

include/linux/aer.h:57:14: warning: ‘struct pci_dev’
declared inside parameter list [enabled by default]

Signed-off-by: Mike Qiu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
10 years agoMerge branch 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Tejun Heo [Wed, 30 Jul 2014 16:49:04 +0000 (12:49 -0400)]
Merge branch 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata into for-3.17

The scheduled ahci platform patches depend on change in
for-3.16-fixes.  Pull it into for-3.17.

Signed-off-by: Tejun Heo <[email protected]>
10 years agoahci: imx: add missing clk_disable_unprepare() on error in imx_sata_enable()
Wei Yongjun [Wed, 30 Jul 2014 00:54:07 +0000 (08:54 +0800)]
ahci: imx: add missing clk_disable_unprepare() on error in imx_sata_enable()

Add the missing clk_disable_unprepare() before return from
imx_sata_enable() in the phy reset error handling case.

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoMerge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Linus Torvalds [Wed, 30 Jul 2014 16:01:04 +0000 (09:01 -0700)]
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux

Pull Exynos platform DT fix from Grant Likely:
 "Device tree Exynos bug fix for v3.16-rc7

  This bug fix has been brewing for a while.  I hate sending it to you
  so late, but I only got confirmation that it solves the problem this
  past weekend.  The diff looks big for a bug fix, but the majority of
  it is only executed in the Exynos quirk case.  Unfortunately it
  required splitting early_init_dt_scan() in two and adding quirk
  handling in the middle of it on ARM.

  Exynos has buggy firmware that puts bad data into the memory node.
  Commit 1c2f87c22566 ("ARM: Get rid of meminfo") exposed the bug by
  dropping the artificial upper bound on the number of memory banks that
  can be added.  Exynos fails to boot after that commit.  This branch
  fixes it by splitting the early DT parse function and inserting a
  fixup hook.  Exynos uses the hook to correct the DT before parsing
  memory regions"

* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
  arm: Add devicetree fixup machine function
  of: Add memory limiting function for flattened devicetrees
  of: Split early_init_dt_scan into two parts

10 years agoMerge tag 'stable/for-linus-3.16-rc7-tag' of git://git.kernel.org/pub/scm/linux/kerne...
Linus Torvalds [Wed, 30 Jul 2014 16:00:20 +0000 (09:00 -0700)]
Merge tag 'stable/for-linus-3.16-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull Xen fix from David Vrabel:
 "Fix BUG when trying to expand the grant table.  This seems to occur
  often during boot with Ubuntu 14.04 PV guests"

* tag 'stable/for-linus-3.16-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: safely map and unmap grant frames when in atomic context

10 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Wed, 30 Jul 2014 15:59:15 +0000 (08:59 -0700)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fix from Paolo Bonzini:
 "Fix a bug which allows KVM guests to bring down the entire system on
  some 64K enabled ARM64 hosts"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  kvm: arm64: vgic: fix hyp panic with 64k pages on juno platform

10 years agoRevert "cdc_subset: deal with a device that needs reset for timeout"
Linus Torvalds [Wed, 30 Jul 2014 15:56:23 +0000 (08:56 -0700)]
Revert "cdc_subset: deal with a device that needs reset for timeout"

This reverts commit 20fbe3ae990fd54fc7d1f889d61958bc8b38f254.

As reported by Stephen Rothwell, it causes compile failures in certain
configurations:

  drivers/net/usb/cdc_subset.c:360:15: error: 'dummy_prereset' undeclared here (not in a function)
    .pre_reset = dummy_prereset,
                 ^
  drivers/net/usb/cdc_subset.c:361:16: error: 'dummy_postreset' undeclared here (not in a function)
    .post_reset = dummy_postreset,
                  ^

Reported-by: Stephen Rothwell <[email protected]>
Acked-by: David Miller <[email protected]>
Cc: Oliver Neukum <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agoarm64: defconfig: enable devtmpfs mount option
Robert Richter [Wed, 30 Jul 2014 15:06:34 +0000 (16:06 +0100)]
arm64: defconfig: enable devtmpfs mount option

Matching x86 and making it more convenient to run the arm64 default
kernel as distros like Ubuntu need this option.

Signed-off-by: Robert Richter <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 30 Jul 2014 15:54:17 +0000 (08:54 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Make fragmentation IDs less predictable, from Eric Dumazet.

 2) TSO tunneling can crash in bnx2x driver, fix from Dmitry Kravkov.

 3) Don't allow NULL msg->msg_name just because msg->msg_namelen is
    non-zero, from Andrey Ryabinin.

 4) ndm->ndm_type set using wrong macros, from Jun Zhao.

 5) cdc-ether devices can come up with entries in their address filter,
    so explicitly clear the filter after the device initializes.  From
    Oliver Neukum.

 6) Forgotten refcount bump in xfrm_lookup(), from Steffen Klassert.

 7) Short packets not padded properly, exposing random data, in bcmgenet
    driver.  Fix from Florian Fainelli.

 8) xgbe_probe() doesn't return an error code, but rather zero, when
    netif_set_real_num_tx_queues() fails.  Fix from Wei Yongjun.

 9) USB speed not probed properly in r8152 driver, from Hayes Wang.

10) Transmit logic choosing the outgoing port in the sunvnet driver
    needs to consider a) is the port actually up and b) whether it is a
    switch port.  Fix from David L Stevens.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
  net: phy: re-apply PHY fixups during phy_register_device
  cdc-ether: clean packet filter upon probe
  cdc_subset: deal with a device that needs reset for timeout
  net: sendmsg: fix NULL pointer dereference
  isdn/bas_gigaset: fix a leak on failure path in gigaset_probe()
  ip: make IP identifiers less predictable
  neighbour : fix ndm_type type error issue
  sunvnet: only use connected ports when sending
  can: c_can_platform: Fix raminit, use devm_ioremap() instead of devm_ioremap_resource()
  bnx2x: fix crash during TSO tunneling
  r8152: fix the checking of the usb speed
  net: phy: Ensure the MDIO bus module is held
  net: phy: Set the driver when registering an MDIO bus device
  bnx2x: fix set_setting for some PHYs
  hyperv: Fix error return code in netvsc_init_buf()
  amd-xgbe: Fix error return code in xgbe_probe()
  ath9k: fix aggregation session lockup
  net: bcmgenet: correctly pad short packets
  net: sctp: inherit auth_capable on INIT collisions
  mac80211: fix crash on getting sta info with uninitialized rate control
  ...

10 years agoKVM: vmx: remove duplicate vmx_mpx_supported() prototype
Chris J Arges [Tue, 29 Jul 2014 21:14:10 +0000 (16:14 -0500)]
KVM: vmx: remove duplicate vmx_mpx_supported() prototype

Remove a prototype which was added by both 93c4adc7afe and 36be0b9deb2.

Signed-off-by: Chris J Arges <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
10 years agocpuset: fix the WARN_ON() in update_nodemasks_hier()
Li Zefan [Wed, 30 Jul 2014 07:07:13 +0000 (15:07 +0800)]
cpuset: fix the WARN_ON() in update_nodemasks_hier()

The WARN_ON() is used to check if we break the legal hierarchy, on
which the effective mems should be equal to configured mems.

Reported-by: Mike Qiu <[email protected]>
Tested-by: Mike Qiu <[email protected]>
Signed-off-by: Li Zefan <[email protected]>
10 years agoarm64: vdso: fix build error when switching from LE to BE
Arun Chandran [Thu, 26 Jun 2014 09:46:03 +0000 (15:16 +0530)]
arm64: vdso: fix build error when switching from LE to BE

Building a kernel with CPU_BIG_ENDIAN fails if there are stale objects
from a !CPU_BIG_ENDIAN build. Due to a missing FORCE prerequisite on an
if_changed rule in the VDSO Makefile, we attempt to link a stale LE
object into the new BE kernel.

According to Documentation/kbuild/makefiles.txt, FORCE is required for
if_changed rules and forgetting it is a common mistake, so fix it by
'Forcing' the build of vdso. This patch fixes build errors like these:

arch/arm64/kernel/vdso/note.o: compiled for a little endian system and target is big endian
failed to merge target specific data of file arch/arm64/kernel/vdso/note.o

arch/arm64/kernel/vdso/sigreturn.o: compiled for a little endian system and target is big endian
failed to merge target specific data of file arch/arm64/kernel/vdso/sigreturn.o

Tested-by: Mark Rutland <[email protected]>
Signed-off-by: Arun Chandran <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
10 years agoKVM: s390: Fix memory leak on busy SIGP stop
Christian Borntraeger [Mon, 28 Jul 2014 09:52:02 +0000 (11:52 +0200)]
KVM: s390: Fix memory leak on busy SIGP stop

commit 7dfc63cf977447e09b1072911c22564f900fc578
(KVM: s390: allow only one SIGP STOP (AND STORE STATUS) at a time)
introduced a memory leak if a sigp stop is already pending. Free
the allocated inti structure.

Signed-off-by: Christian Borntraeger <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
10 years agox86/xen: safely map and unmap grant frames when in atomic context
David Vrabel [Fri, 11 Jul 2014 15:42:34 +0000 (16:42 +0100)]
x86/xen: safely map and unmap grant frames when in atomic context

arch_gnttab_map_frames() and arch_gnttab_unmap_frames() are called in
atomic context but were calling alloc_vm_area() which might sleep.

Also, if a driver attempts to allocate a grant ref from an interrupt
and the table needs expanding, then the CPU may already by in lazy MMU
mode and apply_to_page_range() will BUG when it tries to re-enable
lazy MMU mode.

These two functions are only used in PV guests.

Introduce arch_gnttab_init() to allocates the virtual address space in
advance.

Avoid the use of apply_to_page_range() by using saving and using the
array of PTE addresses from the alloc_vm_area() call (which ensures
that the required page tables are pre-allocated).

Signed-off-by: David Vrabel <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
10 years agoMerge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Wed, 30 Jul 2014 12:51:06 +0000 (14:51 +0200)]
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core

Pull perf/core improvements and fixes from Jiri Olsa:

 * Fix perf usage string leftover (Jiri Olsa)

 * Revert "perf tools: Fix jump label always changing during tracing" (Jiri Olsa)

Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
10 years agokvm: arm64: vgic: fix hyp panic with 64k pages on juno platform
Will Deacon [Fri, 25 Jul 2014 15:29:12 +0000 (16:29 +0100)]
kvm: arm64: vgic: fix hyp panic with 64k pages on juno platform

If the physical address of GICV isn't page-aligned, then we end up
creating a stage-2 mapping of the page containing it, which causes us to
map neighbouring memory locations directly into the guest.

As an example, consider a platform with GICV at physical 0x2c02f000
running a 64k-page host kernel. If qemu maps this into the guest at
0x80010000, then guest physical addresses 0x80010000 - 0x8001efff will
map host physical region 0x2c020000 - 0x2c02efff. Accesses to these
physical regions may cause UNPREDICTABLE behaviour, for example, on the
Juno platform this will cause an SError exception to EL3, which brings
down the entire physical CPU resulting in RCU stalls / HYP panics / host
crashing / wasted weeks of debugging.

SBSA recommends that systems alias the 4k GICV across the bounding 64k
region, in which case GICV physical could be described as 0x2c020000 in
the above scenario.

This patch fixes the problem by failing the vgic probe if the physical
base address or the size of GICV aren't page-aligned. Note that this
generated a warning in dmesg about freeing enabled IRQs, so I had to
move the IRQ enabling later in the probe.

Cc: Christoffer Dall <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Gleb Natapov <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Joel Schopp <[email protected]>
Cc: Don Dutile <[email protected]>
Acked-by: Peter Maydell <[email protected]>
Acked-by: Joel Schopp <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Christoffer Dall <[email protected]>
10 years agoarm: Add devicetree fixup machine function
Laura Abbott [Tue, 15 Jul 2014 17:03:36 +0000 (10:03 -0700)]
arm: Add devicetree fixup machine function

Commit 1c2f87c22566cd057bc8cde10c37ae9da1a1bb76
(ARM: 8025/1: Get rid of meminfo) dropped the upper bound on
the number of memory banks that can be added as there was no
technical need in the kernel. It turns out though, some bootloaders
(specifically the arndale-octa exynos boards) may pass invalid memory
information and rely on the kernel to not parse this data. This is a
bug in the bootloader but we still need to work around this.
Work around this by introducing a dt_fixup function. This function
gets called before the flattened devicetree is scanned for memory
and the like. In this fixup function for exynos, limit the maximum
number of memory regions in the devicetree.

Signed-off-by: Laura Abbott <[email protected]>
Tested-by: Andreas Färber <[email protected]>
[glikely: Added a comment and fixed up function name]
Signed-off-by: Grant Likely <[email protected]>
10 years agoof: Add memory limiting function for flattened devicetrees
Laura Abbott [Tue, 15 Jul 2014 17:03:35 +0000 (10:03 -0700)]
of: Add memory limiting function for flattened devicetrees

Buggy bootloaders may pass bogus memory entries in the devicetree.
Add of_fdt_limit_memory to add an upper bound on the number of
entries that can be present in the devicetree.

Signed-off-by: Laura Abbott <[email protected]>
Tested-by: Andreas Färber <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
10 years agoof: Split early_init_dt_scan into two parts
Laura Abbott [Tue, 15 Jul 2014 17:03:34 +0000 (10:03 -0700)]
of: Split early_init_dt_scan into two parts

Currently, early_init_dt_scan validates the header, sets the
boot params, and scans for chosen/memory all in one function.
Split this up into two separate functions (validation/setting
boot params in one, scanning in another) to allow for
additional setup between boot params and scanning the memory.

Signed-off-by: Laura Abbott <[email protected]>
Tested-by: Andreas Färber <[email protected]>
[glikely: s/early_init_dt_scan_all/early_init_dt_scan_nodes/]
Signed-off-by: Grant Likely <[email protected]>
10 years agoclk: Propagate any error return from debug_init()
Chris Brand [Thu, 3 Jul 2014 21:01:29 +0000 (14:01 -0700)]
clk: Propagate any error return from debug_init()

If the .debug_init op is provided, it will be called by
clk_debug_create_one(). If debug_init() returns an error code,
clk_debug_create_one() will return -ENOMEM, regardless of the
value returned from debug_init(). Tweak the code to return
the actual value returned by debug_init() instead.

Signed-off-by: Chris Brand <[email protected]>
Reviewed-by: Matt Porter <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years ago[IA64] sn: Do not needlessly convert between pointers and integers
Thierry Reding [Mon, 28 Jul 2014 15:01:49 +0000 (17:01 +0200)]
[IA64] sn: Do not needlessly convert between pointers and integers

The nasid_to_try variable is an array of integers, so plain integers can
be used when assigning values to the elements rather than casting a NULL
pointer to an integer, which results in the following warning from GCC:

arch/ia64/sn/kernel/bte.c:117:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    nasid_to_try[1] = (int)NULL;
                      ^
arch/ia64/sn/kernel/bte.c:125:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    nasid_to_try[1] = (int)NULL;
                      ^

Replace (int)NULL with a simple 0 to silence these warnings.

Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
10 years ago[IA64] sn: Fix zeroing of PDAs
Thierry Reding [Mon, 28 Jul 2014 15:01:48 +0000 (17:01 +0200)]
[IA64] sn: Fix zeroing of PDAs

The code uses a the following to zero out a PDA:

memset(pda, 0, sizeof(pda));

But sizeof(pda) will return the size of a pointer rather than the size
of the structure pointed to. This triggers the following warning from
GCC:

arch/ia64/sn/kernel/setup.c:582:23: warning: argument to 'sizeof' in 'memset' call is the same pointer type 'struct pda_s *' as the destination; expected 'struct pda_s' or an explicit length [-Wsizeof-pointer-memaccess]
  memset(pda, 0, sizeof(pda));
                       ^

Fix this by passing in the size of the structure using sizeof(*pda)
instead.

Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
10 years agoACPI / PNP: Fix acpi_pnp_match()
Rafael J. Wysocki [Tue, 29 Jul 2014 22:23:09 +0000 (00:23 +0200)]
ACPI / PNP: Fix acpi_pnp_match()

The acpi_pnp_match() function is used for finding the ACPI device
object that should be associated with the given PNP device.
Unfortunately, the check used by that function is not strict enough
and may cause success to be returned for a wrong ACPI device object.

To fix that, use the observation that the pointer to the ACPI
device object in question is already stored in the data field
in struct pnp_dev, so acpi_pnp_match() can simply use that
field to do its job.

This problem was uncovered in 3.14 by commit 202317a573b2 (ACPI / scan:
Add acpi_device objects for all device nodes in the namespace).

Fixes: 202317a573b2 (ACPI / scan: Add acpi_device objects for all device nodes in the namespace)
Reported-and-tested-by: Vinson Lee <[email protected]>
Cc: 3.14+ <[email protected]> # 3.14+
Signed-off-by: Rafael J. Wysocki <[email protected]>
10 years agonet: phy: re-apply PHY fixups during phy_register_device
Florian Fainelli [Mon, 28 Jul 2014 23:28:07 +0000 (16:28 -0700)]
net: phy: re-apply PHY fixups during phy_register_device

Commit 87aa9f9c61ad ("net: phy: consolidate PHY reset in phy_init_hw()")
moved the call to phy_scan_fixups() in phy_init_hw() after a software
reset is performed.

By the time phy_init_hw() is called in phy_device_register(), no driver
has been bound to this PHY yet, so all the checks in phy_init_hw()
against the PHY driver and the PHY driver's config_init function will
return 0. We will therefore never call phy_scan_fixups() as we should.

Fix this by calling phy_scan_fixups() and check for its return value to
restore the intended functionality.

This broke PHY drivers which do register an early PHY fixup callback to
intercept the PHY probing and do things like changing the 32-bits unique
PHY identifier when a pseudo-PHY address has been used, as well as
board-specific PHY fixups that need to be applied during driver probe
time.

Reported-by: Hauke Merthens <[email protected]>
Reported-by: Jonas Gorski <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agocdc-ether: clean packet filter upon probe
Oliver Neukum [Mon, 28 Jul 2014 08:56:36 +0000 (10:56 +0200)]
cdc-ether: clean packet filter upon probe

There are devices that don't do reset all the way. So the packet filter should
be set to a sane initial value. Failure to do so leads to intermittent failures
of DHCP on some systems under some conditions.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agocdc_subset: deal with a device that needs reset for timeout
Oliver Neukum [Mon, 28 Jul 2014 08:12:34 +0000 (10:12 +0200)]
cdc_subset: deal with a device that needs reset for timeout

This device needs to be reset to recover from a timeout.
Unfortunately this can be handled only at the level of
the subdrivers.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agonet: sendmsg: fix NULL pointer dereference
Andrey Ryabinin [Sat, 26 Jul 2014 17:26:58 +0000 (21:26 +0400)]
net: sendmsg: fix NULL pointer dereference

Sasha's report:
> While fuzzing with trinity inside a KVM tools guest running the latest -next
> kernel with the KASAN patchset, I've stumbled on the following spew:
>
> [ 4448.949424] ==================================================================
> [ 4448.951737] AddressSanitizer: user-memory-access on address 0
> [ 4448.952988] Read of size 2 by thread T19638:
> [ 4448.954510] CPU: 28 PID: 19638 Comm: trinity-c76 Not tainted 3.16.0-rc4-next-20140711-sasha-00046-g07d3099-dirty #813
> [ 4448.956823]  ffff88046d86ca40 0000000000000000 ffff880082f37e78 ffff880082f37a40
> [ 4448.958233]  ffffffffb6e47068 ffff880082f37a68 ffff880082f37a58 ffffffffb242708d
> [ 4448.959552]  0000000000000000 ffff880082f37a88 ffffffffb24255b1 0000000000000000
> [ 4448.961266] Call Trace:
> [ 4448.963158] dump_stack (lib/dump_stack.c:52)
> [ 4448.964244] kasan_report_user_access (mm/kasan/report.c:184)
> [ 4448.965507] __asan_load2 (mm/kasan/kasan.c:352)
> [ 4448.966482] ? netlink_sendmsg (net/netlink/af_netlink.c:2339)
> [ 4448.967541] netlink_sendmsg (net/netlink/af_netlink.c:2339)
> [ 4448.968537] ? get_parent_ip (kernel/sched/core.c:2555)
> [ 4448.970103] sock_sendmsg (net/socket.c:654)
> [ 4448.971584] ? might_fault (mm/memory.c:3741)
> [ 4448.972526] ? might_fault (./arch/x86/include/asm/current.h:14 mm/memory.c:3740)
> [ 4448.973596] ? verify_iovec (net/core/iovec.c:64)
> [ 4448.974522] ___sys_sendmsg (net/socket.c:2096)
> [ 4448.975797] ? put_lock_stats.isra.13 (./arch/x86/include/asm/preempt.h:98 kernel/locking/lockdep.c:254)
> [ 4448.977030] ? lock_release_holdtime (kernel/locking/lockdep.c:273)
> [ 4448.978197] ? lock_release_non_nested (kernel/locking/lockdep.c:3434 (discriminator 1))
> [ 4448.979346] ? check_chain_key (kernel/locking/lockdep.c:2188)
> [ 4448.980535] __sys_sendmmsg (net/socket.c:2181)
> [ 4448.981592] ? trace_hardirqs_on_caller (kernel/locking/lockdep.c:2600)
> [ 4448.982773] ? trace_hardirqs_on (kernel/locking/lockdep.c:2607)
> [ 4448.984458] ? syscall_trace_enter (arch/x86/kernel/ptrace.c:1500 (discriminator 2))
> [ 4448.985621] ? trace_hardirqs_on_caller (kernel/locking/lockdep.c:2600)
> [ 4448.986754] SyS_sendmmsg (net/socket.c:2201)
> [ 4448.987708] tracesys (arch/x86/kernel/entry_64.S:542)
> [ 4448.988929] ==================================================================

This reports means that we've come to netlink_sendmsg() with msg->msg_name == NULL and msg->msg_namelen > 0.

After this report there was no usual "Unable to handle kernel NULL pointer dereference"
and this gave me a clue that address 0 is mapped and contains valid socket address structure in it.

This bug was introduced in f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
(net: rework recvmsg handler msg_name and msg_namelen logic).
Commit message states that:
"Set msg->msg_name = NULL if user specified a NULL in msg_name but had a
 non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
 affect sendto as it would bail out earlier while trying to copy-in the
 address."
But in fact this affects sendto when address 0 is mapped and contains
socket address structure in it. In such case copy-in address will succeed,
verify_iovec() function will successfully exit with msg->msg_namelen > 0
and msg->msg_name == NULL.

This patch fixes it by setting msg_namelen to 0 if msg_name == NULL.

Cc: Hannes Frederic Sowa <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: <[email protected]>
Reported-by: Sasha Levin <[email protected]>
Signed-off-by: Andrey Ryabinin <[email protected]>
Acked-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agoisdn/bas_gigaset: fix a leak on failure path in gigaset_probe()
Alexey Khoroshilov [Fri, 25 Jul 2014 22:34:31 +0000 (02:34 +0400)]
isdn/bas_gigaset: fix a leak on failure path in gigaset_probe()

There is a lack of usb_put_dev(udev) on failure path in gigaset_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Acked-by: Tilman Schmidt <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Tue, 29 Jul 2014 17:28:38 +0000 (10:28 -0700)]
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "A nice small set of bug fixes for arm-soc:

   - two incorrect register addresses in DT files on shmobile and hisilicon
   - one revert for a regression on omap
   - one bug fix for a newly introduced pin controller binding
   - one regression fix for the memory controller on omap
   - one patch to avoid a harmless WARN_ON"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: dts: Revert enabling of twl configuration for n900
  ARM: dts: fix L2 address in Hi3620
  ARM: OMAP2+: gpmc: fix gpmc_hwecc_bch_capable()
  pinctrl: dra: dt-bindings: Fix pull enable/disable
  ARM: shmobile: r8a7791: Fix SD2CKCR register address
  ARM: OMAP2+: l2c: squelch warning dump on power control setting

10 years agoAFS: Correctly assemble the client UUID
David Howells [Tue, 29 Jul 2014 16:53:23 +0000 (17:53 +0100)]
AFS: Correctly assemble the client UUID

Correctly assemble the client UUID by OR'ing in the flags rather than
assigning them over the other components.

Reported-by: Himangi Saraogi <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agomm: fix page_alloc.c kernel-doc warnings
Randy Dunlap [Sun, 27 Jul 2014 21:15:33 +0000 (14:15 -0700)]
mm: fix page_alloc.c kernel-doc warnings

Fix kernel-doc warnings and function name in mm/page_alloc.c:

  Warning(..//mm/page_alloc.c:6074): No description found for parameter 'pfn'
  Warning(..//mm/page_alloc.c:6074): No description found for parameter 'mask'
  Warning(..//mm/page_alloc.c:6074): Excess function parameter 'start_bitidx' description in 'get_pfnblock_flags_mask'
  Warning(..//mm/page_alloc.c:6102): No description found for parameter 'pfn'
  Warning(..//mm/page_alloc.c:6102): No description found for parameter 'mask'
  Warning(..//mm/page_alloc.c:6102): Excess function parameter 'start_bitidx' description in 'set_pfnblock_flags_mask'

Signed-off-by: Randy Dunlap <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agoarm64: defconfig: add virtio support for running as a kvm guest
Will Deacon [Tue, 29 Jul 2014 15:20:02 +0000 (16:20 +0100)]
arm64: defconfig: add virtio support for running as a kvm guest

When running as a kvm guest on a para-virtualised platform, it is useful
to have virtio implementations of console, 9pfs and network.

This adds these options to the arm64 defconfig, so we can easily run a
defconfig kernel build as both host and as a kvm guest.

Signed-off-by: Will Deacon <[email protected]>
10 years agoahci_xgene: Use correct OOB tunning parameters for APM X-Gene SoC AHCI SATA Host...
Suman Tripathi [Tue, 29 Jul 2014 06:54:51 +0000 (12:24 +0530)]
ahci_xgene: Use correct OOB tunning parameters for APM X-Gene SoC AHCI SATA Host controller driver.

APM X-Gene SoC AHCI SATA Host controller driver requires
some correction of Phy Control OOB timing for the
COMINIT/COMWAKE parameters to correctly interoperate with
different kinds of disks.

Signed-off-by: Loc Ho <[email protected]>
Signed-off-by: Suman Tripathi <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoahci_xgene: Fix the watermark threshold for the APM X-Gene SATA host controller driver.
Suman Tripathi [Tue, 29 Jul 2014 06:54:49 +0000 (12:24 +0530)]
ahci_xgene: Fix the watermark threshold for the APM X-Gene SATA host controller driver.

As per SATA IO specification, when Host sends HOLD, the device takes
about 20DW latency to reply to HOLDA. In some case, device doesn't
response to HOLDA over 20DW and causes FIFO goes into over flow
condition. Due to this condition, device enumerations fails with
those devices. This patch adjust the watermark FIFO by increasing
the FIFO depth from 0x16(default) to 0x30 to address this issue.

Signed-off-by: Loc Ho <[email protected]>
Signed-off-by: Suman Tripathi <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout
Konstantin Khlebnikov [Fri, 25 Jul 2014 08:17:12 +0000 (09:17 +0100)]
ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout

On LPAE, each level 1 (pgd) page table entry maps 1GiB, and the level 2
(pmd) entries map 2MiB.

When the identity mapping is created on LPAE, the pgd pointers are copied
from the swapper_pg_dir.  If we find that we need to modify the contents
of a pmd, we allocate a new empty pmd table and insert it into the
appropriate 1GB slot, before then filling it with the identity mapping.

However, if the 1GB slot covers the kernel lowmem mappings, we obliterate
those mappings.

When replacing a PMD, first copy the old PMD contents to the new PMD, so
that we preserve the existing mappings, particularly the mappings of the
kernel itself.

[rewrote commit message and added code comment -- rmk]

Fixes: ae2de101739c ("ARM: LPAE: Add identity mapping support for the 3-level page table format")
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Russell King <[email protected]>
10 years agoMerge tag 'omap-for-v3.16/n900-regression' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Tue, 29 Jul 2014 11:04:27 +0000 (13:04 +0200)]
Merge tag 'omap-for-v3.16/n900-regression' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Merge "omap n900 regression fix for v3.16 rc series" from Tony Lindgren:

Minimal regression fix for n900 display that got broken with
enabling of twl4030 PM features. Turns out more work is needed
before we can enable twl4030 PM on n900.

I did not notice this earlier as I have my n900 in a rack
and the display did not get enabled for device tree based booting
until for v3.16.

* tag 'omap-for-v3.16/n900-regression' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: Revert enabling of twl configuration for n900

Signed-off-by: Arnd Bergmann <[email protected]>
10 years agoARM: fix alignment of keystone page table fixup
Russell King [Tue, 29 Jul 2014 08:24:47 +0000 (09:24 +0100)]
ARM: fix alignment of keystone page table fixup

If init_mm.brk is not section aligned, the LPAE fixup code will miss
updating the final PMD.  Fix this by aligning map_end.

Fixes: a77e0c7b2774 ("ARM: mm: Recreate kernel mappings in early_paging_init()")
Cc: <[email protected]>
Signed-off-by: Russell King <[email protected]>
10 years agoARM: dts: Revert enabling of twl configuration for n900
Tony Lindgren [Fri, 25 Jul 2014 11:41:25 +0000 (04:41 -0700)]
ARM: dts: Revert enabling of twl configuration for n900

Commit 9188883fd66e9 (ARM: dts: Enable twl4030 off-idle configuration
for selected omaps) allowed n900 to cut off core voltages during
off-idle. This however caused a regression where twl regulator
vaux1 was not getting enabled for the LCD panel as we are not
requesting it for the panel.

Turns out quite a few devices on n900 are using vaux1, and we need
to either stop idling it, or add proper regulator_get calls for all
users. But until we have a proper solution implemented and tested,
let's just disable the twl off-idle configuration for now for n900.

Reported-by: Aaro Koskinen <[email protected]>
Fixes: 9188883fd66e9 (ARM: dts: Enable twl4030 off-idle configuration for selected omaps)
Signed-off-by: Tony Lindgren <[email protected]>
10 years agoclk: clps711x: Add DT bindings documentation
Alexander Shiyan [Sun, 13 Jul 2014 04:38:20 +0000 (08:38 +0400)]
clk: clps711x: Add DT bindings documentation

This patch adds DT binding documentation for the Cirrus Logic
CLPS711X-based CPUs clock subsystem.

Signed-off-by: Alexander Shiyan <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: Add CLPS711X clk driver
Alexander Shiyan [Sun, 13 Jul 2014 04:37:52 +0000 (08:37 +0400)]
clk: Add CLPS711X clk driver

This adds the clock driver for Cirrus Logic CLPS711X series SoCs
using common clock infrastructure.
Designed primarily for migration CLPS711X subarch for multiplatform & DT,
for this as the "OF" and "non-OF" calls implemented.

Signed-off-by: Alexander Shiyan <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Use round to closest divider flag
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:31 +0000 (17:20 +0200)]
clk: st: Use round to closest divider flag

This patch uses CLK_DIVIDER_ROUND_CLOSEST flag to specify
the divider has to round to closest div.

Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Update frequency tables for fs660c32 and fs432c65
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:30 +0000 (17:20 +0200)]
clk: st: Update frequency tables for fs660c32 and fs432c65

This patch extend the range of possible frequencies of the fs432c65
and fs660c32 Quad frequency synthesizers.

Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for clockgenA9
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:29 +0000 (17:20 +0200)]
clk: st: STiH407: Support for clockgenA9

The patch added support for DT registration of ClockGenA9
It includes c32 type PLL.

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for clockgenD0/D2/D3
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:28 +0000 (17:20 +0200)]
clk: st: STiH407: Support for clockgenD0/D2/D3

The patch added support for ClockGenD0/D2/D3
It includes one 660 Quadfs.

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for clockgenC0
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:27 +0000 (17:20 +0200)]
clk: st: STiH407: Support for clockgenC0

The patch added support for DT registration of ClockGenC0
It includes 2 c32 type PLL and a 660 Quadfs.

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Add quadfs reset handling
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:26 +0000 (17:20 +0200)]
clk: st: Add quadfs reset handling

This patch adds the support of quadfs reset handling.

Signed-off-by: Olivier Bideau <[email protected]>
Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Add polarity bit indication
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:25 +0000 (17:20 +0200)]
clk: st: Add polarity bit indication

This patch introduces polarity indication for pll power up bit
and for standby bit in order to have same code between stih416
and stih407 boards.

Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for clockgenA0
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:24 +0000 (17:20 +0200)]
clk: st: STiH407: Support for clockgenA0

The patch added support for DT registration of ClockGenA0
It includes c32 type PLL.

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for A9 MUX Clocks
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:23 +0000 (17:20 +0200)]
clk: st: STiH407: Support for A9 MUX Clocks

The patch supports the A9-mux clocks used by ClockGenA9

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: STiH407: Support for Flexgen Clocks
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:22 +0000 (17:20 +0200)]
clk: st: STiH407: Support for Flexgen Clocks

This patch is the Flexgen implementation reusing as much as possible
of Common Clock Framework functions.

The idea is to have an instance of "struct flexgen" per output clock.
It represents the clock cross bar (by a mux element), and the pre and final dividers
(using dividers and gates elements).

Signed-off-by: Maxime Coquelin <[email protected]>
Signed-off-by: Olivier Bideau <[email protected]>
Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Adds Flexgen clock binding
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:21 +0000 (17:20 +0200)]
clk: st: Adds Flexgen clock binding

A Flexgen structure is composed by:
- a clock cross bar (represented by a mux element)
- a pre and final dividers (represented by a divider and gate elements)

Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Remove uncessary (void *) cast
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:20 +0000 (17:20 +0200)]
clk: st: Remove uncessary (void *) cast

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: use static const for clkgen_pll_data tables
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:19 +0000 (17:20 +0200)]
clk: st: use static const for clkgen_pll_data tables

converts clkgen_pll_data tables into static const

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: use static const for stm_fs tables
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:18 +0000 (17:20 +0200)]
clk: st: use static const for stm_fs tables

converts stm_fs tables into static const

Signed-off-by: Gabriel Fernandez <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: st: Update ST clock binding documentation
Gabriel FERNANDEZ [Tue, 15 Jul 2014 15:20:17 +0000 (17:20 +0200)]
clk: st: Update ST clock binding documentation

Naming convention was changed in dts file but the
clock binding documentation hasn't been updated.

Signed-off-by: Gabriel Fernandez <[email protected]>
Acked-by: Peter Griffin <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoip: make IP identifiers less predictable
Eric Dumazet [Sat, 26 Jul 2014 06:58:10 +0000 (08:58 +0200)]
ip: make IP identifiers less predictable

In "Counting Packets Sent Between Arbitrary Internet Hosts", Jeffrey and
Jedidiah describe ways exploiting linux IP identifier generation to
infer whether two machines are exchanging packets.

With commit 73f156a6e8c1 ("inetpeer: get rid of ip_id_count"), we
changed IP id generation, but this does not really prevent this
side-channel technique.

This patch adds a random amount of perturbation so that IP identifiers
for a given destination [1] are no longer monotonically increasing after
an idle period.

Note that prandom_u32_max(1) returns 0, so if generator is used at most
once per jiffy, this patch inserts no hole in the ID suite and do not
increase collision probability.

This is jiffies based, so in the worst case (HZ=1000), the id can
rollover after ~65 seconds of idle time, which should be fine.

We also change the hash used in __ip_select_ident() to not only hash
on daddr, but also saddr and protocol, so that ICMP probes can not be
used to infer information for other protocols.

For IPv6, adds saddr into the hash as well, but not nexthdr.

If I ping the patched target, we can see ID are now hard to predict.

21:57:11.008086 IP (...)
    A > target: ICMP echo request, seq 1, length 64
21:57:11.010752 IP (... id 2081 ...)
    target > A: ICMP echo reply, seq 1, length 64

21:57:12.013133 IP (...)
    A > target: ICMP echo request, seq 2, length 64
21:57:12.015737 IP (... id 3039 ...)
    target > A: ICMP echo reply, seq 2, length 64

21:57:13.016580 IP (...)
    A > target: ICMP echo request, seq 3, length 64
21:57:13.019251 IP (... id 3437 ...)
    target > A: ICMP echo reply, seq 3, length 64

[1] TCP sessions uses a per flow ID generator not changed by this patch.

Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: Jeffrey Knockel <[email protected]>
Reported-by: Jedidiah R. Crandall <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agoneighbour : fix ndm_type type error issue
Jun Zhao [Fri, 25 Jul 2014 16:38:59 +0000 (00:38 +0800)]
neighbour : fix ndm_type type error issue

ndm_type means L3 address type, in neighbour proxy and vxlan, it's RTN_UNICAST.
NDA_DST is for netlink TLV type, hence it's not right value in this context.

Signed-off-by: Jun Zhao <[email protected]>
Acked-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agosunvnet: only use connected ports when sending
David L Stevens [Fri, 25 Jul 2014 14:30:11 +0000 (10:30 -0400)]
sunvnet: only use connected ports when sending

The sunvnet driver doesn't check whether or not a port is connected when
transmitting packets, which results in failures if a port fails to connect
(e.g., due to a version mismatch). The original code also assumes
unnecessarily that the first port is up and a switch, even though there is
a flag for switch ports.

This patch only matches a port if it is connected, and otherwise uses the
switch_port flag to send the packet to a switch port that is up.

Signed-off-by: David L Stevens <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 years agoMerge tag 'linux-can-fixes-for-3.16-20140725' of git://gitorious.org/linux-can/linux-can
David S. Miller [Tue, 29 Jul 2014 00:01:01 +0000 (17:01 -0700)]
Merge tag 'linux-can-fixes-for-3.16-20140725' of git://gitorious.org/linux-can/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2014-07-25

this is a pull request of one patch for the net tree, hoping to get into the
3.16 release.

The patch by George Cherian fixes a regression in the c_can platform driver.
When using two interfaces the regression leads to a non function second
interface.
====================

Signed-off-by: David S. Miller <[email protected]>
10 years agoclk: sunxi: staticize structures and arrays
Emilio López [Mon, 28 Jul 2014 03:49:43 +0000 (00:49 -0300)]
clk: sunxi: staticize structures and arrays

There are some structs and arrays on the driver that are not used
anywhere else. Let's mark them as static.

Signed-off-by: Emilio López <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agoclk: sunxi: add __iomem markings to MMIO pointers
Emilio López [Mon, 28 Jul 2014 03:49:42 +0000 (00:49 -0300)]
clk: sunxi: add __iomem markings to MMIO pointers

This commit adds __iomem thoughout the sunxi clock driver, in places
where it was ommited. This cleans most of the sparse warnings we
are getting here.

Signed-off-by: Emilio López <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
10 years agox86_64/entry/xen: Do not invoke espfix64 on Xen
Andy Lutomirski [Wed, 23 Jul 2014 15:34:11 +0000 (08:34 -0700)]
x86_64/entry/xen: Do not invoke espfix64 on Xen

This moves the espfix64 logic into native_iret.  To make this work,
it gets rid of the native patch for INTERRUPT_RETURN:
INTERRUPT_RETURN on native kernels is now 'jmp native_iret'.

This changes the 16-bit SS behavior on Xen from OOPSing to leaking
some bits of the Xen hypervisor's RSP (I think).

[ hpa: this is a nonzero cost on native, but probably not enough to
  measure. Xen needs to fix this in their own code, probably doing
  something equivalent to espfix64. ]

Signed-off-by: Andy Lutomirski <[email protected]>
Link: http://lkml.kernel.org/r/7b8f1d8ef6597cb16ae004a43c56980a7de3cf94.1406129132.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <[email protected]>
Cc: <[email protected]>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Mon, 28 Jul 2014 18:35:30 +0000 (11:35 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull ARM AES crypto fixes from Herbert Xu:
 "This push fixes a regression on ARM where odd-sized blocks supplied to
  AES may cause crashes"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: arm-aes - fix encryption of unaligned data
  crypto: arm64-aes - fix encryption of unaligned data

10 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Mon, 28 Jul 2014 18:34:31 +0000 (11:34 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Pull powerpc fixes from Ben Herrenschmidt:
 "Here are 3 more small powerpc fixes that should still go into .16.

  One is a recent regression (MMCR2 business), the other is a trivial
  endian fix without which FW updates won't work on LE in IBM machines,
  and the 3rd one turns a BUG_ON into a WARN_ON which is definitely a
  LOT more friendly especially when the whole thing is about retrieving
  error logs ..."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Fix endianness of flash_block_list in rtas_flash
  powerpc/powernv: Change BUG_ON to WARN_ON in elog code
  powerpc/perf: Fix MMCR2 handling for EBB

10 years agokthread_work: remove the unused wait_queue_head
Lai Jiangshan [Sat, 26 Jul 2014 04:04:00 +0000 (12:04 +0800)]
kthread_work: remove the unused wait_queue_head

The wait_queue_head_t kthread_work->done is unused since
flush_kthread_work() has been re-implemented.  Let's remove it
including the initialization code.  This makes
DEFINE_KTHREAD_WORK_ONSTACK() unnecessary, removed.

tj: Updated description.  Removed DEFINE_KTHREAD_WORK_ONSTACK().

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agokthread_work: wake up worker only when the worker is idle
Lai Jiangshan [Sat, 26 Jul 2014 04:03:59 +0000 (12:03 +0800)]
kthread_work: wake up worker only when the worker is idle

If the worker is already executing a work item when another is queued,
we can safely skip wakeup without worrying about stalling queue thus
avoiding waking up the busy worker spuriously.  Spurious wakeups
should be fine but still isn't nice and avoiding it is trivial here.

tj: Updated description.

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
10 years agoRevert "perf tools: Fix jump label always changing during tracing"
Jiri Olsa [Mon, 28 Jul 2014 13:58:47 +0000 (15:58 +0200)]
Revert "perf tools: Fix jump label always changing during tracing"

This reverts commit deaff8b659cf4d34181c087b8cdf74f1eb17b02b.

This commit makes CLOEXEC feature undetected for normal users,
because per-cpu events are priviledged.

Reported-by: Peter Zijlstra <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
10 years agocrypto: arm-aes - fix encryption of unaligned data
Mikulas Patocka [Fri, 25 Jul 2014 23:42:30 +0000 (19:42 -0400)]
crypto: arm-aes - fix encryption of unaligned data

Fix the same alignment bug as in arm64 - we need to pass residue
unprocessed bytes as the last argument to blkcipher_walk_done.

Signed-off-by: Mikulas Patocka <[email protected]>
Cc: [email protected] # 3.13+
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
10 years agocrypto: arm64-aes - fix encryption of unaligned data
Mikulas Patocka [Fri, 25 Jul 2014 23:40:20 +0000 (19:40 -0400)]
crypto: arm64-aes - fix encryption of unaligned data

cryptsetup fails on arm64 when using kernel encryption via AF_ALG socket.
See https://bugzilla.redhat.com/show_bug.cgi?id=1122937

The bug is caused by incorrect handling of unaligned data in
arch/arm64/crypto/aes-glue.c. Cryptsetup creates a buffer that is aligned
on 8 bytes, but not on 16 bytes. It opens AF_ALG socket and uses the
socket to encrypt data in the buffer. The arm64 crypto accelerator causes
data corruption or crashes in the scatterwalk_pagedone.

This patch fixes the bug by passing the residue bytes that were not
processed as the last parameter to blkcipher_walk_done.

Signed-off-by: Mikulas Patocka <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
10 years agoperf tools: Fix perf usage string leftover
Jiri Olsa [Fri, 18 Jul 2014 07:11:30 +0000 (09:11 +0200)]
perf tools: Fix perf usage string leftover

Fixing perf usage string leftover pointed out by Namhyung.

Reported-by: Namhyung Kim <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Corey Ashford <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
10 years agoMerge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Mon, 28 Jul 2014 08:09:03 +0000 (10:09 +0200)]
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

Infrastructure changes:

 o More prep work to support Intel PT: (Adrian Hunter)
   - Polishing 'script' BTS output
   - 'inject' can specify --kallsym
   - VDSO is per machine, not a global var
   - Expose data addr lookup functions previously private to 'script'
   - Large mmap fixes in events processing

 o Fix build on gcc 4.4.7 (Arnaldo Carvalho de Melo)

 o Event ordering fixes (Jiri Olsa)

 o Include standard stringify macros in power pc code (Sukadev Bhattiprolu)

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
10 years agosched/fair: Fix 'make xmldocs' warning caused by missing description
Masanari Iida [Mon, 28 Jul 2014 03:38:06 +0000 (12:38 +0900)]
sched/fair: Fix 'make xmldocs' warning caused by missing description

This patch fix following warning caused by missing description
"overload" in kernel/sched/fair.c

Warning(.//kernel/sched/fair.c:5906): No description found for
parameter 'overload'

Signed-off-by: Masanari Iida <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
10 years agosched: Use macro for magic number of -1 for setparam
Steven Rostedt [Wed, 23 Jul 2014 15:28:26 +0000 (11:28 -0400)]
sched: Use macro for magic number of -1 for setparam

Instead of passing around a magic number -1 for the sched_setparam()
policy, use a more descriptive macro name like SETPARAM_POLICY.

[ based on top of Daniel's sched_setparam() fix ]

Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Daniel Bristot de Oliveira<[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
10 years agosched: Robustify topology setup
Peter Zijlstra [Tue, 22 Jul 2014 09:47:40 +0000 (11:47 +0200)]
sched: Robustify topology setup

We hard assume that higher topology levels are supersets of lower
levels.

Detect, warn and try to fixup when we encounter this violated.

Tested-by: Dietmar Eggemann <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Josh Boyer <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Bruno Wolff III <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
10 years agoMerge branch 'sched/urgent' into sched/core, to merge fixes before applying new changes
Ingo Molnar [Mon, 28 Jul 2014 08:03:00 +0000 (10:03 +0200)]
Merge branch 'sched/urgent' into sched/core, to merge fixes before applying new changes

Signed-off-by: Ingo Molnar <[email protected]>
10 years agoperf: Check permission only for parent tracepoint event
Jiri Olsa [Wed, 16 Jul 2014 12:33:29 +0000 (14:33 +0200)]
perf: Check permission only for parent tracepoint event

There's no need to check cloned event's permission once the
parent was already checked.

Also the code is checking 'current' process permissions, which
is not owner process for cloned events, thus could end up with
wrong permission check result.

Reported-by: Alexander Yarygin <[email protected]>
Tested-by: Alexander Yarygin <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Corey Ashford <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
10 years agoMerge tag 'v3.16-rc7' into perf/core, to merge in the latest fixes before applying...
Ingo Molnar [Mon, 28 Jul 2014 08:00:33 +0000 (10:00 +0200)]
Merge tag 'v3.16-rc7' into perf/core, to merge in the latest fixes before applying new changes

Signed-off-by: Ingo Molnar <[email protected]>
10 years agosched: Fix sched_setparam() policy == -1 logic
Daniel Bristot de Oliveira [Wed, 23 Jul 2014 02:27:41 +0000 (23:27 -0300)]
sched: Fix sched_setparam() policy == -1 logic

The scheduler uses policy == -1 to preserve the current policy state to
implement sched_setparam(). But, as (int) -1 is equals to 0xffffffff,
it's matching the if (policy & SCHED_RESET_ON_FORK) on
_sched_setscheduler(). This match changes the policy value to an
invalid value, breaking the sched_setparam() syscall.

This patch checks policy == -1 before check the SCHED_RESET_ON_FORK flag.

The following program shows the bug:

int main(void)
{
struct sched_param param = {
.sched_priority = 5,
};

sched_setscheduler(0, SCHED_FIFO, &param);
param.sched_priority = 1;
sched_setparam(0, &param);
param.sched_priority = 0;
sched_getparam(0, &param);
if (param.sched_priority != 1)
printf("failed priority setting (found %d instead of 1)\n",
param.sched_priority);
else
printf("priority setting fine\n");
}

Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Reviewed-by: Steven Rostedt <[email protected]>
Cc: <[email protected]> # 3.14+
Cc: Linus Torvalds <[email protected]>
Cc: [email protected]
Fixes: 7479f3c9cf67 "sched: Move SCHED_RESET_ON_FORK into attr::sched_flags"
Link: http://lkml.kernel.org/r/9ebe0566a08dbbb3999759d3f20d6004bb2dbcfa.1406079891.git.bristot@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
10 years agopowerpc: Fix endianness of flash_block_list in rtas_flash
Thomas Falcon [Fri, 25 Jul 2014 17:47:42 +0000 (12:47 -0500)]
powerpc: Fix endianness of flash_block_list in rtas_flash

The function rtas_flash_firmware passes the address of a data structure,
flash_block_list, when making the update-flash-64-and-reboot rtas call.
While the endianness of the address is handled correctly, the endianness
of the data is not.  This patch ensures that the data in flash_block_list
is big endian when passed to rtas on little endian hosts.

Signed-off-by: Thomas Falcon <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
10 years agopowerpc/powernv: Change BUG_ON to WARN_ON in elog code
Vasant Hegde [Wed, 23 Jul 2014 09:22:39 +0000 (14:52 +0530)]
powerpc/powernv: Change BUG_ON to WARN_ON in elog code

We can continue to read the error log (up to MAX size) even if
we get the elog size more than MAX size. Hence change BUG_ON to
WARN_ON.

Also updated error message.

Reported-by: Gopesh Kumar Chaudhary <[email protected]>
Signed-off-by: Vasant Hegde <[email protected]>
Signed-off-by: Ananth N Mavinakayanahalli <[email protected]>
Acked-by: Deepthi Dharwar <[email protected]>
Acked-by: Stewart Smith <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
10 years agoLinux 3.16-rc7 v3.16-rc7
Linus Torvalds [Sun, 27 Jul 2014 19:41:55 +0000 (12:41 -0700)]
Linux 3.16-rc7

10 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 27 Jul 2014 16:57:16 +0000 (09:57 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:
 "A bunch of fixes for perf and kprobes:
   - revert a commit that caused a perf group regression
   - silence dmesg spam
   - fix kprobe probing errors on ia64 and ppc64
   - filter kprobe faults from userspace
   - lockdep fix for perf exit path
   - prevent perf #GP in KVM guest
   - correct perf event and filters"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  kprobes: Fix "Failed to find blacklist" probing errors on ia64 and ppc64
  kprobes/x86: Don't try to resolve kprobe faults from userspace
  perf/x86/intel: Avoid spamming kernel log for BTS buffer failure
  perf/x86/intel: Protect LBR and extra_regs against KVM lying
  perf: Fix lockdep warning on process exit
  perf/x86/intel/uncore: Fix SNB-EP/IVT Cbox filter mappings
  perf/x86/intel: Use proper dTLB-load-misses event on IvyBridge
  perf: Revert ("perf: Always destroy groups on exit")

10 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 27 Jul 2014 16:53:01 +0000 (09:53 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
 "A couple of crash fixes, plus a fix that on 32 bits would cause a
  missing -ENOSYS for nonexistent system calls"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, cpu: Fix cache topology for early P4-SMT
  x86_32, entry: Store badsys error code in %eax
  x86, MCE: Robustify mcheck_init_device

10 years agoMerge branch 'vfs-for-3.16' of git://git.infradead.org/users/hch/vfs
Linus Torvalds [Sun, 27 Jul 2014 16:43:41 +0000 (09:43 -0700)]
Merge branch 'vfs-for-3.16' of git://git.infradead.org/users/hch/vfs

Pull vfs fixes from Christoph Hellwig:
 "A vfsmount leak fix, and a compile warning fix"

* 'vfs-for-3.16' of git://git.infradead.org/users/hch/vfs:
  fs: umount on symlink leaks mnt count
  direct-io: fix uninitialized warning in do_direct_IO()

10 years agoMerge tag 'firewire-fix-vt6315' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 27 Jul 2014 16:42:06 +0000 (09:42 -0700)]
Merge tag 'firewire-fix-vt6315' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire regression fix from Stefan Richter:
 "IEEE 1394 (FireWire) subsystem fix: MSI don't work on VIA PCIe
  controllers with some isochronous workloads (regression since
  v3.16-rc1)"

* tag 'firewire-fix-vt6315' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire: ohci: disable MSI for VIA VT6315 again

10 years agoFix gcc-4.9.0 miscompilation of load_balance() in scheduler
Linus Torvalds [Sat, 26 Jul 2014 21:52:01 +0000 (14:52 -0700)]
Fix gcc-4.9.0 miscompilation of load_balance()  in scheduler

Michel Dänzer and a couple of other people reported inexplicable random
oopses in the scheduler, and the cause turns out to be gcc mis-compiling
the load_balance() function when debugging is enabled.  The gcc bug
apparently goes back to gcc-4.5, but slight optimization changes means
that it now showed up as a problem in 4.9.0 and 4.9.1.

The instruction scheduling problem causes gcc to schedule a spill
operation to before the stack frame has been created, which in turn can
corrupt the spilled value if an interrupt comes in.  There may be other
effects of this bug too, but that's the code generation problem seen in
Michel's case.

This is fixed in current gcc HEAD, but the workaround as suggested by
Markus Trippelsdorf is pretty simple: use -fno-var-tracking-assignments
when compiling the kernel, which disables the gcc code that causes the
problem.  This can result in slightly worse debug information for
variable accesses, but that is infinitely preferable to actual code
generation problems.

Doing this unconditionally (not just for CONFIG_DEBUG_INFO) also allows
non-debug builds to verify that the debug build would be identical: we
can do

    export GCC_COMPARE_DEBUG=1

to make gcc internally verify that the result of the build is
independent of the "-g" flag (it will make the compiler build everything
twice, toggling the debug flag, and compare the results).

Without the "-fno-var-tracking-assignments" option, the build would fail
(even with 4.8.3 that didn't show the actual stack frame bug) with a gcc
compare failure.

See also gcc bugzilla:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801

Reported-by: Michel Dänzer <[email protected]>
Suggested-by: Markus Trippelsdorf <[email protected]>
Cc: Jakub Jelinek <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
10 years agomm: fix direct reclaim writeback regression
Hugh Dickins [Sat, 26 Jul 2014 19:58:23 +0000 (12:58 -0700)]
mm: fix direct reclaim writeback regression

Shortly before 3.16-rc1, Dave Jones reported:

  WARNING: CPU: 3 PID: 19721 at fs/xfs/xfs_aops.c:971
           xfs_vm_writepage+0x5ce/0x630 [xfs]()
  CPU: 3 PID: 19721 Comm: trinity-c61 Not tainted 3.15.0+ #3
  Call Trace:
    xfs_vm_writepage+0x5ce/0x630 [xfs]
    shrink_page_list+0x8f9/0xb90
    shrink_inactive_list+0x253/0x510
    shrink_lruvec+0x563/0x6c0
    shrink_zone+0x3b/0x100
    shrink_zones+0x1f1/0x3c0
    try_to_free_pages+0x164/0x380
    __alloc_pages_nodemask+0x822/0xc90
    alloc_pages_vma+0xaf/0x1c0
    handle_mm_fault+0xa31/0xc50
  etc.

 970   if (WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) ==
 971                   PF_MEMALLOC))

I did not respond at the time, because a glance at the PageDirty block
in shrink_page_list() quickly shows that this is impossible: we don't do
writeback on file pages (other than tmpfs) from direct reclaim nowadays.
Dave was hallucinating, but it would have been disrespectful to say so.

However, my own /var/log/messages now shows similar complaints

  WARNING: CPU: 1 PID: 28814 at fs/ext4/inode.c:1881 ext4_writepage+0xa7/0x38b()
  WARNING: CPU: 0 PID: 27347 at fs/ext4/inode.c:1764 ext4_writepage+0xa7/0x38b()

from stressing some mmotm trees during July.

Could a dirty xfs or ext4 file page somehow get marked PageSwapBacked,
so fail shrink_page_list()'s page_is_file_cache() test, and so proceed
to mapping->a_ops->writepage()?

Yes, 3.16-rc1's commit 68711a746345 ("mm, migration: add destination
page freeing callback") has provided such a way to compaction: if
migrating a SwapBacked page fails, its newpage may be put back on the
list for later use with PageSwapBacked still set, and nothing will clear
it.

Whether that can do anything worse than issue WARN_ON_ONCEs, and get
some statistics wrong, is unclear: easier to fix than to think through
the consequences.

Fixing it here, before the put_new_page(), addresses the bug directly,
but is probably the worst place to fix it.  Page migration is doing too
many parts of the job on too many levels: fixing it in
move_to_new_page() to complement its SetPageSwapBacked would be
preferable, except why is it (and newpage->mapping and newpage->index)
done there, rather than down in migrate_page_move_mapping(), once we are
sure of success? Not a cleanup to get into right now, especially not
with memcg cleanups coming in 3.17.

Reported-by: Dave Jones <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
10 years agom68k/sun3: Remove define statement no longer needed
Nicholas Krause [Fri, 4 Jul 2014 16:29:53 +0000 (12:29 -0400)]
m68k/sun3: Remove define statement no longer needed

In the file sun3_pgalloc.h we should remove #define_KERNPG_TABLE equals 0
as this define statement hasn't been used since kernel verison 2.5.18 and
is now no longer needed.

Signed-off-by: Nicholas Krause <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
10 years agoARM: dts: fix L2 address in Hi3620
Haojian Zhuang [Wed, 2 Apr 2014 13:31:50 +0000 (21:31 +0800)]
ARM: dts: fix L2 address in Hi3620

Fix the address of L2 controler register in hi3620 SoC.
This has been wrong from the point that the file was merged
in v3.14.

Signed-off-by: Haojian Zhuang <[email protected]>
Acked-by: Wei Xu <[email protected]>
Cc: [email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
This page took 0.12923 seconds and 4 git commands to generate.