From: Jack Pham <jackp@codeaurora.org>
To: Peter Chen <peter.chen@kernel.org>
Cc: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Roger Quadros <rogerq@kernel.org>,
linux-usb@vger.kernel.org, Wesley Cheng <wcheng@codeaurora.org>
Subject: Re: [PATCH] usb: dwc3: debugfs: Add and remove endpoint dirs dynamically
Date: Tue, 1 Jun 2021 09:09:10 -0700 [thread overview]
Message-ID: <20210601160910.GA4812@jackp-linux.qualcomm.com> (raw)
In-Reply-To: <20210601070744.GA9087@nchen>
Hi Peter,
On Tue, Jun 01, 2021 at 03:07:44PM +0800, Peter Chen wrote:
<snip>
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index 65d9b7227752..dbba31d415d7 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -2754,6 +2754,8 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum)
> > INIT_LIST_HEAD(&dep->started_list);
> > INIT_LIST_HEAD(&dep->cancelled_list);
> >
> > + dwc3_debugfs_create_endpoint_dir(dep);
> > +
> > return 0;
> > }
> >
> > @@ -2797,6 +2799,7 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
> > list_del(&dep->endpoint.ep_list);
> > }
> >
> > + debugfs_remove_recursive(debugfs_lookup(dep->name, dwc->root));
>
> There is one more debugfs_remove_recursive at dwc3_debugfs_exit, need to delete?
No I think it should be fine. dwc3_debugfs_exit() is only called by
dwc3_remove(), and at that time it removes the debugfs directory for the
entire instance from dwc->root, which includes the parent and all the
endpoint subdirectories if present.
dwc3_core_exit_mode() -> dwc3_gadget_exit() is done after that, by which
point the debugfs remove here at dwc3_gadget_free_endpoints() will be
redundant and a no-op anyway.
Thanks,
Jack
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2021-06-01 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-29 19:29 [PATCH] usb: dwc3: debugfs: Add and remove endpoint dirs dynamically Jack Pham
2021-06-01 7:07 ` Peter Chen
2021-06-01 16:09 ` Jack Pham [this message]
2021-06-02 0:55 ` Peter Chen
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=20210601160910.GA4812@jackp-linux.qualcomm.com \
--to=jackp@codeaurora.org \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@kernel.org \
--cc=rogerq@kernel.org \
--cc=wcheng@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).