From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65C7E352084; Tue, 26 Aug 2025 14:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756218649; cv=none; b=sFTgY1mEUryyoUgbZG0rAkW212Qud6xPgL722W813UQx+a/4G8Xk2OHs6uqt23w9hlfrICOTDDHHE6h2h0wCa5YUHPy91OP+fNTISU7yGapX2RegP2FWPO2cfUtCdqqSfK87ypTG+pk36ZD1rZAIsuSCZSmNfSsRQxS/Yorh4t8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756218649; c=relaxed/simple; bh=seMxkweLD7HqC5V7kncGJXpxbIoJTve4ElWvcdV2BQg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZBOMIbBBDmGVzRbGdYMRDeWugaCmQifgdNlNef/2DHXsN34Ka+GhRg+RaGYT/DHtkzQ+5+RZhRpsoVGxbxgtu0fATJ7mMOzxr+7APdc+ndfeJR1zUOTjgbCbqaJAFz6atrAQMN1UsziU2JeTvxY8cxXOVUghXyy8mWmNb0tdI54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BqvMRzjt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BqvMRzjt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A39EC4CEF1; Tue, 26 Aug 2025 14:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756218649; bh=seMxkweLD7HqC5V7kncGJXpxbIoJTve4ElWvcdV2BQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqvMRzjt13yx6x/6DawcStHoB3b7Ljzw/BkxWKztpuyoKnFsV+N66i7zTPI1HA+AV +RX85pbE8QSXBEEdFa2VVPFUKdT7IEDjvtD2e3eZ65VQQoCzXj8MF14y9PyVvEAICZ KO+Lh66vWXdQlIdcKvzJjRsjiA0IRUJYgaphhlFQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lucas De Marchi , Sasha Levin Subject: [PATCH 5.4 079/403] usb: early: xhci-dbc: Fix early_ioremap leak Date: Tue, 26 Aug 2025 13:06:45 +0200 Message-ID: <20250826110908.636068927@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lucas De Marchi [ Upstream commit 2b7eec2ec3015f52fc74cf45d0408925e984ecd1 ] Using the kernel param earlyprintk=xdbc,keep without proper hardware setup leads to this: [ ] xhci_dbc:early_xdbc_parse_parameter: dbgp_num: 0 ... [ ] xhci_dbc:early_xdbc_setup_hardware: failed to setup the connection to host ... [ ] calling kmemleak_late_init+0x0/0xa0 @ 1 [ ] kmemleak: Kernel memory leak detector initialized (mem pool available: 14919) [ ] kmemleak: Automatic memory scanning thread started [ ] initcall kmemleak_late_init+0x0/0xa0 returned 0 after 417 usecs [ ] calling check_early_ioremap_leak+0x0/0x70 @ 1 [ ] ------------[ cut here ]------------ [ ] Debug warning: early ioremap leak of 1 areas detected. please boot with early_ioremap_debug and report the dmesg. [ ] WARNING: CPU: 11 PID: 1 at mm/early_ioremap.c:90 check_early_ioremap_leak+0x4e/0x70 When early_xdbc_setup_hardware() fails, make sure to call early_iounmap() since xdbc_init() won't handle it. Signed-off-by: Lucas De Marchi Fixes: aeb9dd1de98c ("usb/early: Add driver for xhci debug capability") Link: https://lore.kernel.org/r/20250627-xdbc-v1-1-43cc8c317b1b@intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/early/xhci-dbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c index 5a462a1d1896..7673ded077a4 100644 --- a/drivers/usb/early/xhci-dbc.c +++ b/drivers/usb/early/xhci-dbc.c @@ -678,6 +678,10 @@ int __init early_xdbc_setup_hardware(void) xdbc.table_base = NULL; xdbc.out_buf = NULL; + + early_iounmap(xdbc.xhci_base, xdbc.xhci_length); + xdbc.xhci_base = NULL; + xdbc.xhci_length = 0; } return ret; -- 2.39.5