TxSkipPatched: iso_xmit_cycle_skip.patch

File iso_xmit_cycle_skip.patch, 3.5 kB (added by ppalmers, 8 months ago)

cycle skip patch

  • ieee1394-2.6.22-14-rt-1/iso.h

    old new  
    123123 
    124124        /* how many times the buffer has overflowed or underflowed */ 
    125125        atomic_t overflows; 
     126        /* how many cycles were skipped for a given context */ 
     127        atomic_t skips; 
    126128 
    127129        /* Current number of bytes lost in discarded packets */ 
    128130        int bytes_discarded; 
  • ieee1394-2.6.22-14-rt-1/ohci1394.c

    old new  
    18821882        struct dma_prog_region prog; 
    18831883        struct ohci1394_iso_tasklet task; 
    18841884        int task_active; 
     1885        int last_cycle; 
     1886        atomic_t skips; 
    18851887 
    18861888        u32 ContextControlSet; 
    18871889        u32 ContextControlClear; 
     
    19181920        iso->hostdata = xmit; 
    19191921        xmit->ohci = iso->host->hostdata; 
    19201922        xmit->task_active = 0; 
     1923        xmit->last_cycle = -1; 
     1924        atomic_set(&iso->skips, 0); 
    19211925 
    19221926        dma_prog_region_init(&xmit->prog); 
    19231927 
     
    20152019                /* parse cycle */ 
    20162020                cycle = le32_to_cpu(cmd->output_last.status) & 0x1FFF; 
    20172021 
     2022                if (xmit->last_cycle > -1) { 
     2023                        int cycle_diff = cycle - xmit->last_cycle; 
     2024                        int skip; 
     2025                         
     2026                        // unwrap 
     2027                        if(cycle_diff < 0) { 
     2028                                cycle_diff += 8000; 
     2029                                if(cycle_diff < 0) { 
     2030                                        PRINT(KERN_ERR, 
     2031                                                "bogus cycle diff %d\n", cycle_diff); 
     2032                                } 
     2033                        } 
     2034                         
     2035                        skip = cycle_diff - 1; 
     2036                        if(skip > 0) { 
     2037                                DBGMSG("skipped %d cycles without packet loss", skip); 
     2038                                atomic_add(skip, &iso->skips); 
     2039                        } 
     2040                } 
     2041                xmit->last_cycle = cycle; 
     2042 
    20182043                /* tell the subsystem the packet has gone out */ 
    20192044                hpsb_iso_packet_sent(iso, cycle, event != 0x11); 
    20202045 
     
    21022127        prev->output_last.branchAddress = cpu_to_le32( 
    21032128                dma_prog_region_offset_to_bus(&xmit->prog, sizeof(struct iso_xmit_cmd) * next_i) | 3); 
    21042129 
     2130        /* link the skip address to this descriptor itself 
     2131           this causes a context to skip a cycle whenever lost cycles 
     2132           or FIFO overruns occur, without dropping the data at that point 
     2133           the application should then decide whether this is an error condition 
     2134           or not. Some protocols can deal with this by dropping some rate-matching 
     2135           padding packets 
     2136        */ 
     2137        next->output_more_immediate.branchAddress = prev->output_last.branchAddress; 
     2138 
    21052139        /* disable interrupt, unless required by the IRQ interval */ 
    21062140        if (prev_i % iso->irq_interval) { 
    21072141                prev->output_last.control &= cpu_to_le32(~(3 << 20)); /* no interrupt */ 
  • ieee1394-2.6.22-14-rt-1/raw1394.c

    old new  
    25072507static void raw1394_iso_fill_status(struct hpsb_iso *iso, 
    25082508                                    struct raw1394_iso_status *stat) 
    25092509{ 
     2510        int overflows = atomic_read(&iso->overflows); 
     2511        int skips = atomic_read(&iso->skips); 
    25102512        stat->config.data_buf_size = iso->buf_size; 
    25112513        stat->config.buf_packets = iso->buf_packets; 
    25122514        stat->config.channel = iso->channel; 
    25132515        stat->config.speed = iso->speed; 
    25142516        stat->config.irq_interval = iso->irq_interval; 
    25152517        stat->n_packets = hpsb_iso_n_ready(iso); 
    2516         stat->overflows = atomic_read(&iso->overflows); 
     2518        stat->overflows = ((skips & 0xFFFF) << 16) | ((overflows & 0xFFFF)); 
    25172519        stat->xmit_cycle = iso->xmit_cycle; 
    25182520} 
    25192521 
     
    25882590 
    25892591        /* reset overflow counter */ 
    25902592        atomic_set(&iso->overflows, 0); 
     2593        /* reset skip counter */ 
     2594        atomic_set(&iso->skips, 0); 
    25912595 
    25922596        return 0; 
    25932597}