Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3276945rwl; Mon, 27 Mar 2023 11:37:37 -0700 (PDT) X-Google-Smtp-Source: AKy350ZqminexhL6V34AqU3Cf30kZ7bFaQdyk/wddlFDBPKFYfp5UH6KOxamEivl00+gY6szIl2B X-Received: by 2002:a17:906:c7cc:b0:878:955e:b4a4 with SMTP id dc12-20020a170906c7cc00b00878955eb4a4mr11554486ejb.33.1679942257155; Mon, 27 Mar 2023 11:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679942257; cv=none; d=google.com; s=arc-20160816; b=zqKYRRMFaVcBu1pOJQBDHlEb4ZDkPrX3EAL4XEgAa9e9toAavR7tKppS9alKBWCO+3 JPzq9H3j6TpblwvO1ZRiM3oVDpZBDiEf3tZjDE6Ib9YJkXVcDj1nLnm2Gd9E3vBizfO/ ovbkh79TvCR3lzwfXgeIojapCAYH7q4rr3Nu0FK0Ra842QROBECECgCdNirWc63ZX8mN jJ5BE9G5R8f1DJaM8Y1T4j5JFeVoTknY8kKCXWJuH7wIZBq+O3oBJVLxXcqpqeC4uIVS 7unmSXLwUwcBlctRqjhHA79uG9S/qoKhhlN/egvlyqakyhNbKVxBjkhNWuhH0pCicfft VITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=OGbOFJayhgRcXq5FMeS6bRDyUolQeucd8waNYOur4j4=; b=Rj122s2SPkCIeHCx0B+rb6GI997iI2RcR9sHUveHA9oeD7lg6zK3CHbTWeJYvUxjrj xlK1lxkZELfYgiUVHGh5Pz0Y5j0e53jGN311JcZceYpl0iBC6ycVDHRzSUej+gZKr5Tw R6UljWeWK3swZPrmCv1evwWddaG6QsQibxlrgPoAK43jnB6LoPta/KeOLPIQBXkoyrF3 1RnOY6LUYxImwaleNUNy3Y8nUSfQ2DzRmVFNLfO6I07YLQCdI5fMnUnl2kJsv+lJRD44 yz+K77gTjJ6YvwxpG5VjJ25o+WCbhqLEFaH/zBHk/2ZnrdJBmLmDQBKyHFUTSLQY3S+l yAtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@n90.eu header.s=default header.b=nPD85CB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=n90.eu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw9-20020a170906478900b00935b1b87416si21812553ejc.866.2023.03.27.11.37.13; Mon, 27 Mar 2023 11:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@n90.eu header.s=default header.b=nPD85CB4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=n90.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjC0Sbs (ORCPT + 99 others); Mon, 27 Mar 2023 14:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjC0Sbq (ORCPT ); Mon, 27 Mar 2023 14:31:46 -0400 X-Greylist: delayed 900 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 27 Mar 2023 11:31:45 PDT Received: from mx2.n90.eu (mx.n90.eu [65.21.251.117]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21E26271D; Mon, 27 Mar 2023 11:31:45 -0700 (PDT) Received: by mx2.n90.eu (Postfix, from userid 182) id 6277A1027DB45; Mon, 27 Mar 2023 18:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=n90.eu; s=default; t=1679940370; bh=OGbOFJayhgRcXq5FMeS6bRDyUolQeucd8waNYOur4j4=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=nPD85CB4IjQubR+FqhGXUYhBxV7bbwiHtN9kDpUsMfvJ5VKjUsWV88RDwd2C5oy4/ 9tlJmIwPVi3rnu2uF27A0Xua2/i08lUSZ8Yll0MXwtsw+rld4069lz2IM8kPcwxggO phjBZkPfcy0QaShZxkSowFm5huqTrA2RmJl4unv3BE9WpLw5cHrd/vU7l+6slZ5l9/ p7m9eSvV87wcasXYp44lZW2pwDpGg8ecJrJGUayyE9ySjUesRCJHONIfC7Dbqvhl94 Nfe8MHZJvedo8D6w1a4cBrMOGJeF/f9TiWznHy5d8o12ZS2UBdgtiZxheA/fa2BBpK PygFgKG/87wsA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from spica (unknown [172.20.188.202]) by mx2.n90.eu (Postfix) with ESMTP id CD5411025BB5A; Mon, 27 Mar 2023 18:06:07 +0000 (UTC) References: <20230327143359.GA2834753@bhelgaas> User-agent: mu4e 1.8.14; emacs 30.0.50 From: Aleksander Trofimowicz To: Keith Busch Cc: Bjorn Helgaas , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Lukas Wunner , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [bugzilla-daemon@kernel.org: [Bug 217251] New: pciehp: nvme not visible after re-insert to tbt port] Date: Mon, 27 Mar 2023 17:43:18 +0000 In-reply-to: X-Mailer: boring 1.0 Message-ID: <871qlank6o.fsf@n90.eu> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Keith Busch writes: > On Mon, Mar 27, 2023 at 09:33:59AM -0500, Bjorn Helgaas wrote: >> Forwarding to NVMe folks, lists for visibility. >> >> ----- Forwarded message from bugzilla-daemon@kernel.org ----- >> >> https://bugzilla.kernel.org/show_bug.cgi?id=217251 >> ... >> >> Created attachment 304031 >> --> https://bugzilla.kernel.org/attachment.cgi?id=304031&action=edit >> the tracing of nvme_pci_enable() during re-insertion >> >> Hi, >> >> There is a JHL7540-based device that may host a NVMe device. After the first >> insertion a nvme drive is properly discovered and handled by the relevant >> modules. Once disconnected any further attempts are not successful. The device >> is visible on a PCI bus, but nvme_pci_enable() ends up calling >> pci_disable_device() every time; the runtime PM status of the device is >> "suspended", the power status of the 04:01.0 PCI bridge is D3. Preventing the >> device from being power managed ("on" -> /sys/devices/../power/control) >> combined with device removal and pci rescan changes nothing. A host reboot >> restores the initial state. >> >> I would appreciate any suggestions how to debug it further. > > Sounds the same as this report: > > http://lists.infradead.org/pipermail/linux-nvme/2023-March/038259.html > > The driver is bailing on the device because we can't read it's status register > out of the remapped BAR. There's nothing we can do about that from the nvme > driver level. Memory mapped IO has to work in order to proceed. > Thanks. I can confirm it is the same problem: a) the platform is Intel Alderlake b) readl(dev->bar + NVME_REG_CSTS) in nvme_pci_enable() fails c) reading BAR0 via setpci gives 0x00000004 -- at