1. 24 Jul, 2008 2 commits
    • Lennert Buytenhek's avatar
      mv643xx_eth: prevent breakage when link goes down during transmit · 6b368f68
      Lennert Buytenhek authored
      When the ethernet link goes down while mv643xx_eth is transmitting
      data, transmit DMA can stop before all queued transmit descriptors
      have been processed.  But even the descriptors that _have_ been
      processed might not be properly marked as done before the transmit
      DMA unit shuts down.
      
      Then when the link comes up again, the hardware transmit pointer
      might have advanced while not all previous packet descriptors have
      been marked as transmitted, causing software transmit reclaim to
      hang waiting for the hardware to finish transmitting a descriptor
      that it has already skipped.
      
      This patch forcibly reclaims all packets on the transmit ring on a
      link down interrupt, and then resyncs the hardware transmit pointer to
      what the software's idea of the first free descriptor is.  Also, we
      need to prevent re-waking the transmit queue if we get a 'transmit
      done' interrupt at the same time as a 'link down' interrupt, which
      this patch does as well.
      Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
      6b368f68
    • Lennert Buytenhek's avatar
      mv643xx_eth: fix TX hang erratum workaround · 8fa89bf5
      Lennert Buytenhek authored
      The previously merged TX hang erratum workaround ("mv643xx_eth:
      work around TX hang hardware issue") assumes that TX_END interrupts
      are delivered simultaneously with or after their corresponding TX
      interrupts, but this is not always true in practise.
      
      In particular, it appears that TX_END interrupts are issued as soon
      as descriptor fetch returns an invalid descriptor, which may happen
      before earlier descriptors have been fully transmitted and written
      back to memory as being done.
      
      This hardware behavior can lead to a situation where the current
      driver code mistakenly assumes that the MAC has given up transmitting
      before noticing the packets that it is in fact still currently working
      on, causing the driver to re-kick the transmit queue, which will only
      cause the MAC to re-fetch the invalid head descriptor, and generate
      another TX_END interrupt, et cetera, until the packets in the pipe
      finally finish transmitting and have their descriptors written back
      to memory, which will then finally break the loop.
      
      Fix this by having the erratum workaround not check the 'number of
      unfinished descriptor', but instead, to compare the software's idea
      of what the head descriptor pointer should be to the hardware's head
      descriptor pointer (which is updated on the same conditions as the
      TX_END interupt is generated on, i.e. possibly before all previous
      descriptors have been transmitted and written back).
      Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
      8fa89bf5
  2. 23 Jul, 2008 9 commits
  3. 22 Jul, 2008 29 commits