mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Kling <webgeek1234@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	 Jonathan Hunter <jonathanh@nvidia.com>,
	linux-pm@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/2] cpufreq: tegra124: Allow building as a module
Date: Mon, 21 Apr 2025 01:07:33 -0500	[thread overview]
Message-ID: <CALHNRZ_abv1P6o7sf9qCjUpOhYCNV1Ms3vr-zAUsX-QgWePu6Q@mail.gmail.com> (raw)
In-Reply-To: <20250421055808.ol4bu3vsdphv4pvs@vireshk-i7>

On Mon, Apr 21, 2025 at 12:58 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 21-04-25, 00:52, Aaron Kling wrote:
> > lsmod lists the module as "[permanent]" and if I try to rmmod the
> > module, the command throws 'device or resource busy'.
>
> Ahh, I thought kernel will give error on double insertion instead. But
> it looks like we keep some sort of refcount for the devices registered
> by the driver and don't let it unload.

This situation piqued my interest since I was unfamiliar with the
permanent flag in lsmod. And I found this stackoverflow answer [0]
that explained it. If no module_exit is defined, the module cannot be
removed.

>
> Anyway, if you want it to be a module, then it must unload as well I
> guess.
>
> You need to do the reverse of tegra_cpufreq_init() from module_exit to
> get it working I guess.
I will look into adding an exit for v2.

Sincerely,
Aaron

[0] https://stackoverflow.com/a/33464275

      reply	other threads:[~2025-04-21  6:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-20 20:41 [PATCH 0/2] Support building tegra124-cpufreq " Aaron Kling via B4 Relay
2025-04-20 20:42 ` [PATCH 1/2] cpufreq: Export disable_cpufreq() Aaron Kling via B4 Relay
2025-04-21  5:44   ` Viresh Kumar
2025-04-21  5:55     ` Aaron Kling
2025-04-20 20:42 ` [PATCH 2/2] cpufreq: tegra124: Allow building as a module Aaron Kling via B4 Relay
2025-04-21  5:45   ` Viresh Kumar
2025-04-21  5:52     ` Aaron Kling
2025-04-21  5:58       ` Viresh Kumar
2025-04-21  6:07         ` Aaron Kling [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=CALHNRZ_abv1P6o7sf9qCjUpOhYCNV1Ms3vr-zAUsX-QgWePu6Q@mail.gmail.com \
    --to=webgeek1234@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=viresh.kumar@linaro.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

all inboxes | Powered by JetHome®