Skip to content

Commit f815c33

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 74a0118 + baed6b8 commit f815c33

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

drivers/firewire/core-iso.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
196196
switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
197197
irm_id, generation, SCODE_100,
198198
CSR_REGISTER_BASE + CSR_BANDWIDTH_AVAILABLE,
199-
data, sizeof(data))) {
199+
data, 8)) {
200200
case RCODE_GENERATION:
201201
/* A generation change frees all bandwidth. */
202202
return allocate ? -EAGAIN : bandwidth;
@@ -233,7 +233,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
233233
data[1] = old ^ c;
234234
switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
235235
irm_id, generation, SCODE_100,
236-
offset, data, sizeof(data))) {
236+
offset, data, 8)) {
237237
case RCODE_GENERATION:
238238
/* A generation change frees all channels. */
239239
return allocate ? -EAGAIN : i;

drivers/firewire/ohci.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/module.h>
3535
#include <linux/moduleparam.h>
3636
#include <linux/pci.h>
37+
#include <linux/pci_ids.h>
3738
#include <linux/spinlock.h>
3839
#include <linux/string.h>
3940

@@ -2372,6 +2373,9 @@ static void ohci_pmac_off(struct pci_dev *dev)
23722373
#define ohci_pmac_off(dev)
23732374
#endif /* CONFIG_PPC_PMAC */
23742375

2376+
#define PCI_VENDOR_ID_AGERE PCI_VENDOR_ID_ATT
2377+
#define PCI_DEVICE_ID_AGERE_FW643 0x5901
2378+
23752379
static int __devinit pci_probe(struct pci_dev *dev,
23762380
const struct pci_device_id *ent)
23772381
{
@@ -2422,6 +2426,16 @@ static int __devinit pci_probe(struct pci_dev *dev,
24222426
version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
24232427
ohci->use_dualbuffer = version >= OHCI_VERSION_1_1;
24242428

2429+
/* dual-buffer mode is broken if more than one IR context is active */
2430+
if (dev->vendor == PCI_VENDOR_ID_AGERE &&
2431+
dev->device == PCI_DEVICE_ID_AGERE_FW643)
2432+
ohci->use_dualbuffer = false;
2433+
2434+
/* dual-buffer mode is broken */
2435+
if (dev->vendor == PCI_VENDOR_ID_RICOH &&
2436+
dev->device == PCI_DEVICE_ID_RICOH_R5C832)
2437+
ohci->use_dualbuffer = false;
2438+
24252439
/* x86-32 currently doesn't use highmem for dma_alloc_coherent */
24262440
#if !defined(CONFIG_X86_32)
24272441
/* dual-buffer mode is broken with descriptor addresses above 2G */

drivers/firewire/sbp2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,12 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
456456
}
457457
spin_unlock_irqrestore(&card->lock, flags);
458458

459-
if (&orb->link != &lu->orb_list)
459+
if (&orb->link != &lu->orb_list) {
460460
orb->callback(orb, &status);
461-
else
461+
kref_put(&orb->kref, free_orb);
462+
} else {
462463
fw_error("status write for unknown orb\n");
463-
464-
kref_put(&orb->kref, free_orb);
464+
}
465465

466466
fw_send_response(card, request, RCODE_COMPLETE);
467467
}

0 commit comments

Comments
 (0)