From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: surong pang <surong.pang@gmail.com>
Cc: mathias.nyman@intel.com, Greg KH <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Orson.Zhai@unisoc.com, yunguo.wu@unisoc.com
Subject: Re: [PATCH V1 1/1] usb/host: Let usb phy shutdown later
Date: Fri, 22 Apr 2022 14:59:01 +0300 [thread overview]
Message-ID: <e05ec742-c3dc-df7c-c5d7-29358d0a7081@linux.intel.com> (raw)
In-Reply-To: <CAEDbmAT3SoSsEmTkELSYoykGN+AuPgi2N11V2YwKuaC3nKMEmQ@mail.gmail.com>
On 22.4.2022 13.43, surong pang wrote:
>>>> @@ -398,6 +397,7 @@ static int xhci_plat_remove(struct platform_device *dev)
>>>> clk_disable_unprepare(clk);
>>>> clk_disable_unprepare(reg_clk);
>>>> + usb_phy_shutdown(hcd->usb_phy);
>>>> usb_put_hcd(hcd);
>
> Is it ok to put usb_phy_shutdown before usb_put_hcd(hcd)? hcd is
> released at usb_put_hcd.
yes, above looks good.
>
> UNISOC DWC3 phy is not divided USB 2.0/3.0 phy clearly. Yes, it's
> UNISOC's issue.
> It UNISOC's dtsi: phys = <&ssphy>, <&ssphy>;
> If to shutdown phy too earlier, it will cost 10s timeout to do xhci_reset.
> usb_remmove_hcd --> usb_stop_hcd --> xhci_stop --> xhci_reset -->
> xhci_handshake(&xhci->op_regs->command, CMD_RESET, 0, 10 * 1000 *1000)
>
> I want to know this change is acceptable or not?
>
> hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
> Why in xhci_plat_remove, just to shutdown "usb-phy"[0], not to
> shutdown "usb-phy"[1] ?
xhci-plat.c only takes one phy at index 0, so we only shutdowns that one.
Looks like usb core hcd code has better phy handling when adding and
removing hcds. It supports multiple phys.
If possible use that instead.
See drivers/usb/core/hcd.c usb_add_hcd()
Thanks
-Mathias
next prev parent reply other threads:[~2022-04-22 11:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 12:25 Surong Pang
2022-04-19 14:45 ` Mathias Nyman
2022-04-22 2:10 ` surong pang
2022-04-22 7:53 ` Mathias Nyman
2022-04-22 10:43 ` surong pang
2022-04-22 11:59 ` Mathias Nyman [this message]
2022-04-24 1:57 ` [PATCH V2] " Surong Pang
2022-04-26 11:53 ` Greg KH
[not found] ` <CAEDbmAQmYQdMNY8sANnSuauBcsemrV1MFR3bB83JJ7cHNdWGmA@mail.gmail.com>
2022-04-28 6:31 ` Greg KH
2022-04-29 1:54 ` [PATCH V2] xhci-plat: " surong pang
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=e05ec742-c3dc-df7c-c5d7-29358d0a7081@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=Orson.Zhai@unisoc.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=surong.pang@gmail.com \
--cc=yunguo.wu@unisoc.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
Powered by JetHome