From nobody Wed Feb 11 06:53:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D25BDC76188 for ; Wed, 5 Apr 2023 09:03:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237585AbjDEJDf (ORCPT ); Wed, 5 Apr 2023 05:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237156AbjDEJDd (ORCPT ); Wed, 5 Apr 2023 05:03:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21130E72; Wed, 5 Apr 2023 02:03:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A86956232B; Wed, 5 Apr 2023 09:03:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C66D2C433D2; Wed, 5 Apr 2023 09:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680685411; bh=AreqL9r3Yew0sS4T15gu7pKjtnVtIobuhUST+Klm1yw=; h=From:To:Cc:Subject:Date:From; b=HoiMD4ktg4vcT8DaHpg95N0uDYOIuwAtTu2tfk+coIc2mMWV6gChq++iSqy5GykFX HsPr8Dfx6UHNDwBRT5AOUI1VEZr549y6Ej+TP7escZ2cXIw8oILL7x+eaOybITT5rl xD50WscOk53x55uLD1MX3jI0CW6KoWP4hm/rbhn5pr52oA7Ar7lIAh0ME6Q9OIQRR2 2bWp4TYd8i3s17V7Mv4qpDVmINkt4yHhGLXaszEz6Z9HrWUZFqneAmiYmAkXVuvT/V kJDAVELtV17iGrnfjzO+EvHHJsvDzmL+oMHSyBoXILjYpc88XGh7hqUoB6aPruoF7A jC6d0+RFBprLg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pjz3h-0001uw-Vn; Wed, 05 Apr 2023 11:04:02 +0200 From: Johan Hovold To: Mathias Nyman Cc: Greg Kroah-Hartman , Lu Baolu , Alan Stern , Oliver Neukum , Thinh Nguyen , Udipto Goswami , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH] xhci: fix debugfs register accesses while suspended Date: Wed, 5 Apr 2023 11:03:42 +0200 Message-Id: <20230405090342.7363-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Wire up the debugfs regset device pointer so that the controller is resumed before accessing registers to avoid crashing or locking up if it happens to be runtime suspended. Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver") Cc: stable@vger.kernel.org # 4.15: 30332eeefec8: debugfs: regset32: Add Run= time PM support Cc: stable@vger.kernel.org # 4.15 Signed-off-by: Johan Hovold --- drivers/usb/host/xhci-debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugf= s.c index 0bc7fe11f749..99baa60ef50f 100644 --- a/drivers/usb/host/xhci-debugfs.c +++ b/drivers/usb/host/xhci-debugfs.c @@ -133,6 +133,7 @@ static void xhci_debugfs_regset(struct xhci_hcd *xhci, = u32 base, regset->regs =3D regs; regset->nregs =3D nregs; regset->base =3D hcd->regs + base; + regset->dev =3D hcd->self.controller; =20 debugfs_create_regset32((const char *)rgs->name, 0444, parent, regset); } --=20 2.39.2