linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: "Sumit Garg" <sumit.garg@oss.qualcomm.com>,
	"Jens Wiklander" <jens.wiklander@linaro.org>,
	"Olivia Mackall" <olivia@selenic.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"Sudeep Holla" <sudeep.holla@arm.com>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Michael Chan" <michael.chan@broadcom.com>,
	"Pavan Chebbi" <pavan.chebbi@broadcom.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"James Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Jarkko Sakkinen" <jarkko@kernel.org>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"David Howells" <dhowells@redhat.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"Peter Huewe" <peterhuewe@gmx.de>,
	op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org, linux-rtc@vger.kernel.org,
	linux-efi@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	"Cristian Marussi" <cristian.marussi@arm.com>,
	arm-scmi@vger.kernel.org, netdev@vger.kernel.org,
	linux-mips@vger.kernel.org, linux-integrity@vger.kernel.org,
	keyrings@vger.kernel.org, linux-security-module@vger.kernel.org,
	"Jason Gunthorpe" <jgg@ziepe.ca>
Subject: Re: [PATCH v1 00/17] tee: Use bus callbacks instead of driver callbacks
Date: Wed, 17 Dec 2025 14:32:02 +0530	[thread overview]
Message-ID: <aUJxiioKnDVSC34H@sumit-xelite> (raw)
In-Reply-To: <max5wxkcjjvnftwfwgymybwbnvf5s3ytwpy4oo5i74kfvnav4m@m2wasqyxsf4h>

On Wed, Dec 17, 2025 at 09:21:41AM +0100, Uwe Kleine-König wrote:
> Hello Sumit,
> 
> On Wed, Dec 17, 2025 at 01:25:39PM +0530, Sumit Garg wrote:
> > On Tue, Dec 16, 2025 at 12:08:38PM +0100, Uwe Kleine-König wrote:
> > > On Tue, Dec 16, 2025 at 01:08:38PM +0530, Sumit Garg wrote:
> > > > On Mon, Dec 15, 2025 at 3:02 PM Uwe Kleine-König
> > > > <u.kleine-koenig@baylibre.com> wrote:
> > > > >  - Why does optee_probe() in drivers/tee/optee/smc_abi.c unregister all
> > > > >    optee devices in its error path (optee_unregister_devices())?
> > > > 
> > > > This is mostly to take care of if any device got registered before the
> > > > failure occured. Let me know if you have a better way to address that.
> > > 
> > > Without understanding the tee stuff, I'd say: Don't bother and only undo
> > > the things that probe did before the failure.
> > 
> > True, but this is special case where if there is any leftover device
> > registered from the TEE implementation then it is likely going to cause
> > the corresponding kernel client driver crash.
> 
> You are aware that this is racy? So if a driver crashes e.g. after
> teedev_close_context() it might happen that it is registered just after
> optee_unregister_devices() returns.
> 

I see your point about the unavoidable race. Maybe it's better to not
try anything and let the kernel client driver fail.

-Sumit

      reply	other threads:[~2025-12-17  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 17:14 [PATCH v1 00/17] tee: Use bus callbacks instead of driver callbacks Uwe Kleine-König
2025-12-11 17:14 ` [PATCH v1 04/17] hwrng: optee - Make use of module_tee_client_driver() Uwe Kleine-König
2025-12-15  7:26   ` Sumit Garg
2025-12-11 17:14 ` [PATCH v1 05/17] hwrng: optee - Make use of tee bus methods Uwe Kleine-König
2025-12-15  7:27   ` Sumit Garg
2025-12-15  7:54 ` [PATCH v1 00/17] tee: Use bus callbacks instead of driver callbacks Sumit Garg
2025-12-15  9:32   ` Uwe Kleine-König
2025-12-16  7:38     ` Sumit Garg
2025-12-16 11:08       ` Uwe Kleine-König
2025-12-17  7:55         ` Sumit Garg
2025-12-17  8:21           ` Uwe Kleine-König
2025-12-17  9:02             ` Sumit Garg [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=aUJxiioKnDVSC34H@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ardb@kernel.org \
    --cc=arm-scmi@vger.kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=clement.leger@bootlin.com \
    --cc=cristian.marussi@arm.com \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jan.kiszka@siemens.com \
    --cc=jarkko@kernel.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=olivia@selenic.com \
    --cc=op-tee@lists.trustedfirmware.org \
    --cc=paul@paul-moore.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=peterhuewe@gmx.de \
    --cc=serge@hallyn.com \
    --cc=sudeep.holla@arm.com \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=zajec5@gmail.com \
    --cc=zohar@linux.ibm.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).