1. 19 Jan, 2011 14 commits
  2. 18 Jan, 2011 3 commits
  3. 17 Jan, 2011 3 commits
  4. 16 Jan, 2011 14 commits
  5. 14 Jan, 2011 6 commits
    • Daniel Hellstrom's avatar
      GRETH: resolve SMP issues and other problems · 0f73f2c5
      Daniel Hellstrom authored
      Fixes the following:
      1. POLL should not enable IRQ when work is not completed
      2. No locking between TX descriptor cleaning and XMIT descriptor handling
      3. No locking between RX POLL and XMIT modifying control register
      4. Since TX cleaning (called from POLL) is running in parallel with XMIT
         unnecessary locking is needed.
      5. IRQ handler looks at RX frame status solely, this is wrong when IRQ is
         temporarily disabled (in POLL), and when IRQ is shared.
      6. IRQ handler clears IRQ status, which is unnecessary
      7. TX queue was stopped in preventing cause when not MAX_SKB_FRAGS+1
         descriptors were available after a SKB been scheduled by XMIT. Instead
         the TX queue is stopped first when not enough descriptors are available
         upon entering XMIT.
      
      It was hard to split up this patch in smaller pieces since all are tied
      together somehow.
      
      Note the RX flag used in the interrupt handler does not signal that
      interrupt was asserted, but that a frame was received. Same goes for TX.
      Also, IRQ is not asserted when the RX flag is set before enabling IRQ
      enable until a new frame is received. So extra care must be taken to
      avoid enabling IRQ and all descriptors are already used, hence dead lock
      will upon us. See new POLL implementation that enableds IRQ then look at
      the RX flag to determine if one or more IRQs may have been missed. TX/RX
      flags are cleared before handling previously enabled descriptors, this
      ensures that the RX/TX flags are valid when determining if IRQ should be
      turned on again.
      
      By moving TX cleaning from POLL to XMIT in the standard case, removes some
      locking trouble. Enabling TX cleaning from poll only when not enough TX
      descriptors are available is safe because the TX queue is at the same time
      stopped, thus XMIT will not be called. The TX queue is woken up again when
      enough descriptrs are available.
      
      TX Frames are always enabled with IRQ, however the TX IRQ Enable flag will
      not be enabled until XMIT must wait for free descriptors.
      
      Locking RX and XMIT parts of the driver from each other is needed because
      the RX/TX enable bits share the same register.
      Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f73f2c5
    • Daniel Hellstrom's avatar
      GRETH: handle frame error interrupts · 1ca23434
      Daniel Hellstrom authored
      Frame error interrupts must also be handled since the RX flag only indicates
      successful reception, it is unlikely but the old code may lead to dead lock
      if 128 error frames are recieved in a row.
      Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ca23434
    • Daniel Hellstrom's avatar
    • Daniel Hellstrom's avatar
      GRETH: fixed skb buffer memory leak on frame errors · b669e7f0
      Daniel Hellstrom authored
      A new SKB buffer should not be allocated when the old SKB is reused.
      Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b669e7f0
    • Daniel Hellstrom's avatar
      GRETH: GBit transmit descriptor handling optimization · 2a2bc012
      Daniel Hellstrom authored
      It is safe to enable all fragments before enabling the first descriptor,
      this way all descriptors don't have to be processed twice, added extra
      memory barrier.
      Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a2bc012
    • Daniel Hellstrom's avatar
      GRETH: fix opening/closing · bbe9e637
      Daniel Hellstrom authored
      When NAPI is disabled there is no point in having IRQs enabled, TX/RX
      should be off before clearing the TX/RX descriptor rings.
      Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bbe9e637