Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4818691rwb; Mon, 31 Jul 2023 12:45:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsoioJheULZ68GpHnjNJJgAVqe2UJgDB1ilEpmdvhiPOgNHYMRiDuH2xZWSUiNKPV4V7J+ X-Received: by 2002:a17:907:77cd:b0:98d:4000:1bf9 with SMTP id kz13-20020a17090777cd00b0098d40001bf9mr675862ejc.65.1690832749544; Mon, 31 Jul 2023 12:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690832749; cv=none; d=google.com; s=arc-20160816; b=p6CPpkjZFZBX/ZUSh6C3LaUA1sSJ7brZCpdo/tkg+h7vxFi1p8XiQOeq6a62XYfIaU kXj6SmyruxmPi/n2hwIif27dRzKqoLkrbWcNLZbNCR9PjXSEsfz2VhnaB7V4vGHbbp3h K4yqNVNCH5g5EhLoC1cNJtd55UZhm0ExzVWOuzdaof/d7/05LMA33tJO1HXYxouY8tzB OkiN7eiKKrfjPMIGDKCn50QWk/+S+5d0zKryyzFcyWdbz3q0fhNC71+mCucrIWA228uN 9F1MlHqFPKvgfN2YnGMdEpAUTNU38mzPqH71StxahpdnLHPgqRD2251jMZTbMOW6jnY5 6QrQ== 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=3TorukNnHMeG5Dl454WzehxY6SuXeHm2IsGSo18GQSw=; fh=wG/j76GFpJLC6iu+Yk04N9C4Ha983W42Ka+4UgWTYI4=; b=BWx3RCrWYPAsDcrondppn4EHzdyKanYvm0KVmbrk4AlNhMQGE9zK9ZPQOnbQMu3hKm eYtBvQdv4cJTUy2G3toKgUA0ExZ3b3dyro57pt5KLDvpPNfzAphy246NG/Oyb0tqey1o Xu5ZKSPzcgVHCVic205T/KRwz5LE8cp4Zspu+dalG8JjJ6NWSOu7WYpW106osPQxl+UP QQymFHZJi1H6X1xersB5jVNEBeSezBmah2xUJeMgZVluu8MTG8JvMkfrRWQn0mKZqwXa rYBSDzqrdth82IIFYBAlSbtBxOjc5ENGoLryjjtH0Ga1W8NTCdKx8BhyzxnugcPSjqzm wYzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K3rVcA8G; 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 s11-20020a170906a18b00b0099b41fa79f3si6994002ejy.331.2023.07.31.12.45.23; Mon, 31 Jul 2023 12:45:49 -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=K3rVcA8G; 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 S230155AbjGaTKR (ORCPT + 99 others); Mon, 31 Jul 2023 15:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjGaTKP (ORCPT ); Mon, 31 Jul 2023 15:10:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CA2184 for ; Mon, 31 Jul 2023 12:10:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7EC6C61277 for ; Mon, 31 Jul 2023 19:10:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53347C433C8; Mon, 31 Jul 2023 19:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690830613; bh=7BUP17YZLUCEJIi4rAJBHLTCh+olUP+m+qo5gNNUQQ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K3rVcA8G0AtmamNt3KZciRNmpZAw/gId0t1RzJbGLJkPD4PbMzKu7fAVivLCU6t8R zRm5RhEinrX2CWq1QAzTEqID4FOPvovwH7Ghb5VPjCAjRBqO81Hk2tzpyPsXxpmHvb Ndss40rzb6kGEP141ddFKfhhxe6l7uwCeA9upxQ7dYDckl4wQRjh5uf1xdv8uZMgHn +0kbgT8Nu6B/SiL1ZmKDOmteoJw4QxDaOSCWuZh1h2yDIwY5G1WgdNVaQ3EeUrtEHH 7endB90IpUb3NyJ6jDaNVYzjhM7f/ZIWTaLQZS7OeVeGhz1M4Gd9SQUzwbUKtPMeqg adlYGJ0AG5fFw== Date: Mon, 31 Jul 2023 13:10:11 -0600 From: Keith Busch To: Mario Limonciello Cc: axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, nilskruse97@gmail.com, git@augustwikerfors.se, David.Chang@amd.com Subject: Re: [PATCH] nvme: Don't fail to resume if NSIDs change Message-ID: References: <20230731185103.18436-1-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731185103.18436-1-mario.limonciello@amd.com> 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,T_SCC_BODY_TEXT_LINE autolearn=ham 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, Jul 31, 2023 at 01:51:03PM -0500, Mario Limonciello wrote: > Samsung PM9B1 has problems after resume because NSID has changed. > This has been reported in the past on OEM varities of PM9B1 parts > and fixed by firmware updates on 'some' of those parts. > > However this same issue also happens on 'retail' PM9B1 parts which > Samsung has not released firmware updates for. > > As the check has been relaxed at startup for multiple disks with > duplicate NSIDs with commit ac522fc6c3165 ("nvme: don't reject > probe due to duplicate IDs for single-ported PCIe devices") also > relax the check that runs on resume for NSIDs and mark them bogus > if this occurs on resume. How could the driver tell the difference between the device needing a quirk compared to a rapid delete-create-attach namespace sequence? Proceeding with the namespace now may get dirty writes intended for the previous namespace, corrupting the new one. The commit you mentioned tries to constrain allowing duplication where we can reasonably assume the quirk is needed. If we need to do similiar for this condition, one possible constraint might be that the device doesn't report OACS bit 3 (Namespace Management).