From: "Marek Behún" <kabel@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>,
Arnd Bergmann <arnd@arndb.de>,
soc@kernel.org, Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-crypto@vger.kernel.org, arm@kernel.org
Subject: Re: [PATCH v6 07/11] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG
Date: Wed, 24 Apr 2024 18:55:47 +0200 [thread overview]
Message-ID: <20240424185547.4cf20408@dellmb> (raw)
In-Reply-To: <Zifu-l2o9ADkhMlW@smile.fi.intel.com>
On Tue, 23 Apr 2024 20:25:14 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Tue, Apr 23, 2024 at 06:57:04PM +0200, Marek Behún wrote:
> > On Tue, 23 Apr 2024 19:43:41 +0300
> > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > On Tue, Apr 23, 2024 at 7:32 PM Marek Behún <kabel@kernel.org> wrote:
> > > > On Tue, 23 Apr 2024 18:58:19 +0300
> > > > Andy Shevchenko <andy@kernel.org> wrote:
> > > > > On Thu, Apr 18, 2024 at 02:11:12PM +0200, Marek Behún wrote:
>
> ...
>
> > > > > > + irq_idx = omnia_int_to_gpio_idx[__bf_shf(INT_TRNG)];
> > > > > > + irq = devm_irq_create_mapping(dev, mcu->gc.irq.domain, irq_idx);
> > > > > > + if (irq < 0)
> > > > > > + return dev_err_probe(dev, irq, "Cannot map TRNG IRQ\n");
> > > > >
> > > > > This looks like some workaround against existing gpiod_to_irq(). Why do you
> > > > > need this?
> > > >
> > > > Hmmm, I thought that would not work because that line is only valid
> > > > as an IRQ, not as a GPIO (this is enforced via the valid_mask member of
> > > > gpio_chip and gpio_irq_chip).
> > > >
> > > > But looking at the code of gpiolib, if I do
> > > > irq = gpiod_to_irq(gpiochip_get_desc(gc, irq_idx));
> > > > the valid_mask is not enforced anywhere.
> > >
> > > Which one? GPIO has two: one per GPIO realm and one for IRQ domain.
> >
> > The GPIO line validity is not enforced. The IRQ line validity is
> > enforced in the gpiochip_to_irq() method.
>
> Okay, but does it work for you as expected then?
>
> If not, we should fix GPIO library to have gpiod_to_irq() to work as expected.
Yes, it does. I am going to send a new version in a few minutes.
Marek
next prev parent reply other threads:[~2024-04-24 16:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 12:11 [PATCH v6 00/11] Turris Omnia MCU driver Marek Behún
2024-04-18 12:11 ` [PATCH v6 07/11] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG Marek Behún
2024-04-23 15:58 ` Andy Shevchenko
2024-04-23 16:32 ` Marek Behún
2024-04-23 16:43 ` Andy Shevchenko
2024-04-23 16:57 ` Marek Behún
2024-04-23 17:25 ` Andy Shevchenko
2024-04-24 16:55 ` Marek Behún [this message]
2024-04-18 12:11 ` [PATCH v6 09/11] platform: cznic: turris-omnia-mcu: Add support for digital message signing via debugfs Marek Behún
2024-04-23 16:05 ` [PATCH v6 00/11] Turris Omnia MCU driver Andy Shevchenko
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=20240424185547.4cf20408@dellmb \
--to=kabel@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=arm@kernel.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.clement@bootlin.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=olivia@selenic.com \
--cc=soc@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