Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3058830rdg; Tue, 17 Oct 2023 03:26:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVLrLqED+/bd+Bo9eveOkSrQzMKOC1oiQvGCRDwsgqJad0JTP60WTaGd0mbM6URkogVyaO X-Received: by 2002:a05:6808:19a9:b0:3ac:f107:52b with SMTP id bj41-20020a05680819a900b003acf107052bmr2471832oib.2.1697538416530; Tue, 17 Oct 2023 03:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697538416; cv=none; d=google.com; s=arc-20160816; b=oQqMKKMPHosevDfXH0iKJRElwWrYHM9IrW7yo1VnMbuxIja5hWsab6INWdJp7BsOMJ Qv80/WvWh6j0NlWZymBMeMr+AxGFoCn6cT5gG4LnJWWbKBWgb94BexAcUNsd590fK2cg d6SghDDgnDiBqeAjqnMg+1Va6hR+x4vFDDegfIQ+VY4Q9V6mHN2OtBUthPfZTdQOar8x U0y6wxycoJTRzJ/AB4kWXGmVUflcpXSTJJeR4gdvsCbaiEGKgwLiKIQ9qhEQ/3zbCFdk SWospFTt2hAlT2/+31DAeRfmr+wnrvqquOIqmH8+JUXk+89LWdK8Fe8RN+voWupDS2rJ jPBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=VlgJmvuKTXsz/msGY6jJEwuzR1Un2ZwFNT7ciGfJfD0=; fh=B1nv1KYNp+PiZ8KIOD9ChiIrcsSCem5uOjwtpWuh9is=; b=kJdRNtXLytlcLzOgnUHXkqNr/upfluzk6/n9ruuKv2urHr5gRZ7bORurThHFgPWFtr 9O8alZ+syQhLsbtiKp4bDo5cPQpfRx9zoRZmAuchFNWoXMZr5bSYj77SsOkNSx5fDRgz BvWQ53QUj7x4bE9WYhxe24RZfKRn3SR0xiRu6eT/hJQh68PsrDUfF3XCyvRQ//yFwlLr qgjAw1mwF9eg7NehQnfyzKmHM7okgNHvLmrsannHu0Cich8vVUQjBqsZE5k5ZY85zO+Y 2ia9X+ap/c4dOKJUGtjLWaVMMpQYwP77u3HwAmZ3ML4pnni18/+SMa4iQ8U9sNIdVdgi XRGA== 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 x26-20020aa7941a000000b006be264b2734si1308145pfo.29.2023.10.17.03.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 03:26:56 -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 D41F180398FA; Tue, 17 Oct 2023 03:26:53 -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 S234840AbjJQK0d convert rfc822-to-8bit (ORCPT + 99 others); Tue, 17 Oct 2023 06:26:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbjJQK0R (ORCPT ); Tue, 17 Oct 2023 06:26:17 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81E7D120; Tue, 17 Oct 2023 03:26:13 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39HAPeE724097804, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39HAPeE724097804 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Oct 2023 18:25:40 +0800 Received: from RTEXMBS06.realtek.com.tw (172.21.6.99) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 17 Oct 2023 18:25:39 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXMBS06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 17 Oct 2023 18:25:39 +0800 Received: from RTEXMBS01.realtek.com.tw ([fe80::9cb8:8d5:b6b3:213b]) by RTEXMBS01.realtek.com.tw ([fe80::9cb8:8d5:b6b3:213b%5]) with mapi id 15.01.2375.007; Tue, 17 Oct 2023 18:25:39 +0800 From: Ricky WU To: Lukas Wunner , Kai-Heng Feng CC: "bhelgaas@google.com" , "linux-pm@vger.kernel.org" , "linux-mmc@vger.kernel.org" , Kees Cook , Tony Luck , "Guilherme G. Piccoli" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hardening@vger.kernel.org" , "bpf@vger.kernel.org" Subject: RE: [PATCH] PCI: pciehp: Prevent child devices from doing RPM on PCIe Link Down Thread-Topic: [PATCH] PCI: pciehp: Prevent child devices from doing RPM on PCIe Link Down Thread-Index: AQHZ/+WX29Sx+yjN7keHtkFSV38Z/LBLoV4AgAIjnlA= Date: Tue, 17 Oct 2023 10:25:39 +0000 Message-ID: <263982e90fc046cf977ecb8727003690@realtek.com> References: <20231016040132.23824-1-kai.heng.feng@canonical.com> <20231016093210.GA22952@wunner.de> In-Reply-To: <20231016093210.GA22952@wunner.de> Accept-Language: zh-TW, en-US Content-Language: zh-TW x-originating-ip: [172.22.81.100] x-kse-serverinfo: RTEXMBS06.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback 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 03:26:54 -0700 (PDT) > On Mon, Oct 16, 2023 at 12:01:31PM +0800, Kai-Heng Feng wrote: > > When inserting an SD7.0 card to Realtek card reader, it can trigger > > PCI slot Link down and causes the following error: > > Why does *inserting* a card cause a Link Down? > > > > [ 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? Yes it is card reader unplug itself, because sd7.0 card is not used rtsx_pcr, it use nvme driver Ricky > 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. > > Thanks, > > Lukas