Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp325566imu; Mon, 26 Nov 2018 11:25:25 -0800 (PST) X-Google-Smtp-Source: AJdET5cYgu75pKUN6lNujhPZys5eNX1i422aNIXrc8o1eTKy9UPf3VWZUtYmRsboMgtZ8i7lhrFl X-Received: by 2002:aa7:8608:: with SMTP id p8mr29920666pfn.125.1543260325297; Mon, 26 Nov 2018 11:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543260325; cv=none; d=google.com; s=arc-20160816; b=t9bJYyPFBPhUT54ZreUe3cmiRScdxiBoTMgQvIlpiHBLMHu30hb37dF0IBsXqU2eED aKh+3pYJY04AoQVgnf7M139wdEJWv+t50m77EokwyVeE0IwRNUwRS21R6P4sOyGHEWXM oNhwTCYgODa+xw7V8fDT2UWXXNsWtCmWxpeA5zMUQbDquLscV/Ep7sXYlp9UuvS4f4zP RwvmtUIQuUIdz3MORrEnUO0fD9I24qLUdhaODfybeFkBD4wIYRtFUrdghfdugUH+5UHo GH2A1toidTW36y/mzFzyUO6sI/QTC4Mcyjfx9s202K1e3psmoR0jNbA5o3X1a4DgH0Da JBog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=605Zdld7i3iQ+wKjCXqJFa7zoPjzAI70xFSHLiOMxGI=; b=FPB6JPBPNTmrKsWFpoz/dPl5kRg7z8xsMaWIKdwqQP+0UPBuaEOXNd8MwpvTW+NpRg 724onFsS5gyDflCfAqm+S+OkETsxPkpRNhVY1s/aijM8+k9Y5LdeY7VrEYvUVpJVyPPY 5BMMrSQvBQiRrCnVgdo292/0EczE64XJA8E3myXWyg8vhA4H/MWOhVWcvFVtP22CcuMI 1gaW+KgIGn22yJYsRyZ8zqiYaIdjWEllTPLeSQ0at4+0DERgYCcSXxPX0X471MJZphXy 7R94IsZVzkMJ+nZpz6pFe7Xuby2h+ozIkOjp+MDQHuxaaSjPW4/+KuBBBMD3nzOoo0tf VZ8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si1102617pgd.248.2018.11.26.11.24.58; Mon, 26 Nov 2018 11:25:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbeK0GTA (ORCPT + 99 others); Tue, 27 Nov 2018 01:19:00 -0500 Received: from ale.deltatee.com ([207.54.116.67]:51994 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbeK0GS7 (ORCPT ); Tue, 27 Nov 2018 01:18:59 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1gRMTv-00019x-C5; Mon, 26 Nov 2018 12:23:44 -0700 To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Keith Busch , Christoph Hellwig , Jens Axboe , Sasha Levin References: <20181126105059.832485122@linuxfoundation.org> <20181126105100.053276084@linuxfoundation.org> From: Logan Gunthorpe Message-ID: <22aec0ec-4da1-fcbc-3318-ec7709888769@deltatee.com> Date: Mon, 26 Nov 2018 12:23:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181126105100.053276084@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: sashal@kernel.org, axboe@kernel.dk, hch@lst.de, keith.busch@intel.com, stable@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_FREE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH 4.19 005/118] nvme-pci: fix conflicting p2p resource adds X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-11-26 3:49 a.m., Greg Kroah-Hartman wrote: > 4.19-stable review patch. If anyone has any objections, please let me know. This commit is fixing a bug in the p2pdma code which was merged for 4.20. I'm not sure it would actually fix anything in the stable kernels. On the other hand, based on my understanding, it shouldn't hurt anything either. Thanks, Logan > ------------------ > > [ Upstream commit 9fe5c59ff6a1e5e26a39b75489a1420e7eaaf0b1 ] > > The nvme pci driver had been adding its CMB resource to the P2P DMA > subsystem everytime on on a controller reset. This results in the > following warning: > > ------------[ cut here ]------------ > nvme 0000:00:03.0: Conflicting mapping in same section > WARNING: CPU: 7 PID: 81 at kernel/memremap.c:155 devm_memremap_pages+0xa6/0x380 > ... > Call Trace: > pci_p2pdma_add_resource+0x153/0x370 > nvme_reset_work+0x28c/0x17b1 [nvme] > ? add_timer+0x107/0x1e0 > ? dequeue_entity+0x81/0x660 > ? dequeue_entity+0x3b0/0x660 > ? pick_next_task_fair+0xaf/0x610 > ? __switch_to+0xbc/0x410 > process_one_work+0x1cf/0x350 > worker_thread+0x215/0x3d0 > ? process_one_work+0x350/0x350 > kthread+0x107/0x120 > ? kthread_park+0x80/0x80 > ret_from_fork+0x1f/0x30 > ---[ end trace f7ea76ac6ee72727 ]--- > nvme nvme0: failed to register the CMB > > This patch fixes this by registering the CMB with P2P only once. > > Signed-off-by: Keith Busch > Reviewed-by: Logan Gunthorpe > Signed-off-by: Christoph Hellwig > Signed-off-by: Jens Axboe > 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 d668682f91df..da18e0ac9fa2 100644 > --- a/drivers/nvme/host/pci.c > +++ b/drivers/nvme/host/pci.c > @@ -1647,6 +1647,9 @@ static void nvme_map_cmb(struct nvme_dev *dev) > struct pci_dev *pdev = to_pci_dev(dev->dev); > int bar; > > + if (dev->cmb_size) > + return; > + > dev->cmbsz = readl(dev->bar + NVME_REG_CMBSZ); > if (!dev->cmbsz) > return; > @@ -2129,7 +2132,6 @@ static void nvme_pci_disable(struct nvme_dev *dev) > { > struct pci_dev *pdev = to_pci_dev(dev->dev); > > - nvme_release_cmb(dev); > pci_free_irq_vectors(pdev); > > if (pci_is_enabled(pdev)) { > @@ -2577,6 +2579,7 @@ static void nvme_remove(struct pci_dev *pdev) > nvme_stop_ctrl(&dev->ctrl); > nvme_remove_namespaces(&dev->ctrl); > nvme_dev_disable(dev, true); > + nvme_release_cmb(dev); > nvme_free_host_mem(dev); > nvme_dev_remove_admin(dev); > nvme_free_queues(dev, 0); >