Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: balbi@ti.com, ralf@linux-mips.org, linux-mips@linux-mips.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: bcm63xx UDC driver
Date: Sun, 19 Aug 2012 22:17:14 +0200	[thread overview]
Message-ID: <20120819201714.GA3152@breakpoint.cc> (raw)
In-Reply-To: <97cb21b8063a02a9664baf8b749ae200@localhost>

On Sat, Aug 18, 2012 at 10:18:01AM -0700, Kevin Cernekee wrote:

This is a quick look :)

> diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
> new file mode 100644
> index 0000000..da68f43
> --- /dev/null
> +++ b/drivers/usb/gadget/bcm63xx_udc.c
<snip>

> +static irqreturn_t bcm63xx_udc_data_isr(int irq, void *dev_id)
> +{
> +	struct bcm63xx_udc *udc = dev_id;
> +	struct bcm63xx_ep *bep;
> +	struct iudma_ch *iudma = NULL;
> +	struct usb_request *req = NULL;
> +	struct bcm63xx_req *breq = NULL;
> +	int is_done = 0, rc, i;
> +
> +	spin_lock(&udc->lock);
> +
> +	for (i = 0; i < NUM_IUDMA; i++)
> +		if (udc->iudma[i].irq == irq)
> +			iudma = &udc->iudma[i];
> +	BUG_ON(!iudma);

This is rough. Please don't do this. Bail out in probe or print an error here
and return with IRQ_NONE and time will close this irq.

<snip>

> +static int __devinit bcm63xx_udc_probe(struct platform_device *pdev)
> +{

<snip>

> +	for (i = 0; i < NUM_IUDMA + 1; i++) {
> +		int irq = platform_get_irq(pdev, i);
> +		if (irq < 0) {
> +			dev_err(dev, "missing IRQ resource #%d\n", i);
> +			goto out_uninit;
> +		}
> +		if (devm_request_irq(dev, irq,
> +		    i ? &bcm63xx_udc_data_isr : &bcm63xx_udc_ctrl_isr,
> +		    0, dev_name(dev), udc) < 0) {
> +			dev_err(dev, "error requesting IRQ #%d\n", irq);
> +			goto out_uninit;
> +		}
> +		if (i > 0)
> +			udc->iudma[i - 1].irq = irq;
> +	}

According to this code, i in iudma[] can be in 1..5. You could have more than
one IRQ. The comment above this for loop is point less. So I think if you can
only have _one_ idma irq than you could remove the for loop in
bcm63xx_udc_data_isr().

Sebastian

  reply	other threads:[~2012-08-19 20:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18 17:18 [PATCH] usb: gadget: bcm63xx UDC driver Kevin Cernekee
2012-08-19 20:17 ` Sebastian Andrzej Siewior [this message]
2012-08-19 20:53   ` Kevin Cernekee
2012-08-20  7:24     ` Felipe Balbi
2012-08-20 19:52     ` Sebastian Andrzej Siewior
2012-08-20  7:40 ` Felipe Balbi
2012-08-21  3:48   ` Kevin Cernekee
2012-08-21 12:04     ` Felipe Balbi
2012-08-21 15:20       ` Kevin Cernekee
2012-08-21 18:08         ` Felipe Balbi
2012-08-21 19:35           ` Kevin Cernekee
2012-08-21 20:34             ` Alan Stern
2012-08-21 20:34               ` Alan Stern
2012-08-21 21:08               ` Kevin Cernekee
2012-08-21 21:34                 ` Alan Stern
2012-08-21 21:34                   ` Alan Stern
2012-08-21 21:58                   ` Kevin Cernekee

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=20120819201714.GA3152@breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=balbi@ti.com \
    --cc=cernekee@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox