From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.ozlabs.org (Postfix) with ESMTP id 41Kq1w1SFfzF1Pn for ; Wed, 4 Jul 2018 02:14:11 +1000 (AEST) Subject: Re: [PATCH 5/7 v5] bus: fsl-mc: support dma configure for devices on fsl-mc bus To: Nipun Gupta , will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com Cc: hch@lst.de, joro@8bytes.org, m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com References: <1526824191-7000-1-git-send-email-nipun.gupta@nxp.com> <1526824191-7000-6-git-send-email-nipun.gupta@nxp.com> From: Robin Murphy Message-ID: Date: Tue, 3 Jul 2018 17:14:05 +0100 MIME-Version: 1.0 In-Reply-To: <1526824191-7000-6-git-send-email-nipun.gupta@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 20/05/18 14:49, Nipun Gupta wrote: > This patch adds support of dma configuration for devices on fsl-mc > bus using 'dma_configure' callback for busses. Also, directly calling > arch_setup_dma_ops is removed from the fsl-mc bus. Looks like this is the final arch_setup_dma_ops offender, yay! > Signed-off-by: Nipun Gupta > Reviewed-by: Laurentiu Tudor > --- > drivers/bus/fsl-mc/fsl-mc-bus.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c > index 5d8266c..fa43c7d 100644 > --- a/drivers/bus/fsl-mc/fsl-mc-bus.c > +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c > @@ -127,6 +127,16 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) > return 0; > } > > +static int fsl_mc_dma_configure(struct device *dev) > +{ > + struct device *dma_dev = dev; > + > + while (dev_is_fsl_mc(dma_dev)) > + dma_dev = dma_dev->parent; > + > + return of_dma_configure(dev, dma_dev->of_node, 0); > +} > + > static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, > char *buf) > { > @@ -148,6 +158,7 @@ struct bus_type fsl_mc_bus_type = { > .name = "fsl-mc", > .match = fsl_mc_bus_match, > .uevent = fsl_mc_bus_uevent, > + .dma_configure = fsl_mc_dma_configure, > .dev_groups = fsl_mc_dev_groups, > }; > EXPORT_SYMBOL_GPL(fsl_mc_bus_type); > @@ -633,10 +644,6 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, > goto error_cleanup_dev; > } > > - /* Objects are coherent, unless 'no shareability' flag set. */ > - if (!(obj_desc->flags & FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY)) Although it seems we do end up without any handling of this "non-coherent object behind coherent MC" case, and I'm not sure how easily that could be accommodated by generic code... :/ How important is the quirk? Robin. > - arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true); > - > /* > * The device-specific probe callback will get invoked by device_add() > */ >