Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: ohci: work around VIA and NEC PHY packet reception bug
firewire: core: do not use del_timer_sync() in interrupt context
firewire: net: fix unicast reception RCODE in failure paths
firewire: sbp2: fix stall with "Unsolicited response"
firewire: sbp2: fix memory leak in sbp2_cancel_orbs or at send error
ieee1394: Adjust confusing if indentation

+50 -26
+10 -3
drivers/firewire/core-transaction.c
··· 81 81 spin_lock_irqsave(&card->lock, flags); 82 82 list_for_each_entry(t, &card->transaction_list, link) { 83 83 if (t == transaction) { 84 + if (!del_timer(&t->split_timeout_timer)) { 85 + spin_unlock_irqrestore(&card->lock, flags); 86 + goto timed_out; 87 + } 84 88 list_del_init(&t->link); 85 89 card->tlabel_mask &= ~(1ULL << t->tlabel); 86 90 break; ··· 93 89 spin_unlock_irqrestore(&card->lock, flags); 94 90 95 91 if (&t->link != &card->transaction_list) { 96 - del_timer_sync(&t->split_timeout_timer); 97 92 t->callback(card, rcode, NULL, 0, t->callback_data); 98 93 return 0; 99 94 } 100 95 96 + timed_out: 101 97 return -ENOENT; 102 98 } 103 99 ··· 925 921 spin_lock_irqsave(&card->lock, flags); 926 922 list_for_each_entry(t, &card->transaction_list, link) { 927 923 if (t->node_id == source && t->tlabel == tlabel) { 924 + if (!del_timer(&t->split_timeout_timer)) { 925 + spin_unlock_irqrestore(&card->lock, flags); 926 + goto timed_out; 927 + } 928 928 list_del_init(&t->link); 929 929 card->tlabel_mask &= ~(1ULL << t->tlabel); 930 930 break; ··· 937 929 spin_unlock_irqrestore(&card->lock, flags); 938 930 939 931 if (&t->link == &card->transaction_list) { 932 + timed_out: 940 933 fw_notify("Unsolicited response (source %x, tlabel %x)\n", 941 934 source, tlabel); 942 935 return; ··· 971 962 data_length = 0; 972 963 break; 973 964 } 974 - 975 - del_timer_sync(&t->split_timeout_timer); 976 965 977 966 /* 978 967 * The response handler may be executed while the request handler
+15 -13
drivers/firewire/net.c
··· 579 579 if (!peer) { 580 580 fw_notify("No peer for ARP packet from %016llx\n", 581 581 (unsigned long long)peer_guid); 582 - goto failed_proto; 582 + goto no_peer; 583 583 } 584 584 585 585 /* ··· 656 656 657 657 return 0; 658 658 659 - failed_proto: 659 + no_peer: 660 660 net->stats.rx_errors++; 661 661 net->stats.rx_dropped++; 662 662 ··· 664 664 if (netif_queue_stopped(net)) 665 665 netif_wake_queue(net); 666 666 667 - return 0; 667 + return -ENOENT; 668 668 } 669 669 670 670 static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, ··· 701 701 fw_error("out of memory\n"); 702 702 net->stats.rx_dropped++; 703 703 704 - return -1; 704 + return -ENOMEM; 705 705 } 706 706 skb_reserve(skb, (net->hard_header_len + 15) & ~15); 707 707 memcpy(skb_put(skb, len), buf, len); ··· 726 726 spin_lock_irqsave(&dev->lock, flags); 727 727 728 728 peer = fwnet_peer_find_by_node_id(dev, source_node_id, generation); 729 - if (!peer) 730 - goto bad_proto; 729 + if (!peer) { 730 + retval = -ENOENT; 731 + goto fail; 732 + } 731 733 732 734 pd = fwnet_pd_find(peer, datagram_label); 733 735 if (pd == NULL) { ··· 743 741 dg_size, buf, fg_off, len); 744 742 if (pd == NULL) { 745 743 retval = -ENOMEM; 746 - goto bad_proto; 744 + goto fail; 747 745 } 748 746 peer->pdg_size++; 749 747 } else { ··· 757 755 pd = fwnet_pd_new(net, peer, datagram_label, 758 756 dg_size, buf, fg_off, len); 759 757 if (pd == NULL) { 760 - retval = -ENOMEM; 761 758 peer->pdg_size--; 762 - goto bad_proto; 759 + retval = -ENOMEM; 760 + goto fail; 763 761 } 764 762 } else { 765 763 if (!fwnet_pd_update(peer, pd, buf, fg_off, len)) { ··· 770 768 */ 771 769 fwnet_pd_delete(pd); 772 770 peer->pdg_size--; 773 - goto bad_proto; 771 + retval = -ENOMEM; 772 + goto fail; 774 773 } 775 774 } 776 775 } /* new datagram or add to existing one */ ··· 797 794 spin_unlock_irqrestore(&dev->lock, flags); 798 795 799 796 return 0; 800 - 801 - bad_proto: 797 + fail: 802 798 spin_unlock_irqrestore(&dev->lock, flags); 803 799 804 800 if (netif_queue_stopped(net)) 805 801 netif_wake_queue(net); 806 802 807 - return 0; 803 + return retval; 808 804 } 809 805 810 806 static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
+9 -1
drivers/firewire/ohci.c
··· 694 694 log_ar_at_event('R', p.speed, p.header, evt); 695 695 696 696 /* 697 - * The OHCI bus reset handler synthesizes a phy packet with 697 + * Several controllers, notably from NEC and VIA, forget to 698 + * write ack_complete status at PHY packet reception. 699 + */ 700 + if (evt == OHCI1394_evt_no_status && 701 + (p.header[0] & 0xff) == (OHCI1394_phy_tcode << 4)) 702 + p.ack = ACK_COMPLETE; 703 + 704 + /* 705 + * The OHCI bus reset handler synthesizes a PHY packet with 698 706 * the new generation number when a bus reset happens (see 699 707 * section 8.4.2.3). This helps us determine when a request 700 708 * was received and make sure we send the response in the same
+15 -8
drivers/firewire/sbp2.c
··· 450 450 451 451 if (&orb->link != &lu->orb_list) { 452 452 orb->callback(orb, &status); 453 - kref_put(&orb->kref, free_orb); 453 + kref_put(&orb->kref, free_orb); /* orb callback reference */ 454 454 } else { 455 455 fw_error("status write for unknown orb\n"); 456 456 } ··· 472 472 * So this callback only sets the rcode if it hasn't already 473 473 * been set and only does the cleanup if the transaction 474 474 * failed and we didn't already get a status write. 475 + * 476 + * Here we treat RCODE_CANCELLED like RCODE_COMPLETE because some 477 + * OXUF936QSE firmwares occasionally respond after Split_Timeout and 478 + * complete the ORB just fine. Note, we also get RCODE_CANCELLED 479 + * from sbp2_cancel_orbs() if fw_cancel_transaction() == 0. 475 480 */ 476 481 spin_lock_irqsave(&card->lock, flags); 477 482 478 483 if (orb->rcode == -1) 479 484 orb->rcode = rcode; 480 - if (orb->rcode != RCODE_COMPLETE) { 485 + 486 + if (orb->rcode != RCODE_COMPLETE && orb->rcode != RCODE_CANCELLED) { 481 487 list_del(&orb->link); 482 488 spin_unlock_irqrestore(&card->lock, flags); 489 + 483 490 orb->callback(orb, NULL); 491 + kref_put(&orb->kref, free_orb); /* orb callback reference */ 484 492 } else { 485 493 spin_unlock_irqrestore(&card->lock, flags); 486 494 } 487 495 488 - kref_put(&orb->kref, free_orb); 496 + kref_put(&orb->kref, free_orb); /* transaction callback reference */ 489 497 } 490 498 491 499 static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, ··· 509 501 list_add_tail(&orb->link, &lu->orb_list); 510 502 spin_unlock_irqrestore(&device->card->lock, flags); 511 503 512 - /* Take a ref for the orb list and for the transaction callback. */ 513 - kref_get(&orb->kref); 514 - kref_get(&orb->kref); 504 + kref_get(&orb->kref); /* transaction callback reference */ 505 + kref_get(&orb->kref); /* orb callback reference */ 515 506 516 507 fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST, 517 508 node_id, generation, device->max_speed, offset, ··· 532 525 533 526 list_for_each_entry_safe(orb, next, &list, link) { 534 527 retval = 0; 535 - if (fw_cancel_transaction(device->card, &orb->t) == 0) 536 - continue; 528 + fw_cancel_transaction(device->card, &orb->t); 537 529 538 530 orb->rcode = RCODE_CANCELLED; 539 531 orb->callback(orb, NULL); 532 + kref_put(&orb->kref, free_orb); /* orb callback reference */ 540 533 } 541 534 542 535 return retval;
+1 -1
drivers/ieee1394/ohci1394.c
··· 1106 1106 if (recv->block_irq_interval * 4 > iso->buf_packets) 1107 1107 recv->block_irq_interval = iso->buf_packets / 4; 1108 1108 if (recv->block_irq_interval < 1) 1109 - recv->block_irq_interval = 1; 1109 + recv->block_irq_interval = 1; 1110 1110 1111 1111 /* choose a buffer stride */ 1112 1112 /* must be a power of 2, and <= PAGE_SIZE */