lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <HE1PR0401MB2425626DB35517BFD4FA9E15E6470@HE1PR0401MB2425.eurprd04.prod.outlook.com>
Date:   Fri, 6 Jul 2018 12:17:09 +0000
From:   Nipun Gupta <nipun.gupta@....com>
To:     Robin Murphy <robin.murphy@....com>,
        "will.deacon@....com" <will.deacon@....com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "robh@...nel.org" <robh@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "catalin.marinas@....com" <catalin.marinas@....com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        "bhelgaas@...gle.com" <bhelgaas@...gle.com>
CC:     "hch@....de" <hch@....de>, "joro@...tes.org" <joro@...tes.org>,
        "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "frowand.list@...il.com" <frowand.list@...il.com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        Bharat Bhushan <bharat.bhushan@....com>,
        "stuyoder@...il.com" <stuyoder@...il.com>,
        Leo Li <leoyang.li@....com>
Subject: RE: [PATCH 5/7 v5] bus: fsl-mc: support dma configure for devices on
 fsl-mc bus



> -----Original Message-----
> From: Robin Murphy [mailto:robin.murphy@....com]
> Sent: Tuesday, July 3, 2018 9:44 PM
> To: Nipun Gupta <nipun.gupta@....com>; will.deacon@....com;
> robh+dt@...nel.org; robh@...nel.org; mark.rutland@....com;
> catalin.marinas@....com; gregkh@...uxfoundation.org; Laurentiu Tudor
> <laurentiu.tudor@....com>; bhelgaas@...gle.com
> Cc: hch@....de; joro@...tes.org; m.szyprowski@...sung.com;
> shawnguo@...nel.org; frowand.list@...il.com; iommu@...ts.linux-
> foundation.org; linux-kernel@...r.kernel.org; devicetree@...r.kernel.org;
> linux-arm-kernel@...ts.infradead.org; linuxppc-dev@...ts.ozlabs.org; linux-
> pci@...r.kernel.org; Bharat Bhushan <bharat.bhushan@....com>;
> stuyoder@...il.com; Leo Li <leoyang.li@....com>
> Subject: Re: [PATCH 5/7 v5] bus: fsl-mc: support dma configure for devices
> on fsl-mc bus
> 
> 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 <nipun.gupta@....com>
> > Reviewed-by: Laurentiu Tudor <laurentiu.tudor@....com>
> > ---
> >   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?

We have all the devices as coherent in our SoC's now :) So this is fine.
We have internally discussed it.

Regards,
Nipun

> 
> Robin.
> 
> > -		arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true);
> > -
> >   	/*
> >   	 * The device-specific probe callback will get invoked by device_add()
> >   	 */
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ