Commit a1c0169a authored by Tao Ren's avatar Tao Ren Committed by Felipe Balbi

usb: gadget: aspeed: fixup vhub port irq handling

This is a follow-on patch for commit a23be4ed ("usb: gadget: aspeed:
improve vhub port irq handling"): for_each_set_bit() is replaced with
simple for() loop because for() loop runs faster on ASPEED BMC.
Signed-off-by: default avatarTao Ren <rentao.bupt@gmail.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent e319bd62
......@@ -135,13 +135,9 @@ static irqreturn_t ast_vhub_irq(int irq, void *data)
/* Handle device interrupts */
if (istat & vhub->port_irq_mask) {
unsigned long bitmap = istat;
int offset = VHUB_IRQ_DEV1_BIT;
int size = VHUB_IRQ_DEV1_BIT + vhub->max_ports;
for_each_set_bit_from(offset, &bitmap, size) {
i = offset - VHUB_IRQ_DEV1_BIT;
ast_vhub_dev_irq(&vhub->ports[i].dev);
for (i = 0; i < vhub->max_ports; i++) {
if (istat & VHUB_DEV_IRQ(i))
ast_vhub_dev_irq(&vhub->ports[i].dev);
}
}
......
......@@ -67,6 +67,9 @@
#define VHUB_IRQ_HUB_EP0_SETUP (1 << 0)
#define VHUB_IRQ_ACK_ALL 0x1ff
/* Downstream device IRQ mask. */
#define VHUB_DEV_IRQ(n) (VHUB_IRQ_DEVICE1 << (n))
/* SW reset reg */
#define VHUB_SW_RESET_EP_POOL (1 << 9)
#define VHUB_SW_RESET_DMA_CONTROLLER (1 << 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment