Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: sbp2: fix freeing of unallocated memory
  firewire: ohci: fix Ricoh R5C832, video reception
  firewire: ohci: fix Agere FW643 and multiple cameras
  firewire: core: fix crash in iso resource management
  • Loading branch information
Linus Torvalds committed Sep 5, 2009
2 parents 74a0118 + baed6b8 commit f815c33
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/firewire/core-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
irm_id, generation, SCODE_100,
CSR_REGISTER_BASE + CSR_BANDWIDTH_AVAILABLE,
data, sizeof(data))) {
data, 8)) {
case RCODE_GENERATION:
/* A generation change frees all bandwidth. */
return allocate ? -EAGAIN : bandwidth;
Expand Down Expand Up @@ -233,7 +233,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
data[1] = old ^ c;
switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
irm_id, generation, SCODE_100,
offset, data, sizeof(data))) {
offset, data, 8)) {
case RCODE_GENERATION:
/* A generation change frees all channels. */
return allocate ? -EAGAIN : i;
Expand Down
14 changes: 14 additions & 0 deletions drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 */
Expand Down
8 changes: 4 additions & 4 deletions drivers/firewire/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,12 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
}
spin_unlock_irqrestore(&card->lock, flags);

if (&orb->link != &lu->orb_list)
if (&orb->link != &lu->orb_list) {
orb->callback(orb, &status);
else
kref_put(&orb->kref, free_orb);
} else {
fw_error("status write for unknown orb\n");

kref_put(&orb->kref, free_orb);
}

fw_send_response(card, request, RCODE_COMPLETE);
}
Expand Down

0 comments on commit f815c33

Please sign in to comment.