From: Philipp Zabel <p.zabel@pengutronix.de>
To: Alex Elder <elder@ieee.org>, Ze Huang <huang.ze@linux.dev>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@gentoo.org>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] usb: dwc3: add generic driver to support flattened
Date: Mon, 21 Jul 2025 13:01:30 +0200 [thread overview]
Message-ID: <d178cfb17e726597e2b4d4c49de5040646b9e55e.camel@pengutronix.de> (raw)
In-Reply-To: <d2e9a521-568e-433d-a59b-9b98138ace2b@ieee.org>
On Di, 2025-07-15 at 15:50 -0500, Alex Elder wrote:
> On 7/12/25 2:49 AM, Ze Huang wrote:
[...]
> > +static int dwc3_generic_probe(struct platform_device *pdev)
> > +{
> > + struct dwc3_probe_data probe_data = {};
> > + struct device *dev = &pdev->dev;
> > + struct dwc3_generic *dwc3;
> > + struct resource *res;
> > + int ret;
> > +
> > + dwc3 = devm_kzalloc(dev, sizeof(*dwc3), GFP_KERNEL);
> > + if (!dwc3)
> > + return -ENOMEM;
> > +
> > + dwc3->dev = dev;
> > +
> > + platform_set_drvdata(pdev, dwc3);
> > +
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + if (!res) {
> > + dev_err(&pdev->dev, "missing memory resource\n");
> > + return -ENODEV;
> > + }
> > +
> > + dwc3->resets = devm_reset_control_array_get_optional_exclusive(dev);
> > + if (IS_ERR(dwc3->resets))
> > + return dev_err_probe(dev, PTR_ERR(dwc3->resets), "failed to get resets\n");
> > +
>
> It isn't enforced on exclusive resets, but I'm pretty sure
> resets are assumed to be asserted initially.
The reset controller API doesn't guarantee this. Whether reset controls
are initially asserted depends on the specific SoC/reset controller and
also on what the bootloader did before.
For example, there are self-deasserting reset controls that start out
deasserted and can only ever be asserted for a short pulse [1]. Even
the shared reset API only assumes that the reset line may have been
asserted at some point before the first assert() [2].
[1] https://docs.kernel.org/driver-api/reset.html#triggering
[2] https://docs.kernel.org/driver-api/reset.html#assertion-and-deassertion
Whether an explicit reset_control_assert() in the probe function is
needed depends on which assumptions the driver can make on its own (on
all platforms it is used on).
For example, for some devices it may be enough to assume that the
device has been reset at some point between power-on and probe.
regards
Philipp
prev parent reply other threads:[~2025-07-21 11:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 7:48 [PATCH v6 0/2] Add SpacemiT K1 USB3.0 host controller support Ze Huang
2025-07-12 7:49 ` [PATCH v6 1/2] dt-bindings: usb: dwc3: add support for SpacemiT K1 Ze Huang
2025-07-21 11:02 ` Philipp Zabel
2025-07-21 11:57 ` Ze Huang
2025-07-12 7:49 ` [PATCH v6 2/2] usb: dwc3: add generic driver to support flattened Ze Huang
2025-07-15 20:50 ` Alex Elder
2025-07-20 6:34 ` Ze Huang
2025-07-21 12:08 ` Ze Huang
2025-07-22 0:34 ` Yao Zi
2025-07-22 15:55 ` Ze Huang
2025-07-21 11:01 ` Philipp Zabel [this message]
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=d178cfb17e726597e2b4d4c49de5040646b9e55e.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=Thinh.Nguyen@synopsys.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=elder@ieee.org \
--cc=gregkh@linuxfoundation.org \
--cc=huang.ze@linux.dev \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
/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).