From: Philipp Zabel <p.zabel@pengutronix.de>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Grégory Clement" <gregory.clement@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>
Subject: Re: [PATCH 2/2] reset: eyeq: add platform driver
Date: Tue, 02 Jul 2024 11:19:16 +0200 [thread overview]
Message-ID: <3fe74a3fc2747c8f9a3f433352720cfed76918ba.camel@pengutronix.de> (raw)
In-Reply-To: <D2EC7KK40YX5.C3G1SM3FEDJO@bootlin.com>
Hi Théo,
On Mo, 2024-07-01 at 18:19 +0200, Théo Lebrun wrote:
[...]
> > Is there any benefit from per-domain mutexes over just a single mutex?
>
> Some domains can stay locked for pretty long in theory because of Logic
> built-in self-test (LBIST). This is the reasoning behind
> eqr_busy_wait_locked().
>
> Other domains are not concerned by this behavior.
>
> More concretely, on EyeQ5, SARCR and ACRP domains can lock their mutexes
> for a relatively long time, and for good reasons. We wouldn't want the
> PCIE domain to suffer from that if it happens to (de)assert a reset at
> the same time.
Thank you for the explanation.
> >
> > > + void __iomem *base;
> > > + const struct eqr_match_data *data;
> > > + struct reset_controller_dev rcdev;
> > > +};
> > > +
> > > +#define rcdev_to_priv(rcdev) container_of(rcdev, struct eqr_private, rcdev)
> >
> > Please use checkpatch --strict, and ideally mention when you ignore a
> > warning on purpose. In this case, the macro parameter should named
> > something else, because the last parameter to container_of must be
> > "rcdev" verbatim. This only works by accident because the passed
> > parameter also happens to be called called "rcdev" at all call sites.
Thinking about this again, it would be even better to turn this into a
static inline function instead.
> I have let this CHECK from `checkpatch --strict` slip through indeed.
> Other remaining messages, with explanations, are:
>
> - WARNING: added, moved or deleted file(s), does MAINTAINERS need
> updating?
>
> This is done in a single patch [0] in the MIPS series to avoid
> conflicts in between series.
>
> - CHECK: struct mutex definition without comment
>
> This is about the above mutexes field. Do you want a code comment
> about the reasoning for one mutex per domain?
Yes, that would be nice. I'm not pedantic about the lock comments
because in reset drivers it's usually pretty obvious what the lock is
used for, but mentioning that the mutexes cover register read-modify-
write plus waiting for LBIST on some domains seems like a good idea.
[...]
> >
> > > +static void eqr_assert_locked(struct eqr_private *priv, u32 domain, u32 offset)
> > > +{
[...]
> > > + case EQR_EYEQ6H_SARCR:
> > > + val = readl(base + EQR_EYEQ6H_SARCR_RST_REQUEST);
> > > + val &= ~BIT(offset);
> > > + writel(val, base + EQR_EYEQ6H_SARCR_RST_REQUEST);
> > > + writel(val, base + EQR_EYEQ6H_SARCR_CLK_REQUEST);
> >
> > This looks peculiar. Why is it ok to write the value read from
> > RST_REQUEST into CLK_REQUEST?
>
> What is abstracted away by the hardware on EyeQ5 is not anymore on
> EyeQ6H. Previously a single register was used for requests and a single
> register for status. Now there are two request registers and two status
> registers.
>
> Those registers *must be kept in sync*. The register name referencing
> clock is not to be confused with the clock driver of the
> system-controller. It is describing a register within the reset
> controller.
>
> This hardware interface is odd, I might add a comment?
Yes, please. With the knowledge that those registers must be kept in
sync, this goes from strange to obvious.
regards
Philipp
next prev parent reply other threads:[~2024-07-02 9:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 16:11 [PATCH 0/2] Add Mobileye EyeQ reset support Théo Lebrun
2024-06-28 16:11 ` [PATCH 1/2] Revert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings" Théo Lebrun
2024-06-28 16:11 ` [PATCH 2/2] reset: eyeq: add platform driver Théo Lebrun
2024-07-01 8:59 ` Philipp Zabel
2024-07-01 16:19 ` Théo Lebrun
2024-07-02 9:19 ` Philipp Zabel [this message]
2024-07-02 16:06 ` Théo Lebrun
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=3fe74a3fc2747c8f9a3f433352720cfed76918ba.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.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).