usb: mtu3: enable SETUPENDISR interrupt
If the controller receives a new SETUP during SETUP data stage, and will generate SETUPENDISR interrupt, the driver should abort the current SETUP command and process the new one. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e802972433
commit
94552090cd
@ -484,7 +484,7 @@ void mtu3_ep0_setup(struct mtu3 *mtu)
|
|||||||
mtu3_writel(mtu->mac_base, U3D_EP0CSR, csr);
|
mtu3_writel(mtu->mac_base, U3D_EP0CSR, csr);
|
||||||
|
|
||||||
/* Enable EP0 interrupt */
|
/* Enable EP0 interrupt */
|
||||||
mtu3_writel(mtu->mac_base, U3D_EPIESR, EP0ISR);
|
mtu3_writel(mtu->mac_base, U3D_EPIESR, EP0ISR | SETUPENDISR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtu3_mem_alloc(struct mtu3 *mtu)
|
static int mtu3_mem_alloc(struct mtu3 *mtu)
|
||||||
|
@ -692,9 +692,13 @@ irqreturn_t mtu3_ep0_isr(struct mtu3 *mtu)
|
|||||||
mtu3_writel(mbase, U3D_EPISR, int_status); /* W1C */
|
mtu3_writel(mbase, U3D_EPISR, int_status); /* W1C */
|
||||||
|
|
||||||
/* only handle ep0's */
|
/* only handle ep0's */
|
||||||
if (!(int_status & EP0ISR))
|
if (!(int_status & (EP0ISR | SETUPENDISR)))
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
|
||||||
|
/* abort current SETUP, and process new one */
|
||||||
|
if (int_status & SETUPENDISR)
|
||||||
|
mtu->ep0_state = MU3D_EP0_STATE_SETUP;
|
||||||
|
|
||||||
csr = mtu3_readl(mbase, U3D_EP0CSR);
|
csr = mtu3_readl(mbase, U3D_EP0CSR);
|
||||||
|
|
||||||
dev_dbg(mtu->dev, "%s csr=0x%x\n", __func__, csr);
|
dev_dbg(mtu->dev, "%s csr=0x%x\n", __func__, csr);
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
|
|
||||||
/* U3D_EPISR */
|
/* U3D_EPISR */
|
||||||
#define EPRISR(x) (BIT(16) << (x))
|
#define EPRISR(x) (BIT(16) << (x))
|
||||||
|
#define SETUPENDISR BIT(16)
|
||||||
#define EPTISR(x) (BIT(0) << (x))
|
#define EPTISR(x) (BIT(0) << (x))
|
||||||
#define EP0ISR BIT(0)
|
#define EP0ISR BIT(0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user