From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Jeff LaBundy <jeff@labundy.com>
Cc: James Ogletree <jogletre@opensource.cirrus.com>,
<dmitry.torokhov@gmail.com>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
<lee@kernel.org>, <broonie@kernel.org>,
<patches@opensource.cirrus.com>, <linux-sound@vger.kernel.org>,
<linux-input@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v9 3/5] mfd: cs40l50: Add support for CS40L50 core driver
Date: Mon, 11 Mar 2024 10:30:53 +0000 [thread overview]
Message-ID: <Ze7dXdVdZKN5Kmv/@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <Ze5E1KxRltUTX4R6@nixie71>
On Sun, Mar 10, 2024 at 06:40:04PM -0500, Jeff LaBundy wrote:
> On Fri, Mar 08, 2024 at 10:24:19PM +0000, James Ogletree wrote:
> > +static void cs40l50_start_dsp(const struct firmware *bin, void *context)
> > +{
> > + struct cs40l50 *cs40l50 = context;
> > + int err;
> > +
> > + /* Wavetable is optional; start DSP regardless */
> > + cs40l50->bin = bin;
> > +
> > + mutex_lock(&cs40l50->lock);
>
> It seems the mutex is used only to prevent interrupt handling while the DSP
> is being configured; can't we just call disable_irq() and enable_irq() here?
>
The trouble with diabling the IRQ is it masks the IRQ line. That
means if the IRQ is shared with other devices you will be
silencing their IRQs for the duration as well, which is slightly
rude. Especially given the driver requests the IRQ with the
SHARED flag I would be inclinded to stick with the mutex unless
there are other reasons not to.
> > +static int cs40l50_irq_init(struct cs40l50 *cs40l50)
> > +{
> > + struct device *dev = cs40l50->dev;
> > + int err, i, virq;
> > +
> > + err = devm_regmap_add_irq_chip(dev, cs40l50->regmap, cs40l50->irq,
> > + IRQF_ONESHOT | IRQF_SHARED, 0,
> > + &cs40l50_irq_chip, &cs40l50->irq_data);
> > + if (err) {
> > + dev_err(dev, "Failed adding IRQ chip\n");
>
> I don't see any need for individual prints in this function, since the call
> to cs40l50_irq_init() is already followed by a call to dev_err_probe().
I would probably suggest keeping these individual prints here and
removing the one in cs40l50_probe, it is nicer to know exactly
what failed when something goes wrong. That said at least the
devm_request_threaded_irq can probe defer so that print should be
a dev_err_probe since this function is only called on the probe
path.
> > + dev_info(cs40l50->dev, "Cirrus Logic CS40L50 rev. %02X\n", cs40l50->revid);
>
> This should be dev_dbg().
>
Not sure what the concenus is on this, but personally I greatly
prefer these device ID prints being infos. Nice to always have
some indication of the device and its version.
Thanks,
Charles
next prev parent reply other threads:[~2024-03-11 10:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 22:24 [PATCH v9 0/5] Add support for CS40L50 James Ogletree
2024-03-08 22:24 ` [PATCH v9 1/5] firmware: cs_dsp: Add write sequencer interface James Ogletree
2024-03-10 19:12 ` Jeff LaBundy
2024-03-11 10:14 ` Charles Keepax
2024-03-14 14:40 ` Jeff LaBundy
2024-03-15 9:29 ` Charles Keepax
2024-03-08 22:24 ` [PATCH v9 2/5] dt-bindings: input: cirrus,cs40l50: Add initial DT binding James Ogletree
2024-03-10 19:29 ` Jeff LaBundy
2024-03-11 6:31 ` Krzysztof Kozlowski
2024-03-14 14:42 ` Jeff LaBundy
2024-03-08 22:24 ` [PATCH v9 3/5] mfd: cs40l50: Add support for CS40L50 core driver James Ogletree
2024-03-10 23:40 ` Jeff LaBundy
2024-03-11 10:30 ` Charles Keepax [this message]
2024-03-14 15:15 ` Jeff LaBundy
2024-03-14 21:03 ` James Ogletree
2024-03-08 22:24 ` [PATCH v9 4/5] Input: cs40l50 - Add support for the CS40L50 haptic driver James Ogletree
2024-03-14 15:54 ` Jeff LaBundy
2024-03-15 20:23 ` James Ogletree
2024-03-08 22:24 ` [PATCH v9 5/5] ASoC: cs40l50: Support I2S streaming to CS40L50 James Ogletree
2024-03-14 16:05 ` Jeff LaBundy
2024-03-14 16:22 ` Mark Brown
2024-03-20 0:41 ` James Ogletree
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=Ze7dXdVdZKN5Kmv/@ediswmail9.ad.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jeff@labundy.com \
--cc=jogletre@opensource.cirrus.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=robh+dt@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