Commit Graph

601728 Commits

Author SHA1 Message Date
Stefan Agner
3ef79ca6bd ARM: dts: imx7d: use imx7s.dtsi as base device tree
The i.MX 7 series currently consists of two SoCs: i.MX 7Solo and
7Dual. The former has a subset of features of the latter, hence
use imx7s.dtsi as the new base device tree. To keep diffstat nice,
just move imx7d.dtsi to imx7s.dtsi temporarily and recreate
imx7d.dtsi in a second commit.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-28 10:45:23 +08:00
Diego Dorta
d09e6beafa ARM: dts: imx7d-sdb: Add support for touchscreen
Add support for tsc2046 touchscreen.

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-28 09:59:10 +08:00
Diego Dorta
419690556f ARM: dts: imx7d-sdb: Add display support
Add support for the LCD8000-43T display.

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-28 09:59:07 +08:00
Diego Dorta
b754af313f ARM: dts: imx7d: Add SPI support
Add ecspi nodes and aliases.

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-28 09:59:03 +08:00
Ken Lin
fe4b467da6 ARM: dts: imx6q-bx50v3: Add gpio power off support
bx50v3 boards can be powered off via GPIO, this patch specifies the GPIO to
be used with the gpio-poweroff driver.

Signed-off-by: Ken Lin <ken.lin@advantech.com.tw>
Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-28 09:54:10 +08:00
Diego Dorta
6b75a66b6e ARM: dts: imx6ul-pico-hobbit: Fix Ethernet PHY reset GPIO
According to the imx6ul-pico-hobbit schematics the Ethernet PHY reset GPIO
is GPIO1_28, so fix it accordingly.

Also adjust the reset duration to 1ms, because the KSZ8081 datasheet
requires 500μs.

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 10:05:17 +08:00
Soeren Moch
771db6c8ba ARM: dts: imx6q-tbs2910: fix pcie reset polarity
According to Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt the
polarity of "reset-gpio" is assumed to be active-low unless a separate
property "reset-gpio-active-high" is available. So replace the inconsistent
polarity description to make the correct active-low reset behavior more
obvious.

Signed-off-by: Soeren Moch <smoch@web.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:58:17 +08:00
Fabio Estevam
8c4a18e232 ARM: dts: imx6sx-sdb: Use WDOG_B pin reset
imx6sx-sdb has WDOG1_B pin connected to the PMIC.

Pass the 'fsl,ext-reset-output' property so that the watchdog
can trigger a system POR reset via the PMIC.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:55:34 +08:00
Fabio Estevam
50e0299809 ARM: dts: imx6ul-evk: Use WDOG_B pin reset
imx6ul-evk has WDOG1_B pin connected to the PMIC.

Pass the 'fsl,ext-reset-output' property so that the watchdog
can trigger a system POR reset via the PMIC.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:55:31 +08:00
Fabio Estevam
51fd03233d ARM: dts: imx7d-sdb: Use WDOG_B pin reset
imx7d-sdb has WDOG1_B pin connected to the PMIC.

Pass the 'fsl,ext-reset-output' property so that the watchdog
can trigger a system POR reset via the PMIC.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:55:25 +08:00
Fabio Estevam
49607ff7a6 ARM: dts: imx6qdl-sabresd: Use WDOG_B pin reset
imx6qdl-sabresd has WDOG2_B pin connected to the PMIC.

Pass the 'fsl,ext-reset-output' property so that the watchdog
can trigger a system POR reset via the PMIC.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:54:47 +08:00
Christopher Spinrath
3cfb411a64 ARM: dts: utilite-pro: add mmc card slot support
The Utilite Pro has a mmc card slot connected to the usdhc3
controller. There is no card detection until hardware revision 1.3.

Add support for it and signal the controller with the broken-cd
property that polling has to be used to detect a card.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:39:48 +08:00
Valentin Raevsky
5bca20f7fe ARM: dts: imx6q-cm-fx6: fix the operation points
The current ldo settings of the cm-fx6 do not allow 1.2GHz cpu
frequency. At this frequency the module behaves unstable.

But the imx6q fuse indicates that 1.2GHz operation is possible.
Hence, remove the 1.2GHz operation point in the device tree.

Signed-off-by: Valentin Raevsky <valentin@compulab.co.il>
[christopher.spinrath@rwth-aachen.de: enhance commit message, adjust
 remaining operation points to match the ones in imx6q.dtsi and add
 a comment in the device tree]
Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:32:37 +08:00
Peter Chen
74332d7576 ARM: dts: imx6qdl.dtsi: add "arm,shared-override" for pl310
The imx6 SMP system has the same DMA memory coherency issue [1] with
pl310 L2 controller. With this shared override bit set, the customer
reports the DMA coherency issue is gone. Besides, I have tested
the performance using USB ethernet with/without this bit, it shows
no difference.

[1] http://patchwork.ozlabs.org/patch/469362/

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-16 09:01:38 +08:00
Uwe Kleine-König
67c29a81c2 ARM: imx25-pinfunc: remove SION from all modes
With the SION bit set a pin can be read as GPIO even though it's not muxed
as GPIO. This is useful at times. The downside however is that the signal
is not only routed to the GPIO IP but also all other IPs that can make use
of the pin. This resulted in more than one issue for me in the past. Things
like spi transfers that result in usb reenumeration or setting a GPIO to a
value that triggers an RTS irq for an UART.

This convinces me that the SION bit does more harm than good and so all
SION bits are removed that are not known to be needed.

Note that this has no influence on GPIOs under Linux as the gpio-mxc
driver just reports the level the pin is driven to for outputs and not
the level as seen on the pin.

If this commit introduces a regression for you, please report which SION
bit is essential for your setup.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-15 21:42:45 +08:00
Uwe Kleine-König
da4fa6fa80 ARM: imx25-pinfunc: document SION being important for MX25_PAD_SD1_CMD__SD1_CMD
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-15 21:42:29 +08:00
Rajesh Bhagat
6f0808c482 ARM: dts: ls1021a: Add dis_rxdet_inp3_quirk property to USB3 node
Add "dis_rxdet_inp3_quirk" boolean property to USB3 node. This property
is used to disable rx detection in P3 PHY mode.

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 22:10:08 +08:00
Fabio Estevam
f1472f82cc ARM: dts: imx6qdl-sabresd: Pass the correct PCI reset polarity
The PCI reset GPIO is active low, so represent it with the
GPIO_ACTIVE_LOW flag.

Even though the imx6 PCI driver will not take the polarity into account
in this case, it is better to provide a correct description in device-tree.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:36:10 +08:00
Christopher Spinrath
a98704b46b ARM: dts: imx6q-cm-fx6: Relicense under GPLv2/X11
GPLv2-only devicetrees make reuse difficult for software components
licensed under a different license. In particular, the Utilite Pro
devicetree file (which includes imx6q-cm-fx6.dts) is already dual
licensed under GPLv2/X11.

Hence, relicense imx6q-cm-fx6.dts under GPLv2/X11 dual license.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:34:20 +08:00
Christopher Spinrath
1ad257d1c8 ARM: dts: imx6q: add support for the Utilite Pro
The CompuLab Utilite Pro is a miniature fanless desktop pc based on
the i.MX6 Quad powered cm-fx6 module. It features two serial ports,
USB OTG, 4x USB, analog audio and S/PDIF, 2x Gb Ethernet, HDMI and
DVI ports, an on-board 32GB SSD, a mmc slot, and on-board wifi/bt.

Add initial support for it including USB, Ethernet (both ports), sata
and HDMI support.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:34:16 +08:00
Christopher Spinrath
669c940a46 ARM: dts: imx6q: extend support for the cm-fx6
The cm-fx6 module has an on-board spi-flash chip for its firmware, an
eeprom (containing e.g. the mac address of the on-board Ethernet),
a sata port, a pcie controller, an USB hub, and an USB otg port.
Enable support for them. In addition, enable syscon poweroff support.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:33:40 +08:00
Christopher Spinrath
0c3bc8c943 ARM: dts: imx6q-cm-fx6: remove iomuxc container node
The imx6q-cm-fx6 iomuxc container node is not required. Remove it.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:33:01 +08:00
Stefan Wahren
17b35f2872 ARM: dts: imx28-tx28: fix dtc warning
This fixes the following dtc warning by removing the unnecessary unit:

Warning (unit_address_vs_reg): Node /matrix-keypad@0 has a unit name,
but no reg property

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-By: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:21:08 +08:00
Stefan Wahren
88ab101cd2 ARM: dts: imx28-cfa10049: fix dtc warning
This fixes the following dtc warning by removing the unnecessary unit:

Warning (unit_address_vs_reg): Node /onewire@0 has a unit name,
but no reg property

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:21:08 +08:00
Stefan Wahren
7cae24dfe9 ARM: dts: imx28-eukrea-mbmx28lc: add missing reg properties
This patch adds the missing reg properties for the regulator nodes
in order to fix the dtc warnings.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:21:05 +08:00
Stefan Wahren
e57609aa53 ARM: dts: mxs: add missing reg properties for GPIO banks
This patch adds the missing reg properties for the MXS GPIO banks
in order to fix the dtc warnings.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:18:22 +08:00
Lucas Stach
31836adea2 ARM: dts: imx6: add support for Auvidea H100 board
The Auvidea H100 is a baseboard for the SolidRun MicroSOM.
Its primary feature is a Toshiba TC358743 HDMI to CSI decoder,
allowing the board to work as HDMI passthrough and framegrabber.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:10:08 +08:00
Lucas Stach
a28eeb43ee ARM: dts: imx6: tag boards that have the HW workaround for ERR006687
Add the DT property to all boards that have the hardware workaround
for erratum ERR006687 present. This allows the CPUidle driver to use
the deep idle states, even if the FEC is active.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 17:03:44 +08:00
Juergen Borleis
f255f89f93 ARM: dts: imx6: fix IPU1 DI1 node name
This node describes the DI1 port of IPU, fix the node name to reflect this.
There's currently no user of this node in mainline, so this change should
not break any supported platforms.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 14:55:59 +08:00
Fabio Estevam
e5adcb7c8a ARM: dts: imx6ul-14x14-evk: Add LCD and backlight support
Add support for the LCD8000-43T display and for the backlight
controlled via PWM1.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 14:53:17 +08:00
Geert Uytterhoeven
2e7c416cba ARM: dts: imx: Use generic uart-has-rtscts DT property
As of commit 1006ed7e1b ("serial: imx: Use generic uart-has-rtscts
DT property"), the Freescale IMX UART driver recognizes the generic
"uart-has-rtscts" DT property, deprecating the vendor-specific
"fsl,uart-has-rtscts" DT property. Hence replace the latter by the
former in all DTS files.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 14:48:05 +08:00
Geert Uytterhoeven
aee9911181 ARM: dts: imx28: Use generic uart-has-rtscts DT property
As of commit 182cdcb8bb ("serial: mxs-auart: Use generic
uart-has-rtscts DT property"), the Freescale MXS AUART driver recognizes
the generic "uart-has-rtscts" DT property, deprecating the
vendor-specific "fsl,uart-has-rtscts" DT property. Hence replace the
latter by the former in all DTS files.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-11 14:48:00 +08:00
Marek Vasut
542a8d98f1 ARM: dts: mxs: Add SanDisk Sansa Fuze+ support
Add support for this small MP3 player based on STMP3780 (rev.3).
Currently supported are both external microSD and internal SD-NAND
bridge, PWM and USB gadget.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-10 21:03:55 +08:00
Marek Vasut
053034f0a2 ARM: dts: mxs: Add Creative X-Fi3 support
Add support for this small MP3 player based on STMP3780 (rev.4).
Currently supported is both external microSD and internal SD-NAND
bridge, PWM and USB gadget.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-10 21:03:50 +08:00
Marek Vasut
d33c731b8a ARM: dts: mxs: Add AUART2 pinmux
Add 2-pin pinmux settings for AUART2.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-10 21:03:44 +08:00
Marek Vasut
1ebcb168c5 ARM: dts: mxs: Add SSP2 SD mux
Add pinmux configuration for SSP2 port in SD mode, both for
the 4-bit and 8-bit case.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-10 21:03:36 +08:00
Damien Riegel
a059ee7910 ARM: dts: TS-4800: add CAN support
This enables support for the CAN controller located in the FPGA.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-09 23:13:37 +08:00
Damien Riegel
d6535e6a33 ARM: dts: TS-4800: add FPGA's IRQ controller support
Enable FPGA's IRQ controller. It is in charge of dispatching interrupts
generated by IPs in the FPGA. The SoC is notified that an interrupt
occurred through a GPIO.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-09 23:13:32 +08:00
Stefan Agner
97f5c1817b ARM: dts: imx7d-pinfunc: add input mux for UART2 RX DTE mode
Add input mux for UART2 RX in DTE mode. This allows to use the pad
UART2_TX_DATA_ALT0 as UART2 RX. This particular input select seems
to be missing in current reference manuals (Rev. B), but when looking
at the tables and other UART input select registers (e.g. UART3) it
seems naturally that this input mux register also has a fourth pad
option for UART2_TX_DATA_ALT0. It has also been proven to be required
to use UART2 in DTE mode and the particular pads on the Colibri iMX7
platform.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Frank Li  <Frank.Li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:27:49 +08:00
Fabio Estevam
d805adb21f ARM: dts: imx6ul-14x14-evk: Pass "fsl, sai-mclk-direction-output"
Pass "fsl,sai-mclk-direction-output" to the sai2 node, so that the
SAI2_MCLK can be an output.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:24:31 +08:00
Fabio Estevam
fb3239ff03 ARM: dts: imx6ul: Add SAI alias
Add SAI alias entries, which makes it possibe for the SAI driver
to retrieve the port instance.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:24:27 +08:00
Fabio Estevam
298701ec04 ARM: dts: imx: Remove unneeded unit-addresses
Building with W=1 option leads to several warnings like:

Warning (unit_address_vs_reg): Node /soc/aips-bus@02000000/anatop@020c8000/regulator-1p1@110 has a unit name, but no reg property

Fix them by removing the unneeded unit-addresses.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:17:16 +08:00
Peng Fan
d72b7b44f1 ARM: dts: imx6sl: add clocks property for ocotp node
Add clocks property for ocotp node.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:05:29 +08:00
Peng Fan
b8ecd88979 ARM: dts: imx6qdl: add clocks property for ocotp node
Add clocks property for ocotp node.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-06-06 16:05:18 +08:00
Linus Torvalds
1a695a905c Linux 4.7-rc1 2016-05-29 09:29:24 -07:00
George Spelvin
e0ab7af9bd hash_string: Fix zero-length case for !DCACHE_WORD_ACCESS
The self-test was updated to cover zero-length strings; the function
needs to be updated, too.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Fixes: fcfd2fbf22 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-29 07:33:47 -07:00
George Spelvin
f2a031b66e Rename other copy of hash_string to hashlen_string
The original name was simply hash_string(), but that conflicted with a
function with that name in drivers/base/power/trace.c, and I decided
that calling it "hashlen_" was better anyway.

But you have to do it in two places.

[ This caused build errors for architectures that don't define
  CONFIG_DCACHE_WORD_ACCESS   - Linus ]

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: fcfd2fbf22 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 22:34:33 -07:00
Mikulas Patocka
037369b872 hpfs: implement the show_options method
The HPFS filesystem used generic_show_options to produce string that is
displayed in /proc/mounts.  However, there is a problem that the options
may disappear after remount.  If we mount the filesystem with option1
and then remount it with option2, /proc/mounts should show both option1
and option2, however it only shows option2 because the whole option
string is replaced with replace_mount_options in hpfs_remount_fs.

To fix this bug, implement the hpfs_show_options function that prints
options that are currently selected.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
Mikulas Patocka
01d6e08711 affs: fix remount failure when there are no options changed
Commit c8f33d0bec ("affs: kstrdup() memory handling") checks if the
kstrdup function returns NULL due to out-of-memory condition.

However, if we are remounting a filesystem with no change to
filesystem-specific options, the parameter data is NULL.  In this case,
kstrdup returns NULL (because it was passed NULL parameter), although no
out of memory condition exists.  The mount syscall then fails with
ENOMEM.

This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.

The patch also changes the call to replace_mount_options - if we didn't
pass any filesystem-specific options, we don't call
replace_mount_options (thus we don't erase existing reported options).

Fixes: c8f33d0bec ("affs: kstrdup() memory handling")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org	# v4.1+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
Mikulas Patocka
44d51706b4 hpfs: fix remount failure when there are no options changed
Commit ce657611ba ("hpfs: kstrdup() out of memory handling") checks if
the kstrdup function returns NULL due to out-of-memory condition.

However, if we are remounting a filesystem with no change to
filesystem-specific options, the parameter data is NULL.  In this case,
kstrdup returns NULL (because it was passed NULL parameter), although no
out of memory condition exists.  The mount syscall then fails with
ENOMEM.

This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.

The patch also changes the call to replace_mount_options - if we didn't
pass any filesystem-specific options, we don't call
replace_mount_options (thus we don't erase existing reported options).

Fixes: ce657611ba ("hpfs: kstrdup() out of memory handling")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00