From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3434C433EF for ; Tue, 19 Apr 2022 18:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5kEMZurW5/epwEFrCMOqDK9uOuGEZxsZKFO0EvMJJ6I=; b=N4LDsLDmmt74KWWnfpL8tmsldd m38dPsCW56cSY7g3hZJBpk8S8IDZVXt3VEadCUgKRecsTHGL/9nccof+k57hob+D7R1LmGbmKAkiL NTLMkNuFG1oN1k+JRRkn7pY/FY4SKrxq42Jh+JAc+mwU8RQ1TMMEgAcd9qmbVn+6KqQkbYuz9DD2V MTlJu6Auk9gXOgvYJnBtqfLeMN+f5Knz/MihgmmLPor+dhIt8mb9B9tk/u9Mik8tjASmSfBKDZ+sc 4HC2wh7yrC3XH00VJAxCXvhXuJVHGfsolWyIyEfSV2H3rQF+QaLJU+EXcN6GiaKUisnwqeEuMU8DT UR1qBehw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngsVC-005dCA-Fy; Tue, 19 Apr 2022 18:23:02 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngsNC-005YvH-V1 for linux-nvme@lists.infradead.org; Tue, 19 Apr 2022 18:14:48 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 2A0D4CE18A1; Tue, 19 Apr 2022 18:14:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583EFC385A5; Tue, 19 Apr 2022 18:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650392083; bh=PIttuX7zubSRysD+VGdkK4RbcQDOcg7fcQEYv5OVc9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kSNVr+VvewJoZB1iVzDhHl0jIz4BS2NhcvM20iiVp+KqGehH9B6N53A5sMWq8y/yR s1cicm0FE8xZTde8G1Ri1ZeHq51VPXEX4mx0e0i+VLCpjohSCUUZKpf51t8RH4tJEP SMT7/8dzonaiQ8BtJIu46YqVhpdYhaFYo0613BKT8vNrPwuvG8RGC/nriNtrnrjbaC 3DRoTT61IwDAvRsb/LrEwVQqTjyzOpKeWO5r+3UG3jr8p/yowON5oclY3ZudzndMoA 3/iHJhrjLBEF5S8sy4j1/lglsAOmciKxcVbuAkqwv0PHDAfW96uiek0e6D51Q5jPGg FtqP974SxMZRw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christoph Hellwig , Luis Chamberlain , Keith Busch , Sagi Grimberg , Sasha Levin , axboe@fb.com, linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 18/18] nvme-pci: disable namespace identifiers for Qemu controllers Date: Tue, 19 Apr 2022 14:13:52 -0400 Message-Id: <20220419181353.485719-18-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220419181353.485719-1-sashal@kernel.org> References: <20220419181353.485719-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220419_111447_207014_4EA884DF X-CRM114-Status: GOOD ( 17.28 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Christoph Hellwig [ Upstream commit 66dd346b84d79fde20832ed691a54f4881eac20d ] Qemu unconditionally reports a UUID, which depending on the qemu version is either all-null (which is incorrect but harmless) or contains a single bit set for all controllers. In addition it can also optionally report a eui64 which needs to be manually set. Disable namespace identifiers for Qemu controlles entirely even if in some cases they could be set correctly through manual intervention. Reported-by: Luis Chamberlain Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 97afeb898b25..6939b03a16c5 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3212,7 +3212,10 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ .driver_data = NVME_QUIRK_IDENTIFY_CNS | - NVME_QUIRK_DISABLE_WRITE_ZEROES, }, + NVME_QUIRK_DISABLE_WRITE_ZEROES | + NVME_QUIRK_BOGUS_NID, }, + { PCI_VDEVICE(REDHAT, 0x0010), /* Qemu emulated controller */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */ .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, }, { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ -- 2.35.1