mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Alexander Graf" <graf@amazon.com>, linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Olivia Mackall" <olivia@selenic.com>,
	"Petre Eftime" <petre.eftime@gmail.com>,
	"Erdem Meydanlli" <meydanli@amazon.nl>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"David Woodhouse" <dwmw@amazon.co.uk>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH v2 1/2] misc: Add Nitro Secure Module driver
Date: Tue, 03 Oct 2023 19:48:52 +0200	[thread overview]
Message-ID: <527e3b5d-2bed-4cd9-b722-7b468ad4e477@app.fastmail.com> (raw)
In-Reply-To: <a44a2df0-beb9-4a43-ade4-267ad819729e@amazon.com>

On Fri, Sep 29, 2023, at 21:26, Alexander Graf wrote:
> On 29.09.23 19:28, Arnd Bergmann wrote:
>> On Fri, Sep 29, 2023, at 09:33, Alexander Graf wrote:

>>
>>> +int nsm_register_hwrng(struct nsm_hwrng *_nsm_hwrng)
>>> +{
>>> +     if (nsm_hwrng)
>>> +             return -EEXIST;
>>> +
>>> +     nsm_hwrng = _nsm_hwrng;
>>> +     if (nsm_vdev)
>>> +             nsm_hwrng->probe(nsm_vdev);
>>> +
>>> +     return 0;
>>> +}
>>> +EXPORT_SYMBOL_GPL(nsm_register_hwrng);
>> This should get easier of you reverse the dependency between
>> the two drivers and just call into the nsm_hwrng_probe()
>> function from the main driver's probe.
>
>
> I don't understand what you mean by reversing the dependency. Nsm_rng is 
> a downstream of Nsm, because Nsm is the virtio device that owns the channel.

To clarify: I don't really consider Nsm_rng as a downstream driver,
since the main driver does not have a bus model or device detection
below it that would allow probing any function specific drivers.

I would remove the dynamic registration entirely and just merge both
parts into a single file that happens to expose an rng interface.

     Arnd

  parent reply	other threads:[~2023-10-03 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 13:33 [PATCH v2 0/2] Add Nitro Secure Module support Alexander Graf
2023-09-29 13:33 ` [PATCH v2 1/2] misc: Add Nitro Secure Module driver Alexander Graf
2023-09-29 17:28   ` Arnd Bergmann
2023-09-29 19:26     ` Alexander Graf
2023-09-30  6:20       ` Greg Kroah-Hartman
2023-10-02 12:28         ` Alexander Graf
2023-10-03 16:47           ` Arnd Bergmann
2023-10-03 17:48       ` Arnd Bergmann [this message]
2023-09-29 13:33 ` [PATCH v2 2/2] hwrng: Add support for Nitro Secure Module Alexander Graf

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=527e3b5d-2bed-4cd9-b722-7b468ad4e477@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=dwmw@amazon.co.uk \
    --cc=graf@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jasowang@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meydanli@amazon.nl \
    --cc=mst@redhat.com \
    --cc=olivia@selenic.com \
    --cc=petre.eftime@gmail.com \
    --cc=xuanzhuo@linux.alibaba.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

all inboxes | Powered by JetHome®