[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080222190613.0043B229B4D@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
Date: Fri, 22 Feb 2008 11:06:13 -0800
From: David Brownell <david-b@...bell.net>
To: nforrester@...i.edu, anemo@....ocn.ne.jp
Cc: spi-devel-general@...ts.sourceforge.net, marc.pignat@...s.ch,
linux-kernel@...r.kernel.org
Subject: Re: [spi-devel-general] [PATCH] atmel_spi: support zero length
transfer
> > If the driver could not handle zero length transfer, then the driver
> > should reject it (just like unsupported transfer mode). Then the
> > behavior will be 'assert chip select and wait some time' or 'rejected
> > by the driver'.
>
> This would be OK. It would not be hard to fix pxa2xx_spi, for example,
> to reject zero-length transfers in DMA mode, as long as it is acceptable
> to reject the message in mid-message.
Such "illegal message" rejection is best done early; "fail-fast".
Mid-message rejection isn't wrong, but it's a rude policy.
It'd be best to fix pxa2xx_spi to not start zero-length DMAs.
> If it were necessary to scan a
> whole message for zero-length transfers and refuse to queue an offending
> message, then that adds burden to all messages.
Sanity checking messages as they're submitted is easy; and it's
also the natural point for setting up DMA mappings (and making
those cachelines available for better use).
- Dave
--
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