1. 17 8月, 2010 1 次提交
  2. 06 8月, 2010 1 次提交
  3. 19 7月, 2010 1 次提交
  4. 08 7月, 2010 1 次提交
    • E
      gianfar: code cleanup · acbc0f03
      Eran Liberty 提交于
      This patch relates to "[PATCH] gainfar.c : skb_over_panic
      (kernel-2.6.32.15)"
      
      While in 2.6.32.15 it actually fixed a bug here it merely cleans up
      the previous attempts to fix the bug with a more coherent code.
      
      Currently before queuing skb into the rx_recycle it is
      "un-skb_reserve"-ed so when taken out in gfar_new_skb() it wont be
      reserved twice.
      
      This patch makes sure the alignment skb_reserve is done once, upon
      allocating the skb and not when taken out of the rx_recycle
      pool. Eliminating the need to undo anything before queue skb back to
      the pool.
      
      NOTE: This patch will compile and is fairly straight forward but I do
      not have environment to test it as I did with the 2.6.32.15 fix.
      Signed-off-by: NEran Liberty <liberty@extricom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      acbc0f03
  5. 01 7月, 2010 3 次提交
    • A
      gianfar: Implement workaround for eTSEC-A002 erratum · 511d934f
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "If the controller receives a 1- or 2-byte frame (such as an illegal
       runt packet or a packet with RX_ER asserted) before GRS is asserted
       and does not receive any other frames, the controller may fail to set
       GRSC even when the receive logic is completely idle. Any subsequent
       receive frame that is larger than two bytes will reset the state so
       the graceful stop can complete. A MAC receiver (Rx) reset will also
       reset the state."
      
      This patch implements the proposed workaround:
      
      "If IEVENT[GRSC] is still not set after the timeout, read the eTSEC
       register at offset 0xD1C. If bits 7-14 are the same as bits 23-30,
       the eTSEC Rx is assumed to be idle and the Rx can be safely reset.
       If the register fields are not equal, wait for another timeout
       period and check again."
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      511d934f
    • A
      gianfar: Implement workaround for eTSEC76 erratum · deb90eac
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "For TOE=1 huge or jumbo frames, the data required to generate the
       checksum may exceed the 2500-byte threshold beyond which the controller
       constrains itself to one memory fetch every 256 eTSEC system clocks.
      
       This throttling threshold is supposed to trigger only when the
       controller has sufficient data to keep transmit active for the duration
       of the memory fetches. The state machine handling this threshold,
       however, fails to take large TOE frames into account. As a result,
       TOE=1 frames larger than 2500 bytes often see excess delays before start
       of transmission."
      
      This patch implements the workaround as suggested by the errata
      document, i.e.:
      
      "Limit TOE=1 frames to less than 2500 bytes to avoid excess delays due to
       memory throttling.
       When using packets larger than 2700 bytes, it is recommended to turn TOE
       off."
      
      To be sure, we limit the TOE frames to 2500 bytes, and do software
      checksumming instead.
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      deb90eac
    • A
      gianfar: Implement workaround for eTSEC74 erratum · 7d350977
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "If MACCFG2[Huge Frame]=0 and the Ethernet controller receives frames
       which are larger than MAXFRM, the controller truncates the frames to
       length MAXFRM and marks RxBD[TR]=1 to indicate the error. The controller
       also erroneously marks RxBD[TR]=1 if the received frame length is MAXFRM
       or MAXFRM-1, even though those frames are not truncated.
       No truncation or truncation error occurs if MACCFG2[Huge Frame]=1."
      
      There are two options to workaround the issue:
      
      "1. Set MACCFG2[Huge Frame]=1, so no truncation occurs for invalid large
       frames. Software can determine if a frame is larger than MAXFRM by
       reading RxBD[LG] or RxBD[Data Length].
      
       2. Set MAXFRM to 1538 (0x602) instead of the default 1536 (0x600), so
       normal-length frames are not marked as truncated. Software can examine
       RxBD[Data Length] to determine if the frame was larger than MAXFRM-2."
      
      This patch implements the first workaround option by setting HUGEFRAME
      bit, and gfar_clean_rx_ring() already checks the RxBD[Data Length].
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d350977
  6. 17 6月, 2010 3 次提交
    • A
      gianfar: Fix oversized packets handling · 63b88b90
      Anton Vorontsov 提交于
      Issuing the following command on host:
      
      $ ifconfig eth2 mtu 1600 ; ping 10.0.0.27 -s 1485 -c 1
      
      Makes some boards (tested with MPC8315 rev 1.1 and MPC8313 rev 1.0)
      oops like this:
      
        skb_over_panic: text:c0195914 len:1537 put:1537 head:c79e4800 data:c79e4880 tail:0xc79e4e81 end:0xc79e4e80 dev:eth1
        ------------[ cut here ]------------
        kernel BUG at net/core/skbuff.c:127!
        Oops: Exception in kernel mode, sig: 5 [#1]
        MPC831x RDB
        last sysfs file: /sys/kernel/uevent_seqnum
        Modules linked in:
        NIP: c01c1840 LR: c01c1840 CTR: c016d918
        [...]
        NIP [c01c1840] skb_over_panic+0x48/0x5c
        LR [c01c1840] skb_over_panic+0x48/0x5c
        Call Trace:
        [c0339d50] [c01c1840] skb_over_panic+0x48/0x5c (unreliable)
        [c0339d60] [c01c3020] skb_put+0x5c/0x60
        [c0339d70] [c0195914] gfar_clean_rx_ring+0x25c/0x3d0
        [c0339dc0] [c01976e8] gfar_poll+0x170/0x1bc
      
      Dumped buffer descriptors showed that eTSEC's length/truncation
      logic sometimes passes oversized packets, i.e. for the above ICMP
      packet the following two buffer descriptors may become ready:
      
        status=1400 length=1536
        status=1800 length=1541
      
      So, it seems that gianfar actually receives the whole big frame,
      and it tries to place the packet into two BDs. This situation
      confuses the driver, and so the skb_put() sanity check fails.
      
      This patch fixes the issue by adding an appropriate check, i.e.
      the driver should not try to process frames with buffer
      descriptor's length over rx_buffer_size (i.e. maxfrm and mrblr).
      
      Note that sometimes eTSEC works correctly, i.e. in the second
      (last) buffer descriptor bits 'truncated' and 'crcerr' are set,
      and so there's no oops. Though I couldn't find any logic when
      it works correctly and when not.
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63b88b90
    • M
      gianfar: Fix setup of RX time stamping · 97553f7f
      Manfred Rudigier 提交于
      Previously the RCTRL_TS_ENABLE bit was set unconditionally. However, if
      the RCTRL_TS_ENABLE is set without TMR_CTRL[TE], the driver does not work
      properly on some boards (Anton had problems with the MPC8313ERDB and
      MPC8568EMDS).
      
      With this patch the bit will only be set if requested from user space
      with the SIOCSHWTSTAMP ioctl command, meaning that time stamping is
      disabled during normal operation. Users who are not interested in time
      stamps will not experience problems with buggy CPU revisions or
      performance drops any more.
      
      The setting of TMR_CTRL[TE] is still up to the user. This is considered
      safe because users wanting HW timestamps must initialize the eTSEC clock
      first anyway, e.g. with the recently submitted PTP clock driver.
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Reviewed-by: NAnton Vorontsov <cbouatmailru@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      97553f7f
    • U
      fix typos concerning "first" · 85dd08eb
      Uwe Kleine-König 提交于
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      85dd08eb
  7. 10 6月, 2010 1 次提交
    • A
      gianfar: Revive the driver for eTSEC devices (disable timestamping) · 619baba1
      Anton Vorontsov 提交于
      Since commit cc772ab7 ("gianfar: Add
      hardware RX timestamping support"), the driver no longer works on
      at least MPC8313ERDB and MPC8568EMDS boards (and possibly much more
      boards as well).
      
      That's how MPC8313 Reference Manual describes RCTRL_TS_ENABLE bit:
      
        Timestamp incoming packets as padding bytes. PAL field is set
        to 8 if the PAL field is programmed to less than 8. Must be set
        to zero if TMR_CTRL[TE]=0.
      
      I see that the commit above sets this bit, but it doesn't handle
      TMR_CTRL. Manfred probably had this bit set by the firmware for
      his boards. But obviously this isn't true for all boards in the
      wild.
      
      Also, I recall that Freescale BSPs were explicitly disabling the
      timestamping because of a performance drop.
      
      For now, the best way to deal with this is just disable the
      timestamping, and later we can discuss proper device tree bindings
      and implement enabling this feature via some property.
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      619baba1
  8. 01 6月, 2010 1 次提交
  9. 22 5月, 2010 1 次提交
    • G
      of: Remove duplicate fields from of_platform_driver · 4018294b
      Grant Likely 提交于
      .name, .match_table and .owner are duplicated in both of_platform_driver
      and device_driver.  This patch is a removes the extra copies from struct
      of_platform_driver and converts all users to the device_driver members.
      
      This patch is a pretty mechanical change.  The usage model doesn't change
      and if any drivers have been missed, or if anything has been fixed up
      incorrectly, then it will fail with a compile time error, and the fixup
      will be trivial.  This patch looks big and scary because it touches so
      many files, but it should be pretty safe.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NSean MacLennan <smaclennan@pikatech.com>
      4018294b
  10. 19 5月, 2010 1 次提交
  11. 18 5月, 2010 1 次提交
  12. 14 5月, 2010 1 次提交
    • J
      drivers/net: Remove unnecessary returns from void function()s · a4b77097
      Joe Perches 提交于
      This patch removes from drivers/net/ all the unnecessary
      return; statements that precede the last closing brace of
      void functions.
      
      It does not remove the returns that are immediately
      preceded by a label as gcc doesn't like that.
      
      It also does not remove null void functions with return.
      
      Done via:
      $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
        xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
      
      with some cleanups by hand.
      
      Compile tested x86 allmodconfig only.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4b77097
  13. 10 5月, 2010 1 次提交
  14. 06 5月, 2010 1 次提交
  15. 28 4月, 2010 1 次提交
  16. 24 4月, 2010 1 次提交
  17. 13 4月, 2010 2 次提交
    • M
      gianfar: Add hardware TX timestamping support · f0ee7acf
      Manfred Rudigier 提交于
      If a packet has the skb_shared_tx->hardware flag set the device is
      instructed to generate a TX timestamp and write it back to memory after
      the frame is transmitted. During the clean_tx_ring operation the
      timestamp will be extracted and copied into the skb_shared_hwtstamps
      struct of the skb.
      
      TX timestamping is enabled by setting the tx_type to something else
      than HWTSTAMP_TX_OFF with the SIOCSHWTSTAMP ioctl command. It is only
      supported by eTSEC devices.
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0ee7acf
    • M
      gianfar: Add hardware RX timestamping support · cc772ab7
      Manfred Rudigier 提交于
      The device is configured to insert hardware timestamps into all
      received packets. The RX timestamps are extracted from the padding
      alingment bytes during the clean_rx_ring operation and copied into the
      skb_shared_hwtstamps struct of the skb. This extraction only happens if
      the rx_filter was set to something else than HWTSTAMP_FILTER_NONE with
      the SIOCSHWTSTAMP ioctl command.
      
      Hardware timestamping is only supported for eTSEC devices. To indicate
      device support the new FSL_GIANFAR_DEV_HAS_TIMER flag was introduced.
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc772ab7
  18. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      Converts the list and the core manipulating with it to be the same as uc_list.
      
      +uses two functions for adding/removing mc address (normal and "global"
       variant) instead of a function parameter.
      +removes dev_mcast.c completely.
      +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
       manipulation with lists on a sandbox (used in bonding and 80211 drivers)
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  19. 31 3月, 2010 3 次提交
  20. 27 3月, 2010 1 次提交
  21. 07 3月, 2010 1 次提交
  22. 04 3月, 2010 1 次提交
    • A
      gianfar: Fix TX ring processing on SMP machines · 0eddba52
      Anton Vorontsov 提交于
      Starting with commit a3bc1f11 ("gianfar: Revive SKB
      recycling") gianfar driver sooner or later stops transmitting any
      packets on SMP machines.
      
      start_xmit() prepares new skb for transmitting, generally it does
      three things:
      
      1. sets up all BDs (marks them ready to send), except the first one.
      2. stores skb into tx_queue->tx_skbuff so that clean_tx_ring()
         would cleanup it later.
      3. sets up the first BD, i.e. marks it ready.
      
      Here is what clean_tx_ring() does:
      
      1. reads skbs from tx_queue->tx_skbuff
      2. checks if the *last* BD is ready. If it's still ready [to send]
         then it it isn't transmitted, so clean_tx_ring() returns.
         Otherwise it actually cleanups BDs. All is OK.
      
      Now, if there is just one BD, code flow:
      
      - start_xmit(): stores skb into tx_skbuff. Note that the first BD
        (which is also the last one) isn't marked as ready, yet.
      - clean_tx_ring(): sees that skb is not null, *and* its lstatus
        says that it is NOT ready (like if BD was sent), so it cleans
        it up (bad!)
      - start_xmit(): marks BD as ready [to send], but it's too late.
      
      We can fix this simply by reordering lstatus/tx_skbuff writes.
      Reported-by: NMartyn Welch <martyn.welch@ge.com>
      Bisected-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Tested-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Tested-by: NMartyn Welch <martyn.welch@ge.com>
      Cc: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
      Cc: Stable <stable@vger.kernel.org> [2.6.33]
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0eddba52
  23. 23 2月, 2010 1 次提交
  24. 13 2月, 2010 1 次提交
  25. 27 12月, 2009 1 次提交
    • S
      gianfar: Fix gianfar select_queue bogosity · f74dac08
      Sandeep Gopalpet 提交于
      The gfar_select_queue() function was used to set queue mapping
      only for forwarding/bridging applications and the condition
      for locally generated packets was completely ignored.
      
      The solution is to remove the gfar_select_queue() function and
      use skb_record_rx_queue to set queue mapping for
      forwarding/bridging applications. This will ensure that in case of
      forwarding/bridging applications txq = rxq will be selected and
      skb_tx_hash will be used to pick up a txq for locally generated packets.
      Signed-off-by: NSandeep Gopalpet <Sandeep.Kumar@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f74dac08
  26. 19 12月, 2009 2 次提交
  27. 09 12月, 2009 1 次提交
    • A
      gianfar: Fix build with CONFIG_NET_POLL_CONTROLLER=y · 43de004b
      Anton Vorontsov 提交于
      commit 46ceb60c ("gianfar: Add
      Multiple group Support") introduced the following build error
      with CONFIG_NET_POLL_CONTROLLER=y:
      
        CC      ggianfar.o
      ggianfar.c: In function 'gfar_netpoll':
      ggianfar.c:2653: error: invalid storage class for function 'gfar_interrupt'
      ggianfar.c:2652: warning: ISO C90 forbids mixed declarations and code
      ggianfar.c:2681: error: invalid storage class for function 'adjust_link'
      ggianfar.c:2764: error: invalid storage class for function 'gfar_set_multi'
      ggianfar.c:2855: error: invalid storage class for function 'gfar_clear_exact_match'
      ggianfar.c:2877: error: invalid storage class for function 'gfar_set_hash_for_addr'
      ggianfar.c:2898: error: invalid storage class for function 'gfar_set_mac_for_addr'
      ggianfar.c:2922: error: invalid storage class for function 'gfar_error'
      ggianfar.c:3020: warning: ISO C90 forbids mixed declarations and code
      ggianfar.c:3032: error: invalid storage class for function 'gfar_init'
      ggianfar.c:3037: error: invalid storage class for function 'gfar_exit'
      ggianfar.c:3041: error: initializer element is not constant
      ggianfar.c:3042: error: initializer element is not constant
      ggianfar.c:3042: warning: ISO C90 forbids mixed declarations and code
      ggianfar.c:3042: error: expected declaration or statement at end of input
      make[1]: *** [ggianfar.o] Error 1
      
      This patch fixes the issue.
      Reported-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      43de004b
  28. 12 11月, 2009 4 次提交
  29. 08 11月, 2009 1 次提交
    • A
      gianfar: Fix compiler and sparse warnings · 18294ad1
      Anton Vorontsov 提交于
      commit fba4ed03 ("gianfar: Add Multiple
      Queue Support") introduced the following warnings:
      
        CHECK   gianfar.c
      gianfar.c:333:8: warning: incorrect type in assignment (different address spaces)
      gianfar.c:333:8:    expected unsigned int [usertype] *baddr
      gianfar.c:333:8:    got unsigned int [noderef] <asn:2>*<noident>
      [... 67 lines skipped ...]
      gianfar.c:2565:3: warning: incorrect type in argument 1 (different type sizes)
      gianfar.c:2565:3:    expected unsigned long const *addr
      gianfar.c:2565:3:    got unsigned int *<noident>
        CC      gianfar.o
      gianfar.c: In function 'gfar_probe':
      gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c: In function 'gfar_configure_coalescing':
      gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c: In function 'gfar_poll':
      gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:2566: warning: passing argument 2 of 'test_bit' from incompatible pointer type
      gianfar.c:2585: warning: passing argument 2 of 'set_bit' from incompatible pointer type
      
      Following warnings left unfixed (looks like sparse doesn't like
      locks in loops, so __acquires/__releases() doesn't help):
      
      gianfar.c:441:40: warning: context imbalance in 'lock_rx_qs': wrong count at exit
      gianfar.c:441:40:    context '<noident>': wanted 0, got 1
      gianfar.c:449:40: warning: context imbalance in 'lock_tx_qs': wrong count at exit
      gianfar.c:449:40:    context '<noident>': wanted 0, got 1
      gianfar.c:458:3: warning: context imbalance in 'unlock_rx_qs': __context__ statement expected different context
      gianfar.c:458:3:    context '<noident>': wanted >= 0, got -1
      gianfar.c:466:3: warning: context imbalance in 'unlock_tx_qs': __context__ statement expected different context
      gianfar.c:466:3:    context '<noident>': wanted >= 0, got -1
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18294ad1