]> Git Repo - linux.git/log
linux.git
9 years agoMIPS: ralink: Add support for mt7688
John Crispin [Wed, 4 Nov 2015 10:50:06 +0000 (11:50 +0100)]
MIPS: ralink: Add support for mt7688

MT7688 is similar tot he MT7628 but has a different wifi radio.

Signed-off-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11439/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7362
Jaedon Shin [Tue, 27 Oct 2015 06:48:11 +0000 (15:48 +0900)]
MIPS: BMIPS: Add SATA/PHY nodes for bcm7362

Add AHCI and PHY device nodes to MIPS-based BCM7362 set-top box
platform.

Signed-off-by: Jaedon Shin <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Kevin Cernekee <[email protected]>
Cc: Dragan Stancevic <[email protected]>
Cc: [email protected]
Cc: Linux-MIPS <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11379/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7346
Jaedon Shin [Tue, 27 Oct 2015 06:48:10 +0000 (15:48 +0900)]
MIPS: BMIPS: Add SATA/PHY nodes for bcm7346

Add AHCI and PHY device nodes to MIPS-based BCM7346 set-top box
platform.

Signed-off-by: Jaedon Shin <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Kevin Cernekee <[email protected]>
Cc: Dragan Stancevic <[email protected]>
Cc: [email protected]
Cc: Linux-MIPS <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11378/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7425
Jaedon Shin [Tue, 27 Oct 2015 06:48:09 +0000 (15:48 +0900)]
MIPS: BMIPS: Add SATA/PHY nodes for bcm7425

Add AHCI and PHY device nodes to MIPS-based BCM7425 set-top box
platform.

Signed-off-by: Jaedon Shin <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Kevin Cernekee <[email protected]>
Cc: Dragan Stancevic <[email protected]>
Cc: [email protected]
Cc: Linux-MIPS <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11377/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add I2C node for bcm7362
Jaedon Shin [Wed, 21 Oct 2015 02:37:01 +0000 (11:37 +0900)]
MIPS: BMIPS: Add I2C node for bcm7362

Add I2C device nodes to BMIPS based BCM7362 platform.

Signed-off-by: Jaedon Shin <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Kamal Dasu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11336/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add I2C node for bcm7360
Jaedon Shin [Wed, 21 Oct 2015 02:37:00 +0000 (11:37 +0900)]
MIPS: BMIPS: Add I2C node for bcm7360

Add I2C device nodes to BMIPS based BCM7360 platform.

Signed-off-by: Jaedon Shin <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Kamal Dasu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11335/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add I2C node for bcm7358
Jaedon Shin [Wed, 21 Oct 2015 02:36:59 +0000 (11:36 +0900)]
MIPS: BMIPS: Add I2C node for bcm7358

Add I2C device nodes to BMIPS based BCM7358 platform.

Signed-off-by: Jaedon Shin <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Kamal Dasu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11334/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BMIPS: Add I2C node for bcm7346
Jaedon Shin [Wed, 21 Oct 2015 02:36:58 +0000 (11:36 +0900)]
MIPS: BMIPS: Add I2C node for bcm7346

Add I2C device nodes to BMIPS based BCM7346 platform.

Signed-off-by: Jaedon Shin <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Kamal Dasu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11333/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Fix check for return value of request_mem_region()
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:44 +0000 (23:37 +0100)]
MIPS: Lantiq: Fix check for return value of request_mem_region()

request_mem_region() returns a pointer and not an integer with an error
value. A check for "< 0" on a pointer will cause problems, replace it
with not null checks instead. This was found with sparse.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11395/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add support for xRX220 SoC
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:43 +0000 (23:37 +0100)]
MIPS: Lantiq: Add support for xRX220 SoC

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11394/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add misc clocks
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:42 +0000 (23:37 +0100)]
MIPS: Lantiq: Add misc clocks

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11393/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add 1e103100.deu clock
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:41 +0000 (23:37 +0100)]
MIPS: Lantiq: Add 1e103100.deu clock

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11392/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add clock for mei driver
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:40 +0000 (23:37 +0100)]
MIPS: Lantiq: Add clock for mei driver

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11391/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add SoC detection for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:39 +0000 (23:37 +0100)]
MIPS: Lantiq: Add SoC detection for ar10 and grx390

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11390/
Patchwork: https://patchwork.linux-mips.org/patch/11399/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add support for gphy firmware loading for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:38 +0000 (23:37 +0100)]
MIPS: Lantiq: Add support for gphy firmware loading for ar10 and grx390

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11389/
Patchwork: https://patchwork.linux-mips.org/patch/11398/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add pmu bits for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:37 +0000 (23:37 +0100)]
MIPS: Lantiq: Add pmu bits for ar10 and grx390

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11388/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add PMU bits for USB and SDIO devices
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:36 +0000 (23:37 +0100)]
MIPS: Lantiq: Add PMU bits for USB and SDIO devices

This adds the PUM bits for USB and SDIO devices

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11387/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Deactivate most of the devices by default
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:35 +0000 (23:37 +0100)]
MIPS: Lantiq: Deactivate most of the devices by default

When the SoC starts up most of the devices should be deactivated by the
PMU, they should be activated when they get used by their drivers. Some
devices should not get deactivate at startup like the serial, register
them in a special way.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11386/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add clock detection for grx390 and ar10
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:34 +0000 (23:37 +0100)]
MIPS: Lantiq: Add clock detection for grx390 and ar10

This add detection of some clocks on the ar10 and grx390.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11385/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Fix pp32 clock on vr9
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:33 +0000 (23:37 +0100)]
MIPS: Lantiq: Fix pp32 clock on vr9

The vendor code uses different clock values for this clock.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11384/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Rename CGU_SYS_VR9 register
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:32 +0000 (23:37 +0100)]
MIPS: Lantiq: Rename CGU_SYS_VR9 register

This register is also used on other SoCs.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11383/
Patchwork: https://patchwork.linux-mips.org/patch/11397/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add support for setting PMU register on AR10 and GRX390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:31 +0000 (23:37 +0100)]
MIPS: Lantiq: Add support for setting PMU register on AR10 and GRX390

This adds support for setting the PMU register on the AR10 and GRX390.

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11382/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Lantiq: Add locking for PMU register and check status afterwards
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:30 +0000 (23:37 +0100)]
MIPS: Lantiq: Add locking for PMU register and check status afterwards

The PMU register are accessed in a non atomic way and they could be
accessed by different threads simultaneously, which could cause
problems this patch adds locking around the PMU registers. In
addition we now also wait till the PMU is actually deactivated.

[[email protected]: Fix spelling mistake in commit message as noticed
by Sergei Shtylyov <[email protected]>.]

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11381/
Patchwork: https://patchwork.linux-mips.org/patch/11396/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BCM47xx: Fetch board info directly in callback function
Rafał Miłecki [Mon, 26 Oct 2015 10:13:16 +0000 (11:13 +0100)]
MIPS: BCM47xx: Fetch board info directly in callback function

This drops another symbol dependency between setup.c and sprom.c which
will allow us to make SPROM code a separated module (and share it with
ARM).
Patch tested on Linksys WRT300N V1.

Signed-off-by: Rafał Miłecki <[email protected]>
Cc: Hauke Mehrtens <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11360/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by checkpatch.pl
Rafał Miłecki [Sun, 25 Oct 2015 21:16:48 +0000 (22:16 +0100)]
MIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by checkpatch.pl

There are still few left:
1) Most of them about lines over 80 chars (increased readability exception)
2) Wrong parsing of preprocessor macros

Signed-off-by: Rafał Miłecki <[email protected]>
Cc: [email protected]
Cc: Hauke Mehrtens <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11356/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: BCM47xx: Support on-SoC bus in SPROM reading function
Rafał Miłecki [Sun, 25 Oct 2015 21:16:47 +0000 (22:16 +0100)]
MIPS: BCM47xx: Support on-SoC bus in SPROM reading function

To support (extract) SPROM on Broadcom ARM devices we should separate
SPROM code and make it a separated module. We won't want to export
bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard
fallback function and then modify ssb to use it.

Signed-off-by: Rafał Miłecki <[email protected]>
Acked-by: Hauke Mehrtens <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11355/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: lantiq: add clk_round_rate()
Hauke Mehrtens [Sun, 25 Oct 2015 22:21:42 +0000 (23:21 +0100)]
MIPS: lantiq: add clk_round_rate()

This adds a basic implementation of clk_round_rate()
The clk_round_rate() function is called by multiple drivers and
subsystems now and the lantiq clk driver is supposed to export this,
but doesn't do so, this causes linking problems like this one:
ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!

Signed-off-by: Hauke Mehrtens <[email protected]>
Acked-by: John Crispin <[email protected]>
Cc: <[email protected]> # 4.1+
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11358/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Add LATENCYTOP support
Aaro Koskinen [Fri, 23 Oct 2015 12:39:02 +0000 (15:39 +0300)]
MIPS: Add LATENCYTOP support

Add LATENCYTOP support for MIPS. Tested on OCTEON.

Signed-off-by: Aaro Koskinen <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11353/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: pci-rt3883: drop unneeded of_node_get
Julia Lawall [Sun, 25 Oct 2015 21:24:25 +0000 (22:24 +0100)]
MIPS: pci-rt3883: drop unneeded of_node_get

for_each_child_of_node performs an of_node_get on each iteration, so no
of_node_get is needed on breaking out of the loop when the device_node
structure is saved in another variable.

A simplified semantic match that finds this problem is as follows
(http://coccinelle.lip6.fr):

// <smpl>
@@
expression root;
local idexpression child;
@@

 for_each_child_of_node(root, child) {
   ...
*  of_node_get(child)
   ...
   break;
 }
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Russell King - ARM Linux <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Jason Cooper <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11357/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()
Alex Smith [Wed, 21 Oct 2015 08:57:44 +0000 (09:57 +0100)]
MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

Add user-mode implementations of gettimeofday() and clock_gettime() to
the VDSO. This is currently usable with 2 clocksources: the CP0 count
register, which is accessible to user-mode via RDHWR on R2 and later
cores, or the MIPS Global Interrupt Controller (GIC) timer, which
provides a "user-mode visible" section containing a mirror of its
counter registers. This section must be mapped into user memory, which
is done below the VDSO data page.

When a supported clocksource is not in use, the VDSO functions will
return -ENOSYS, which causes libc to fall back on the standard syscall
path.

When support for neither of these clocksources is compiled into the
kernel at all, the VDSO still provides clock_gettime(), as the coarse
realtime/monotonic clocks can still be implemented. However,
gettimeofday() is not provided in this case as nothing can be done
without a suitable clocksource. This causes the symbol lookup to fail
in libc and it will then always use the standard syscall path.

This patch includes a workaround for a bug in QEMU which results in
RDHWR on the CP0 count register always returning a constant (incorrect)
value. A fix for this has been submitted, and the workaround can be
removed after the fix has been in stable releases for a reasonable
amount of time.

A simple performance test which calls gettimeofday() 1000 times in a
loop and calculates the average execution time gives the following
results on a Malta + I6400 (running at 20MHz):

 - Syscall:    ~31000 ns
 - VDSO (GIC): ~15000 ns
 - VDSO (CP0): ~9500 ns

[[email protected]:
- Minor code re-arrangements in order for mappings to be made
in the order they appear to the process' address space.
- Move do_{monotonic, realtime} outside of the MIPS_CLOCK_VSYSCALL ifdef
- Use gic_get_usm_range so we can do the GIC mapping in the
arch/mips/kernel/vdso instead of the GIC irqchip driver]

Signed-off-by: Alex Smith <[email protected]>
Signed-off-by: Markos Chandras <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11338/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoirqchip: irq-mips-gic: Provide function to map GIC user section
Alex Smith [Mon, 12 Oct 2015 09:40:43 +0000 (10:40 +0100)]
irqchip: irq-mips-gic: Provide function to map GIC user section

The GIC provides a "user-mode visible" section containing a mirror of
the counter registers which can be mapped into user memory. This will
be used by the VDSO time function implementations, so provide a
function to map it in.

When the GIC is not enabled in Kconfig a dummy inline version of this
function is provided, along with "#define gic_present 0", so that we
don't have to litter the VDSO code with ifdefs.

[[email protected]:
  - Move mapping code to arch/mips/kernel/vdso.c and use a resource
    type to get the GIC usermode information
  - Avoid renaming function arguments and use __gic_base_addr to hold
    the base GIC address prior to ioremap.]
[[email protected]: Fix up gic_get_usm_range() to compile and make inline
again.]

Signed-off-by: Alex Smith <[email protected]>
Signed-off-by: Markos Chandras <[email protected]>
Reviewed-by: Marc Zyngier <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Alex Smith <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: http://patchwork.linux-mips.org/patch/11281/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Initial implementation of a VDSO
Alex Smith [Wed, 21 Oct 2015 08:54:38 +0000 (09:54 +0100)]
MIPS: Initial implementation of a VDSO

Add an initial implementation of a proper (i.e. an ELF shared library)
VDSO. With this commit it does not export any symbols, it only replaces
the current signal return trampoline page. A later commit will add user
implementations of gettimeofday()/clock_gettime().

To support both new toolchains and old ones which don't generate ABI
flags section, we define its content manually and then use a tool
(genvdso) to patch up the section to have the correct name and type.
genvdso also extracts symbol offsets ({,rt_}sigreturn) needed by the
kernel, and generates a C file containing a "struct mips_vdso_image"
containing both the VDSO data and these offsets. This C file is
compiled into the kernel.

On 64-bit kernels we require a different VDSO for each supported ABI,
so we may build up to 3 different VDSOs. The VDSO to use is selected by
the mips_abi structure.

A kernel/user shared data page is created and mapped below the VDSO
image. This is currently empty, but will be used by the user time
function implementations which are added later.

[[email protected]:
- Add more comments
- Move abi detection in genvdso.h since it's the get_symbol function
that needs it.
- Add an R6 specific way to calculate the base address of VDSO in order
to avoid the branch instruction which affects performance.
- Do not patch .gnu.attributes since it's not needed for dynamic linking.
- Simplify Makefile a little bit.
- checkpatch fixes
- Restrict VDSO support for binutils < 2.25 for pre-R6
- Include atomic64.h for O32 variant on MIPS64]

Signed-off-by: Alex Smith <[email protected]>
Signed-off-by: Markos Chandras <[email protected]>
Cc: Matthew Fortune <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11337/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: mpc30x_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:56 +0000 (17:51 +0200)]
MIPS: mpc30x_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts mpc30x_defconfig to use libata PATA
drivers.

PS This platform still uses "ide0=base[,ctl[,irq]]" hack in
its defconfig.  The hack itself has been removed in 2008 and
this platform should be converted to using PATA platform host
driver (pata_platform) instead.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11141/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: maltaup_xpa_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:55 +0000 (17:51 +0200)]
MIPS: maltaup_xpa_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts maltaup_xpa_defconfig to use libata PATA
drivers (tc86c001 IDE host driver has no corresponding libata
driver yet so it is not converted).

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Steven J. Hill <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11140/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: maltaup_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:54 +0000 (17:51 +0200)]
MIPS: maltaup_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts maltaup_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Steven J. Hill <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11142/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: maltasmvp_eva_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:53 +0000 (17:51 +0200)]
MIPS: maltasmvp_eva_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts maltasmvp_eva_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Steven J. Hill <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11139/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: maltaaprp_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:52 +0000 (17:51 +0200)]
MIPS: maltaaprp_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts maltaaprp_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Steven J. Hill <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11137/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: malta_qemu_32r6_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:51 +0000 (17:51 +0200)]
MIPS: malta_qemu_32r6_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts malta_qemu_32r6_defconfig to use libata
PATA drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11138/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: malta_kvm_guest_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:50 +0000 (17:51 +0200)]
MIPS: malta_kvm_guest_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts malta_kvm_guest_defconfig to use libata
PATA drivers (tc86c001 IDE host driver has no corresponding
libata driver yet so it is not converted).

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Sanjay Lal <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11136/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: malta_kvm_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:49 +0000 (17:51 +0200)]
MIPS: malta_kvm_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts malta_kvm_defconfig to use libata PATA
drivers (tc86c001 IDE host driver has no corresponding libata
driver yet so it is not converted).

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Sanjay Lal <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11135/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: malta_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:48 +0000 (17:51 +0200)]
MIPS: malta_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts malta_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11134/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: lemote2f_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:47 +0000 (17:51 +0200)]
MIPS: lemote2f_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts lemote2f_defconfig to use libata PATA
drivers.

PS This platform uses CS5536 chipset which (due to historical
reasons) has basic support in AMD/nVidia PATA host driver and
full support in a newer CS5536 PATA one (pata_cs5536).  Thus
most likely this platform should switch to using the latter
host driver.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11133/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: lasat_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:46 +0000 (17:51 +0200)]
MIPS: lasat_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts lasat_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Brian Murphy <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11132/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: fuloong2e_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:45 +0000 (17:51 +0200)]
MIPS: fuloong2e_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts fuloong2e_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Wu Zhangjin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11131/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: e55_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:44 +0000 (17:51 +0200)]
MIPS: e55_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts e55_defconfig to use libata PATA drivers.

PS This platform still uses "ide0=base[,ctl[,irq]]" hack in
its defconfig.  The hack itself has been removed in 2008 and
this platform should be converted to using PATA platform host
driver (pata_platform) instead.

Cc: Yoichi Yuasa <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: capcella_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:43 +0000 (17:51 +0200)]
MIPS: capcella_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts capcella_defconfig to use libata PATA
drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11129/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: bigsur_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:42 +0000 (17:51 +0200)]
MIPS: bigsur_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts bigsur_defconfig to use libata PATA
drivers (tc86c001 IDE host driver has no corresponding libata
driver yet so it is not converted).

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11128/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Extend hardware table walking support to MIPS64
Paul Burton [Tue, 22 Sep 2015 19:03:37 +0000 (12:03 -0700)]
MIPS: Extend hardware table walking support to MIPS64

Extend the existing support for Hardware Table Walking (HTW) to MIPS64
systems by supporting PMDs & setting the pointer size bit in PWSize,
then ceasing to blacklist HTW on MIPS64 systems.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Joshua Kinard <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11224/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Malta: Register UP SMP ops if all else fails
Paul Burton [Tue, 22 Sep 2015 18:58:43 +0000 (11:58 -0700)]
MIPS: Malta: Register UP SMP ops if all else fails

If we fail to register any real SMP implementations, fall back to
registering the dummy UP implementation. Otherwise when we build an SMP
kernel & run it on a system where the SMP implementations fail to probe
(eg. QEMU) the kernel will perform a NULL dereference attempting to call
mp_ops->smp_setup() from plat_smp_setup().

Notably this fixes booting kernels with CPS SMP enabled on QEMU, which
doesn't currently implement the CM, CPC or GIC.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Peter Hurley <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11223/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Malta: Setup RAM regions via DT
Paul Burton [Tue, 22 Sep 2015 18:56:38 +0000 (11:56 -0700)]
MIPS: Malta: Setup RAM regions via DT

Move memory configuration to be performed via device tree for the Malta
board. This moves more Malta specific code to malta-dtshim.c, leaving
the rest of the mti-malta code a little more board-agnostic. This will
be useful to share more code between boards, with the device tree
providing the board specifics as intended.

Since we can't rely upon Malta boards running a bootloader capable of
handling devictrees & filling in the required information, a piece of
shim code (malta_dt_shim) is added to consume the (e)memsize variables
provided as part of the bootloader environment (or on the kernel command
line) then generate the DT memory node using the provided values.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Kumar Gala <[email protected]>
Cc: [email protected]
Cc: Ian Campbell <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Pawel Moll <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Mark Rutland <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11222/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Malta: Remove fw_memblock_t abstraction
Paul Burton [Tue, 22 Sep 2015 18:56:37 +0000 (11:56 -0700)]
MIPS: Malta: Remove fw_memblock_t abstraction

The fw_getmdesc function & fw_memblock_t abstraction is only used by
Malta, and so far as I can tell serves no purpose beyond making the code
less clear than it could be. Remove the useless level of abstraction.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11221/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Malta: Split obj-y entries across lines
Paul Burton [Tue, 22 Sep 2015 18:56:36 +0000 (11:56 -0700)]
MIPS: Malta: Split obj-y entries across lines

Split the obj-y entries to their own lines such that it's easier to see
what's going on when adding or removing entries.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Markos Chandras <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11220/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Allow RIXI for 32-bit kernels on MIPS64
Paul Burton [Tue, 22 Sep 2015 18:42:53 +0000 (11:42 -0700)]
MIPS: Allow RIXI for 32-bit kernels on MIPS64

Commit a68d09a156b2 ("MIPS: Don't use RI/XI with 32-bit kernels on
64-bit CPUs") prevented use of RIXI on MIPS64 systems, stating that the
"TLB handlers cannot handle this case". What they actually couldn't
handle was cases where there were less fill bits in the Entry{Lo,Hi}
registers than bits used by software in PTEs. The handlers can now deal
with this case, so enable RIXI for MIPS32 kernels on MIPS64 systems.

Note that beyond the obvious benefits provided by having RIXI on such
systems, this is required for systems implementing MIPSr6 where RIXI
cannot be disabled.

This reverts commit a68d09a156b2 ("MIPS: Don't use RI/XI with 32-bit
kernels on 64-bit CPUs").

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Joshua Kinard <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11219/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: tlbex: Avoid placing software PTE bits in Entry* PFN fields
Paul Burton [Tue, 22 Sep 2015 18:42:52 +0000 (11:42 -0700)]
MIPS: tlbex: Avoid placing software PTE bits in Entry* PFN fields

Commit 748e787eb6de ("MIPS: Optimize TLB refill for RI/XI
configurations.") stopped explicitly clearing the bits used by software
in PTEs by making use of a rotate instruction that rotates them into the
fill bits of the Entry{Lo,Hi} register. This can only work if there are
actually enough fill bits in the register to cover the software
maintained bits, otherwise we end up writing those bits into the upper
bits of the PFN or PFNX field of the Entry{Lo,Hi} register.

Fix this by detecting the number of fill bits present in the
Entry{Lo,Hi} registers & explicitly clearing the software bits where
necessary.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11218/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Tidy EntryLo bit definitions, add PFN
Paul Burton [Tue, 22 Sep 2015 18:42:51 +0000 (11:42 -0700)]
MIPS: Tidy EntryLo bit definitions, add PFN

Tidy up the definition of the EntryLo RI & XI bits using BITS_PER_LONG
rather than #ifdef'ing on CONFIG_64BIT, and add a definition for the
offset to the PFN field for use by a later patch.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11217/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: tlbex: Share MIPS32 32 bit phys & MIPS64 64 bit phys code
Paul Burton [Tue, 22 Sep 2015 18:42:50 +0000 (11:42 -0700)]
MIPS: tlbex: Share MIPS32 32 bit phys & MIPS64 64 bit phys code

The code in build_update_entries for 64 bit physical addresses on a
MIPS64 CPU and 32 bit physical addresses on a MIPS32 CPU is now
identical, with the exception of r4k bug workaround in the latter which
would simply not apply to the former. Remove the duplication and some

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11216/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: tlbex: Remove some RIXI redundancy
Paul Burton [Tue, 22 Sep 2015 18:42:49 +0000 (11:42 -0700)]
MIPS: tlbex: Remove some RIXI redundancy

The cpu_has_rixi cases in build_update_entries are now identical to the
non-RIXI cases with the one exception of the r45k_bvahwbug case which is
hardcoded as never happening anyway & presumably was either missed from
the RIXI path or would never happen on a CPU with RIXI support. Remove
the redundant checks & duplication.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11215/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: tlbex: Stop open-coding build_convert_pte_to_entrylo
Paul Burton [Tue, 22 Sep 2015 18:42:48 +0000 (11:42 -0700)]
MIPS: tlbex: Stop open-coding build_convert_pte_to_entrylo

Make use of build_convert_pte_to_entrylo in the RIXI cases within
build_update_entries rather than open-coding it 4 times.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11214/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Always use r4k_wait_irqoff for MIPSr6
Paul Burton [Tue, 22 Sep 2015 18:24:20 +0000 (11:24 -0700)]
MIPS: Always use r4k_wait_irqoff for MIPSr6

Prior to release 6 of the MIPS architecture it has been implementation
dependent whether masked interrupts cause a wait instruction to return,
so the kernel has effectively had to maintain a whitelist of cores upon
which it is safe to use the r4k_wait_irqoff cpu_wait implementation.
With MIPSr6 this is no longer implementation dependent and
r4k_wait_irqoff can always be used.

Remove the existing I6400 case which will no longer ever be hit, and was
incorrect anyway since I6400 & r6 in general doesn't have the WII bit.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Leonid Yegoshin <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11210/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CM, CPC: Ensure core-other GCRs reflect the correct core
Paul Burton [Tue, 22 Sep 2015 18:12:18 +0000 (11:12 -0700)]
MIPS: CM, CPC: Ensure core-other GCRs reflect the correct core

Ensure the update to which core the core-other GCR regions reflect has
taken place before any core-other GCRs are accessed by placing a memory
barrier (sync instruction) between the write to the core-other registers
and any such GCR accesses.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Bjorn Helgaas <[email protected]>
Cc: [email protected]
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11209/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CM: make use of mips_cm_{lock,unlock}_other
Paul Burton [Tue, 22 Sep 2015 18:12:17 +0000 (11:12 -0700)]
MIPS: CM: make use of mips_cm_{lock,unlock}_other

Document that CPC core-other accesses must take place within the bounds
of the CM lock, and begin using the CM lock functions where we access
the GCRs of other cores. This is required because with CM3 the CPC began
using GCR_CL_OTHER instead of CPC_CL_OTHER.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Rusty Russell <[email protected]>
Cc: Andrew Bresticker <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: [email protected]
Cc: Niklas Cassel <[email protected]>
Cc: Ezequiel Garcia <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11208/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CM: Introduce core-other locking functions
Paul Burton [Tue, 22 Sep 2015 18:12:16 +0000 (11:12 -0700)]
MIPS: CM: Introduce core-other locking functions

Introduce mips_cm_lock_other & mips_cm_unlock_other, mirroring the
existing CPC equivalents, in order to lock access from the current core
to another via the core-other GCR region. This hasn't been required in
the past but with CM3 the CPC starts using GCR_CL_OTHER rather than
CPC_CL_OTHER and this will be required for safety.

[[email protected]: Fix merge conflict.]

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11207/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CM: Fix GCR_Cx_CONFIG PVPE mask
Paul Burton [Tue, 22 Sep 2015 18:12:15 +0000 (11:12 -0700)]
MIPS: CM: Fix GCR_Cx_CONFIG PVPE mask

The PVPE (or PVP in >= CM3) field is 10 bits wide, but the mask
previously only covered the bottom 9 bits. Extend the mask to cover all
10 bits of the field.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11206/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CPS: Warn if a core doesn't start
Paul Burton [Tue, 22 Sep 2015 18:12:14 +0000 (11:12 -0700)]
MIPS: CPS: Warn if a core doesn't start

When debugging core bringup it is useful to see the state of the CPC
sequencer, so output that value if the core hasn't started within a
reasonable amount of time (1 second). This avoids simply appearing to
the user to hang if a secondary core fails to start.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Rusty Russell <[email protected]>
Cc: Andrew Bresticker <[email protected]>
Cc: [email protected]
Cc: Niklas Cassel <[email protected]>
Cc: Ezequiel Garcia <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11205/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CPS: Skip Config1 presence check
Paul Burton [Tue, 22 Sep 2015 18:12:13 +0000 (11:12 -0700)]
MIPS: CPS: Skip Config1 presence check

The Config1 register is architecturally defined as required, and is thus
present in all systems which may make use of cps-vec.S. Skip the check
for its presence via the Config.M bit.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Markos Chandras <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11204/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CPS: Read CM GCR base from cop0
Paul Burton [Tue, 22 Sep 2015 18:12:12 +0000 (11:12 -0700)]
MIPS: CPS: Read CM GCR base from cop0

Rather than patching the start of mips_cps_core_entry to provide the
base address of the CM GCRs, simply read that base address from the cop0
CMGCRBase register, converting from the physical address to an uncached
virtual address.

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Rusty Russell <[email protected]>
Cc: Andrew Bresticker <[email protected]>
Cc: [email protected]
Cc: Niklas Cassel <[email protected]>
Cc: Ezequiel Garcia <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11203/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: CPS: Early debug using an ns16550-compatible UART
Paul Burton [Tue, 22 Sep 2015 18:12:11 +0000 (11:12 -0700)]
MIPS: CPS: Early debug using an ns16550-compatible UART

Provide support for outputting early debug information, in the form of
various register values should an exception occur, during the early
bringup of secondary cores. This code requires an ns16550-compatible
UART accessible from the secondary core, and is written in assembly due
to the environment in which such early exceptions occur where way may
not have a stack, be coherent or even have initialised caches.

[[email protected]: Fix merge conflict.]

Signed-off-by: Paul Burton <[email protected]>
Cc: [email protected]
Cc: Steven J. Hill <[email protected]>
Cc: Andrew Bresticker <[email protected]>
Cc: Leonid Yegoshin <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: [email protected]
Cc: James Hogan <[email protected]>
Cc: Markos Chandras <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/11202/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agoMIPS: Fix duplicate CP0_* definitions.
James Hogan [Tue, 10 Nov 2015 17:06:37 +0000 (17:06 +0000)]
MIPS: Fix duplicate CP0_* definitions.

Remove the definition in locore.S and move a few of the other similar
definitions in asm/mipsregs.h too. CP0_INTCTL, CP0_SRSCTL, & CP0_SRSMAP
are unused so they're just dropped instead. CP0_DDATA_LO is left where
it is as I have patches to eliminate its use in locore.S and it
otherwise is unlikely to need to be used from assembly code.

Signed-off-by: James Hogan <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Gleb Natapov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11461/
Signed-off-by: Ralf Baechle <[email protected]>
9 years agofs: 9p: cache.h: Add #define of include guard
Tzvetelin Katchov [Thu, 8 Oct 2015 00:15:21 +0000 (20:15 -0400)]
fs: 9p: cache.h: Add #define of include guard

The include file was intended to have an include guard, but the #define
part is missing.

Signed-off-by: Tzvetelin Katchov <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agovfs: remove stale comment in inode_operations
Ross Zwisler [Thu, 8 Oct 2015 23:07:20 +0000 (17:07 -0600)]
vfs: remove stale comment in inode_operations

The big warning comment that is currently at the end of struct
inode_operations was added as part of this commit:

4aa7c6346be3 ("vfs: add i_op->dentry_open()")

It was added to warn people not to use the newly added 'dentry_open'
function pointer.

This function pointer was removed as part of this commit:

4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and
f_inode to the underlay")

The comment was left behind and now refers to nothing, so remove it.

Signed-off-by: Ross Zwisler <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agovfs: remove unused wrapper block_page_mkwrite()
Ross Zwisler [Tue, 13 Oct 2015 22:51:02 +0000 (16:51 -0600)]
vfs: remove unused wrapper block_page_mkwrite()

The function currently called "__block_page_mkwrite()" used to be called
"block_page_mkwrite()" until a wrapper for this function was added by:

commit 24da4fab5a61 ("vfs: Create __block_page_mkwrite() helper passing
error values back")

This wrapper, the current "block_page_mkwrite()", is currently unused.
__block_page_mkwrite() is used directly by ext4, nilfs2 and xfs.

Remove the unused wrapper, rename __block_page_mkwrite() back to
block_page_mkwrite() and update the comment above block_page_mkwrite().

Signed-off-by: Ross Zwisler <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agobinfmt_elf: Correct `arch_check_elf's description
Maciej W. Rozycki [Mon, 26 Oct 2015 15:47:57 +0000 (15:47 +0000)]
binfmt_elf: Correct `arch_check_elf's description

Correct `arch_check_elf's description, mistakenly copied and pasted from
`arch_elf_pt_proc'.

Signed-off-by: Maciej W. Rozycki <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agofs: fix writeback.c kernel-doc warnings
Randy Dunlap [Fri, 6 Nov 2015 00:54:04 +0000 (16:54 -0800)]
fs: fix writeback.c kernel-doc warnings

Fix kernel-doc warnings in fs/fs-writeback.c by moving a #define macro
to after the function's opening brace. Also #undef this macro at the
end of the function.

..//fs/fs-writeback.c:1984: warning: Excess function parameter 'inode' description in 'I_DIRTY_INODE'
..//fs/fs-writeback.c:1984: warning: Excess function parameter 'flags' description in 'I_DIRTY_INODE'

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agofs: fix inode.c kernel-doc warning
Randy Dunlap [Fri, 6 Nov 2015 00:53:47 +0000 (16:53 -0800)]
fs: fix inode.c kernel-doc warning

Fix kernel-doc warning in fs/inode.c:

..//fs/inode.c:1606: warning: No description found for parameter 'inode'

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agofs/pipe.c: return error code rather than 0 in pipe_write()
Eric Biggers [Sat, 17 Oct 2015 21:26:09 +0000 (16:26 -0500)]
fs/pipe.c: return error code rather than 0 in pipe_write()

pipe_write() would return 0 if it failed to merge the beginning of the
data to write with the last, partially filled pipe buffer.  It should
return an error code instead.  Userspace programs could be confused by
write() returning 0 when called with a nonzero 'count'.

The EFAULT error case was a regression from f0d1bec9d5 ("new helper:
copy_page_from_iter()"), while the ops->confirm() error case was a much
older bug.

Test program:

#include <assert.h>
#include <errno.h>
#include <unistd.h>

int main(void)
{
int fd[2];
char data[1] = {0};

assert(0 == pipe(fd));
assert(1 == write(fd[1], data, 1));

/* prior to this patch, write() returned 0 here  */
assert(-1 == write(fd[1], NULL, 1));
assert(errno == EFAULT);
}

Cc: [email protected] # at least v3.15+
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agofs/pipe.c: preserve alloc_file() error code
Eric Biggers [Sat, 17 Oct 2015 21:26:08 +0000 (16:26 -0500)]
fs/pipe.c: preserve alloc_file() error code

If sys_pipe() was unable to allocate a 'struct file', it always failed
with ENFILE, which means "The number of simultaneously open files in the
system would exceed a system-imposed limit." However, alloc_file()
actually returns an ERR_PTR value and might fail with other error codes.
Currently, in addition to ENFILE, it can fail with ENOMEM, potentially
when there are few open files in the system.  Update sys_pipe() to
preserve this error code.

In a prior submission of a similar patch (1) some concern was raised
about introducing a new error code for sys_pipe().  However, for most
system calls, programs cannot assume that new error codes will never be
introduced.  In addition, ENOMEM was, in fact, already a possible error
code for sys_pipe(), in the case where the file descriptor table could
not be expanded due to insufficient memory.

(1) http://comments.gmane.org/gmane.linux.kernel/1357942

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agobinfmt_elf: Don't clobber passed executable's file header
Maciej W. Rozycki [Mon, 26 Oct 2015 15:48:19 +0000 (15:48 +0000)]
binfmt_elf: Don't clobber passed executable's file header

Do not clobber the buffer space passed from `search_binary_handler' and
originally preloaded by `prepare_binprm' with the executable's file
header by overwriting it with its interpreter's file header.  Instead
keep the buffer space intact and directly use the data structure locally
allocated for the interpreter's file header, fixing a bug introduced in
2.1.14 with loadable module support (linux-mips.org commit beb11695
[Import of Linux/MIPS 2.1.14], predating kernel.org repo's history).
Adjust the amount of data read from the interpreter's file accordingly.

This was not an issue before loadable module support, because back then
`load_elf_binary' was executed only once for a given ELF executable,
whether the function succeeded or failed.

With loadable module support supported and enabled, upon a failure of
`load_elf_binary' -- which may for example be caused by architecture
code rejecting an executable due to a missing hardware feature requested
in the file header -- a module load is attempted and then the function
reexecuted by `search_binary_handler'.  With the executable's file
header replaced with its interpreter's file header the executable can
then be erroneously accepted in this subsequent attempt.

Cc: [email protected] # all the way back
Signed-off-by: Maciej W. Rozycki <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agoFS-Cache: Handle a write to the page immediately beyond the EOF marker
David Howells [Wed, 4 Nov 2015 15:20:42 +0000 (15:20 +0000)]
FS-Cache: Handle a write to the page immediately beyond the EOF marker

Handle a write being requested to the page immediately beyond the EOF
marker on a cache object.  Currently this gets an assertion failure in
CacheFiles because the EOF marker is used there to encode information about
a partial page at the EOF - which could lead to an unknown blank spot in
the file if we extend the file over it.

The problem is actually in fscache where we check the index of the page
being written against store_limit.  store_limit is set to the number of
pages that we're allowed to store by fscache_set_store_limit() - which
means it's one more than the index of the last page we're allowed to store.
The problem is that we permit writing to a page with an index _equal_ to
the store limit - when we should reject that case.

Whilst we're at it, change the triggered assertion in CacheFiles to just
return -ENOBUFS instead.

The assertion failure looks something like this:

CacheFiles: Assertion failed
1000 < 7b1 is false
------------[ cut here ]------------
kernel BUG at fs/cachefiles/rdwr.c:962!
...
RIP: 0010:[<ffffffffa02c9e83>]  [<ffffffffa02c9e83>] cachefiles_write_page+0x273/0x2d0 [cachefiles]

Cc: [email protected] # v2.6.31+; earlier - that + backport of a17754f (at least)
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agocachefiles: perform test on s_blocksize when opening cache file.
NeilBrown [Wed, 4 Nov 2015 15:20:34 +0000 (15:20 +0000)]
cachefiles: perform test on s_blocksize when opening cache file.

cachefiles requires that s_blocksize in the cache is not greater than
PAGE_SIZE, and performs the check every time a block is accessed.

Move the test to the place where the file is "opened", where other
file-validity tests are performed.

Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agoFS-Cache: Don't override netfs's primary_index if registering failed
Kinglong Mee [Wed, 4 Nov 2015 15:20:24 +0000 (15:20 +0000)]
FS-Cache: Don't override netfs's primary_index if registering failed

Only override netfs->primary_index when registering success.

Cc: [email protected] # v2.6.30+
Signed-off-by: Kinglong Mee <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agoFS-Cache: Increase reference of parent after registering, netfs success
Kinglong Mee [Wed, 4 Nov 2015 15:20:15 +0000 (15:20 +0000)]
FS-Cache: Increase reference of parent after registering, netfs success

If netfs exist, fscache should not increase the reference of parent's
usage and n_children, otherwise, never be decreased.

v2: thanks David's suggest,
 move increasing reference of parent if success
 use kmem_cache_free() freeing primary_index directly

v3: don't move "netfs->primary_index->parent = &fscache_fsdef_index;"

Cc: [email protected] # v2.6.30+
Signed-off-by: Kinglong Mee <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agodebugfs: fix refcount imbalance in start_creating
Daniel Borkmann [Wed, 4 Nov 2015 23:01:51 +0000 (00:01 +0100)]
debugfs: fix refcount imbalance in start_creating

In debugfs' start_creating(), we pin the file system to safely access
its root. When we failed to create a file, we unpin the file system via
failed_creating() to release the mount count and eventually the reference
of the vfsmount.

However, when we run into an error during lookup_one_len() when still
in start_creating(), we only release the parent's mutex but not so the
reference on the mount. Looks like it was done in the past, but after
splitting portions of __create_file() into start_creating() and
end_creating() via 190afd81e4a5 ("debugfs: split the beginning and the
end of __create_file() off"), this seemed missed. Noticed during code
review.

Fixes: 190afd81e4a5 ("debugfs: split the beginning and the end of __create_file() off")
Cc: [email protected] # v4.0+
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Al Viro <[email protected]>
9 years agoasus-wmi: fix error handling in store_sys_wmi()
Dan Carpenter [Tue, 10 Nov 2015 22:18:16 +0000 (01:18 +0300)]
asus-wmi: fix error handling in store_sys_wmi()

The asus_wmi_get_devstate_simple() returns 0-1 on success.  In theory
according to static checkers, it can return either -EIO or -ENODEV on
failure.  Currently the error handling code only handles -ENODEV and
-EIO is treated as success.  Let's make it handle the -EIO error as
well.

It's possible that it can't actually return -EIO and this patch is not
needed but in that case this patch is harmless and silences a static
checker warning so it's still worth it.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Darren Hart <[email protected]>
9 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Wed, 11 Nov 2015 05:14:23 +0000 (21:14 -0800)]
Merge branch 'akpm' (patches from Andrew)

Merge final patch-bomb from Andrew Morton:
 "Various leftovers, mainly Christoph's pci_dma_supported() removals"

* emailed patches from Andrew Morton <[email protected]>:
  pci: remove pci_dma_supported
  usbnet: remove ifdefed out call to dma_supported
  kaweth: remove ifdefed out call to dma_supported
  sfc: don't call dma_supported
  nouveau: don't call pci_dma_supported
  netup_unidvb: use pci_set_dma_mask insted of pci_dma_supported
  cx23885: use pci_set_dma_mask insted of pci_dma_supported
  cx25821: use pci_set_dma_mask insted of pci_dma_supported
  cx88: use pci_set_dma_mask insted of pci_dma_supported
  saa7134: use pci_set_dma_mask insted of pci_dma_supported
  saa7164: use pci_set_dma_mask insted of pci_dma_supported
  tw68-core: use pci_set_dma_mask insted of pci_dma_supported
  pcnet32: use pci_set_dma_mask insted of pci_dma_supported
  lib/string.c: add ULL suffix to the constant definition
  hugetlb: trivial comment fix
  selftests/mlock2: add ULL suffix to 64-bit constants
  selftests/mlock2: add missing #define _GNU_SOURCE

9 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 11 Nov 2015 05:11:58 +0000 (21:11 -0800)]
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull misc kbuild updates from Michal Marek:
 "This is the non-critical part of kbuild:

   - several coccinelle updates
   - make deb-pkg creates an armhf package if CONFIG_VFP=y
   - make tags understands some more powerpc macros"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  coccinelle: Improve checking for missing NULL terminators
  coccinelle: ifnullfree: handle various destroy functions
  coccinelle: ifnullfree: various cleanups
  cocinelle: iterators: semantic patch to delete unneeded of_node_put
  deb-pkg: Add automatic support for armhf architecture
  scripts/coccinelle: fix typos
  coccinelle: misc: remove "complex return code" warnings
  Coccinelle: fix incorrect -include option transformation
  coccinelle: tests: improve odd_ptr_err.cocci
  coccinelle: misc: move constants to the right
  scripts/tags.sh: Teach tags about some powerpc macros

9 years agoMerge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 11 Nov 2015 05:06:50 +0000 (21:06 -0800)]
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig updates from Michal Marek:

 - 'make xconfig' ported to Qt5, dropping support for Qt3

 - merge_config.sh supports a single-input-file mode and also respects
   $KCONFIG_CONFIG

 - Fix for incorrect display of >= and > in dependency expressions

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (44 commits)
  Add current selection check.
  Use pkg-config to find Qt 4 and 5 instead of direct qmake
  kconfig: Fix copy&paste error
  kconfig/merge_config.sh: Accept a single file
  kconfig/merge_config.sh: Support KCONFIG_CONFIG
  Update the buildsystem for KConfig finding Qt
  Port xconfig to Qt5 - Update copyright.
  Port xconfig to Qt5 - Fix goParent issue.
  Port xconfig to Qt5 - on Back clicked, deselect old item.
  Port xconfig to Qt5 - Add(back) one click checkbox toggle.
  Port xconfig to Qt5 - Add(back) lineedit editing.
  Port xconfig to Qt5 - Remove some commented code.
  Port xconfig to Qt5 - Source format.
  Port xconfig to Qt5 - Add horizontal scrollbar, and scroll per pixel.
  Port xconfig to Qt5 - Change ConfigItem constructor parent type.
  Port xconfig to Qt5 - Disable ConfigList soring
  Port xconfig to Qt5 - Remove ConfigList::updateMenuList template.
  Port xconfig to Qt5 - Add ConfigList::mode to initializer list.
  Port xconfig to Qt5 - Add ConfigItem::nextItem to initializer list.
  Port xconfig to Qt5 - Tree widget set column titles.
  ...

9 years agoMerge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 11 Nov 2015 04:55:37 +0000 (20:55 -0800)]
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild update from Michal Marek:
 "The kbuild branch for v4.4-rc1 only has one commit: A new make
  kselftest-clean target cleans tools/testing/selftests"

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kselftest: add kselftest-clean rule

9 years agoMerge tag 'linux-kselftest-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 11 Nov 2015 04:46:45 +0000 (20:46 -0800)]
Merge tag 'linux-kselftest-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:
 "This 12 patch update for 4.4-rc1 consists of a new pstore test and
  fixes to existing tests"

* tag 'linux-kselftest-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests: breakpoint: Actually build it
  selftests: vm: Try harder to allocate huge pages
  selftests: Make scripts executable
  selftests: kprobe: Choose an always-defined function to probe
  selftests: memfd: Stop unnecessary rebuilds
  selftests: Add missing #include directives
  selftests/seccomp: Be more precise with syscall arguments.
  selftests/seccomp: build and pass on arm64
  selftests: memfd_test: Revised STACK_SIZE to make it 16-byte aligned
  selftests/pstore: add pstore test scripts going with reboot
  selftests/pstore: add pstore test script for pre-reboot
  selftests: add .gitignore for efivarfs

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Wed, 11 Nov 2015 04:37:28 +0000 (20:37 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Two build fixes, one for VC4, one for nouveau where the ARM only code
  is doing something a bit strange.  While people are discussing that,
  just workaround it and fix the build for now.  The code in question
  will never get used on anything non-ARM anyways.

  Also one fix for AST that SuSE had been hiding in their kernel, that
  allows all fbdev apps to work on that driver"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau: fix build failures on all non ARM.
  drm/ast: Initialized data needed to map fbdev memory
  drm/vc4: Add dependency on HAVE_DMA_ATTRS, and select DRM_GEM_CMA_HELPER

9 years agobtrfs: Use fs_info directly in btrfs_delete_unused_bgs
Zhao Lei [Thu, 8 Oct 2015 10:46:44 +0000 (18:46 +0800)]
btrfs: Use fs_info directly in btrfs_delete_unused_bgs

No need to use root->fs_info in btrfs_delete_unused_bgs(),
use fs_info directly instead.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Fix lost-data-profile caused by balance bg
Zhao Lei [Mon, 9 Nov 2015 03:51:32 +0000 (11:51 +0800)]
btrfs: Fix lost-data-profile caused by balance bg

Reproduce:
 (In integration-4.3 branch)

 TEST_DEV=(/dev/vdg /dev/vdh)
 TEST_DIR=/mnt/tmp

 umount "$TEST_DEV" >/dev/null
 mkfs.btrfs -f -d raid1 "${TEST_DEV[@]}"

 mount -o nospace_cache "$TEST_DEV" "$TEST_DIR"
 btrfs balance start -dusage=0 $TEST_DIR
 btrfs filesystem usage $TEST_DIR

 dd if=/dev/zero of="$TEST_DIR"/file count=100
 btrfs filesystem usage $TEST_DIR

Result:
 We can see "no data chunk" in first "btrfs filesystem usage":
 # btrfs filesystem usage $TEST_DIR
 Overall:
    ...
 Metadata,single: Size:8.00MiB, Used:0.00B
    /dev/vdg        8.00MiB
 Metadata,RAID1: Size:122.88MiB, Used:112.00KiB
    /dev/vdg      122.88MiB
    /dev/vdh      122.88MiB
 System,single: Size:4.00MiB, Used:0.00B
    /dev/vdg        4.00MiB
 System,RAID1: Size:8.00MiB, Used:16.00KiB
    /dev/vdg        8.00MiB
    /dev/vdh        8.00MiB
 Unallocated:
    /dev/vdg        1.06GiB
    /dev/vdh        1.07GiB

 And "data chunks changed from raid1 to single" in second
 "btrfs filesystem usage":
 # btrfs filesystem usage $TEST_DIR
 Overall:
    ...
 Data,single: Size:256.00MiB, Used:0.00B
    /dev/vdh      256.00MiB
 Metadata,single: Size:8.00MiB, Used:0.00B
    /dev/vdg        8.00MiB
 Metadata,RAID1: Size:122.88MiB, Used:112.00KiB
    /dev/vdg      122.88MiB
    /dev/vdh      122.88MiB
 System,single: Size:4.00MiB, Used:0.00B
    /dev/vdg        4.00MiB
 System,RAID1: Size:8.00MiB, Used:16.00KiB
    /dev/vdg        8.00MiB
    /dev/vdh        8.00MiB
 Unallocated:
    /dev/vdg        1.06GiB
    /dev/vdh      841.92MiB

Reason:
 btrfs balance delete last data chunk in case of no data in
 the filesystem, then we can see "no data chunk" by "fi usage"
 command.

 And when we do write operation to fs, the only available data
 profile is 0x0, result is all new chunks are allocated single type.

Fix:
 Allocate a data chunk explicitly to ensure we don't lose the
 raid profile for data.

Test:
 Test by above script, and confirmed the logic by debug output.

Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Fix lost-data-profile caused by auto removing bg
Zhao Lei [Tue, 29 Sep 2015 13:03:54 +0000 (21:03 +0800)]
btrfs: Fix lost-data-profile caused by auto removing bg

Reproduce:
 (In integration-4.3 branch)

 TEST_DEV=(/dev/vdg /dev/vdh)
 TEST_DIR=/mnt/tmp

 umount "$TEST_DEV" >/dev/null
 mkfs.btrfs -f -d raid1 "${TEST_DEV[@]}"

 mount -o nospace_cache "$TEST_DEV" "$TEST_DIR"
 umount "$TEST_DEV"

 mount -o nospace_cache "$TEST_DEV" "$TEST_DIR"
 btrfs filesystem usage $TEST_DIR

We can see the data chunk changed from raid1 to single:
 # btrfs filesystem usage $TEST_DIR
 Data,single: Size:8.00MiB, Used:0.00B
    /dev/vdg        8.00MiB
 #

Reason:
 When a empty filesystem mount with -o nospace_cache, the last
 data blockgroup will be auto-removed in umount.

 Then if we mount it again, there is no data chunk in the
 filesystem, so the only available data profile is 0x0, result
 is all new chunks are created as single type.

Fix:
 Don't auto-delete last blockgroup for a raid type.

Test:
 Test by above script, and confirmed the logic by debug output.

Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Remove len argument from scrub_find_csum
Zhao Lei [Mon, 24 Aug 2015 14:03:02 +0000 (22:03 +0800)]
btrfs: Remove len argument from scrub_find_csum

It is useless.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Reduce unnecessary arguments in scrub_recheck_block
Zhao Lei [Mon, 24 Aug 2015 13:32:06 +0000 (21:32 +0800)]
btrfs: Reduce unnecessary arguments in scrub_recheck_block

We don't need pass so many arguments for recheck sblock now,
this patch cleans them.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Use scrub_checksum_data and scrub_checksum_tree_block for scrub_recheck_block_...
Zhao Lei [Mon, 24 Aug 2015 13:18:02 +0000 (21:18 +0800)]
btrfs: Use scrub_checksum_data and scrub_checksum_tree_block for scrub_recheck_block_checksum

We can use existing scrub_checksum_data() and scrub_checksum_tree_block()
for scrub_recheck_block_checksum(), instead of write duplicated code.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: Reset sblock->xxx_error stats before calling scrub_recheck_block_checksum
Zhao Lei [Mon, 24 Aug 2015 13:10:18 +0000 (21:10 +0800)]
btrfs: Reset sblock->xxx_error stats before calling scrub_recheck_block_checksum

We should reset sblock->xxx_error stats before calling
scrub_recheck_block_checksum().

Current code run correctly because all sblock are allocated by
k[cz]alloc(), and the error stats are not got changed.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: scrub: setup all fields for sblock_to_check
Zhao Lei [Wed, 19 Aug 2015 14:39:18 +0000 (22:39 +0800)]
btrfs: scrub: setup all fields for sblock_to_check

scrub_setup_recheck_block() isn't setup all necessary fields for
sblock_to_check because history reason.

So current code need more arguments in severial functions,
and more local variables, just to passing these lacked values to
necessary place.

This patch setup above fields to sblock_to_check in
scrub_setup_recheck_block(), for:
1: more cleanup for function arg, local variable
2: to make sblock_to_check complete, then we can use sblock_to_check
   without concern about some uninitialized member.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agobtrfs: scrub: set error stats when tree block spanning stripes
Zhao Lei [Tue, 25 Aug 2015 13:31:40 +0000 (21:31 +0800)]
btrfs: scrub: set error stats when tree block spanning stripes

It is better to show error stats to user when we found tree block
spanning stripes.

On a btrfs created by old version of btrfs-convert:
Before patch:
  # btrfs scrub start -B /dev/vdh
  scrub done for 8b342d35-2904-41ab-b3cb-2f929709cf47
          scrub started at Tue Aug 25 21:19:09 2015 and finished after 00:00:00
          total bytes scrubbed: 53.54MiB with 0 errors
  # dmesg
  ...
  [  128.711434] BTRFS error (device vdh): scrub: tree block 27054080 spanning stripes, ignored. logical=27000832
  [  128.712744] BTRFS error (device vdh): scrub: tree block 27054080 spanning stripes, ignored. logical=27066368
  ...

After patch:
  # btrfs scrub start -B /dev/vdh
  scrub done for ff7f844b-7a4e-4b1a-88a9-8252ab25be1b
          scrub started at Tue Aug 25 21:42:29 2015 and finished after 00:00:00
          total bytes scrubbed: 53.60MiB with 2 errors
          error details:
          corrected errors: 0, uncorrectable errors: 2, unverified errors: 0
  ERROR: There are uncorrectable errors.
  # dmesg
  ...omit...
  #

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
9 years agodrm/nouveau: fix build failures on all non ARM.
Dave Airlie [Mon, 9 Nov 2015 22:36:59 +0000 (08:36 +1000)]
drm/nouveau: fix build failures on all non ARM.

gk20a is an ARM only GPU, so we can just do the correct thing on
ARM but fail on other architectures. The other option was to use
SWIOTLB as the define, which means phys_to_page exists, but
this seems clearer.

Signed-off-by: Dave Airlie <[email protected]>
9 years agodrm/ast: Initialized data needed to map fbdev memory
Egbert Eich [Wed, 11 Jun 2014 12:59:55 +0000 (14:59 +0200)]
drm/ast: Initialized data needed to map fbdev memory

Due to a missing initialization there was no way to map fbdev memory.
Thus for example using the Xserver with the fbdev driver failed.
This fix adds initialization for fix.smem_start and fix.smem_len
in the fb_info structure, which fixes this problem.

Requested-by: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Signed-off-by: Egbert Eich <[email protected]>
[pulled from SuSE tree by me - airlied]
Signed-off-by: Dave Airlie <[email protected]>
This page took 0.127271 seconds and 4 git commands to generate.