Commit graph

881333 commits

Author SHA1 Message Date
Guoniu.zhou 3fb05200e0 MLK-23578-1: media: m2m: enable ISI m2m feature for i.MX865
Enable ISI m2m feature for i.MX865. For i.MX8QXP and QM, ISI
use port 5 as image source port from memory, but for i.MX865,
it change to port 2, so add this info as platform data and
configure image source port selection according to the data.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
2020-03-16 17:43:16 +08:00
Li Jun 2304d8ebe9 MLK-23587-2 usb: dwc3: drd: don't free_irq for role switch
As role switch class does not use otg irq like edev, so don't
do free irq for it.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit fd263a3edd95dfe812397fabf1059b5f99bba2ab)
2020-03-15 17:51:02 +08:00
Li Jun 9cc87b55a4 MLK-23587-1 usb: dwc3: imx8mp: keep runtime active when remove driver
As driver removal will do clocks disable, we don't need runtime
suspend to disable clocks, so keep runtime resume when driver
remove.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 24b9a59b32127af6e217e56490d643f39ca6ff60)
2020-03-15 17:51:02 +08:00
Li Jun 1ead578c33 MLK-23531 usb: dwc3: gadget: add skip_remain_trbs flag
If we're in the middle of series of chained TRBs and we
receive a short transfer along the way, DWC3 will skip
through all TRBs including the last TRB in the chain, DWC3
will avoid clearing HWO bit and SW has to do it manually.
but currect code can't hit the condition when loop sgs of
request in dwc3_gadget_ep_reclaim_trb_sg() if short packet
received for one chained trb, because it only check the HWO
bit of all trbs and then break if it's 1, so the remain trbs
has no chance to be handled by dwc3_gadget_ep_reclaim_completed_trb(),
this patch adds a flag if received a short packet in a chained
trb, and let dwc3_gadget_ep_reclaim_trb_sg() continue handle
all trbs and give back to function driver.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
2020-03-15 17:47:58 +08:00
Han Xu ad81692901 MLK-23588: arm64: dts: enable usbotg on imx8qxp lpddr4 val board for uuu download
Enabled the usbotg ports on imx8qxp lpddr4 val board for uuu download
NAND image.

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
2020-03-13 15:32:19 -05:00
Silvano di Ninno 7753837330 arm64: dts: imx8dxl Add caam node
8DXL have a different IRQ mapping compare to
8QM and 8QxP.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
2020-03-13 22:44:22 +01:00
Silvano di Ninno 4e7727ca0a crypto:caam - Add support for i.MX 8DXL
Update CAAM driver to support i.MX 8DXL

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
2020-03-13 22:44:22 +01:00
Franck LENORMAND 9e2b6dacf5 SSI-87: soc: imx: secvio: Report to audit FW all security violations
Report to audit framework in case a secure violation is
reported to the driver.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND 53dca82ef1 SSI-87: arm64: dts: imx8qxp: Add node for Security Violations
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND 02388b72be SSI-87: arm64: defconfig: Enable CONFIG_SECVIO_SC by default
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND 7c907f8b54 SSI-87: soc: imx: secvio: Add support for SNVS secvio and tamper via SCFW
The driver register an IRQ handle to SCU for security
violation interrupt.

When an interruption is fired, the driver inform the user.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND e0ef5fc65d SSI-87: dt-bindings: firmware: imx: secvio: Add imx-secvio-sc binding
Add the documentation for fsl,imx-secvio-sc binding.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND 2ccb9a596a SSI-87: firmware: imx: Add APIs required for secvio
The Security Violation module requires SC API for the SECO, RM, MISC
and IRQ.

This patch does:
 - imx-scu-irq: Allow reuse of imx_scu_irq_get_status
 - seco:
    - Add imx_sc_seco_secvio_enable
    - Add imx_sc_seco_secvio_config
    - Add imx_sc_seco_secvio_dgo_config

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Franck LENORMAND ccf07c0822 SSI-87: firmware: imx: scu: Support reception of any size message
The implementation was limiting the size of a message which can be
received to 4 but soem response can be bigger. For example the
response of the 'sc_seco_secvio_config' API is 6 words.

This patch removes this limitation relying on the count of word
received instead of the index of the chan.
It does so by duplicating imx_scu_call_rpc as imx_scu_call_big_rpc
in order to cahnge the RX method using imx_scu_big_rx_callback
instead of imx_scu_rx_callback.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-13 17:11:58 +01:00
Daniel Baluta ec19a7176f MLK-23560-4 ASoC: SOF: Fix maybe used unitialized warning
This fixes the following compilation warning:

sound/soc/sof/imx/imx8.c: In function ‘imx8_probe’:
sound/soc/sof/imx/imx8.c:210:6: warning: ‘i’ may be used uninitialized
in this function [-Wmaybe-uninitiali

Warning introduce with commit commit 352ad24ec
("MLK-23350-1 ASoC: sof: Skip power domain handline when num_domains")

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-13 16:58:57 +02:00
Pierre-Louis Bossart 236ee9e163 MLK-23560-3 ASoC: SOF: define INFO_ flags in dsp_ops
Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined
in the SOF PCM core, which doesn't scale. To account for platform
variations, these flags need to be set in DSP ops.

This patch only moves the definitions and does not change any
functionality.

Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191024210318.30068-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 16:58:45 +02:00
Daniel Baluta e5e991a741 MLK-23560-2: ASoC: SOF: Enable PM support
We need to provide PM macros in order for the SOF core
to suspend/resume the DSP.

PM support on the DSP side is quite limited and we are mostly
doing PM for ARM core.

Without this patch DSP won't be restarted after a resume causing
SOF driver calls to time out.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-13 15:34:16 +02:00
Zhou Peng 8a7fd2a7a6 MLK-23377-2: arm64: imx8mp: vc8000e: fix system hang in suspend/resume operation
Add suspend related operation:
- add ioctl 'HX280ENC_IOCG_EN_CORE' to trigger HW in kernel
- backup/restore HW registers only after frame ready interrupt received
- notify application re-config HW to avoid unexpected HW behavior

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-03-13 19:39:02 +08:00
Bing Song 031e41b78e MLK-23394 XUVI/PPM: decrease the usage count when it isn't in using.
vpu-ts will in active state when it isn't be using. decrease the
usage count to fix it.

Signed-off-by: Bing Song <bing.song@nxp.com>
Reviewed-by: Jian Li <jian.li@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2020-03-13 18:14:58 +08:00
Shengjiu Wang 3dab39b149 MLK-23585-4: arm64: dts: Enable audio features for imx8dxl-evk
Enable SAI/ASRC/WM8960
1. Update the interrupt number for audio modules
2. Enable 3 wm8960 codecs

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-13 16:26:02 +08:00
Shengjiu Wang 4d23edf7b3 MLK-23585-3: ASoC: imx-wm8960: support capture_only and playback_only
In imx8dxl-evk, some of wm8960s only support capture function,
So we support capture_only and playback_only in driver

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-13 16:26:02 +08:00
Shengjiu Wang 002cd44ea1 MLk-23585-2: ASoC: imx-wm8960: support multi instance
Move the golbal variables to structure, so all variables
are private for each instance.

replace the DRIVER_ATTR with DEVICE_ATTR to support
multi instance.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-13 16:26:02 +08:00
Shengjiu Wang 72b1cc1310 MLK-23585-1: ASoC: imx-wm8960: fix warning message
replace gpio_get_value with gpio_get_value_cansleep

[   35.872238] ------------[ cut here ]------------
[   35.876899] WARNING: CPU: 1 PID: 218 at drivers/gpio/gpiolib.c:3407 gpiod_get_raw_value+0x78/0x80
[   35.885774] Modules linked in:
[   35.888840] CPU: 1 PID: 218 Comm: kworker/u4:5 Tainted: G        W         5.4.24-04375-g6de4b3212b29-dirty #7367
[   35.899102] Hardware name: Freescale i.MX8DXL EVK (DT)
[   35.904247] Workqueue: events_power_efficient gpio_work
[   35.909477] pstate: 20000005 (nzCv daif -PAN -UAO)
[   35.914275] pc : gpiod_get_raw_value+0x78/0x80
[   35.918721] lr : gpiod_get_raw_value+0x20/0x80
[   35.923164] sp : ffff800012a1bd30
[   35.926476] x29: ffff800012a1bd30 x28: 0000000000000000
[   35.931791] x27: ffff00003b4152b8 x26: ffff8000119df7d0
[   35.937107] x25: 0000000000000000 x24: ffff800011ae2d48
[   35.942424] x23: ffff00001050c000 x22: ffff000010507100
[   35.947741] x21: ffff800011ae2000 x20: ffff800011ae2d10
[   35.953060] x19: ffff00003adf8640 x18: 0000000000000000
[   35.958374] x17: 0000000000000000 x16: 0000000000000000
[   35.963691] x15: 0000000000000000 x14: 0000000000000000
[   35.969008] x13: 0000000000000001 x12: 0000000000000000
[   35.974325] x11: 000000000002e708 x10: 00000000000009c0
[   35.979641] x9 : ffff800012a1b920 x8 : ffff00003a310a20
[   35.984958] x7 : ffff00003efec340 x6 : 0000000000000000
[   35.990276] x5 : 0000000000000000 x4 : ffff800011a01748
[   35.995593] x3 : ffff00003b005c00 x2 : 0000000000000001
[   36.000911] x1 : ffff00003b005c00 x0 : ffff00003b00ba18
[   36.006228] Call trace:
[   36.008684]  gpiod_get_raw_value+0x78/0x80
[   36.012790]  hp_jack_status_check+0x2c/0xf8
[   36.016977]  gpio_work+0x4c/0x70
[   36.020215]  process_one_work+0x1dc/0x370
[   36.024221]  worker_thread+0x48/0x468
[   36.027892]  kthread+0xf0/0x120
[   36.031036]  ret_from_fork+0x10/0x1c
[   36.034610] ---[ end trace b40bcf5f3cf8bd40 ]---

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-13 16:26:02 +08:00
Liu Ying 869d88224b MLK-23267-2 arm64: imx8qm-ss-lvds.dtsi: Correct clock property of irqsteer_lvds1 node
The irqsteer_lvds1 node's ipg clock source should be
lvds1_lis_lpcg_ipg_clk, instead of lvds0_lis_lpcg_ipg_clk.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2020-03-13 15:12:16 +08:00
Liu Ying bf8ae75604 MLK-23267-1 arm64: imx8qm-ss-lvds.dtsi: Separate ipg clock for lvds0/1 subsystems
Each LVDS subsystem should have ipg clock of their own.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2020-03-13 15:11:21 +08:00
Franck LENORMAND e4468cd15c MLK-23421: arch: arm64: imx8dxl: Change IRQ number
On 8dxl, the IRQ numbe ris different than on other 8SoC.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND 6f9d149507 MLK-23421: arm64: imx_v8_defconfig: Enable SECO_MU
Enable the support for SECO_MU by default

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND 9a91e2843e MLK-23421: arm64: dts: Use fast IPC for seco mu
This patch enables all the MU in the security subsystem
and configure them to use FAST IPC.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND da897c095b MLK-23421: fw: imx: seco_mu: Use fast IPC
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND 297f4cf6e1 MLK-23421: mailbox: imx: add SECO MU support
i.MX8/8X SECO firmware IPC is an implementation of passing messages.
But current imx-mailbox driver only support one word  message,
i.MX8/8X linux side firmware has to request four TX, four RX and a
TXDB to support IPC to SECO firmware. This is low efficent and
more interrupts triggered compared with one TX and one RX.

To make SECO MU work,
  - parse the size of msg.
  - Only enable TR0/RR0 interrupt for transmit/receive message.
  - For TX/RX, only support one TX channel and one RX channel
  - For RX, support receive msg of any size, linited by hardcoded value of 30.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND a2c5191461 MLK-23421: doc: update SECO MU driver binding for fast IPC
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Franck LENORMAND 7dd4eb4742 MLK-23421: dt-bindings: mailbox: imx-mu: add SECO MU support
i.MX8/8X SECO MU is dedicated for communication between kernel
and SECO. To use SECO MU more effectivly, add "fsl,imx8-seco-mu"
compatible to support fast IPC.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2020-03-12 09:29:51 +01:00
Peng Fan 13b8e3b1fa MLK-23421: mailbox: imx: restructure code to make easy for new MU
Add imx_mu_generic_tx for data send and imx_mu_generic_rx for interrupt
data receive.

Pack original mu chans related code into imx_mu_init_generic

Add tx/rx/init hooks into imx_mu_dcfg

With these, it will be a bit easy to introduce i.MX8/8X SCU type
MU dedicated to communicate with SCU.

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-03-12 09:29:51 +01:00
Minjie Zhuang 509a614b14 MGS-5453 [#imx-1895] update gc_feature_database.h file
update gc_feature_database.h file for patch_base_on_6.4.0.p2_from_20200221_20200227

Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
2020-03-12 15:24:59 +08:00
Fancy Fang 40a94ac801 MLK-23576 gpu/imx: lcdifv3: add system sleep PM ops
To support system suspend and resume, the system sleep
PM ops of suspend and resume are required to be added
for LCDIFv3 display.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-12 10:56:04 +08:00
Zhang Peng 10abba22b3 MLK-23570i fsl: fsl_dsp: Fix dsp suspend issue on imx.mp board
1. Add check pm runtime state to decide send suspend msg to dsp when
call fsl_dsp_suspend.
2. Set proxy->dsp_mu_init be zero in fsl_dsp_suspend for imx.mp.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
2020-03-11 14:29:31 +01:00
Shengjiu Wang dc5a481843 LF-941: ASoC: fsl_easrc: Switch to 32 taps for resampling filter
With 128 taps of resampling filter, there is performance issue
for high sample rate and mulitchannel. For example, there is
noise issue for converting 48kHz to 768kHz, channel number
is larger than 5 channels, and p2p case.

So in order to increase performance, we reduce the taps number
to 32 in default, the quality is relatively downgraded.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-03-11 17:43:38 +08:00
Guoniu.zhou 3a61dae9aa LF-1089: media: imx: fix 1024x768@15 camera issue for imx8qm and qxp
For iMX8QM ov5640 camera, if resolution is 1024x768@15, the image
will have overlapping issue.
For iMX8QXP ov5640 camera, if resolution is 1024x768@15, camera APP
will hang, it means no data from driver.

Run command as bellow can reproduce the issue:
/unit_tests/V4L2/mx8_v4l2_cap_drm.out -cam 1 -ow 1024 -oh 768 -fr 15

Setting HS_SETTLE of CSI to 0x23 for 1024x768@15 can fix the issue

Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2020-03-11 17:17:20 +08:00
Joakim Zhang f158c242b8 MLK-23573 arm64: dts: imx8qm/qxp-val: Enable CAN
Enable CAN on i.MX8QM/QXP validation board for test team requirement.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
2020-03-11 14:34:31 +08:00
Sandor Yu 226c655dd9 LF-452: gpu: drm: bridge: hdmi: Add CEA mode check
Add CEA mode check, only CEA-861 mode supported.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:15:55 +08:00
Sandor Yu 2804599dc0 MLK-23538-3: imx_v8_defconfig: Enable DW_HDMI_CEC
Enable DW_HDMI_CEC for iMX8MP HDMI CEC.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:15:55 +08:00
Sandor Yu 0c0089728e MLK-23538-2: clk: hdmimix: set cec clock parent to 32k_clk
set cec clock parent to 32k_clk

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:15:55 +08:00
Sandor Yu 54aab66071 MLK-23538-1: drm: gpu: dw_imx: add CEC enable bit set
Add iMX8MP CEC enable bit set in hdmi phy initialize function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:15:55 +08:00
Sandor Yu ca29611c76 MLK-23542: phy: support more pixel rates
Move clock rate config table to phy-fsl-samsung-hdmi.h.
Support mode pixel rates.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:12:34 +08:00
Sandor Yu d3b236bce9 MLK-23544: drm: gpu: dw_hdmi: check imx8mp hdmi phy support clk rate
Check imx8mp hdmi phy clk rate to figure out
valid video modes.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2020-03-11 10:12:34 +08:00
Guoniu.zhou 9bd517c235 MLK-23358-2: media: imx: fix variable uninitialized issue
Fix issue reported by coverity, CCID is 1477259

Reviewed-by: Robby.Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2020-03-11 10:04:14 +08:00
Guoniu.zhou d6cf045ae1 MLK-23358-1: media: imx8: fix dereferencing null pointer issue
Fix issue reported by Coverity, CID are 1477361 and 6345201

Reviewed-by: Robby.Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2020-03-11 10:03:33 +08:00
Silvano di Ninno 534d8537d4 MLK-23561 arm64: dts: imx8-ss-security: fix Secure Memory mapping
Ranges for the security subsystem node is too small and does not include
the caam_sm range.

Fixes: e08b2903ae ("LF-824:  arm64: dts: Add seco mu nodes")
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Tested-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
2020-03-10 18:40:44 +01:00
Pratham Pratap 2b55a8e899 usb: dwc3: gadget: Update chain bit correctly when using sg list
If scatter-gather operation is allowed, a large USB request is split
into multiple TRBs. For preparing TRBs for sg list, driver iterates
over the list and creates TRB for each sg and mark the chain bit to
false for the last sg. The current IOMMU driver is clubbing the list
of sgs which shares a page boundary into one and giving it to USB driver.
With this the number of sgs mapped it not equal to the the number of sgs
passed. Because of this USB driver is not marking the chain bit to false
since it couldn't iterate to the last sg. This patch addresses this issue
by marking the chain bit to false if it is the last mapped sg.

At a practical level, this patch resolves USB transfer stalls
seen with adb on dwc3 based db845c, pixel3 and other qcom
hardware after functionfs gadget added scatter-gather support
around v4.20.

Credit also to Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
who implemented a very similar fix to this issue.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Yang Fei <fei.yang@intel.com>
Cc: Thinh Nguyen <thinhn@synopsys.com>
Cc: Tejas Joglekar <tejas.joglekar@synopsys.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: Jack Pham <jackp@codeaurora.org>
Cc: Todd Kjos <tkjos@google.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Linux USB List <linux-usb@vger.kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
[jstultz: Slight tweak to remove sg_is_last() usage, reworked
          commit message, minor comment tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
2020-03-10 21:40:27 +08:00
Lars-Peter Clausen 0892d67aa9 usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags
ffs_aio_cancel() can be called from both interrupt and thread context. Make
sure that the current IRQ state is saved and restored by using
spin_{un,}lock_irq{save,restore}().

Otherwise undefined behavior might occur.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
(cherry picked from commit 43d565727a)
2020-03-10 21:40:27 +08:00