Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2924620rdg; Mon, 16 Oct 2023 21:35:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGt/wqc5vvf8HwJZ3NRjVv7gDa6no6AivOsXAcDJho9pyouKZLEOQ826ijxRO6mH/8eUz14 X-Received: by 2002:a05:6870:2381:b0:1d5:6161:76f3 with SMTP id e1-20020a056870238100b001d5616176f3mr1454940oap.3.1697517345580; Mon, 16 Oct 2023 21:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697517345; cv=none; d=google.com; s=arc-20160816; b=wJH4sUOjW1PPo8p8PwWounrL7k7GUwig9xFFxrnFAjwfb2kJ7SLXAQ4ilpOisxuNgA K+orf27aevDVwyhlHO91NLCpZMxjatq9T7tRk4meCjHF6GJo9COZA07IipUO47zI6qlo VqEIBV2IXABr0s6OUg4EsuXZQR3J8LZ8ZQgVqFiUgrPuysY4P4Dffym9RjoI2TB1sXHw 78CY5MOWR5vZsXr+tYK5LYWN9xaOEQ1iarEVEpLqQmUKxaF8Lp9ujd1Qg7IIVN8QDDOu GwtKHTmaI8NElpRws+tuxwjIBNl0QADUdwSLqS5xnrlydq0pWyCNMFM6ndzmbUTgYhsT NoFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iKSzw0H7imvFnQsSbXS4s9q/+KmLgFfqqX5RqZH9/7g=; fh=cVGF63pAJG7zbYL7VLc6hCAxF82NSd5J1bW3pEjgqF8=; b=lnuM5g4EV+Qby/GbkYcFo7BMQaIRnzB81crg5hw6nKPaz7CvHSFuBjAgSVfygyAhxW DYC9MgSMrsWAiWkiI9QwVau+TnZD9I8cd5cg9OvoPgpMQpsIlMecfYrc4n8f9JMalXsB iwzvUSfHw/r7sxZ+iftZK1mfCaRMKIIiCD3prye4Ko3PsxrpIysM95yJc1qOqQGoaJFq FbmWBF7iOYSfn5L61l4F743W84Z5VnY0U/AdjBryI4tkxGgFZIn0pI8YW7vTQkVDsP7B nFrHOZbPR2yMfKiSwPqKuOH2tmX0wKzi4fJw6RTw3IsODTHlqG5DAECImxeQtK0zAW4Z QpMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=mXWxCtu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q8-20020a631f48000000b00578dfa34d95si892401pgm.574.2023.10.16.21.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 21:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=mXWxCtu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8B999802573A; Mon, 16 Oct 2023 21:35:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234371AbjJQEfj (ORCPT + 99 others); Tue, 17 Oct 2023 00:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234276AbjJQEfg (ORCPT ); Tue, 17 Oct 2023 00:35:36 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E255A1 for ; Mon, 16 Oct 2023 21:35:33 -0700 (PDT) Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id C96EE3F7DE for ; Tue, 17 Oct 2023 04:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1697517331; bh=iKSzw0H7imvFnQsSbXS4s9q/+KmLgFfqqX5RqZH9/7g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mXWxCtu4VYDoH0Y4rZGGzv+kiJ3a77Uo1RPh3iMH1RNzEFijCF/WzKQYi6gvQyMwo eR9KEr2c+t2RhS7xYclxh6H3s9UnQL6zfPAo8eMheEjrYb/QObYI74jl5JNg27CBAl bC903xQYCNB7rQXtUArBfa11NIe+iIk9UYeZKiZVhJJcnYhzZ+BiLzgfBVEsKEM5LH 6dHFRLpzcMONViZ20lz1ecTI8JaZJSgu0P3DV8DWVkogH/NCmPp68a7e19MudzBNGF DDmX9SI6DKUmKMgZJ3RYM3tBH8Z27iVAu0HitJAUZXG3ygA3WvuqBTR0Krp8t6HFYr gfIRKhhygNglA== Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-6927a39c466so4014358b3a.0 for ; Mon, 16 Oct 2023 21:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697517330; x=1698122130; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iKSzw0H7imvFnQsSbXS4s9q/+KmLgFfqqX5RqZH9/7g=; b=qXMgQOCBO6LLCrNeoHdeO7UdCjfZnOy2KGJwh4Gp4qSpOgWAXzEJ7XgUVlfhXlLCLy m5Cev3dGVNfLfwDkn5pigQvUO3IwK3N16sfMK/mTwqPihVveoe1b6ofQLKe66coP5QEx /upSPKNuUQ1i2c9PCLcPB1TWLic0EIxohHaKHPm5WLRjXgmo/KpPb3klAb9IHi8AkPzt Lpx3iFrhtkew2567LjEGvqOvve+qP6fTzdsC7EhjlYK1O3b2e520cSBdx8MdE4xCtNDv H5EqVdaZ4famcz3+4u3qRuXRFqA9FyhLOxcQOTh1L3yMpttM3xNlQnw+Hzcex4YjpiAg VcxQ== X-Gm-Message-State: AOJu0YwB/lKaK2hIe4ykf3YUhi3mrcXE/u0878jYqGrr2U7vROkHe/g8 yv+LZtNgHbuXBBHpIOJeRwAouTHaV1Oik3jIOzqNS6IsdI4Y7NKJLf9ev+FOcJ+hEcdhD6l30gm CHYVI5kUjHRibAL7c6Uf1DdmZTovgossg93iVnY8lPZN2YuLztLYDsTfG6g== X-Received: by 2002:a05:6a20:748d:b0:13f:1622:29de with SMTP id p13-20020a056a20748d00b0013f162229demr1084704pzd.7.1697517330285; Mon, 16 Oct 2023 21:35:30 -0700 (PDT) X-Received: by 2002:a05:6a20:748d:b0:13f:1622:29de with SMTP id p13-20020a056a20748d00b0013f162229demr1084694pzd.7.1697517329969; Mon, 16 Oct 2023 21:35:29 -0700 (PDT) MIME-Version: 1.0 References: <20231016040132.23824-1-kai.heng.feng@canonical.com> <20231016093210.GA22952@wunner.de> In-Reply-To: <20231016093210.GA22952@wunner.de> From: Kai-Heng Feng Date: Tue, 17 Oct 2023 12:35:18 +0800 Message-ID: Subject: Re: [PATCH] PCI: pciehp: Prevent child devices from doing RPM on PCIe Link Down To: Lukas Wunner 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, linux-hardening@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 21:35:44 -0700 (PDT) On Mon, Oct 16, 2023 at 5:32=E2=80=AFPM Lukas Wunner wrot= e: > > 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? Ricky, do you know the reason why Link Down happens? > > > > [ 63.898861] pcieport 0000:00:1c.0: pciehp: Slot(8): Link Down > > [ 63.912118] BUG: unable to handle page fault for address: ffffb24d40= 3e5010 > [...] > > [ 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 it= self? Kai-Heng > > Thanks, > > Lukas