From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Rosen Penev <rosenp@gmail.com>, linux-wireless@vger.kernel.org
Cc: "Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Giedrius Statkevičius" <giedrius.statkevicius@gmail.com>,
"Kalle Valo" <kvalo@qca.qualcomm.com>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:GPIO
SUBSYSTEM:Keyword:(devm_)?gpio_(request|free|direction|get|set)"
<linux-gpio@vger.kernel.org>
Subject: Re: [PATCH ath-next] wifi: ath9k: release the LED GPIO after ath9k_stop()
Date: Fri, 23 Oct 2026 17:30:12 +0200 [thread overview]
Message-ID: <87o6ckqvsr.fsf@toke.dk> (raw)
In-Reply-To: <20261022022343.1409432-1-rosenp@gmail.com>
Rosen Penev <rosenp@gmail.com> writes:
> ath9k_deinit_device() frees the LED pin in ath_deinit_leds() before it
> unregisters the hw. ath9k_stop() then switches the LED pin back to an
> input with ath9k_hw_gpio_request_in(). For a SoC GPIO outside of the
> WMAC, ath9k_hw_gpio_request() takes a new descriptor through
> gpiod_get_index() at that point, and nothing releases it again. The
> next probe fails with "request GPIO12 failed:-16" and every LED update
> hits the WARN_ON() in ath9k_hw_set_gpio(). That request also runs
> under sc->sc_pcu_lock, while gpiod_get_index() and
> gpiod_set_consumer_name() may sleep.
>
> Free the LED pin after ieee80211_unregister_hw() instead. This also
> frees the pin when the LED class device could not be registered,
> which leaked it before.
Hmm, instead of reworking the deinit code, how about we just drop the
ath9k_hw_gpio_request_in() call from ath9k_stop()? It's an LED pin, why
would it ever need to be reset? The commit that introduced that call
says it was "for consistency", which seems entirely bogus in this case?
-Toke
next prev parent reply other threads:[~2026-10-23 15:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 2:23 [PATCH ath-next] wifi: ath9k: release the LED GPIO after ath9k_stop() Rosen Penev
2026-10-23 15:30 ` Toke Høiland-Jørgensen [this message]
2026-10-23 18:19 ` Rosen Penev
2026-10-26 11:13 ` Toke Høiland-Jørgensen
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=87o6ckqvsr.fsf@toke.dk \
--to=toke@toke.dk \
--cc=brgl@kernel.org \
--cc=giedrius.statkevicius@gmail.com \
--cc=kvalo@qca.qualcomm.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rosenp@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.