From patchwork Tue Nov 8 15:02:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13036403 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 A487BC433FE for ; Tue, 8 Nov 2022 15:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3LdKaJbnFm3QaOlRjy107hLyn/PT485cOGxgzAvFvGM=; b=x1DVgsdDAdHqbp BOOnw17V3lv/b8FDf/kIJwF8F+MQFEwVVwdUdJK2flpfyIVXVQW7IHuQBwShkg4JdbfLa5iJBsOYZ z/4hTvxdtw63EDJ/iwswpLSp6v8d50am18CiJt3b4R9FQNHQYp+luMpno3deI0VdVhoj9KBeR70TU UNAm3XyBG/aYICE0ZOvO2iyRtpT/V1lPuE2QigbKy5IQKEIf/xjS9TiwDAFT9ef6lz7fA0jVL7Osx tHnyWDzctwHQUKKRGd3QOMiPEsCHWBVcFq5jPUZTiDJCy2NDsU/9cPL7tefeeJcGXmTUfkAnI9fVA 7GRKDLSfvWIex380H+Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osQ8L-006BvN-NS; Tue, 08 Nov 2022 15:03:25 +0000 Received: from [2001:4bb8:191:2450:b4e6:4796:2c38:d4bf] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1osQ7u-006BmC-TN; Tue, 08 Nov 2022 15:02:59 +0000 From: Christoph Hellwig To: Keith Busch Cc: Sagi Grimberg , Chaitanya Kulkarni , Gerd Bayer , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH 01/12] nvme-pci: don't call nvme_init_ctrl_finish from nvme_passthru_end Date: Tue, 8 Nov 2022 16:02:41 +0100 Message-Id: <20221108150252.2123727-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108150252.2123727-1-hch@lst.de> References: <20221108150252.2123727-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org nvme_passthrough_end can race with a reset, so we should not call nvme_init_ctrl_finish from here. Instead just log that the controller capabilities might have changed. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f94b05c585cbc..706499d4bfefb 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1120,8 +1120,10 @@ void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects, mutex_unlock(&ctrl->subsys->lock); mutex_unlock(&ctrl->scan_lock); } - if (effects & NVME_CMD_EFFECTS_CCC) - nvme_init_ctrl_finish(ctrl); + if (effects & NVME_CMD_EFFECTS_CCC) { + dev_info(ctrl->device, +"controller capabilities changed, reset may be required to take effect.\n"); + } if (effects & (NVME_CMD_EFFECTS_NIC | NVME_CMD_EFFECTS_NCC)) { nvme_queue_scan(ctrl); flush_work(&ctrl->scan_work);