From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ale.deltatee.com (ale.deltatee.com [207.54.116.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 26F4321959CB2 for ; Mon, 17 Jun 2019 13:08:18 -0700 (PDT) References: <20190617122733.22432-1-hch@lst.de> <20190617122733.22432-9-hch@lst.de> From: Logan Gunthorpe Message-ID: Date: Mon, 17 Jun 2019 14:08:14 -0600 MIME-Version: 1.0 In-Reply-To: <20190617122733.22432-9-hch@lst.de> Content-Language: en-CA Subject: Re: [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Christoph Hellwig , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , Ben Skeggs Cc: linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, nouveau@lists.freedesktop.org List-ID: On 2019-06-17 6:27 a.m., Christoph Hellwig wrote: > diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c > index a98126ad9c3a..e083567d26ef 100644 > --- a/drivers/pci/p2pdma.c > +++ b/drivers/pci/p2pdma.c > @@ -100,7 +100,7 @@ static void pci_p2pdma_percpu_cleanup(struct percpu_ref *ref) > struct p2pdma_pagemap *p2p_pgmap = to_p2p_pgmap(ref); > > wait_for_completion(&p2p_pgmap->ref_done); > - percpu_ref_exit(&p2p_pgmap->ref); > + percpu_ref_exit(ref); > } > > static void pci_p2pdma_release(void *data) > @@ -152,6 +152,11 @@ static int pci_p2pdma_setup(struct pci_dev *pdev) > return error; > } > > +static const struct dev_pagemap_ops pci_p2pdma_pagemap_ops = { > + .kill = pci_p2pdma_percpu_kill, > + .cleanup = pci_p2pdma_percpu_cleanup, > +}; > + > /** > * pci_p2pdma_add_resource - add memory for use as p2p memory > * @pdev: the device to add the memory to > @@ -207,8 +212,6 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size, > pgmap->type = MEMORY_DEVICE_PCI_P2PDMA; > pgmap->pci_p2pdma_bus_offset = pci_bus_address(pdev, bar) - > pci_resource_start(pdev, bar); > - pgmap->kill = pci_p2pdma_percpu_kill; > - pgmap->cleanup = pci_p2pdma_percpu_cleanup; I just noticed this is missing a line to set pgmap->ops to pci_p2pdma_pagemap_ops. I must have gotten confused by the other users in my original review. Though I'm not sure how this compiles as the new struct is static and unused. However, it is rendered moot in Patch 16 when this is all removed. Logan _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 287CDC31E5C for ; Mon, 17 Jun 2019 20:08:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04B612085A for ; Mon, 17 Jun 2019 20:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728901AbfFQUIS (ORCPT ); Mon, 17 Jun 2019 16:08:18 -0400 Received: from ale.deltatee.com ([207.54.116.67]:48412 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfFQUIS (ORCPT ); Mon, 17 Jun 2019 16:08:18 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1hcxvM-0004o2-QE; Mon, 17 Jun 2019 14:08:17 -0600 To: Christoph Hellwig , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , Ben Skeggs Cc: linux-mm@kvack.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190617122733.22432-1-hch@lst.de> <20190617122733.22432-9-hch@lst.de> From: Logan Gunthorpe Message-ID: Date: Mon, 17 Jun 2019 14:08:14 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190617122733.22432-9-hch@lst.de> 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: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvdimm@lists.01.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-mm@kvack.org, bskeggs@redhat.com, jgg@mellanox.com, jglisse@redhat.com, dan.j.williams@intel.com, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure 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 2019-06-17 6:27 a.m., Christoph Hellwig wrote: > diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c > index a98126ad9c3a..e083567d26ef 100644 > --- a/drivers/pci/p2pdma.c > +++ b/drivers/pci/p2pdma.c > @@ -100,7 +100,7 @@ static void pci_p2pdma_percpu_cleanup(struct percpu_ref *ref) > struct p2pdma_pagemap *p2p_pgmap = to_p2p_pgmap(ref); > > wait_for_completion(&p2p_pgmap->ref_done); > - percpu_ref_exit(&p2p_pgmap->ref); > + percpu_ref_exit(ref); > } > > static void pci_p2pdma_release(void *data) > @@ -152,6 +152,11 @@ static int pci_p2pdma_setup(struct pci_dev *pdev) > return error; > } > > +static const struct dev_pagemap_ops pci_p2pdma_pagemap_ops = { > + .kill = pci_p2pdma_percpu_kill, > + .cleanup = pci_p2pdma_percpu_cleanup, > +}; > + > /** > * pci_p2pdma_add_resource - add memory for use as p2p memory > * @pdev: the device to add the memory to > @@ -207,8 +212,6 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size, > pgmap->type = MEMORY_DEVICE_PCI_P2PDMA; > pgmap->pci_p2pdma_bus_offset = pci_bus_address(pdev, bar) - > pci_resource_start(pdev, bar); > - pgmap->kill = pci_p2pdma_percpu_kill; > - pgmap->cleanup = pci_p2pdma_percpu_cleanup; I just noticed this is missing a line to set pgmap->ops to pci_p2pdma_pagemap_ops. I must have gotten confused by the other users in my original review. Though I'm not sure how this compiles as the new struct is static and unused. However, it is rendered moot in Patch 16 when this is all removed. Logan