Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3114160rwl; Mon, 27 Mar 2023 09:22:45 -0700 (PDT) X-Google-Smtp-Source: AKy350aZIHq9PPI1GznFz2s0VSHK7cJQI7AyFyA9V+IBuWOpsOOefPJe50erfXnGSWk58r5VZOXq X-Received: by 2002:a17:906:cd12:b0:930:f149:7865 with SMTP id oz18-20020a170906cd1200b00930f1497865mr11127787ejb.21.1679934165689; Mon, 27 Mar 2023 09:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679934165; cv=none; d=google.com; s=arc-20160816; b=VlZtysqORnVq8hqzhzdKXcdesS4ak/Y5nwF8cJOdHYhLlufoXgl0FZX2yXVpbtbZUN RVKqo6ZPr85QmPwLaoWmolphHrb7gdVM5+HQ/ECAulAAK79pECsgInedbjP8wddIrheG 9T+A65WZfJdIvtY3TaMcsuJTGf9YYW+7hTVPKqtZTnh4lcG/oLUwvYYuqUCpc1NmrU/T wsv9Cpnw5bo3VgUxfyUAR65BRJ5Hmi4IHCVC+s4Sxb3zzvxj5+5LPst4MbIUNUD3qTx1 0CtjL7WIYeHCmXNWb0DMJUokGrm5LZETYN4DGW+vtmCKxaI2e5zuLVFY8Esg7gRr3IBN arOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=deJgujfaRoB644lILTjlVzIuAihhn8YDNl8DUxYKRW4=; b=V/jk+9QR6zPoScTKi8vXifJD/oaN9Bu2uWDct3+GnpmrO/d9REFgH4OqKCxebz7yNw mZIoXj0jokvUHYbEASRuNLsuCcIRatrDx1I2Bt7TVqDPIAjVF2WmT0AJcmn4CSlbk31q wQGrcT7OLprf3877UQQdYT8oTlBbFhCkYI4v7rC6Sby68wkSisqZUM/QdOy0nGHurrPN rs4Qpp9bBIsTl84pTCmh5/BdFNdw/r56syNh+nh9G5pIPdokPIB30OV9I0oD8Mg+MEd6 Yty0XI/+X6zKWGMo0YNmb9gb4/B5NfEudPrPJEz1nSKQyzk3aaDGAfrXtS4FKJkKGwlQ ugyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qYTRjGZE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rp5-20020a170906d96500b00933b7f95468si21636139ejb.277.2023.03.27.09.22.13; Mon, 27 Mar 2023 09:22:45 -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=@kernel.org header.s=k20201202 header.b=qYTRjGZE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjC0QTl (ORCPT + 99 others); Mon, 27 Mar 2023 12:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232477AbjC0QTY (ORCPT ); Mon, 27 Mar 2023 12:19:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 414E61998; Mon, 27 Mar 2023 09:18:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id A86BDB816D8; Mon, 27 Mar 2023 16:18:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86974C433D2; Mon, 27 Mar 2023 16:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679933933; bh=vdqssHVignhvMODkXP8HH8VTKfr6z1MWWUoqltaO3Cc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qYTRjGZEBBXiXXfAOaZVoPNuFrTNI1Ijd/sAlIcF0ivsxiXPYqC8Jqu9JRZcqbQa/ 8q1zUqogO4GXn5J+uYpXrtpARDsQttsg51Cyq2Am/ED+aZ2jFM95U9BAf7S2/PSd5W FWv4JatvJakyZR+8hMV1gyOR9AKV6Y6gPF28KdbkekCmGiJlWJh4on8P+vBRloSmYq MYQi7nRznGylJpSv2Lx3aB20I5xsrsErN8MlfzXjho3c23+Y6cbXtLtRzSiTCeQzUD zB3BXHVE95K91O+jTp+bzBlp7JtbH19z/kNCW9FQooQ5banU8BuoUYEsvpgNpaFXQX MEGWQsr3lD62Q== Date: Mon, 27 Mar 2023 10:18:50 -0600 From: Keith Busch To: Bjorn Helgaas Cc: Jens Axboe , Christoph Hellwig , Sagi Grimberg , Lukas Wunner , Aleksander Trofimowicz , 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] Message-ID: References: <20230327143359.GA2834753@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230327143359.GA2834753@bhelgaas> X-Spam-Status: No, score=-2.5 required=5.0 tests=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 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.