From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Julie Zhu <julie.zhu@xilinx.com>
Cc: linux-usb@vger.kernel.org, gregkh@suse.de, juliez@xilinx.com,
linuxppc-dev@ozlabs.org, john.linn@xilinx.com
Subject: Re: [PATCH] USB: Add support for Xilinx USB host controller
Date: Mon, 21 Sep 2009 20:23:52 +1000 [thread overview]
Message-ID: <1253528632.7103.138.camel@pasglop> (raw)
In-Reply-To: <20090915221050.0DA0F2C005E@mail34-va3.bigfish.com>
On Tue, 2009-09-15 at 16:10 -0600, Julie Zhu wrote:
> Add bus glue driver for Xilinx USB host controller. The controller can be
> configured as HS only or HS/FS hybrid. The driver uses the device tree file
> to configure the driver according to the setting in the hardware system.
>
> This driver has been tested with usbtest using the NET2280 PCI card.
>
> Signed-off-by: Julie Zhu <julie.zhu@xilinx.com>
Hi !
First, this is a very clean piece of code, thanks.
Just a few minor nits:
> static int ehci_xilinx_port_handed_over(struct usb_hcd *hcd, int portnum)
> +{
> + dev_warn(hcd->self.controller, "port %d cannot be enabled\n", portnum);
> + if (hcd->has_tt) {
> + dev_warn(hcd->self.controller,
> + "Maybe you have connected an LS device?\n");
> +
> + dev_warn(hcd->self.controller,
> + "We do not support LS devices\n");
> + } else {
> + dev_warn(hcd->self.controller,
> + "Maybe your device is not an HS device?\n");
> + dev_warn(hcd->self.controller,
> + "The USB host controller does not support FS or "
> + "LS devices\n");
> + dev_warn(hcd->self.controller,
> + "You can reconfigure the host controller to have "
> + "FS support\n");
> + }
> +
> + return 0;
> +}
I'm not sure the final users would know what "FS", "LS" or "HS" mean
here, it might be worth being a -tad- more verbose :-)
.../...
> +
> +/**
> + * ehci_hcd_xilinx_of_remove - shutdown hcd and release resources
> + * @op: pointer to of_device structure that is to be removed
> + *
> + * Remove the hcd structure, and release resources that has been requested
> + * during probe.
> + */
> +static int ehci_hcd_xilinx_of_remove(struct of_device *op)
> +{
> + struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
> + dev_set_drvdata(&op->dev, NULL);
> +
> + dev_dbg(&op->dev, "stopping XILINX-OF USB Controller\n");
> +
> + usb_remove_hcd(hcd);
> +
> + iounmap(hcd->regs);
> + irq_dispose_mapping(hcd->irq);
You don't need to dispose of the irq mapping, and in fact, it could be
harmful if the interrupt is shared, as we don't refcount the mapping
users. Just remove the line above. The mapping doesn't really use
resources (well, it depends on your PIC but even then, it's minor) so
it's better, once a HW IRQ number has been associated to a linux IRQ
number, to keep that association for the lifetime of the kernel.
Cheers,
Ben.
next prev parent reply other threads:[~2009-09-21 10:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-15 22:10 [PATCH] USB: Add support for Xilinx USB host controller Julie Zhu
2009-09-21 10:23 ` Benjamin Herrenschmidt [this message]
2009-09-21 14:14 ` Grant Likely
2009-09-21 14:41 ` Julie Zhu
2009-09-21 14:46 ` Grant Likely
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=1253528632.7103.138.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=gregkh@suse.de \
--cc=john.linn@xilinx.com \
--cc=julie.zhu@xilinx.com \
--cc=juliez@xilinx.com \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).