Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Guangshuo Li <lgs201920130244@gmail.com>
To: gregkh@linuxfoundation.org, mathias.nyman@intel.com,
	thierry.reding@kernel.org, jonathanh@nvidia.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	rosenp@gmail.com, kees@kernel.org, lgs201920130244@gmail.com,
	avorontsov@ru.mvista.com, linux-tegra@vger.kernel.org,
	jckuo@nvidia.com, eeodqql09@gmail.com, stern@rowland.harvard.edu,
	davidm@egauge.net
Subject: [PATCH 1/3] usb: fhci: release IRQ and MMIO mappings on remove
Date: Thu, 24 Sep 2026 19:21:54 +0800	[thread overview]
Message-ID: <20260924112156.1564208-2-lgs201920130244@gmail.com> (raw)
In-Reply-To: <20260924112156.1564208-1-lgs201920130244@gmail.com>

of_fhci_probe() creates an IRQ mapping with irq_of_parse_and_map() and an
MMIO mapping with ioremap(). The probe error path releases both mappings,
but fhci_remove() omits the matching cleanup after a successful probe.

After usb_remove_hcd(), dispose hcd->irq with irq_dispose_mapping() and
unmap hcd->regs with iounmap() before usb_put_hcd(). This matches the
resource release order in the probe error path.

Fixes: 236dd4d18f29 ("USB: Driver for Freescale QUICC Engine USB Host Controller")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/usb/host/fhci-hcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 71e785f445a3..1c8f6317f6aa 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -756,12 +756,14 @@ static void fhci_remove(struct device *dev)
 	int j;
 
 	usb_remove_hcd(hcd);
+	irq_dispose_mapping(hcd->irq);
 	free_irq(fhci->timer->irq, hcd);
 	gtm_put_timer16(fhci->timer);
 	cpm_muram_free(cpm_muram_offset(fhci->pram));
 	for (j = 0; j < NUM_PINS; j++)
 		qe_pin_free(fhci->pins[j]);
 	fhci_dfs_destroy(fhci);
+	iounmap(hcd->regs);
 	usb_put_hcd(hcd);
 }
 
-- 
2.43.0


  reply	other threads:[~2026-09-24 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 11:21 [PATCH 0/3] usb: host: balance resource lifetimes in host drivers Guangshuo Li
2026-09-24 11:21 ` Guangshuo Li [this message]
2026-09-24 11:21 ` [PATCH 2/3] usb: xhci: tegra: release padctl node reference after probe Guangshuo Li
2026-09-24 11:21 ` [PATCH 3/3] usb: max3421: Free transfer buffers on remove Guangshuo Li

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=20260924112156.1564208-2-lgs201920130244@gmail.com \
    --to=lgs201920130244@gmail.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=davidm@egauge.net \
    --cc=eeodqql09@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jckuo@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=rosenp@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=thierry.reding@kernel.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