Skip to content

Commit b7d5c3c

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: mtu3: clear interrupts status when disable interrupts
When disable interrupts, will also want to clear their status, ensure it by calling mtu3_intr_status_clear() in mtu3_intr_disable(). Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f55df11 commit b7d5c3c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

drivers/usb/mtu3/mtu3_core.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,6 @@ static void mtu3_device_reset(struct mtu3 *mtu)
147147
mtu3_clrbits(ibase, U3D_SSUSB_DEV_RST_CTRL, SSUSB_DEV_SW_RST);
148148
}
149149

150-
/* disable all interrupts */
151-
static void mtu3_intr_disable(struct mtu3 *mtu)
152-
{
153-
void __iomem *mbase = mtu->mac_base;
154-
155-
/* Disable level 1 interrupts */
156-
mtu3_writel(mbase, U3D_LV1IECR, ~0x0);
157-
/* Disable endpoint interrupts */
158-
mtu3_writel(mbase, U3D_EPIECR, ~0x0);
159-
}
160-
161150
static void mtu3_intr_status_clear(struct mtu3 *mtu)
162151
{
163152
void __iomem *mbase = mtu->mac_base;
@@ -170,6 +159,18 @@ static void mtu3_intr_status_clear(struct mtu3 *mtu)
170159
mtu3_writel(mbase, U3D_LTSSM_INTR, ~0x0);
171160
/* Clear speed change interrupt status */
172161
mtu3_writel(mbase, U3D_DEV_LINK_INTR, ~0x0);
162+
/* Clear QMU interrupt status */
163+
mtu3_writel(mbase, U3D_QISAR0, ~0x0);
164+
}
165+
166+
/* disable all interrupts */
167+
static void mtu3_intr_disable(struct mtu3 *mtu)
168+
{
169+
/* Disable level 1 interrupts */
170+
mtu3_writel(mtu->mac_base, U3D_LV1IECR, ~0x0);
171+
/* Disable endpoint interrupts */
172+
mtu3_writel(mtu->mac_base, U3D_EPIECR, ~0x0);
173+
mtu3_intr_status_clear(mtu);
173174
}
174175

175176
/* enable system global interrupt */
@@ -312,7 +313,6 @@ void mtu3_stop(struct mtu3 *mtu)
312313
dev_dbg(mtu->dev, "%s\n", __func__);
313314

314315
mtu3_intr_disable(mtu);
315-
mtu3_intr_status_clear(mtu);
316316

317317
if (mtu->softconnect)
318318
mtu3_dev_on_off(mtu, 0);
@@ -600,7 +600,6 @@ static void mtu3_regs_init(struct mtu3 *mtu)
600600

601601
/* be sure interrupts are disabled before registration of ISR */
602602
mtu3_intr_disable(mtu);
603-
mtu3_intr_status_clear(mtu);
604603

605604
mtu3_csr_init(mtu);
606605

0 commit comments

Comments
 (0)