diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2012-11-27 18:49:24 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-12-01 19:04:51 -0500 |
commit | 7ad3eadebcb1778c11bbf0fe059d0804173a8123 (patch) | |
tree | 6dbd35f54b13fd2ccb3076b3fa4e8072712c0f07 /drivers/atm | |
parent | 397ff16dce53888ec693b3718640be2560204751 (diff) |
solos-pci: wait for pending TX to complete when releasing vcc
We should no longer be calling the old pop routine for the vcc, after
vcc_release() has completed. Make sure we wait for any pending TX skbs
to complete, by waiting for our own PKT_PCLOSE control skb to be sent.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/solos-pci.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 98510931c815..026bdc1dfcc6 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
@@ -866,6 +866,7 @@ static int popen(struct atm_vcc *vcc) | |||
866 | static void pclose(struct atm_vcc *vcc) | 866 | static void pclose(struct atm_vcc *vcc) |
867 | { | 867 | { |
868 | struct solos_card *card = vcc->dev->dev_data; | 868 | struct solos_card *card = vcc->dev->dev_data; |
869 | unsigned char port = SOLOS_CHAN(vcc->dev); | ||
869 | struct sk_buff *skb; | 870 | struct sk_buff *skb; |
870 | struct pkt_hdr *header; | 871 | struct pkt_hdr *header; |
871 | 872 | ||
@@ -881,11 +882,18 @@ static void pclose(struct atm_vcc *vcc) | |||
881 | header->vci = cpu_to_le16(vcc->vci); | 882 | header->vci = cpu_to_le16(vcc->vci); |
882 | header->type = cpu_to_le16(PKT_PCLOSE); | 883 | header->type = cpu_to_le16(PKT_PCLOSE); |
883 | 884 | ||
884 | fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL); | 885 | skb_get(skb); |
886 | fpga_queue(card, port, skb, NULL); | ||
885 | 887 | ||
886 | clear_bit(ATM_VF_ADDR, &vcc->flags); | 888 | clear_bit(ATM_VF_ADDR, &vcc->flags); |
887 | clear_bit(ATM_VF_READY, &vcc->flags); | 889 | clear_bit(ATM_VF_READY, &vcc->flags); |
888 | 890 | ||
891 | if (!wait_event_timeout(card->param_wq, !skb_shared(skb), 5 * HZ)) | ||
892 | dev_warn(&card->dev->dev, | ||
893 | "Timeout waiting for VCC close on port %d\n", port); | ||
894 | |||
895 | dev_kfree_skb(skb); | ||
896 | |||
889 | /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the | 897 | /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the |
890 | tasklet has finished processing any incoming packets (and, more to | 898 | tasklet has finished processing any incoming packets (and, more to |
891 | the point, using the vcc pointer). */ | 899 | the point, using the vcc pointer). */ |
@@ -1011,9 +1019,10 @@ static uint32_t fpga_tx(struct solos_card *card) | |||
1011 | if (vcc) { | 1019 | if (vcc) { |
1012 | atomic_inc(&vcc->stats->tx); | 1020 | atomic_inc(&vcc->stats->tx); |
1013 | solos_pop(vcc, oldskb); | 1021 | solos_pop(vcc, oldskb); |
1014 | } else | 1022 | } else { |
1015 | dev_kfree_skb_irq(oldskb); | 1023 | dev_kfree_skb_irq(oldskb); |
1016 | 1024 | wake_up(&card->param_wq); | |
1025 | } | ||
1017 | } | 1026 | } |
1018 | } | 1027 | } |
1019 | /* For non-DMA TX, write the 'TX start' bit for all four ports simultaneously */ | 1028 | /* For non-DMA TX, write the 'TX start' bit for all four ports simultaneously */ |
@@ -1345,6 +1354,8 @@ static struct pci_driver fpga_driver = { | |||
1345 | 1354 | ||
1346 | static int __init solos_pci_init(void) | 1355 | static int __init solos_pci_init(void) |
1347 | { | 1356 | { |
1357 | BUILD_BUG_ON(sizeof(struct solos_skb_cb) > sizeof(((struct sk_buff *)0)->cb)); | ||
1358 | |||
1348 | printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION); | 1359 | printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION); |
1349 | return pci_register_driver(&fpga_driver); | 1360 | return pci_register_driver(&fpga_driver); |
1350 | } | 1361 | } |