From edc985ced86956e449dc6b5ca384afad7ab111e1 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Tue, 21 Apr 2009 12:24:49 -0700 Subject: [PATCH] --- yaml --- r: 143807 b: refs/heads/master c: 6e538aaf50ae782a890cbc02c27950448d8193e1 h: refs/heads/master i: 143805: 0d9e1b338f14e349010ccf013a7e220b729a2129 143803: 955c2541530f6cce574e5851f3bc7e7f867f9f52 143799: 8063c5fe48cd9fc61e4629cc931fb40622f55734 143791: 1b22d0793505dbaefc35b42053789a57814e9661 143775: 43887f3cc6e9a88b14110a405c390dff81f1ae62 143743: dfe7ec4d0236e9df0804c0ef4c83fd9b456d20f5 v: v3 --- [refs] | 2 +- trunk/Documentation/spi/spi-summary | 6 ++++++ trunk/include/linux/spi/spi.h | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b94be36df6d8..fef9e094f478 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 14fadca793e39742f442df53391cdd1437b9262f +refs/heads/master: 6e538aaf50ae782a890cbc02c27950448d8193e1 diff --git a/trunk/Documentation/spi/spi-summary b/trunk/Documentation/spi/spi-summary index 0f5122eb282b..4a02d2508bc8 100644 --- a/trunk/Documentation/spi/spi-summary +++ b/trunk/Documentation/spi/spi-summary @@ -511,10 +511,16 @@ SPI MASTER METHODS This sets up the device clock rate, SPI mode, and word sizes. Drivers may change the defaults provided by board_info, and then call spi_setup(spi) to invoke this routine. It may sleep. + Unless each SPI slave has its own configuration registers, don't change them right away ... otherwise drivers could corrupt I/O that's in progress for other SPI devices. + ** BUG ALERT: for some reason the first version of + ** many spi_master drivers seems to get this wrong. + ** When you code setup(), ASSUME that the controller + ** is actively processing transfers for another device. + master->transfer(struct spi_device *spi, struct spi_message *message) This must not sleep. Its responsibility is arrange that the transfer happens and its complete() callback is issued. The two diff --git a/trunk/include/linux/spi/spi.h b/trunk/include/linux/spi/spi.h index 2cc43fa380cb..a0faa18f7b1b 100644 --- a/trunk/include/linux/spi/spi.h +++ b/trunk/include/linux/spi/spi.h @@ -245,7 +245,12 @@ struct spi_master { */ u16 dma_alignment; - /* setup mode and clock, etc (spi driver may call many times) */ + /* Setup mode and clock, etc (spi driver may call many times). + * + * IMPORTANT: this may be called when transfers to another + * device are active. DO NOT UPDATE SHARED REGISTERS in ways + * which could break those transfers. + */ int (*setup)(struct spi_device *spi); /* bidirectional bulk transfers