From: Jack Pham <jackp@codeaurora.org>
To: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Cc: linux-usb@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <balbi@kernel.org>,
Peter Chen <peter.chen@kernel.org>
Subject: Re: [PATCH] usb: dwc3: Fix debugfs creation flow
Date: Wed, 16 Jun 2021 23:31:31 -0700 [thread overview]
Message-ID: <20210617063130.GA11567@jackp-linux.qualcomm.com> (raw)
In-Reply-To: <7f5167c67cd95102b2acab967d19af7962415a66.1623906350.git.Minas.Harutyunyan@synopsys.com>
Hi Minas,
On Wed, Jun 16, 2021 at 10:56:02PM -0700, Minas Harutyunyan wrote:
> Creation EP's debugfs called earlier than debugfs folder for dwc3
> device created. As result EP's debugfs are created in '/sys/kernel/debug'
> instead of '/sys/kernel/debug/usb/dwc3.1.auto'.
Interesting, I didn't encounter this in my testing. Oh but in our case
we have dr_mode as USB_DR_MODE_OTG, so when dwc3_core_init_mode() calls
dwc3_drd_init() the gadget_init() is done from a worker, and meanwhile
dwc3_debugfs_init() would have already had a chance to create the root
folder before that.
I'm assuming you're seeing this with dr_mode == USB_DR_MODE_PERIPHERAL?
Then in that case dwc3_core_init_mode() synchronously calls
dwc3_gadget_init() before the debugfs_init.
> Moved dwc3_debugfs_init() function call before calling
> dwc3_core_init_mode() to allow create dwc3 debugfs parent before
> creating EP's debugfs's.
>
> Fixes: 8562d5bfc0fc ("USB: dwc3: remove debugfs root dentry storage")
Isn't it fixing 8d396bb0a5b6 ("usb: dwc3: debugfs: Add and remove
endpoint dirs dynamically")? More fallout from my change I guess :-/.
Anyway it looks good to me, thanks!
Reviewed-by: Jack Pham <jackp@codeaurora.org>
> Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
> ---
> drivers/usb/dwc3/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index e0a8e796c158..ba74ad7f6995 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1620,17 +1620,18 @@ static int dwc3_probe(struct platform_device *pdev)
> }
>
> dwc3_check_params(dwc);
> + dwc3_debugfs_init(dwc);
>
> ret = dwc3_core_init_mode(dwc);
> if (ret)
> goto err5;
>
> - dwc3_debugfs_init(dwc);
> pm_runtime_put(dev);
>
> return 0;
>
> err5:
> + dwc3_debugfs_exit(dwc);
> dwc3_event_buffers_cleanup(dwc);
>
> usb_phy_shutdown(dwc->usb2_phy);
>
> base-commit: 1da8116eb0c5dfc05cfb89896239badb18c4daf3
> --
> 2.11.0
>
next prev parent reply other threads:[~2021-06-17 6:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 5:56 [PATCH] usb: dwc3: Fix debugfs creation flow Minas Harutyunyan
2021-06-17 6:10 ` Greg Kroah-Hartman
2021-06-17 7:11 ` Minas Harutyunyan
2021-06-17 7:33 ` Greg Kroah-Hartman
2021-06-17 9:14 ` Minas Harutyunyan
2021-06-17 11:01 ` Greg Kroah-Hartman
2021-06-17 16:20 ` Minas Harutyunyan
2021-06-17 6:31 ` Jack Pham [this message]
2021-06-17 7:24 ` Minas Harutyunyan
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=20210617063130.GA11567@jackp-linux.qualcomm.com \
--to=jackp@codeaurora.org \
--cc=Minas.Harutyunyan@synopsys.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@kernel.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).