From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: Russ Weight <russ.weight@linux.dev>,
Dionna Glaze <dionnaglaze@google.com>
Cc: linux-kernel@vger.kernel.org,
Luis Chamberlain <mcgrof@kernel.org>,
Danilo Krummrich <dakr@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH 1/1] firmware_loader: Move module refcounts to allow unloading
Date: Thu, 24 Oct 2024 04:35:20 -0500 [thread overview]
Message-ID: <e6003804-1f91-45db-8ae7-368fda354acd@amd.com> (raw)
In-Reply-To: <20241023201654.pjz67e5cv7kbki5t@4VRSMR2-DT.corp.robot.car>
On 10/23/2024 3:16 PM, Russ Weight wrote:
>
> On Tue, Oct 15, 2024 at 08:14:24PM +0000, Dionna Glaze wrote:
>> If a kernel module registers a firmware upload API ops set, then it's
>> unable to be moved due to effectively a cyclic reference that the module
>> depends on the upload which depends on the module.
>>
>> Instead, only require the try_module_get when an upload is requested to
>> disallow unloading a module only while the upload is in progress.
>
> Generally, the parent driver that registers for firmware_upload would
> want the module to be present until it unregisters.
>
> Is there a case where this change is needed?
We are using the firmware_upload_register() API interface for SEV firmware loader/update
with the AMD Crypto CCP driver.
Now, when we call firmware_upload_register() it does a module_get() and bumps the module refcnt and
then we do the firmware_upload_unregister() as part of the CCP module's exit() callback, but the
CCP module's exit() callback is never invoked as it's refcnt is non-zero, so it is like a catch 22
situation, we want the module's exit() callback to be invoked to call firmware_upload_unregister()
to do a module_put() and decrement module's refcnt, but the callback is never invoked as it's
refcnt is non-zero.
Isn't the firmware_upload_register() API interface intended to be used by standalone drivers ?
Thanks,
Ashish
next prev parent reply other threads:[~2024-10-24 9:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 20:14 Dionna Glaze
2024-10-23 20:16 ` Russ Weight
2024-10-24 9:35 ` Kalra, Ashish [this message]
2024-10-24 14:58 ` Russ Weight
2024-10-24 15:44 ` Russ Weight
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=e6003804-1f91-45db-8ae7-368fda354acd@amd.com \
--to=ashish.kalra@amd.com \
--cc=dakr@redhat.com \
--cc=dionnaglaze@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=rafael@kernel.org \
--cc=russ.weight@linux.dev \
/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®