* linux-next: manual merge of the pxa tree
@ 2008-09-14 19:27 Stephen Rothwell
[not found] ` <20080915052750.0b0c924c.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2008-09-14 19:27 UTC (permalink / raw)
To: Eric Miao; +Cc: linux-next, Ned Forrester
Hi Eric,
Today's linux-next merge of the pxa tree got a conflict in
drivers/spi/pxa2xx_spi.c between commit
8423597d676615f3dd2d9ab36f59f147086b90b8 ("pxa2xx_spi: chipselect
bugfixes") from Linus' tree and commit
5625ef19d54c02838c867b6a5c87823e021ac7a5 ("spi: pxa2xx_spi introduce chip
select gpio to simplify the common cases") from the pxa tree.
I fixed it up (see below) and can carry the fixup (though it could be
fixed in the pxa tree in a merge with Linus' tree). Please check the
fixup.
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --cc drivers/spi/pxa2xx_spi.c
index 0e53354,98d2338..0000000
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@@ -406,46 -430,11 +430,48 @@@ static void giveback(struct driver_dat
struct spi_transfer,
transfer_list);
+ /* Delay if requested before any change in chip select */
+ if (last_transfer->delay_usecs)
+ udelay(last_transfer->delay_usecs);
+
+ /* Drop chip select UNLESS cs_change is true or we are returning
+ * a message with an error, or next message is for another chip
+ */
if (!last_transfer->cs_change)
- drv_data->cs_control(PXA2XX_CS_DEASSERT);
+ cs_deassert(drv_data);
+ else {
+ struct spi_message *next_msg;
+
+ /* Holding of cs was hinted, but we need to make sure
+ * the next message is for the same chip. Don't waste
+ * time with the following tests unless this was hinted.
+ *
+ * We cannot postpone this until pump_messages, because
+ * after calling msg->complete (below) the driver that
+ * sent the current message could be unloaded, which
+ * could invalidate the cs_control() callback...
+ */
+
+ /* get a pointer to the next message, if any */
+ spin_lock_irqsave(&drv_data->lock, flags);
+ if (list_empty(&drv_data->queue))
+ next_msg = NULL;
+ else
+ next_msg = list_entry(drv_data->queue.next,
+ struct spi_message, queue);
+ spin_unlock_irqrestore(&drv_data->lock, flags);
+
+ /* see if the next and current messages point
+ * to the same chip
+ */
+ if (next_msg && next_msg->spi != msg->spi)
+ next_msg = NULL;
+ if (!next_msg || msg->state == ERROR_STATE)
- drv_data->cs_control(PXA2XX_CS_DEASSERT);
++ cs_deassert(drv_data);
+ }
+ drv_data->cur_chip = NULL;
+
msg->state = NULL;
if (msg->complete)
msg->complete(msg->context);
@@@ -882,33 -873,16 +908,33 @@@ static void pump_transfers(unsigned lon
transfer_list);
if (previous->delay_usecs)
udelay(previous->delay_usecs);
+
+ /* Drop chip select only if cs_change is requested */
+ if (previous->cs_change)
- drv_data->cs_control(PXA2XX_CS_DEASSERT);
++ cs_deassert(drv_data);
}
- /* Check transfer length */
- if (transfer->len > 8191)
- {
- dev_warn(&drv_data->pdev->dev, "pump_transfers: transfer "
- "length greater than 8191\n");
- message->status = -EINVAL;
- giveback(drv_data);
- return;
+ /* Check for transfers that need multiple DMA segments */
+ if (transfer->len > MAX_DMA_LEN && chip->enable_dma) {
+
+ /* reject already-mapped transfers; PIO won't always work */
+ if (message->is_dma_mapped
+ || transfer->rx_dma || transfer->tx_dma) {
+ dev_err(&drv_data->pdev->dev,
+ "pump_transfers: mapped transfer length "
+ "of %lu is greater than %d\n",
+ transfer->len, MAX_DMA_LEN);
+ message->status = -EINVAL;
+ giveback(drv_data);
+ return;
+ }
+
+ /* warn ... we force this to PIO mode */
+ if (printk_ratelimit())
+ dev_warn(&message->spi->dev, "pump_transfers: "
+ "DMA disabled for transfer length %ld "
+ "greater than %d\n",
+ (long)drv_data->len, MAX_DMA_LEN);
}
/* Setup the transfer state based on the type of transfer */
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <20080915052750.0b0c924c.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>]
* Re: linux-next: manual merge of the pxa tree [not found] ` <20080915052750.0b0c924c.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org> @ 2008-09-15 13:18 ` Ned Forrester 2008-09-16 3:02 ` Eric Miao 0 siblings, 1 reply; 6+ messages in thread From: Ned Forrester @ 2008-09-15 13:18 UTC (permalink / raw) To: Stephen Rothwell; +Cc: spi-devel, linux-next-u79uwXL29TY76Z2rM5mHXA, Eric Miao Stephen Rothwell wrote: > Hi Eric, > > Today's linux-next merge of the pxa tree got a conflict in > drivers/spi/pxa2xx_spi.c between commit > 8423597d676615f3dd2d9ab36f59f147086b90b8 ("pxa2xx_spi: chipselect > bugfixes") from Linus' tree and commit > 5625ef19d54c02838c867b6a5c87823e021ac7a5 ("spi: pxa2xx_spi introduce chip > select gpio to simplify the common cases") from the pxa tree. > > I fixed it up (see below) and can carry the fixup (though it could be > fixed in the pxa tree in a merge with Linus' tree). Please check the > fixup. The last word I had from David Brownell, was that Eric should make his patch fit after mine. I think Eric was planning to re-submit, but maybe you have saved him the trouble. I will leave it to Eric to decide if you fixed everything needed. -- Ned Forrester nforrester-/d+BM93fTQY@public•gmane.org Oceanographic Systems Lab 508-289-2226 Applied Ocean Physics and Engineering Dept. Woods Hole Oceanographic Institution Woods Hole, MA 02543, USA http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212 http://www.whoi.edu/hpb/Site.do?id=1532 http://www.whoi.edu/page.do?pid=10079 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the pxa tree 2008-09-15 13:18 ` Ned Forrester @ 2008-09-16 3:02 ` Eric Miao 2008-09-25 4:57 ` [spi-devel-general] " David Brownell 0 siblings, 1 reply; 6+ messages in thread From: Eric Miao @ 2008-09-16 3:02 UTC (permalink / raw) To: Ned Forrester; +Cc: Stephen Rothwell, linux-next, spi-devel On Mon, Sep 15, 2008 at 9:18 PM, Ned Forrester <nforrester@whoi•edu> wrote: > Stephen Rothwell wrote: >> Hi Eric, >> >> Today's linux-next merge of the pxa tree got a conflict in >> drivers/spi/pxa2xx_spi.c between commit >> 8423597d676615f3dd2d9ab36f59f147086b90b8 ("pxa2xx_spi: chipselect >> bugfixes") from Linus' tree and commit >> 5625ef19d54c02838c867b6a5c87823e021ac7a5 ("spi: pxa2xx_spi introduce chip >> select gpio to simplify the common cases") from the pxa tree. >> >> I fixed it up (see below) and can carry the fixup (though it could be >> fixed in the pxa tree in a merge with Linus' tree). Please check the >> fixup. > > The last word I had from David Brownell, was that Eric should make his > patch fit after mine. I think Eric was planning to re-submit, but maybe > you have saved him the trouble. I will leave it to Eric to decide if > you fixed everything needed. > I'll take off the patch to save Stephen's time on this. Sorry for the noise. - eric ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [spi-devel-general] linux-next: manual merge of the pxa tree 2008-09-16 3:02 ` Eric Miao @ 2008-09-25 4:57 ` David Brownell 2008-09-25 7:49 ` Eric Miao 0 siblings, 1 reply; 6+ messages in thread From: David Brownell @ 2008-09-25 4:57 UTC (permalink / raw) To: spi-devel-general, Eric Miao, Stephen Rothwell; +Cc: Ned Forrester, linux-next On Monday 15 September 2008, Eric Miao wrote: > >> I fixed it up (see below) and can carry the fixup (though it could be > >> fixed in the pxa tree in a merge with Linus' tree). Please check the > >> fixup. > > > > The last word I had from David Brownell, was that Eric should make his > > patch fit after mine. I think Eric was planning to re-submit, but maybe > > you have saved him the trouble. I will leave it to Eric to decide if > > you fixed everything needed. > > > > I'll take off the patch to save Stephen's time on this. Sorry for the > noise. Uh, I have yet to see any version of this patch... could someone post it so the SPI maintainer at least has a chance to look at it? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [spi-devel-general] linux-next: manual merge of the pxa tree 2008-09-25 4:57 ` [spi-devel-general] " David Brownell @ 2008-09-25 7:49 ` Eric Miao [not found] ` <f17812d70809250049g3f3b86e7x12dab8cc4f8b1cd6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Eric Miao @ 2008-09-25 7:49 UTC (permalink / raw) To: David Brownell Cc: spi-devel-general, Stephen Rothwell, Ned Forrester, linux-next On Thu, Sep 25, 2008 at 12:57 PM, David Brownell <david-b@pacbell•net> wrote: > On Monday 15 September 2008, Eric Miao wrote: >> >> I fixed it up (see below) and can carry the fixup (though it could be >> >> fixed in the pxa tree in a merge with Linus' tree). Please check the >> >> fixup. >> > >> > The last word I had from David Brownell, was that Eric should make his >> > patch fit after mine. I think Eric was planning to re-submit, but maybe >> > you have saved him the trouble. I will leave it to Eric to decide if >> > you fixed everything needed. >> > >> >> I'll take off the patch to save Stephen's time on this. Sorry for the >> noise. > > Uh, I have yet to see any version of this patch... could someone post > it so the SPI maintainer at least has a chance to look at it? > Expect a week or two before this happen, I'm currently busy with other stuffs. Sorry for the delay. -- Cheers - eric ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <f17812d70809250049g3f3b86e7x12dab8cc4f8b1cd6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: linux-next: manual merge of the pxa tree [not found] ` <f17812d70809250049g3f3b86e7x12dab8cc4f8b1cd6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2008-09-25 8:20 ` David Brownell 0 siblings, 0 replies; 6+ messages in thread From: David Brownell @ 2008-09-25 8:20 UTC (permalink / raw) To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Cc: Ned Forrester, Stephen Rothwell, linux-next-u79uwXL29TY76Z2rM5mHXA, Eric Miao On Thursday 25 September 2008, Eric Miao wrote: > > Uh, I have yet to see any version of this patch... could someone post > > it so the SPI maintainer at least has a chance to look at it? > > > > Expect a week or two before this happen, I'm currently busy with > other stuffs. Sorry for the delay. I thought the situation was that there was a working version that hadn't been sent to the SPI list ... If that's not the case, no worries. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-25 8:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-14 19:27 linux-next: manual merge of the pxa tree Stephen Rothwell
[not found] ` <20080915052750.0b0c924c.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2008-09-15 13:18 ` Ned Forrester
2008-09-16 3:02 ` Eric Miao
2008-09-25 4:57 ` [spi-devel-general] " David Brownell
2008-09-25 7:49 ` Eric Miao
[not found] ` <f17812d70809250049g3f3b86e7x12dab8cc4f8b1cd6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-25 8:20 ` David Brownell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox