From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Tatyana Brokhman <tlinder@codeaurora.org>
Cc: greg@kroah.com, linux-usb@vger.kernel.org,
linux-arm-msm@vger.kernel.org, balbi@ti.com,
ablay@codeaurora.org, open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9 7/7] usb: Adding SuperSpeed support to dummy_hcd
Date: Mon, 9 May 2011 19:49:10 +0200 [thread overview]
Message-ID: <20110509174910.GA7025@linutronix.de> (raw)
In-Reply-To: <1304853414-10234-8-git-send-email-tlinder@codeaurora.org>
* Tatyana Brokhman | 2011-05-08 14:16:48 [+0300]:
> static int dummy_hcd_probe(struct platform_device *pdev)
> {
>- struct usb_hcd *hcd;
>+ struct usb_hcd *hs_hcd;
>+ struct usb_hcd *ss_hcd;
> int retval;
>
> dev_info(&pdev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);
>
>- hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, dev_name(&pdev->dev));
>- if (!hcd)
>+ hs_hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, dev_name(&pdev->dev));
>+ if (!hs_hcd)
> return -ENOMEM;
>- the_controller = hcd_to_dummy (hcd);
>
>- retval = usb_add_hcd(hcd, 0, 0);
>- if (retval != 0) {
>- usb_put_hcd (hcd);
>- the_controller = NULL;
>+ hs_hcd->speed = HCD_USB2;
Why do you overwrite the speed here and in ->reset()?
>+
>+ retval = usb_add_hcd(hs_hcd, 0, IRQF_DISABLED | IRQF_SHARED);
Why IRQF_DISABLED | IRQF_SHARED? you don't interrupts at all.
>+ if (retval != 0)
>+ usb_put_hcd(hs_hcd);
Your error recovery is broken here. You have to leave instead of
continue with SS.
>+ dev_set_drvdata(&pdev->dev, hs_hcd);
This is already done by usb_add_hcd()
>+
>+ ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev,
>+ dev_name(&pdev->dev), hs_hcd);
>+ if (!ss_hcd) {
>+ retval = -ENOMEM;
>+ goto dealloc_usb2_hcd;
> }
>+
>+ retval = usb_add_hcd(ss_hcd, 0, IRQF_DISABLED | IRQF_SHARED);
>+ if (retval)
>+ goto put_usb3_hcd;
>+
>+ return 0;
>+
>+put_usb3_hcd:
>+ usb_put_hcd(ss_hcd);
>+dealloc_usb2_hcd:
>+ usb_put_hcd(hs_hcd);
>+ the_controller.hs_hcd = the_controller.ss_hcd = NULL;
> return retval;
> }
Sebastian
next prev parent reply other threads:[~2011-05-09 17:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-08 11:16 [PATCH v9 0/7] usb gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 1/7] usb: Add usb_endpoint_descriptor to be part of the struct usb_ep Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 2/7] usb: Configure endpoint according to gadget speed Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 3/7] usb: Modify existing gadget drivers to use config_ep_by_speed() instead of ep_choose Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 4/7] usb:gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-09 9:19 ` Felipe Balbi
2011-05-11 13:00 ` Tanya Brokhman
[not found] ` <1304853414-10234-1-git-send-email-tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-05-08 11:16 ` [PATCH v9 5/7] usb: Add streams support to the gadget framework Tatyana Brokhman
2011-05-09 9:25 ` Felipe Balbi
2011-05-11 13:29 ` Tanya Brokhman
2011-05-11 20:54 ` Felipe Balbi
2011-05-08 11:16 ` [PATCH v9 6/7] usb:gadget: Introduce usb_generate_ss_descriptors() Tatyana Brokhman
2011-05-08 11:16 ` [PATCH v9 7/7] usb: Adding SuperSpeed support to dummy_hcd Tatyana Brokhman
2011-05-09 17:49 ` Sebastian Andrzej Siewior [this message]
2011-05-10 11:24 ` Sergei Shtylyov
2011-05-12 5:19 ` Tanya Brokhman
2011-05-12 14:45 ` Alan Stern
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=20110509174910.GA7025@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=ablay@codeaurora.org \
--cc=balbi@ti.com \
--cc=greg@kroah.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tlinder@codeaurora.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).