summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2009-09-04 11:12:16 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2009-09-04 11:12:16 +1000
commit719ff5ce6efb241ce0a2f3df5ba83485d5f3e133 (patch)
tree5e7256933c6f9e76939c02e86267d85a2b21f236 /drivers
parent7632357a8d8ea78488a538a80ccccbe21f387918 (diff)
parente766165b4c1bac5e32293067a9b819155b21fae3 (diff)
Merge commit 'ieee1394/for-next'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/core-card.c12
-rw-r--r--drivers/firewire/ohci.c14
-rw-r--r--drivers/ieee1394/raw1394.c4
3 files changed, 26 insertions, 4 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index f74edae5cb4c..268ea24293b0 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -40,13 +40,19 @@
int fw_compute_block_crc(u32 *block)
{
- __be32 be32_block[256];
+ static DEFINE_SPINLOCK(buffer_lock);
+ static __be32 buffer[256];
+ unsigned long flags;
int i, length;
+ spin_lock_irqsave(&buffer_lock, flags);
+
length = (*block >> 16) & 0xff;
for (i = 0; i < length; i++)
- be32_block[i] = cpu_to_be32(block[i + 1]);
- *block |= crc_itu_t(0, (u8 *) be32_block, length * 4);
+ buffer[i] = cpu_to_be32(block[i + 1]);
+ *block |= crc_itu_t(0, (u8 *)buffer, length * 4);
+
+ spin_unlock_irqrestore(&buffer_lock, flags);
return length;
}
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index ecddd11b797a..76b321bb73f9 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -34,6 +34,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
+#include <linux/pci_ids.h>
#include <linux/spinlock.h>
#include <linux/string.h>
@@ -2372,6 +2373,9 @@ static void ohci_pmac_off(struct pci_dev *dev)
#define ohci_pmac_off(dev)
#endif /* CONFIG_PPC_PMAC */
+#define PCI_VENDOR_ID_AGERE PCI_VENDOR_ID_ATT
+#define PCI_DEVICE_ID_AGERE_FW643 0x5901
+
static int __devinit pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
@@ -2422,6 +2426,16 @@ static int __devinit pci_probe(struct pci_dev *dev,
version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
ohci->use_dualbuffer = version >= OHCI_VERSION_1_1;
+ /* dual-buffer mode is broken if more than one IR context is active */
+ if (dev->vendor == PCI_VENDOR_ID_AGERE &&
+ dev->device == PCI_DEVICE_ID_AGERE_FW643)
+ ohci->use_dualbuffer = false;
+
+ /* dual-buffer mode is broken */
+ if (dev->vendor == PCI_VENDOR_ID_RICOH &&
+ dev->device == PCI_DEVICE_ID_RICOH_R5C832)
+ ohci->use_dualbuffer = false;
+
/* x86-32 currently doesn't use highmem for dma_alloc_coherent */
#if !defined(CONFIG_X86_32)
/* dual-buffer mode is broken with descriptor addresses above 2G */
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index da5f8829b503..0bc3d78ce7b1 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -2272,8 +2272,10 @@ static ssize_t raw1394_write(struct file *file, const char __user * buffer,
return -EFAULT;
}
- if (!mutex_trylock(&fi->state_mutex))
+ if (!mutex_trylock(&fi->state_mutex)) {
+ free_pending_request(req);
return -EAGAIN;
+ }
switch (fi->state) {
case opened: