linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Greg KH <greg@kroah.com>, Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: linux-usb@vger.kernel.org, laurent.pinchart@ideasonboard.com,
	caleb.connolly@ideasonboard.com, paul.elder@ideasonboard.com,
	kernel@pengutronix.de
Subject: Re: [PATCH v3 1/5] usb: dwc3: gadget: set gadgets parent to the right controller
Date: Wed, 21 Jul 2021 11:11:37 +0300	[thread overview]
Message-ID: <87r1fsxf0m.fsf@kernel.org> (raw)
In-Reply-To: <YPfUTSOpXCSDnmyW@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]


Hi,

Greg KH <greg@kroah.com> writes:
> On Mon, Jun 28, 2021 at 05:53:07PM +0200, Michael Grzeschik wrote:
>> In case of dwc3 it is possible that the sysdev is the parent of the
>> controller. To ensure the right dev is set to the gadget's dev parent we
>> will hand over sysdev instead of dev, which will always point to the
>> controller.
>> 
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> 
>> ---
>>    -> v2: first version of patch
>>    -> v3: -
>> ---
>>  drivers/usb/dwc3/gadget.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index af6d7f157989d..8a1b1daff2e97 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -3990,7 +3990,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
>>  	}
>>  
>>  
>> -	usb_initialize_gadget(dwc->dev, dwc->gadget, dwc_gadget_release);
>> +	usb_initialize_gadget(dwc->sysdev, dwc->gadget, dwc_gadget_release);
>
> Does this change how the device shows up in sysfs?

it might, but not in all instances of dwc3

> Why does the parent not always work properly here?

This is a really old commit by Arnd from back in 2016 (d64ff406e51e)
where it was noticed that dwc3's dma ops weren't properly setup. Arnd
decided to pass a property to tell dwc3 core to use the parent device
for dma operations.

This is not required in all instances of dwc3, though.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

  reply	other threads:[~2021-07-21  8:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 15:53 [PATCH v3 0/5] usb: gadget: uvc: improve uvc gadget performance Michael Grzeschik
2021-06-28 15:53 ` [PATCH v3 1/5] usb: dwc3: gadget: set gadgets parent to the right controller Michael Grzeschik
2021-07-21  8:01   ` Greg KH
2021-07-21  8:11     ` Felipe Balbi [this message]
2021-06-28 15:53 ` [PATCH v3 2/5] usb: gadget: uvc: make uvc_num_requests depend on gadget speed Michael Grzeschik
2021-06-28 15:53 ` [PATCH v3 3/5] usb: gadget: uvc: set v4l2_dev->dev in f_uvc Michael Grzeschik
2021-06-28 15:53 ` [PATCH v3 4/5] usb: gadget: uvc: add scatter gather support Michael Grzeschik
2021-06-28 15:53 ` [PATCH v3 5/5] usb: gadget: uvc: decrease the interrupt load to a quarter Michael Grzeschik
2021-06-28 16:47 ` [PATCH v3 0/5] usb: gadget: uvc: improve uvc gadget performance Michael Grzeschik

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=87r1fsxf0m.fsf@kernel.org \
    --to=balbi@kernel.org \
    --cc=caleb.connolly@ideasonboard.com \
    --cc=greg@kroah.com \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=paul.elder@ideasonboard.com \
    /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).