All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Li Jun <jun.li@nxp.com>, "faqiang . zhu" <faqiang.zhu@nxp.com>,
	Peter Chen <peter.chen@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-usb@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 15/39] usb: chipidea: udc: assign interrupt number to USB gadget structure
Date: Thu,  3 Jun 2021 13:08:05 -0400	[thread overview]
Message-ID: <20210603170829.3168708-15-sashal@kernel.org> (raw)
In-Reply-To: <20210603170829.3168708-1-sashal@kernel.org>

From: Li Jun <jun.li@nxp.com>

[ Upstream commit 9e3927f6373da54cb17e17f4bd700907e1123d2f ]

Chipidea also need sync interrupt before unbind the udc while
gadget remove driver, otherwise setup irq handling may happen
while unbind, see below dump generated from android function
switch stress test:

[ 4703.503056] android_work: sent uevent USB_STATE=CONNECTED
[ 4703.514642] android_work: sent uevent USB_STATE=DISCONNECTED
[ 4703.651339] android_work: sent uevent USB_STATE=CONNECTED
[ 4703.661806] init: Control message: Processed ctl.stop for 'adbd' from pid: 561 (system_server)
[ 4703.673469] init: processing action (init.svc.adbd=stopped) from (/system/etc/init/hw/init.usb.configfs.rc:14)
[ 4703.676451] Unable to handle kernel read from unreadable memory at virtual address 0000000000000090
[ 4703.676454] Mem abort info:
[ 4703.676458]   ESR = 0x96000004
[ 4703.676461]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 4703.676464]   SET = 0, FnV = 0
[ 4703.676466]   EA = 0, S1PTW = 0
[ 4703.676468] Data abort info:
[ 4703.676471]   ISV = 0, ISS = 0x00000004
[ 4703.676473]   CM = 0, WnR = 0
[ 4703.676478] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004a867000
[ 4703.676481] [0000000000000090] pgd=0000000000000000, p4d=0000000000000000
[ 4703.676503] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 4703.758297] Modules linked in: synaptics_dsx_i2c moal(O) mlan(O)
[ 4703.764327] CPU: 0 PID: 235 Comm: lmkd Tainted: G        W  O      5.10.9-00001-g3f5fd8487c38-dirty #63
[ 4703.773720] Hardware name: NXP i.MX8MNano EVK board (DT)
[ 4703.779033] pstate: 60400085 (nZCv daIf +PAN -UAO -TCO BTYPE=--)
[ 4703.785046] pc : _raw_write_unlock_bh+0xc0/0x2c8
[ 4703.789667] lr : android_setup+0x4c/0x168
[ 4703.793676] sp : ffff80001256bd80
[ 4703.796989] x29: ffff80001256bd80 x28: 00000000000000a8
[ 4703.802304] x27: ffff800012470000 x26: ffff80006d923000
[ 4703.807616] x25: ffff800012471000 x24: ffff00000b091140
[ 4703.812929] x23: ffff0000077dbd38 x22: ffff0000077da490
[ 4703.818242] x21: ffff80001256be30 x20: 0000000000000000
[ 4703.823554] x19: 0000000000000080 x18: ffff800012561048
[ 4703.828867] x17: 0000000000000000 x16: 0000000000000039
[ 4703.834180] x15: ffff8000106ad258 x14: ffff80001194c277
[ 4703.839493] x13: 0000000000003934 x12: 0000000000000000
[ 4703.844805] x11: 0000000000000000 x10: 0000000000000001
[ 4703.850117] x9 : 0000000000000000 x8 : 0000000000000090
[ 4703.855429] x7 : 6f72646e61203a70 x6 : ffff8000124f2450
[ 4703.860742] x5 : ffffffffffffffff x4 : 0000000000000009
[ 4703.866054] x3 : ffff8000108a290c x2 : ffff00007fb3a9c8
[ 4703.871367] x1 : 0000000000000000 x0 : 0000000000000090
[ 4703.876681] Call trace:
[ 4703.879129]  _raw_write_unlock_bh+0xc0/0x2c8
[ 4703.883397]  android_setup+0x4c/0x168
[ 4703.887059]  udc_irq+0x824/0xa9c
[ 4703.890287]  ci_irq+0x124/0x148
[ 4703.893429]  __handle_irq_event_percpu+0x84/0x268
[ 4703.898131]  handle_irq_event+0x64/0x14c
[ 4703.902054]  handle_fasteoi_irq+0x110/0x210
[ 4703.906236]  __handle_domain_irq+0x8c/0xd4
[ 4703.910332]  gic_handle_irq+0x6c/0x124
[ 4703.914081]  el1_irq+0xdc/0x1c0
[ 4703.917221]  _raw_spin_unlock_irq+0x20/0x54
[ 4703.921405]  finish_task_switch+0x84/0x224
[ 4703.925502]  __schedule+0x4a4/0x734
[ 4703.928990]  schedule+0xa0/0xe8
[ 4703.932132]  do_notify_resume+0x150/0x184
[ 4703.936140]  work_pending+0xc/0x40c
[ 4703.939633] Code: d5384613 521b0a69 d5184609 f9800111 (885ffd01)
[ 4703.945732] ---[ end trace ba5c1875ae49d53c ]---
[ 4703.950350] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[ 4703.957223] SMP: stopping secondary CPUs
[ 4703.961151] Kernel Offset: disabled
[ 4703.964638] CPU features: 0x0240002,2000200c
[ 4703.968905] Memory Limit: none
[ 4703.971963] Rebooting in 5 seconds..

Tested-by: faqiang.zhu <faqiang.zhu@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1620989984-7653-1-git-send-email-jun.li@nxp.com
Signed-off-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/chipidea/udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 60ea932afe2b..5f35cdd2cf1d 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -2055,6 +2055,7 @@ static int udc_start(struct ci_hdrc *ci)
 	ci->gadget.name         = ci->platdata->name;
 	ci->gadget.otg_caps	= otg_caps;
 	ci->gadget.sg_supported = 1;
+	ci->gadget.irq		= ci->irq;
 
 	if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA)
 		ci->gadget.quirk_avoids_skb_reserve = 1;
-- 
2.30.2


  parent reply	other threads:[~2021-06-03 17:12 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 17:07 [PATCH AUTOSEL 5.10 01/39] ASoC: max98088: fix ni clock divider calculation Sasha Levin
2021-06-03 17:07 ` Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 02/39] ASoC: amd: fix for pcm_read() error Sasha Levin
2021-06-03 17:07   ` Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 03/39] spi: Fix spi device unregister flow Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 04/39] spi: spi-zynq-qspi: Fix stack violation bug Sasha Levin
2021-06-03 17:07   ` Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 05/39] bpf: Forbid trampoline attach for functions with variable arguments Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 06/39] net/nfc/rawsock.c: fix a permission check bug Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 07/39] usb: cdns3: Fix runtime PM imbalance on error Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 08/39] ASoC: Intel: bytcr_rt5640: Add quirk for the Glavey TM800A550L tablet Sasha Levin
2021-06-03 17:07   ` Sasha Levin
2021-06-03 17:07 ` [PATCH AUTOSEL 5.10 09/39] ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix 3-830 tablet Sasha Levin
2021-06-03 17:07   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 10/39] bpf: Add deny list of btf ids check for tracing programs Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 11/39] vfio-ccw: Reset FSM state to IDLE inside FSM Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 12/39] vfio-ccw: Serialize FSM IDLE state with I/O completion Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 13/39] ASoC: sti-sas: add missing MODULE_DEVICE_TABLE Sasha Levin
2021-06-03 17:08   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 14/39] spi: sprd: Add " Sasha Levin
2021-06-03 17:08 ` Sasha Levin [this message]
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 16/39] isdn: mISDN: netjet: Fix crash in nj_probe: Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 17/39] bonding: init notify_work earlier to avoid uninitialized use Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 18/39] netlink: disable IRQs for netlink_lock_table() Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 19/39] net: mdiobus: get rid of a BUG_ON() Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 20/39] cgroup: disable controllers at parse time Sasha Levin
2021-06-03 17:08   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 21/39] wq: handle VM suspension in stall detection Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 22/39] net/qla3xxx: fix schedule while atomic in ql_sem_spinlock Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 23/39] RDS tcp loopback connection can hang Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 24/39] net:sfc: fix non-freed irq in legacy irq mode Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 25/39] scsi: bnx2fc: Return failure if io_req is already in ABTS processing Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 26/39] scsi: vmw_pvscsi: Set correct residual data length Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 27/39] scsi: hisi_sas: Drop free_irq() of devm_request_irq() allocated irq Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 28/39] scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 29/39] net: macb: ensure the device is available before accessing GEMGXL control registers Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 30/39] net: appletalk: cops: Fix data race in cops_probe1 Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 31/39] net: dsa: microchip: enable phy errata workaround on 9567 Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 32/39] nvme-fabrics: decode host pathing error for connect Sasha Levin
2021-06-03 17:08   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 33/39] MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 34/39] dm verity: fix require_signatures module_param permissions Sasha Levin
2021-06-03 17:08   ` [dm-devel] " Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 35/39] bnx2x: Fix missing error code in bnx2x_iov_init_one() Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 36/39] nvme-tcp: remove incorrect Kconfig dep in BLK_DEV_NVME Sasha Levin
2021-06-03 17:08   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 37/39] nvmet: fix false keep-alive timeout when a controller is torn down Sasha Levin
2021-06-03 17:08   ` Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 38/39] powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P2041 i2c controllers Sasha Levin
2021-06-03 17:08   ` [PATCH AUTOSEL 5.10 38/39] powerpc/fsl: set fsl, i2c-erratum-a004447 " Sasha Levin
2021-06-03 17:08 ` [PATCH AUTOSEL 5.10 39/39] powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 " Sasha Levin
2021-06-03 17:08   ` [PATCH AUTOSEL 5.10 39/39] powerpc/fsl: set fsl, i2c-erratum-a004447 " Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603170829.3168708-15-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=faqiang.zhu@nxp.com \
    --cc=jun.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.