Re: [PATCH] spi: bitbang: convert to using core message queue
On Sat, 19 May 2012, Grant Likely wrote: On Wed, 16 May 2012 08:57:48 +0200, Linus Walleij linus.wall...@linaro.org wrote: On Sat, Mar 17, 2012 at 12:39 AM, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: The SPI subsystem core now manages message queues internally. Remove the local message queue implementation from the spi-bitbang driver and migrate to the common one. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Grant have you picked this patch? It arrived pretty early so should be quite ripe by now... Hmmm, two problems. The patch is mailer damaged which I fixed manually, Sorry, that's _extremely_ unlikely. I don't subscribe to spi-devel, so, I cannot verify the patch as it appeared on the list, but I don't think I used any special procedure, when sending that patch, just the same as what I use to send (almost) all my patches, which is also confirmed by what it looks like in my sent folder. but I also cannot figure out what it is based on. Right, it was based on another spi-bitbang patch, that we dropped. Guennadi, could you please respin this patch on top of current mainline and repost? Sure, I'll resend it and a couple of cosmetic improvements in a minute. Thanks, g. Thanks g. ;-) --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH] spi: bitbang: convert to using core message queue
On Wed, Apr 11, 2012 at 10:56 PM, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: Hi Grant On Tue, 20 Mar 2012, Grant Likely wrote: On Mon, 19 Mar 2012 00:33:14 +0100, Linus Walleij linus.wall...@linaro.org wrote: On Sat, Mar 17, 2012 at 12:39 AM, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: The SPI subsystem core now manages message queues internally. Remove the local message queue implementation from the spi-bitbang driver and migrate to the common one. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de This is great stuff! Acked-by: Linus Walleij linus.wall...@linaro.org (Since I've never really used the bitbang driver I wouldn't trust me to do any deeper review.) In hindsite; I should have asked you to make the pl driver use bitbang queueing since that was already used for generic queuing by a number of drivers; and then refactored that to perform better. Doing that would have been refactoring better tested code, but oh well. I'm going to ignore this series for the moment; please remind me to look at it after the merge window has closed. Seems to be time:-) Yeah lets ping Grant on this :) Yours, Linus Walleij -- Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general
Re: [PATCH] spi: bitbang: convert to using core message queue
Hi Grant On Tue, 20 Mar 2012, Grant Likely wrote: On Mon, 19 Mar 2012 00:33:14 +0100, Linus Walleij linus.wall...@linaro.org wrote: On Sat, Mar 17, 2012 at 12:39 AM, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: The SPI subsystem core now manages message queues internally. Remove the local message queue implementation from the spi-bitbang driver and migrate to the common one. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de This is great stuff! Acked-by: Linus Walleij linus.wall...@linaro.org (Since I've never really used the bitbang driver I wouldn't trust me to do any deeper review.) In hindsite; I should have asked you to make the pl driver use bitbang queueing since that was already used for generic queuing by a number of drivers; and then refactored that to perform better. Doing that would have been refactoring better tested code, but oh well. I'm going to ignore this series for the moment; please remind me to look at it after the merge window has closed. Seems to be time:-) Thanks Guennadi g. Quick thought: +static int spi_bitbang_dummy_prepare(struct spi_master *master) +{ + Â Â Â return 0; (...) + Â Â Â master-prepare_transfer_hardware = spi_bitbang_dummy_prepare; + Â Â Â master-unprepare_transfer_hardware = spi_bitbang_dummy_prepare; Maybe we should think about making these two hooks optional if this pattern turns up a lot. I'll try to fix some refactoring further down the road if nobody beats me to it. Yours, Linus Walleij From: Grant Likely grant.lik...@secretlab.ca Subject: Re: [PATCH] spi: bitbang: convert to using core message queue To: Guennadi Liakhovetski g.liakhovet...@gmx.de, Linus Walleij linus.wall...@linaro.org Cc: spi-devel-general@lists.sourceforge.net, Magnus Damm magnus.d...@gmail.com In-Reply-To: Pine.LNX.4.64.1203170036590.20979@axis700.grange References: Pine.LNX.4.64.1203141837170.30291@axis700.grange 20120315092923.951203E04FD@localhost cacrpkdznqzyx-hzjzymctpuqjtnymwq5ksde6rtfwkchuz_...@mail.gmail.com Pine.LNX.4.64.1203170036590.20979@axis700.grange On Sat, 17 Mar 2012 00:39:44 +0100 (CET), Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: The SPI subsystem core now manages message queues internally. Remove the local message queue implementation from the spi-bitbang driver and migrate to the common one. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- On Fri, 16 Mar 2012, Linus Walleij wrote: On Thu, Mar 15, 2012 at 10:29 AM, Grant Likely grant.lik...@secretlab.ca wrote: On Wed, 14 Mar 2012 22:04:25 +0100 (CET), Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: This patch adds a PM QoS requirement to the spi-bitbang driver, preventing the underlying SPI hardware driver to suspend for too long a time, as long as there are transfers on the queue. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Shouldn't this be part of the core spi infrastructure? Â Particularly since queuing is moving into the core. Hm, the spi-bitbang driver needs to be converted to use the central message queue, Guennadi can you look into that since you're using it? The spi-pl022.c and also Samsung spi-s3c64xx.c is converted showing examples on how go about with that. Something like this? Tested with spi-sh-msiof on SuperH and sh-mobile ARM and with spi-gpio. drivers/spi/spi-bitbang.c | 280 +++ include/linux/spi/spi_bitbang.h |7 - 2 files changed, 108 insertions(+), 179 deletions(-) diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index 6c0ec81..5f163d9 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -244,162 +244,125 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) /*--*/ -/* - * SECOND PART ... simple transfer queue runner. - * - * This costs a task context per controller, running the queue by - * performing each transfer in sequence. Smarter hardware can queue - * several DMA transfers at once, and process several controller queues - * in parallel; this driver doesn't match such hardware very well. - * - * Drivers can provide word-at-a-time i/o primitives, or provide - * transfer-at-a-time ones to leverage dma or fifo hardware. - */ -static void bitbang_work(struct work_struct *work) +static int spi_bitbang_transfer_one_message(struct spi_master *master, + struct spi_message *msg) { - struct spi_bitbang *bitbang = - container_of(work, struct spi_bitbang, work); + struct spi_bitbang *bitbang = spi_master_get_devdata(master); + struct spi_device *spi = msg-spi; + unsigned
Re: [PATCH] spi: bitbang: convert to using core message queue
On Sat, Mar 17, 2012 at 12:39 AM, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: The SPI subsystem core now manages message queues internally. Remove the local message queue implementation from the spi-bitbang driver and migrate to the common one. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de This is great stuff! Acked-by: Linus Walleij linus.wall...@linaro.org (Since I've never really used the bitbang driver I wouldn't trust me to do any deeper review.) Quick thought: +static int spi_bitbang_dummy_prepare(struct spi_master *master) +{ + return 0; (...) + master-prepare_transfer_hardware = spi_bitbang_dummy_prepare; + master-unprepare_transfer_hardware = spi_bitbang_dummy_prepare; Maybe we should think about making these two hooks optional if this pattern turns up a lot. I'll try to fix some refactoring further down the road if nobody beats me to it. Yours, Linus Walleij -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general