linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Documentation/spi/spidev_test.c  "Message too long" -EMSGSIZE
@ 2011-03-04 20:30 Kevyn-Alexandre Paré
  2011-03-04 21:52 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Kevyn-Alexandre Paré @ 2011-03-04 20:30 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

I just try to transfer 32775 bytes with spidev_test.c and receive this
message:
can't send spi message: Message too long

Since driver/spi/spidev.c validate that count is not bigger then bufsiz
that is 4096. Because of this:

static unsigned bufsiz = 4096;
module_param(bufsiz, uint, S_IRUGO);
MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");

Question1: Anyone have made some test with buffer bigger then 4096 and see any reason not going to something like 32775?

Question2: Since this parameter is S_IRUGO I have no other choice then using the driver as module if I want to change this size!?

Best Regards,

Kevyn-Alexandre Paré


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Documentation/spi/spidev_test.c  "Message too long" -EMSGSIZE
  2011-03-04 20:30 Documentation/spi/spidev_test.c "Message too long" -EMSGSIZE Kevyn-Alexandre Paré
@ 2011-03-04 21:52 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2011-03-04 21:52 UTC (permalink / raw)
  To: Kevyn-Alexandre Paré
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Fri, Mar 04, 2011 at 03:30:17PM -0500, Kevyn-Alexandre Paré wrote:
> Hi,
> 
> I just try to transfer 32775 bytes with spidev_test.c and receive this
> message:
> can't send spi message: Message too long
> 
> Since driver/spi/spidev.c validate that count is not bigger then bufsiz
> that is 4096. Because of this:
> 
> static unsigned bufsiz = 4096;
> module_param(bufsiz, uint, S_IRUGO);
> MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");

That's just broken.  There shouldn't be any limit on the size of an
spi message sent from userspace.  If userspace can pass the buffer,
then the spi layer should be able to send it.

It looks like it should be possible to modify spidev to handle large
transfers.

> 
> Question1: Anyone have made some test with buffer bigger then 4096 and see any reason not going to something like 32775?
> 
> Question2: Since this parameter is S_IRUGO I have no other choice then using the driver as module if I want to change this size!?

You should be able to pass a different default value in the kernel
parameters string at boot time.

g.

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-04 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-04 20:30 Documentation/spi/spidev_test.c "Message too long" -EMSGSIZE Kevyn-Alexandre Paré
2011-03-04 21:52 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).