Thread (28 messages) 28 messages, 7 authors, 2018-05-16

RE: [PATCH 5/6 v3] bus: fsl-mc: supoprt dma configure for devices on fsl-mc bus

From: Nipun Gupta <hidden>
Date: 2018-05-16 08:49:07
Also in: linux-arm-kernel, linux-devicetree, linux-iommu, linux-pci, lkml

-----Original Message-----
From: Laurentiu Tudor
Sent: Monday, May 14, 2018 7:10 PM
To: Nipun Gupta <redacted>; robin.murphy@arm.com;
will.deacon@arm.com; mark.rutland@arm.com; catalin.marinas@arm.com
Cc: hch@lst.de; gregkh@linuxfoundation.org; joro@8bytes.org;
robh+dt@kernel.org; m.szyprowski@samsung.com; shawnguo@kernel.org;
frowand.list@gmail.com; bhelgaas@google.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; linu=
x-
pci@vger.kernel.org; Bharat Bhushan [off-list ref];
stuyoder@gmail.com; Leo Li [off-list ref]
Subject: Re: [PATCH 5/6 v3] bus: fsl-mc: supoprt dma configure for device=
s
on fsl-mc bus
=20
Hi Nipun,
=20
On 04/27/2018 01:27 PM, Nipun Gupta wrote:
quoted
Signed-off-by: Nipun Gupta <redacted>
---
  drivers/bus/fsl-mc/fsl-mc-bus.c | 16 ++++++++++++----
  1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-m=
c-
bus.c
quoted
index 5d8266c..624828b 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)
quoted
  	return 0;
  }

+static int fsl_mc_dma_configure(struct device *dev)
+{
+	struct device *dma_dev =3D dev;
+
+	while (dev_is_fsl_mc(dma_dev))
+		dma_dev =3D dma_dev->parent;
+
+	return of_dma_configure(dev, dma_dev->of_node, 0);
+}
+
  static ssize_t modalias_show(struct device *dev, struct device_attrib=
ute
*attr,
quoted
  			     char *buf)
  {
@@ -148,6 +158,7 @@ struct bus_type fsl_mc_bus_type =3D {
  	.name =3D "fsl-mc",
  	.match =3D fsl_mc_bus_match,
  	.uevent =3D fsl_mc_bus_uevent,
+	.dma_configure  =3D fsl_mc_dma_configure,
  	.dev_groups =3D fsl_mc_dev_groups,
  };
  EXPORT_SYMBOL_GPL(fsl_mc_bus_type);
@@ -616,6 +627,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc
*obj_desc,
quoted
  		mc_dev->icid =3D parent_mc_dev->icid;
  		mc_dev->dma_mask =3D FSL_MC_DEFAULT_DMA_MASK;
  		mc_dev->dev.dma_mask =3D &mc_dev->dma_mask;
+		mc_dev->dev.coherent_dma_mask =3D mc_dev->dma_mask;
=20
This change seems a bit unrelated to the patch subject. I wonder if it
makes sense to split it it in a distinct patch.
Okay. I will spin a v5 after splitting this patch and adding changelog (Gre=
g's comment), fixing typo (Bjorn's comment).

Regards,
Nipun
=20
---
Best Regards, Laurentiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help