Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2981230rdg; Tue, 17 Oct 2023 00:14:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEieGURdYN30ZFEnPsWSDSEllG4wWyiuSPr4GF1pp8DXfPez+KdNtgQNEM3sw3SxIOT0az5 X-Received: by 2002:a17:902:d490:b0:1c5:c23c:a9ff with SMTP id c16-20020a170902d49000b001c5c23ca9ffmr1850365plg.58.1697526856431; Tue, 17 Oct 2023 00:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697526856; cv=none; d=google.com; s=arc-20160816; b=w4zWqLwtiJQdoseWM+HayF461u1y88irtKmd3WekgLSduPkcCrcFnOuHUcPbO6uTPv WyNImd+SXr98iuysPxNIs62PHU3t3MVe11LYzKVFR/PyIMCXwTt2vKdjmCIfBnmr4geo vddX1JNvnQZxaZHgAw8lPgHbqUkyHBDBGlcztaSFcbh2a7RdaOMqLwEyLeQE3NTlXxV3 H1a1iWQ4Tx30+S52d5iH7Eo4eKFPRrPtAduSzYMT8lPhjWDqoS6WBtpddYIYAZdsR7Lq slmiAACnGuZCs9FgIonh9p2V0Fz/IoyLSz1kTpJQDblJFWZTM+CrtS6WwvX2VaV4QnGn msXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xaPrJhrq3L6NxaQ7kmul5GxaMr4FJZQpPSt4tck+QZc=; fh=EmVEuWVMjfGBCFrlkxsyuYJvr2mu1AbhszL3rYTa1ds=; b=gDDxBjorwhYyJc4nTYj+6s8Ijjpg8X2hZhioAyJ6ReGmtAgqgR0WAk5lZ+lSV+8jR3 NFGk5tRq6dhd6rNgTDCOIfLQoDgfVJNoU0MDQ8AwjTAWEHZ3qdR8nboSOZQ++Dnh402x eUyaF2pKVqJHe986nux24yP1Q6CHyDgkiBi45J0EWurqDaLbvJVsKNEbLZuf1rcVegsc JcJ7az/eiA8Jyzbg9w+sA0IZ2m2R8b72Yws1oArRqPDIsnFDuYyAAUTeQagjIt8SXzzs m/MAmkE04XTZZtt4oi+6x8yQNV1YrtD6dTOknZy8vR+OPm7uWGJpHhRZ6Vyc6md/nM0E 97Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id v7-20020a170902b7c700b001c5eb1706d3si1166768plz.171.2023.10.17.00.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 00:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9E4A1804025B; Tue, 17 Oct 2023 00:14:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234702AbjJQHOD (ORCPT + 99 others); Tue, 17 Oct 2023 03:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234403AbjJQHOB (ORCPT ); Tue, 17 Oct 2023 03:14:01 -0400 Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6D295; Tue, 17 Oct 2023 00:13:59 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 1B1E72800B758; Tue, 17 Oct 2023 09:13:57 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0DB1F1D3C4; Tue, 17 Oct 2023 09:13:57 +0200 (CEST) Date: Tue, 17 Oct 2023 09:13:57 +0200 From: Lukas Wunner To: Kai-Heng Feng Cc: bhelgaas@google.com, linux-pm@vger.kernel.org, linux-mmc@vger.kernel.org, Ricky Wu , Kees Cook , Tony Luck , "Guilherme G. Piccoli" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: pciehp: Prevent child devices from doing RPM on PCIe Link Down Message-ID: <20231017071357.GB4592@wunner.de> References: <20231016040132.23824-1-kai.heng.feng@canonical.com> <20231016093210.GA22952@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 00:14:13 -0700 (PDT) [cc -= unrelated mailing lists bpf, kernel-hardening] On Tue, Oct 17, 2023 at 12:35:18PM +0800, Kai-Heng Feng wrote: > On Mon, Oct 16, 2023 at 5:32???PM Lukas Wunner wrote: > > On Mon, Oct 16, 2023 at 12:01:31PM +0800, Kai-Heng Feng wrote: > > > [ 63.898861] pcieport 0000:00:1c.0: pciehp: Slot(8): Link Down > > > [ 63.912118] BUG: unable to handle page fault for address: ffffb24d403e5010 > > [...] > > > [ 63.912198] ? asm_exc_page_fault+0x27/0x30 > > > [ 63.912203] ? ioread32+0x2e/0x70 > > > [ 63.912206] ? rtsx_pci_write_register+0x5b/0x90 [rtsx_pci] > > > [ 63.912217] rtsx_set_l1off_sub+0x1c/0x30 [rtsx_pci] > > > [ 63.912226] rts5261_set_l1off_cfg_sub_d0+0x36/0x40 [rtsx_pci] > > > [ 63.912234] rtsx_pci_runtime_idle+0xc7/0x160 [rtsx_pci] > > > [ 63.912243] ? __pfx_pci_pm_runtime_idle+0x10/0x10 > > > [ 63.912246] pci_pm_runtime_idle+0x34/0x70 > > > [ 63.912248] rpm_idle+0xc4/0x2b0 > > > [ 63.912251] pm_runtime_work+0x93/0xc0 > > > [ 63.912254] process_one_work+0x21a/0x430 > > > [ 63.912258] worker_thread+0x4a/0x3c0 > > > > This looks like pcr->remap_addr is accessed after it has been iounmap'ed > > in rtsx_pci_remove() or before it has been iomap'ed in rtsx_pci_probe(). > > > > Is the card reader itself located below a hotplug port and unplugged here? > > Or is this about the card being removed from the card reader? > > > > Having full dmesg output and lspci -vvv output attached to a bugzilla > > would help to understand what is going on. > > I don't have the hardware so we need Ricky to provide more information here. > > Regardless of the cardreader issue, do you have any concern on the patch > itself? Yes, my concern is that this might be the wrong approach. I would like to understand what is going on, hence my questions above. Thanks, Lukas