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: <20120921154247.GZ28835@atomide.com>
Date:	Fri, 21 Sep 2012 08:42:47 -0700
From:	Tony Lindgren <tony@...mide.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Matt Porter <mporter@...com>, Sekhar Nori <nsekhar@...com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Benoit Cousson <b-cousson@...com>,
	Russell King <linux@....linux.org.uk>,
	Vinod Koul <vinod.koul@...el.com>,
	Rob Landley <rob@...dley.net>, Chris Ball <cjb@...top.org>,
	Devicetree Discuss <devicetree-discuss@...ts.ozlabs.org>,
	Linux OMAP List <linux-omap@...r.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@...ts.infradead.org>,
	Linux DaVinci Kernel List 
	<davinci-linux-open-source@...ux.davincidsp.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux Documentation List <linux-doc@...r.kernel.org>,
	Linux MMC List <linux-mmc@...r.kernel.org>,
	Linux SPI Devel List 
	<spi-devel-general@...ts.sourceforge.net>,
	Dan Williams <djbw@...com>,
	Rob Herring <rob.herring@...xeda.com>
Subject: Re: [RFC PATCH 10/13] spi: omap2-mcspi:
 dma_request_slave_channel() support for DT platforms

* Arnd Bergmann <arnd@...db.de> [120921 02:19]:
> On Thursday 20 September 2012, Tony Lindgren wrote:
> > >  /* use PIO for small transfers, avoiding DMA setup/teardown overhead and
> > > @@ -798,14 +801,26 @@ static int omap2_mcspi_request_dma(struct spi_device *spi)
> > >       dma_cap_zero(mask);
> > >       dma_cap_set(DMA_SLAVE, mask);
> > >       sig = mcspi_dma->dma_rx_sync_dev;
> > > -     mcspi_dma->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig);
> > > +     if (spi->dev.of_node)
> > > +             mcspi_dma->dma_rx =
> > > +                     dma_request_slave_channel(&master->dev,
> > > +                                               mcspi_dma->dma_rx_ch_name);
> > > +     else
> > > +             mcspi_dma->dma_rx =
> > > +                     dma_request_channel(mask, omap_dma_filter_fn, &sig);
> > >       if (!mcspi_dma->dma_rx) {
> > >               dev_err(&spi->dev, "no RX DMA engine channel for McSPI\n");
> > >               return -EAGAIN;
> > >       }
> > >  
> > 
> > Hmm this does not look nice.. We should be able to somehow not to care about
> > the configuration at the mcspi driver level.
> 
> I agree, but as far as I understand Vinod's plans, we would actually move
> all drivers over to dma_request_slave_channel() when we have an interface
> to register the lookup tables from platform code.
> 
> I think the above is ok for a transitional phase and we can remove the
> fallback path when we have converted all platforms using this driver
> to either use DT or move to the new style way of passing the channel
> configuration.

Can't we come up with a version of dma_request_slave_channel that works
both ways for now:

	mcspi_dma->dma_rx =
		dma_request_slave_channel_compat(mask, omap_dma_filter_fn, &sig,
					&master->dev, mcspi_dma->dma_rx_ch_name);
	...			

Then it's just question of patching away two lines later on rather than
having to add all this if else to all the drivers first, then patching
it away again.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ