Li Jun [Thu, 15 Jan 2015 11:13:13 +0000 (19:13 +0800)]
MLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep
i.MX6SX mega off can shutdown domain power supply if none of peripheral
in this domain is registered as wakeup source, this patch adds usb controller
imx specific re-init after resume from such power lost during system sleep.
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit
cd37f9b7157322e28c1d336e42813d441eb1f778)
Li Jun [Fri, 9 Jan 2015 13:58:41 +0000 (21:58 +0800)]
MLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6
The usb controller driver creates usb charger, and notify
the charger connect and disconnect using vbus connect and
disconnect event.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit
da98a621a79b6febf4e072ffb99e16e20b5bc36a)
Li Jun [Wed, 14 Jan 2015 05:12:04 +0000 (13:12 +0800)]
MLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode
Use b_sess_valid_event for charger detection in otg fsm mode.
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit
a89ac6eb611277e140fae0ef4ebe97e1a75fb4cc)
Li Jun [Fri, 9 Jan 2015 07:35:07 +0000 (15:35 +0800)]
MLK-10085-5 usb: chipidea: Add usb charger detect notify
- Change .notify's return value from void to int, update msm notify_event
return value accordingly.
- Add CI_HDRC_CONTROLLER_VBUS_EVENT and
CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
detection flow.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
Li Jun [Fri, 9 Jan 2015 06:37:24 +0000 (14:37 +0800)]
MLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
It is used to indicate whether we use SoC's usb charger
detection or not. Besides, we add anatop phandle since
we need to use anatop register to do most of charger detect operations.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Li Jun [Fri, 9 Jan 2015 06:27:07 +0000 (14:27 +0800)]
MLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node
Add anatop phandle at usbotg node to access anatop register.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Peter Chen [Tue, 14 Jul 2015 07:43:02 +0000 (15:43 +0800)]
MLK-11340-8 usb: chipidea: host: delete the redundancy ci_hdrc struct
The struct ci_hdrc is the drvdata for hcd device, so we don't
need to introduce extra ci_hdrc structure for ehci.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit
144247425683f783888e2a384946d05962237b60)
Peter Chen [Wed, 15 Jul 2015 05:56:26 +0000 (13:56 +0800)]
MLK-11340-5 usb: chipidea: otg_fsm: delete duplicated controller reset
At host_stop, it will call usb_remove_hcd, and reset controller later.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit
b574ec92b3fcf70743a7467cfc832c7c1b0fe904)
Peter Chen [Fri, 8 Aug 2014 01:12:52 +0000 (09:12 +0800)]
MLK-11340-40 usb: whitelist: update otg & eh's TPL for fsl i.mx
The default TPL is for USB OTG & EH compliance test, the supported
class is: mass storage, hub, and hid.
Besides, we add one match criterion that matching targeted device
through class at interface descriptor.
Tested-by: Li Jun <b47624@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit
483c071d989ceb36cacf76e1e3e779c67e5b8280)
Li Jun [Mon, 23 Jun 2014 07:50:50 +0000 (15:50 +0800)]
MLK-11340-31 usb: chipidea: udc: add OTG status request handling
Peripheral answers OTG status selector request from host according to
host request flag of gadget, length is 1. this flag may be set by application
via sysfs.
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit
c08edfce9dded6a49d3127179d5f0a036ddb99aa)
Peter Chen [Mon, 16 Sep 2013 08:31:24 +0000 (16:31 +0800)]
MLK-11340-26 usb: phy: add notify suspend and resume callback
They are used to notify PHY that the controller enters suspend
or finishes resume.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit
737908259ccc3c3166a51ed8e3638ac1f1730e08)
Fabio Estevam [Sat, 9 May 2015 15:15:24 +0000 (12:15 -0300)]
MLK-11340-1 usb: chipidea: usbmisc_imx: Remove unneeded semicolon
Remove unneeded semicolon.
The semantic patch that makes this change is available
in scripts/coccinelle/misc/semicolon.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Rob Herring [Fri, 29 May 2015 16:38:46 +0000 (11:38 -0500)]
usb: chipidea: add work-around for Marvell HSIC PHY startup
The Marvell 28nm HSIC PHY requires the port to be forced to HS mode after
the port power is applied. This is done using the test mode in the PORTSC
register.
As HSIC is always HS, this work-around should be safe to do with all HSIC
PHYs and has been tested on i.MX6S.
Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Peter Chen <Peter.Chen@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Robin Gong [Mon, 15 Jun 2015 04:43:47 +0000 (12:43 +0800)]
MLK-11110: cpufreq: imx7-cpufreq: fix system resume failed
System resume failed easily after commit
b993956109856d3, the commit is no
problem, but it exposes the potential deadlock bug which not unlock mutex if
cpufreq not change, remove these code since the cpufreq framwork has consider
it.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit
d791bf25e07023f7a936fcabe6f641ad391048b3)
Bai Ping [Tue, 9 Jun 2015 15:42:50 +0000 (23:42 +0800)]
MLK-11071 cpufreq: imx7: add cpufreq pm_notifier on imx7d
Add pm_notifier for cpufreq on i.MX7D to make sure when
system do suspend/resume no cpu frequency change.
cpu frequency change may use the I2C/SPI interface to
control the external PMIC chip, if the I2C/SPI are not
active in this procedure, frequency change will fail.
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
b993956109856d3b86df501271b5a55620781c1a)
Bai Ping [Mon, 2 Mar 2015 16:44:04 +0000 (00:44 +0800)]
MLK-10257-05 arm: imx7: enable cpufreq driver in defconfig
Enable the imx7 cpufreq driver in defconfig.
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
88d8fe5196ce424467b5b747977af404427c4ef2)
Bai Ping [Thu, 12 Feb 2015 17:05:07 +0000 (01:05 +0800)]
MLK-10257-04 cpufreq: imx7: Add cpufreq support for imx7D
Add the basic cpufreq driver for imx7.
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
db765324267a7c3b93aaf798cefd6a775cf46b1a)
Bai Ping [Thu, 12 Feb 2015 17:02:03 +0000 (01:02 +0800)]
MLK-10257-03 arm: imx7: Add cpufreq platform device
Add cpufreq platform device support for DVFS.
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
27642021d28555c37aab5e2b75214d8c383f668d)
Bai Ping [Mon, 2 Mar 2015 09:52:27 +0000 (17:52 +0800)]
MLK-10257-01 arm: dts: Add operating-points property for cpu node
Add operating-points, clks and regulators property used in DVFS
Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit
f13001e89f5b64750735fd190a8316d8ee800d36)
Bai Ping [Wed, 5 Aug 2015 16:27:47 +0000 (00:27 +0800)]
MLK-11322-02 ARM: imx: add io map for pm code
add necessary io memory mapping used by power management.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Wed, 5 Aug 2015 19:37:44 +0000 (03:37 +0800)]
MLK-11322-01 ARM: dts: imx: add ocram node used for lpm code
Reserve iram space for low power code. The first 16KB space
is used for suspend/resume and cpuidle. Another 4KB space is
for busfreq code.
for i.MX6SX, it has a dedicated ocram space start at 0x8f8000
for low power code.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Wed, 5 Aug 2015 17:37:35 +0000 (01:37 +0800)]
MLK-11323-03 ARM: defconfig: unselect ARMv6 support in v7 defconfig
In imx_v7_defconfig file, no need to enable the ARMv6 support.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Wed, 5 Aug 2015 17:34:30 +0000 (01:34 +0800)]
MLK-11323-02 ARM: defconfig: enable the snvs_pwrkey support
Enable the snvs_pwrkey driver support.
Signed-off-by: Bai Ping <b51503@freescale.com>
Fancy Fang [Thu, 6 Aug 2015 07:29:15 +0000 (15:29 +0800)]
MLK-11327 dma: pxp: porting pxp dma driver to imx_4.1.y
Porting pxp dma drivers v2 and v3 to imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Richard Zhu [Mon, 27 Jul 2015 05:59:55 +0000 (13:59 +0800)]
MLK-11286-3 rpmsg: imx: enable rpmsg tests on imx
enable the rpmsg pingpong and tty string echo tests
on imx amp socs
- pingpong test howto
insmod imx_rpmsg_pingpong.ko
- tty string echo test howto
- step 1, load the imx_rpmsg_tty.ko
insmod imx_rpmsg_tty.ko
- step 2, lanunch the mxc_mcc_tty_test.out in backend
./mxc_mcc_tty_test.out /dev/ttyRPMSG 115200 R 512 512 &
- step 3, issue the echo command
echo <string> > /dev/ttyRPMSG
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
Richard Zhu [Wed, 5 Aug 2015 06:20:21 +0000 (14:20 +0800)]
MLK-11286-2 ARM: dts: enable rpmsg support on imx7d
- enable rpmsg on imx7d platforms
- since there are some modules conflictions between A# and m4,
add new *-m4.dts files, that used when m4 core is kicked off.
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
Richard Zhu [Wed, 5 Aug 2015 06:17:40 +0000 (14:17 +0800)]
MLK-11286-1 ARM: imx: enable rpmsg on imx amp platforms
enable rpmsg on imx amp platforms
- use MU receive interrupter as the notify of the multi-cores.
- add the MU root clock support on imx7d
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
[Octavian: select VIRTIO_RPMGS, fix for VIRTIO_RPMSG_F_NS removal]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Fancy Fang [Tue, 4 Aug 2015 09:23:45 +0000 (17:23 +0800)]
MLK-11318-5: video: mxsfb: porting mxsfb driver to imx_4.1.y branch
Porting mxsfb driver to imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Fancy Fang [Tue, 4 Aug 2015 08:08:51 +0000 (16:08 +0800)]
MLK-11318-4 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for pwm backlight
Add dts support for pwm backlight on imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Fancy Fang [Tue, 4 Aug 2015 08:05:20 +0000 (16:05 +0800)]
MLK-11318-3 ARM: dts: imx7d-12x12-lpddr3-arm2: add dts support for lcdif
Add dts support for lcdif on imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Fancy Fang [Tue, 4 Aug 2015 07:51:54 +0000 (15:51 +0800)]
MLK-11318-2 ARM: dts: imx7d-sdb: add dts support for pwm backlight
Add dts support for pwm backlight on imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Fugang Duan [Tue, 18 Aug 2015 03:28:08 +0000 (11:28 +0800)]
MLK-11317-02 ARM: imx: imx6ul: add enet init for i.mx6ul
Add enet MAC address init.
The patch is merged from commit:
67cfceab0b77e887910f11dda13ab3a98bb0d87a
Signed-off-by: Fugang Duan <B38611@freescale.com>
Bai Ping [Fri, 31 Jul 2015 14:06:36 +0000 (22:06 +0800)]
MLK-11300-06 ARM: configs: enable imx6ul in defconfig
Enable the i.MX6UL SOC support in the defconfig file.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Fri, 31 Jul 2015 10:55:38 +0000 (18:55 +0800)]
MLK-11300-05 ARM: imx: add pm support for imx6ul
Add basic pm suspend/resume support for i.MX6UL.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Wed, 29 Jul 2015 18:22:13 +0000 (02:22 +0800)]
MLK-11300-04 ARM: imx: add gpt timer support on imx6ul
Add gpt-timer for i.MX6UL SOC.
Signed-off-by: Bai Ping <b51503@freescale.com>
Bai Ping [Wed, 29 Jul 2015 17:33:13 +0000 (01:33 +0800)]
MLK-11300-02 ARM: dts: imx: add imx6ul board dts support
Add i.MX6UL board support dts file for boards:
* imx6ul-14X14-evk.dts
* imx6ul-14x14-ddr3-arm2.dts
Signed-off-by: Ye.Li <Ye.Li@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
[Octavian: merge with upstream, prefer upstrem in case of conflict]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Bai Ping [Thu, 30 Jul 2015 14:22:26 +0000 (22:22 +0800)]
MLK-11300-01 ARM: dts: imx: add imx6ul dtsi support.
Add i.MX6UL SOC dtsi file.
Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Bai Ping <b51503@freescale.com>
[Octavian: merge 4.1.y into upstream keeping upstream values where values are different]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Sandor Yu [Fri, 20 Mar 2015 06:58:20 +0000 (14:58 +0800)]
MLK-10449-1: 74x164: Add new property registers-default
For some platform such as imx7D SDB, one pin of 74x164 to
control all peripheral power supply(PERI_3V_EN).
The pin should keep in high voltage level when 74x164 loading,
otherwise the module depend on PERI_3V3 will lose power.
So add new property registers-default into 74x164 driver.
Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)
Shawn Guo [Sun, 14 Jul 2013 13:52:38 +0000 (21:52 +0800)]
MLK-11293: gpio: pca953x: add device_reset() call
The pca953x type of devices, e.g. max7310, may have a reset which needs
to be handled to get the device start working. Add a device_reset()
call for that, and defer the probe if the reset controller for that is
not ready yet.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
d3264091b30b777d94a18efda9823a06668d5b10)
Fugang Duan [Tue, 28 Jul 2015 03:13:20 +0000 (11:13 +0800)]
MLK-10447-03: ARM: imx_v7_defconfig: Add spi gpio and gpio 74x164
Enable CONFIG_SPI_GPIO and CONFIG_GPIO_74X164 to imx_v7_defconfig.
Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
a551a35455d14d265ce7aeb4a0e6081303f43fec)
Fugang Duan [Tue, 28 Jul 2015 03:09:20 +0000 (11:09 +0800)]
MLK-10447-01: dts: imx7d sdb: Add 74LV595 driver
-74LV595 function compatible with 74HC595, add 74HC595
driver into imx7d sdb dts.
-74LV595 register as a GPIO device and access 74LV595 chip
by SPI GPIO, so add spi_gpio driver into imx7 sdb dts.
Signed-off-by: Sandor Yu <R01008@freescale.com>
igned-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)
Fugang Duan [Fri, 6 Feb 2015 08:42:46 +0000 (16:42 +0800)]
MLK-10463-1 ARM: imx: init ENET RGMII tx clock source
Init ENET RGMII tx clock source, set GPR5[9] to select clock from
internal PLL_enet. And set phy VDDIO to 1.8V that get better signal
quality.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
d7a171fcf5218166f558428610ca8e9cb9f7e830)
Fugang Duan [Wed, 14 Jan 2015 08:18:58 +0000 (16:18 +0800)]
MLK-10098 ARM: imx: fix 1588 clock init
The enet clock define is changed as there has no "enet_ref" clock name.
If the tx_clk is sourced from SOC anatop PLL, user define the clock id
in devicetree. So we only to judge the ptp clock valid and then set the
related GPR bit.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
01ed2a839d9b76ccb4113dc2a04af4a33b33de22)
Fugang Duan [Thu, 25 Dec 2014 09:17:49 +0000 (17:17 +0800)]
MLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default
Disable ethernet phy AR8031 EEE mode in default to reduce the IEEE1588
latency.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Fugang Duan [Wed, 15 Oct 2014 01:36:40 +0000 (09:36 +0800)]
MLK-9694 ARM: imx6: init enet MAC address
Enet get MAC address order:
From module parameters or kernel command line -> device tree ->
pfuse -> mac registers set by bootloader -> random mac address.
When there have no "fec.macaddr" parameters set in kernel command
line, enet driver get MAC address from device tree. And then if
the MAC address set in device tree and is valid, enet driver get
MAC address from device tree. Otherwise,enet get MAarch/arm/mach-imx
/mach-imx6q.cC address from
pfuse. So, in the condition, update the MAC address (read from pfuse)
to device tree.
Cherry-pick & Merge patches from:
149ac988a25b8d8eb86d05679cbb7b42819ff7a1 &
3269e5c06bdb2f7ab9bd5afa9bbfe46d872197d3
Signed-off-by: Fugang Duan <B38611@freescale.com>
Fugang Duan [Mon, 27 Jul 2015 10:56:07 +0000 (18:56 +0800)]
MLK-11290 ARM: dts: imx7d-12x12-lpddr3-arm2: add enet, i2c, max7322 support
Add enet1, enet2, i2c1~4, max7322 support.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Gao Pan [Wed, 1 Jul 2015 06:38:20 +0000 (14:38 +0800)]
MLK-11206: input: misc: fxls8471: support ±2g/±4g/±8g dynamically selection
Support ±2g/±4g/±8g dynamically selection for motion sensor fxls8471.
Set the sensor mode to standby mode before changing the scale range
with the command "echo 0 > enable". The scale range can be changed
with the command "echo 0/1/2 > range".
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
6824cff93d368eafbf96c71fad541f9bc2502e3a)
Gao Pan [Fri, 3 Jul 2015 08:31:38 +0000 (16:31 +0800)]
MLK-11218: misc: fxos8700: support ±2g/±4g/±8g dynamically
Support ±2g/±4g/±8g dynamically selection for motion sensor fxos8700.
Set the sensor mode to standby mode before changing the scale range
with the command "echo 0 > enable". The scale range can be changed
with the command "echo 0/1/2 > range".
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
74c9af0a5806fb5c926ffdab3145fc1680fc87e6)
Fugang Duan [Mon, 27 Jul 2015 09:38:14 +0000 (17:38 +0800)]
MLK-10947 ARM: imx_v7_defconfig: enable fxls8471 in defconfig
Enable fxls8471 in defconfig.
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
692ff04d68f953d4534f27c6c4529e46b1a48518)
gaopan [Thu, 21 May 2015 06:50:47 +0000 (14:50 +0800)]
MLK-10948 input: misc: fxls8471: add motion sensor fxls8471
Add Freescale fxls8471 motion sensor.
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
20cfe2d9d9305559e35fe2e508d5a70b057ffc70)
gaopan [Tue, 12 May 2015 10:25:29 +0000 (18:25 +0800)]
MLK-10893: i2c: imx: add irqf_no_suspend
The i2c irq is masked when pcie starts a i2c transfer process
during noirq suspend stage. As a result, i2c transfer fails.
To solve the problem, IRQF_NO_SUSPEND is added to i2c bus.
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherrt picked from commit:
ab13b0e11c50021905de00a0f3c0df7e0a36a3f0)
Fugang Duan [Wed, 6 May 2015 02:02:42 +0000 (10:02 +0800)]
MLK-10835-5 ARM: imx_v7_defconfig: enable mpl3115,fxas2100x and fxos8700 in defconfig
Enable mpl3115,fxas2100x and fxos8700 sensors in defconfig.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
275be06ee31ffd0b9c2c12fb7e563a6b060bf5a2)
Fugang Duan [Tue, 5 May 2015 12:36:58 +0000 (20:36 +0800)]
MLK-10835-3 input: misc: mpl3115: add Freescale MPL3115 pressure temperature sensor
Add Freescale MPL3115 pressure temperature sensor.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
a8c2904a442e1aa163b8562e1a940c8755ab3898)
Fugang Duan [Tue, 5 May 2015 10:58:55 +0000 (18:58 +0800)]
MLK-10835-2 misc: fxos8700: add Freescale FXOS8700 6-Axis Acc and Mag Combo Sensor
Add Freescale FXOS8700 6-Axis Acc and Mag Combo Sensor
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
c0ca56bbf3f8503a858d15bb14f27652ae6612eb)
Fugang Duan [Tue, 5 May 2015 09:08:34 +0000 (17:08 +0800)]
MLK-10835-1 misc: fxas2100x: add Freescale FXAS2100X gyroscope sensor
Add Freescale FXAS2100X gyroscope sensor
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
34a99f00d4886f95a8cf8cd4acbf37a82c67e46c)
Fugang Duan [Mon, 27 Jul 2015 08:41:32 +0000 (16:41 +0800)]
MLK-10833-3 imx_v7_defconfig: enable mag3110 by default
Enable mag3110 driver in default config.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
ac43097186e94d5ecfdbc3c6a514aa20e5a7f8ca)
Fugang Duan [Wed, 6 May 2015 11:37:44 +0000 (19:37 +0800)]
MLK-10833-2 hwmon: mag3110: use global variable instead of macro define
Use global variable instead of macro "MAG3110_IRQ_USED" that is more
flexible.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Luwei Zhou [Tue, 16 Sep 2014 05:05:41 +0000 (13:05 +0800)]
MLK-10833-1 hwmon: mag3110: Add mag3110 driver support on i.MX6Q/DL/SX platform.
Add mag3110 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
dd027baab7652c62d26f1749f334099e4dbe61c9)
Fugang Duan [Mon, 27 Jul 2015 08:28:48 +0000 (16:28 +0800)]
MLK-10369 ARM: dts: Add i2c bus support for i.MX7d-sdb board
- Add i2c1,2,3,4 bus support for i.MX7d-sdb board (i2c4 bus need to
rework: swap R485 and R33).
- Add i2c device PMIC support.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
45acb911f7192fcc574f1e0faaf19513b9879046)
Fugang Duan [Mon, 27 Jul 2015 06:38:38 +0000 (14:38 +0800)]
MLK-11288 ARM: dts: imx7d-sdb: add fec1, fec2 support
Add fec1, fec2 support for i.MX7d-sdb board.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Fugang Duan [Mon, 27 Jul 2015 07:40:00 +0000 (15:40 +0800)]
MLK-10919 net: phy: micrel: add ksz8081 resume function
Add ksz8081 resume function since the phy has some non-standard
register init process that has some fixup.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
65c6e997b8e020b9e87d1af23c94c15c13e3d2e3)
Fugang Duan [Tue, 19 May 2015 03:03:55 +0000 (11:03 +0800)]
MLK-10920 ARM: imx_v7_defconfig: enable MICREL phy
Enable CONFIG_MICREL_PHY for MICREL PHY since i.MX6ul boards install
micrel ksz8081 phy.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
626d87758e1724ff92708da11e8af0081bb69ce9)
Fugang Duan [Mon, 27 Jul 2015 06:53:21 +0000 (14:53 +0800)]
MLK-10472-2 ARM: imx_v7_defconfig: enable max7322 in default config
Enable max7322 extention gpio driver in config
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from commit:
575b7e4c2f85b08fb09d6a639adb404718b9b644)
Fugang Duan [Wed, 22 Jul 2015 04:42:40 +0000 (12:42 +0800)]
MLK-11274 net: fec: add mii bus up_failed flag to reflect the real status
Add mii bus up_failed flag to reflect the real mii bus status.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Reported-and-tested-by: Zhang Sanshan <B51434@freescale.com>
(cherry picked from commit:
ea348e597501d44841a28d8ee099361e89d63520)
Fugang Duan [Wed, 20 May 2015 10:36:19 +0000 (18:36 +0800)]
MLK-10939-01 net: fec: add stop mode support for dts register set
The current driver support stop mode by calling machine api.
The patch add dts support to set gpr register for stop request.
After magic pattern comming during system suspend status, system will
be waked up, and irq handler will be running, there have enet register
access. Since all clocks are disabled in suspend, and clocks are enabled
after resume function. But irq handler run before resume function.
For imx7d chip, access register need some clocks enabled, otherwise system
hang. So the patch also disable wake up irq in the suspend, after resume
back enable the irq, which can avoid system hang issue.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry pick and merge from commit:
8da4f80af0913781a4f9d50917c1dd66180e519d)
Anson Huang [Thu, 23 Apr 2015 11:04:10 +0000 (19:04 +0800)]
MLK-10724-6 net: fec: add i.mx6ul enet support
i.MX6UL enet is the lite edition of i.MX6Q enet,
don't support Gbps mode.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
32a2c3878322d8322a29c52af18de7707134ca1c)
Fugang Duan [Wed, 10 Dec 2014 05:46:08 +0000 (13:46 +0800)]
MLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume back
i.MX6SX-AI board has two enet MACs (MAC0 and MAC1), they share MAC0 MII
bus. When PHY0 don't connect to enet MAC0, MAC0 mii bus probe phy0 failed,
and the net interface is set to unattach mode. During suspend resume test,
driver don't reinit MAC0 after resume back, so MII bus don't work that causes
MAC1 also cannot access PHY1.
The patch just is workaround that reinit MAC0 MII bus for MAC1 using.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
b730adeef4f9b44e302c793cbef35ea74f24fbef)
Fugang Duan [Tue, 14 Oct 2014 08:44:57 +0000 (16:44 +0800)]
MLK-9691 net: fec: call .pm_qos_remove_request() in .ndo_stop() callback
Call .pm_qos_remove_request() in .ndo_stop() callback to avoid kernel
warning during enet open/close test.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
f81c176d36b8189220a729d723801d2cdd495108)
Fugang Duan [Fri, 10 Oct 2014 08:25:26 +0000 (16:25 +0800)]
MLK-11285-02 net:fec: add enet AVB Ubuntu Gstreamer demo support
Support Gstreamer AVB demo support.
ring1 -> ClassA, ring2 -> ClassB, ring0 -> Best Effort
For QoS: ring1 > ring2 > ring0
For bandwidth reverse:
50% bandwidth -> ClassA
33% bandwidth -> ClassB
17% bandwidth -> Best effort queue
In general, ClassA run audio, ClassB run video.
Since AVB demo use big bandwidth streaming, video cost more than
33Mbps bandwidth, and with Qos limitation: ClassA >= ClassB > Best effort,
so we have to change ring2 bandwidth equal to ring1 bandwidth (50%).
After validate on FPGA, AVB demo can work fine for audio and video.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit
93d6579a7b3d2dafa721c835df5d5f7d30ed386e)
Shawn Guo [Mon, 15 Sep 2014 03:20:58 +0000 (11:20 +0800)]
MLK-11285-01 net: fec: handle WAIT mode issue for imx6qdl
This is a combination of commits
919d46e37e04 (ENGR00265935 net: fec:
add pm_qos to avoid cpu enter to wait mode) and
8a12c90c9974
(ENGR00313685-14 net: fec: check workaround for FEC_QUIRK_BUG_WAITMODE)
from imx_3.10.y branch. It's added for imx_3.14.y branch to work around
imx6qdl issue ERR006687 (ENET: Only the ENET wake-up interrupt request
can wake the system from Wait mode).
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
(cherry-pick and merge from commit:
4f406fae257cc7945a0e3a425213440bb12ba345)
Anson Huang [Wed, 22 Jul 2015 02:40:07 +0000 (10:40 +0800)]
MLK-11265-11 ARM: configs: enable imx7d soc support by default
Enable CONFIG_SOC_IMX7D by default.
Signed-off-by: Anson Huang <b20788@freescale.com>
Anson Huang [Mon, 20 Jul 2015 09:00:16 +0000 (17:00 +0800)]
MLK-11265-10 ARM: configs: add imx v7 support
Add imx_v7_defconfig and imx_v7_mfg_defconfig support
for V7 only.
Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Anson Huang [Thu, 27 Oct 2016 12:33:59 +0000 (15:33 +0300)]
MLK-11265-7 ARM: imx: add smp support for imx7d
Add SMP support for i.MX7D, including CPU hotplug support.
Signed-off-by: Anson Huang <b20788@freescale.com>
Octavian Purdila [Thu, 27 Oct 2016 12:15:25 +0000 (15:15 +0300)]
MLK-11265-8 ARM: imx: add pm support for imx7d
Add i.MX7D suspend/resume support, including standby
and mem mode support, mega/fast mix off and DDR
retention support.
Signed-off-by: Anson Huang <b20788@freescale.com>
Anson Huang [Mon, 20 Jul 2015 08:59:24 +0000 (16:59 +0800)]
MLK-11265-9 ARM: imx: add ddrc driver support
i.MX7D has a new IP block of DDR controller called
DDRC, add driver for this module.
Signed-off-by: Anson Huang <b20788@freescale.com>
Anson Huang [Thu, 27 Oct 2016 10:55:15 +0000 (13:55 +0300)]
MLK-11265-6 ARM: imx: add imx7d msl support
Add MSL support for new SoC i.MX7D.
Signed-off-by: Anson Huang <b20788@freescale.com>
[Octavian: update upstream with minimal diff from mx_4.1.y to allow compile]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Anson Huang [Wed, 22 Jul 2015 02:35:01 +0000 (10:35 +0800)]
MLK-11265-2 ARM: dts: add imx7d board dtb
Add i.MX7D 12x12 LPDDR3 ARM2 board and SabreSD board
dtb support.
Signed-off-by: Anson Huang <b20788@freescale.com>
Anson Huang [Wed, 22 Jul 2015 02:34:02 +0000 (10:34 +0800)]
MLK-11265-1 ARM: dts: add imx7d soc dtsi support
Add new SoC i.MX7D dtsi and pinfunc head file.
Signed-off-by: Anson Huang <b20788@freescale.com>
Greg Kroah-Hartman [Sun, 18 Mar 2018 10:18:56 +0000 (11:18 +0100)]
Linux 4.9.88
Koen Vandeputte [Wed, 7 Mar 2018 16:46:39 +0000 (10:46 -0600)]
PCI: dwc: Fix enumeration end when reaching root subordinate
commit
fc110ebdd014dd1368c98e7685b47789c31fab42 upstream.
The subordinate value indicates the highest bus number which can be
reached downstream though a certain device.
Commit
a20c7f36bd3d ("PCI: Do not allocate more buses than available in
parent") ensures that downstream devices cannot assign busnumbers higher
than the upstream device subordinate number, which was indeed illogical.
By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a
value of 0x01.
Due to this combined with above commit, enumeration stops digging deeper
downstream as soon as bus num 0x01 has been assigned, which is always the
case for a bridge device.
This results in all devices behind a bridge bus remaining undetected, as
these would be connected to bus 0x02 or higher.
Fix this by initializing the RC to a subordinate value of 0xff, which is
not altering hardware behaviour in any way, but informs probing function
pci_scan_bridge() later on which reads this value back from register.
The following nasty errors during boot are also fixed by this:
pci_bus 0000:02: busn_res: can not insert [bus 02-ff] under [bus 01] (conflicts with (null) [bus 01])
...
pci_bus 0000:03: [bus 03] partially hidden behind bridge 0000:01 [bus 01]
...
pci_bus 0000:04: [bus 04] partially hidden behind bridge 0000:01 [bus 01]
...
pci_bus 0000:05: [bus 05] partially hidden behind bridge 0000:01 [bus 01]
pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 05
pci_bus 0000:02: busn_res: can not insert [bus 02-05] under [bus 01] (conflicts with (null) [bus 01])
pci_bus 0000:02: [bus 02-05] partially hidden behind bridge 0000:01 [bus 01]
Fixes:
a20c7f36bd3d ("PCI: Do not allocate more buses than available in
parent")
Tested-by: Niklas Cassel <niklas.cassel@axis.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Cc: stable@vger.kernel.org # v4.15+
Cc: Binghui Wang <wangbinghui@hisilicon.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jianguo Sun <sunjianguo1@huawei.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Minghuan Lian <minghuan.Lian@freescale.com>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Xiaowei Song <songxiaowei@hisilicon.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
[fabio: adapted to the file location of 4.9 kernel]
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greentime Hu [Tue, 13 Feb 2018 09:09:08 +0000 (17:09 +0800)]
earlycon: add reg-offset to physical address before mapping
commit
1f66dd36bb18437397ea0d7882c52f7e3c476e15 upstream.
It will get the wrong virtual address because port->mapbase is not added
the correct reg-offset yet. We have to update it before earlycon_map()
is called
Signed-off-by: Greentime Hu <greentime@andestech.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: stable@vger.kernel.org
Fixes:
088da2a17619 ("of: earlycon: Initialize port fields from DT properties")
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sebastian Andrzej Siewior [Sat, 3 Feb 2018 11:27:23 +0000 (12:27 +0100)]
serial: core: mark port as initialized in autoconfig
commit
714569064adee3c114a2a6490735b94abe269068 upstream.
This is a followup on
44117a1d1732 ("serial: core: mark port as
initialized after successful IRQ change").
Nikola has been using autoconfig via setserial and reported a crash
similar to what I fixed in the earlier mentioned commit. Here I do the
same fixup for the autoconfig. I wasn't sure that this is the right
approach. Nikola confirmed that it fixes his crash.
Fixes:
b3b576461864 ("tty: serial_core: convert uart_open to use tty_port_open")
Link: http://lkml.kernel.org/r/20180131072000.GD1853@localhost.localdomain
Reported-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nikola Ciprich [Tue, 13 Feb 2018 14:04:46 +0000 (15:04 +0100)]
serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
commit
9f2068f35729948bde84d87a40d135015911345d upstream.
Add PCI ids for two variants of Brainboxes UC-260 quad port
PCI serial cards.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xinyong [Fri, 2 Mar 2018 11:20:07 +0000 (19:20 +0800)]
usb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()
commit
1a087f032111a88e826877449dfb93ceb22b78b9 upstream.
When I debug a kernel crash issue in funcitonfs, found ffs_data.ref
overflowed, While functionfs is unmounting, ffs_data is put twice.
Commit
43938613c6fd ("drivers, usb: convert ffs_data.ref from atomic_t to
refcount_t") can avoid refcount overflow, but that is risk some situations.
So no need put ffs data in ffs_fs_kill_sb, already put in ffs_data_closed.
The issue can be reproduced in Mediatek mt6763 SoC, ffs for ADB device.
KASAN enabled configuration reports use-after-free errro.
BUG: KASAN: use-after-free in refcount_dec_and_test+0x14/0xe0 at addr
ffffffc0579386a0
Read of size 4 by task umount/4650
====================================================
BUG kmalloc-512 (Tainted: P W O ): kasan: bad access detected
-----------------------------------------------------------------------------
INFO: Allocated in ffs_fs_mount+0x194/0x844 age=22856 cpu=2 pid=566
alloc_debug_processing+0x1ac/0x1e8
___slab_alloc.constprop.63+0x640/0x648
__slab_alloc.isra.57.constprop.62+0x24/0x34
kmem_cache_alloc_trace+0x1a8/0x2bc
ffs_fs_mount+0x194/0x844
mount_fs+0x6c/0x1d0
vfs_kern_mount+0x50/0x1b4
do_mount+0x258/0x1034
INFO: Freed in ffs_data_put+0x25c/0x320 age=0 cpu=3 pid=4650
free_debug_processing+0x22c/0x434
__slab_free+0x2d8/0x3a0
kfree+0x254/0x264
ffs_data_put+0x25c/0x320
ffs_data_closed+0x124/0x15c
ffs_fs_kill_sb+0xb8/0x110
deactivate_locked_super+0x6c/0x98
deactivate_super+0xb0/0xbc
INFO: Object 0xffffffc057938600 @offset=1536 fp=0x (null)
......
Call trace:
[<
ffffff900808cf5c>] dump_backtrace+0x0/0x250
[<
ffffff900808d3a0>] show_stack+0x14/0x1c
[<
ffffff90084a8c04>] dump_stack+0xa0/0xc8
[<
ffffff900826c2b4>] print_trailer+0x158/0x260
[<
ffffff900826d9d8>] object_err+0x3c/0x40
[<
ffffff90082745f0>] kasan_report_error+0x2a8/0x754
[<
ffffff9008274f84>] kasan_report+0x5c/0x60
[<
ffffff9008273208>] __asan_load4+0x70/0x88
[<
ffffff90084cd81c>] refcount_dec_and_test+0x14/0xe0
[<
ffffff9008d98f9c>] ffs_data_put+0x80/0x320
[<
ffffff9008d9d904>] ffs_fs_kill_sb+0xc8/0x110
[<
ffffff90082852a0>] deactivate_locked_super+0x6c/0x98
[<
ffffff900828537c>] deactivate_super+0xb0/0xbc
[<
ffffff90082af0c0>] cleanup_mnt+0x64/0xec
[<
ffffff90082af1b0>] __cleanup_mnt+0x10/0x18
[<
ffffff90080d9e68>] task_work_run+0xcc/0x124
[<
ffffff900808c8c0>] do_notify_resume+0x60/0x70
[<
ffffff90080866e4>] work_pending+0x10/0x14
Cc: stable@vger.kernel.org
Signed-off-by: Xinyong <xinyong.fang@linux.alibaba.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pete Zaitcev [Fri, 9 Mar 2018 06:21:14 +0000 (00:21 -0600)]
usb: usbmon: Read text within supplied buffer size
commit
a5f596830e27e15f7a0ecd6be55e433d776986d8 upstream.
This change fixes buffer overflows and silent data corruption with the
usbmon device driver text file read operations.
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Danilo Krummrich [Tue, 6 Mar 2018 08:38:49 +0000 (09:38 +0100)]
usb: quirks: add control message delay for 1b1c:1b20
commit
cb88a0588717ba6c756cb5972d75766b273a6817 upstream.
Corsair Strafe RGB keyboard does not respond to usb control messages
sometimes and hence generates timeouts.
Commit
de3af5bf259d ("usb: quirks: add delay init quirk for Corsair
Strafe RGB keyboard") tried to fix those timeouts by adding
USB_QUIRK_DELAY_INIT.
Unfortunately, even with this quirk timeouts of usb_control_msg()
can still be seen, but with a lower frequency (approx. 1 out of 15):
[ 29.103520] usb 1-8: string descriptor 0 read error: -110
[ 34.363097] usb 1-8: can't set config #1, error -110
Adding further delays to different locations where usb control
messages are issued just moves the timeouts to other locations,
e.g.:
[ 35.400533] usbhid 1-8:1.0: can't add hid device: -110
[ 35.401014] usbhid: probe of 1-8:1.0 failed with error -110
The only way to reliably avoid those issues is having a pause after
each usb control message. In approx. 200 boot cycles no more timeouts
were seen.
Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary
to have the delay in hub_port_connect() after hub_port_init().
The overall boot time seems not to be influenced by these additional
delays, even on fast machines and lightweight distributions.
Fixes:
de3af5bf259d ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard")
Cc: stable@vger.kernel.org
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Thu, 22 Feb 2018 17:39:17 +0000 (17:39 +0000)]
usbip: vudc: fix null pointer dereference on udc->lock
commit
df3334c223a033f562645712e832ca4cbb326bbf upstream.
Currently the driver attempts to spin lock on udc->lock before a NULL
pointer check is performed on udc, hence there is a potential null
pointer dereference on udc->lock. Fix this by moving the null check
on udc before the lock occurs.
Fixes:
ea6873a45a22 ("usbip: vudc: Add SysFS infrastructure for VUDC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Teijo Kinnunen [Thu, 1 Mar 2018 17:34:29 +0000 (19:34 +0200)]
USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h
commit
5126a504b63d82785eaece3a9c30c660b313785a upstream.
This USB-SATA controller seems to be similar with JMicron bridge
152d:2566 already on the list. Adding it here fixes "Invalid
field in cdb" errors.
Signed-off-by: Teijo Kinnunen <teijo.kinnunen@code-q.fi>
Cc: stable@vger.kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joel Fernandes [Fri, 16 Feb 2018 19:02:01 +0000 (11:02 -0800)]
staging: android: ashmem: Fix lockdep issue during llseek
commit
cb57469c9573f6018cd1302953dd45d6e05aba7b upstream.
ashmem_mutex create a chain of dependencies like so:
(1)
mmap syscall ->
mmap_sem -> (acquired)
ashmem_mmap
ashmem_mutex (try to acquire)
(block)
(2)
llseek syscall ->
ashmem_llseek ->
ashmem_mutex -> (acquired)
inode_lock ->
inode->i_rwsem (try to acquire)
(block)
(3)
getdents ->
iterate_dir ->
inode_lock ->
inode->i_rwsem (acquired)
copy_to_user ->
mmap_sem (try to acquire)
There is a lock ordering created between mmap_sem and inode->i_rwsem
causing a lockdep splat [2] during a syzcaller test, this patch fixes
the issue by unlocking the mutex earlier. Functionally that's Ok since
we don't need to protect vfs_llseek.
[1] https://patchwork.kernel.org/patch/
10185031/
[2] https://lkml.org/lkml/2018/1/10/48
Acked-by: Todd Kjos <tkjos@google.com>
Cc: Arve Hjonnevag <arve@android.com>
Cc: stable@vger.kernel.org
Reported-by: syzbot+8ec30bb7bf1a981a2012@syzkaller.appspotmail.com
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Frank Mori Hess [Thu, 15 Feb 2018 20:13:42 +0000 (15:13 -0500)]
staging: comedi: fix comedi_nsamples_left.
commit
a42ae5905140c324362fe5036ae1dbb16e4d359c upstream.
A rounding error was causing comedi_nsamples_left to
return the wrong value when nsamples was not a multiple
of the scan length.
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Frank Mori Hess <fmh6jj@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Oliver Neukum [Tue, 6 Mar 2018 14:04:24 +0000 (15:04 +0100)]
uas: fix comparison for error code
commit
9a513c905bb95bef79d96feb08621c1ec8d8c4bb upstream.
A typo broke the comparison.
Fixes:
cbeef22fd611 ("usb: uas: unconditionally bring back host after reset")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
CC: stable@kernel.org
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jonas Danielsson [Mon, 29 Jan 2018 11:39:15 +0000 (12:39 +0100)]
tty/serial: atmel: add new version check for usart
commit
fd63a8903a2c40425a9811c3371dd4d0f42c0ad3 upstream.
On our at91sam9260 based board the usart0 and usart1 ports report
their versions (ATMEL_US_VERSION) as 0x10302. This version is not
included in the current checks in the driver.
Signed-off-by: Jonas Danielsson <jonas@orbital-systems.com>
Acked-by: Richard Genoud <richard.genoud@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ulrich Hecht [Thu, 15 Feb 2018 12:02:27 +0000 (13:02 +0100)]
serial: sh-sci: prevent lockup on full TTY buffers
commit
7842055bfce4bf0170d0f61df8b2add8399697be upstream.
When the TTY buffers fill up to the configured maximum, a system lockup
occurs:
[ 598.820128] INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 598.825796] 0-...!: (1 GPs behind) idle=5a6/2/0 softirq=1974/1974 fqs=1
[ 598.832577] (detected by 3, t=62517 jiffies, g=296, c=295, q=126)
[ 598.838755] Task dump for CPU 0:
[ 598.841977] swapper/0 R running task 0 0 0 0x00000022
[ 598.849023] Call trace:
[ 598.851476] __switch_to+0x98/0xb0
[ 598.854870] (null)
This can be prevented by doing a dummy read of the RX data register.
This issue affects both HSCIF and SCIF ports. Reported for R-Car H3 ES2.0;
reproduced and fixed on H3 ES1.1. Probably affects other R-Car platforms
as well.
Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable <stable@vger.kernel.org>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Sun, 18 Feb 2018 22:01:44 +0000 (23:01 +0100)]
ASoC: rt5651: Fix regcache sync errors on resume
commit
2d30e9494f1ea320aaaad0cff9ddd92c87eac355 upstream.
The ALC5651 does not like multi-write accesses, avoid them. This fixes:
rt5651 i2c-
10EC5651:00: Unable to sync registers 0x27-0x28. -121
Errors on resume (and all registers after the registers in the error not
being synced).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Estevam [Fri, 16 Feb 2018 13:58:54 +0000 (11:58 -0200)]
ASoC: sgtl5000: Fix suspend/resume
commit
a8992973edbb2555e956b90f6fe97c4bc14d761d upstream.
Commit
8419caa72702 ("ASoC: sgtl5000: Do not disable regulators in
SND_SOC_BIAS_OFF") causes the sgtl5000 to fail after a suspend/resume
sequence:
Playing WAVE '/media/
a2002011001-e02.wav' : Signed 16 bit Little
Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2051: write error: Input/output error
The problem is caused by the fact that the aforementioned commit
dropped the cache handling, so re-introduce the register map
resync to fix the problem.
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H.J. Lu [Wed, 7 Feb 2018 22:20:09 +0000 (14:20 -0800)]
x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
commit
b21ebf2fb4cde1618915a97cc773e287ff49173e upstream.
On i386, there are 2 types of PLTs, PIC and non-PIC. PIE and shared
objects must use PIC PLT. To use PIC PLT, you need to load
_GLOBAL_OFFSET_TABLE_ into EBX first. There is no need for that on
x86-64 since x86-64 uses PC-relative PLT.
On x86-64, for 32-bit PC-relative branches, we can generate PLT32
relocation, instead of PC32 relocation, which can also be used as
a marker for 32-bit PC-relative branches. Linker can always reduce
PLT32 relocation to PC32 if function is defined locally. Local
functions should use PC32 relocation. As far as Linux kernel is
concerned, R_X86_64_PLT32 can be treated the same as R_X86_64_PC32
since Linux kernel doesn't use PLT.
R_X86_64_PLT32 for 32-bit PC-relative branches has been enabled in
binutils master branch which will become binutils 2.31.
[ hjl is working on having better documentation on this all, but a few
more notes from him:
"PLT32 relocation is used as marker for PC-relative branches. Because
of EBX, it looks odd to generate PLT32 relocation on i386 when EBX
doesn't have GOT.
As for symbol resolution, PLT32 and PC32 relocations are almost
interchangeable. But when linker sees PLT32 relocation against a
protected symbol, it can resolved locally at link-time since it is
used on a branch instruction. Linker can't do that for PC32
relocation"
but for the kernel use, the two are basically the same, and this
commit gets things building and working with the current binutils
master - Linus ]
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Josh Poimboeuf [Fri, 3 Nov 2017 12:58:54 +0000 (07:58 -0500)]
x86/module: Detect and skip invalid relocations
commit
eda9cec4c9a12208a6f69fbe68f72a6311d50032 upstream.
There have been some cases where external tooling (e.g., kpatch-build)
creates a corrupt relocation which targets the wrong address. This is a
silent failure which can corrupt memory in unexpected places.
On x86, the bytes of data being overwritten by relocations are always
initialized to zero beforehand. Use that knowledge to add sanity checks
to detect such cases before they corrupt memory.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: jeyu@kernel.org
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/37450d6c6225e54db107fba447ce9e56e5f758e9.1509713553.git.jpoimboe@redhat.com
[ Restructured the messages, as it's unclear whether the relocation or the target is corrupted. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Trond Myklebust [Wed, 7 Mar 2018 20:22:31 +0000 (15:22 -0500)]
NFS: Fix unstable write completion
commit
c4f24df942a181699c5bab01b8e5e82b925f77f3 upstream.
We do want to respect the FLUSH_SYNC argument to nfs_commit_inode() to
ensure that all outstanding COMMIT requests to the inode in question are
complete. Currently we may exit early from both nfs_commit_inode() and
nfs_write_inode() even if there are COMMIT requests in flight, or unstable
writes on the commit list.
In order to get the right semantics w.r.t. sync_inode(), we don't need
to have nfs_commit_inode() reset the inode dirty flags when called from
nfs_wb_page() and/or nfs_wb_all(). We just need to ensure that
nfs_write_inode() leaves them in the right state if there are outstanding
commits, or stable pages.
Reported-by: Scott Mayhew <smayhew@redhat.com>
Fixes:
dc4fd9ab01ab ("nfs: don't wait on commit in nfs_commit_inode()...")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Trond Myklebust [Tue, 6 Mar 2018 17:47:08 +0000 (12:47 -0500)]
NFS: Fix an incorrect type in struct nfs_direct_req
commit
d9ee65539d3eabd9ade46cca1780e3309ad0f907 upstream.
The start offset needs to be of type loff_t.
Fixed:
5fadeb47dcc5c ("nfs: count DIO good bytes correctly with mirroring")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Quinn Tran [Mon, 4 Dec 2017 22:45:10 +0000 (14:45 -0800)]
scsi: qla2xxx: Replace fcport alloc with qla2x00_alloc_fcport
commit
063b36d6b0ad74c748d536f5cb47bac2f850a0fa upstream.
Current code manually allocate an fcport structure that is not properly
initialize. Replace kzalloc with qla2x00_alloc_fcport, so that all
fields are initialized. Also set set scan flag to port found
Cc: <stable@vger.kernel.org>
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>