1. 05 10月, 2015 1 次提交
    • A
      net: fec: avoid timespec use · be7ccdc3
      Arnd Bergmann 提交于
      The fec_ptp_enable_pps uses an open-coded implementation of ns_to_timespec,
      which will be removed eventually as it is not y2038-safe on 32-bit
      architectures. Two more instances of the same code in this file were
      already converted to use the safe ns_to_timespec64 in commit 6630514f
      ("ptp: fec: use helpers for converting ns to timespec"), this changes
      the last one as well.
      
      The seconds portion here is actually unused and we could just remove the
      timespec variable, but using ns_to_timespec64 can still be better as the
      implementation can be hand-optimized in the future.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Fugang Duan <b38611@freescale.com>
      Cc: Luwei Zhou <b45643@freescale.com>
      Cc: Frank Li <Frank.Li@freescale.com>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be7ccdc3
  2. 29 9月, 2015 1 次提交
  3. 25 9月, 2015 3 次提交
  4. 22 9月, 2015 1 次提交
  5. 10 9月, 2015 1 次提交
    • N
      net: fec: add netif status check before set mac address · 9638d19e
      Nimrod Andy 提交于
      There exist one issue by below case that case system hang:
      ifconfig eth0 down
      ifconfig eth0 hw ether 00:10:19:19:81:19
      
      After eth0 down, all fec clocks are gated off. In the .fec_set_mac_address()
      function, it will set new MAC address to registers, which causes system hang.
      
      So it needs to add netif status check to avoid registers access when clocks are
      gated off. Until eth0 up the new MAC address are wrote into related registers.
      
      V2:
      As Lucas Stach's suggestion, add a comment in the code to explain why it needed.
      
      CC: Lucas Stach <l.stach@pengutronix.de>
      CC: Florian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NFugang Duan <B38611@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9638d19e
  6. 06 9月, 2015 1 次提交
  7. 03 9月, 2015 1 次提交
  8. 26 8月, 2015 1 次提交
    • R
      net: fec: use reinit_completion() in mdio accessor functions · aac27c7a
      Russell King 提交于
      Rather than re-initialising the entire completion on every mdio access,
      use reinit_completion() which only resets the completion count.  This
      avoids possible reinitialisation of the contained spinlock and waitqueue
      while they may be in use (eg, mid-completion.)
      
      Such an event could occur if there's a long delay in interrupt handling
      causing the mdio accessor to time out, then a second access comes in
      while the interrupt handler on a different CPU has called complete().
      Another scenario where this has been observed is while locking has
      been missing at the phy layer, allowing concurrent attempts to access
      the MDIO bus.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aac27c7a
  9. 14 8月, 2015 1 次提交
    • C
      gianfar: Restore link state settings after MAC reset · 2a4eebf0
      Claudiu Manoil 提交于
      There are some MAC registers that need to be kept in sync
      with the link state parameters, see adjust_link().
      However, after a MAC soft reset default values for
      these registers are assumed.  In some cases (excepting
      if down/ if up for example) adjust_link() does not see
      that these values were reset to default because the
      priv->old* link parameters were left unchanged.
      So, reset the priv->old* link params as well during a
      MAC reset to let adjust_link() restore the MAC link
      settings to the actual link state values.
      
      Fixes following case, for example:
      Setting link to 100M, changing MTU (implies MAC reset),
      link state remains unchanged to 100M but MAC registers
      were reset to default (1G) breaking the connectivity w/
      the PHY.  Closing and re-opening the interface would
      restore the MAC link parameters to the correct values.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a4eebf0
  10. 13 8月, 2015 4 次提交
    • F
      net: fec: Remove unneeded use of IS_ERR_VALUE() macro · b0c6ce24
      Fabio Estevam 提交于
      There is no need to use the IS_ERR_VALUE() macro for checking
      the return value from pm_runtime_* functions.
      
      Just do a simple negative test instead.
      
      The semantic patch that makes this change is available
      in scripts/coccinelle/api/pm_runtime.cocci.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0c6ce24
    • J
      gianfar: remove faulty filer optimizer · 1f2b7293
      Jakub Kicinski 提交于
      Current filer rule optimization is broken in several ways:
       (1) Can perform reads/writes beyond end of allocated tables.
           (gianfar_ethtool.c:1326).
      
      (2) It breaks badly for rules with more than 2 specifiers
           (e.g. matching ip, port, tos).
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1 tos 1 action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2 tos 2 action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3 tos 3 action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: TOS  == 00000003 AND         Q:00           ctrl:0000008a prop:00000003
      05: DIA  == 0a000003 AND         Q:11           ctrl:0000448c prop:0a000003
      06: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      07: TOS  == 00000002 AND         Q:00           ctrl:0000008a prop:00000002
      08: DIA  == 0a000002 AND         Q:09           ctrl:0000248c prop:0a000002
      09: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      0a: DPT  == 00000001 AND         Q:00           ctrl:0000008e prop:00000001
      0b: TOS  == 00000001     CLE     Q:01           ctrl:0000060a prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      (Entire cluster gets AND-ed together).
      
       (3) We observed that the masking rules it generates do not
           play well with clustering on P2020.  Only first rule
           of the cluster would ever fire.  Given that optimizer
           relies heavily on masking this is very hard to fix.
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1  action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2  action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3  action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: DIA  == 0a000003             Q:11           ctrl:0000440c prop:0a000003
      05: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      06: DIA  == 0a000002             Q:09           ctrl:0000240c prop:0a000002
      07: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      08: DPT  == 00000001     CLE     Q:01           ctrl:0000060e prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      Which looks correct according to the spec but only the first
      (eth id 252)/last added rule for 10.0.0.3 will ever trigger.
      As if filer did not treat the AND CLE as cluster start but
      also kept AND-ing the rules.  We found no errata covering this.
      
      The fact that nobody noticed (2) or (3) makes me think
      that this feature is not very widely used and we should just
      remove it.
      Reported-by: NAleksander Dutkowski <adutkowski@gmail.com>
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Acked-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f2b7293
    • J
      gianfar: correct list membership accounting · b5c8c890
      Jakub Kicinski 提交于
      At a cost of one line let's make sure .count is correct
      when calling gfar_process_filer_changes().
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5c8c890
    • J
      gianfar: correct filer table writing · a898fe04
      Jakub Kicinski 提交于
      MAX_FILER_IDX is the last usable index.  Using less-than
      will already guarantee that one entry for catch-all rule
      will be left, no need to subtract 1 here.
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a898fe04
  11. 12 8月, 2015 2 次提交
  12. 11 8月, 2015 1 次提交
    • K
      net: fec: fix the race between xmit and bdp reclaiming path · c4bc44c6
      Kevin Hao 提交于
      When we transmit a fragmented skb, we may run into a race like the
      following scenario (assume txq->cur_tx is next to txq->dirty_tx):
                 cpu 0                                          cpu 1
        fec_enet_txq_submit_skb
          reserve a bdp for the first fragment
          fec_enet_txq_submit_frag_skb
             update the bdp for the other fragment
             update txq->cur_tx
                                                         fec_enet_tx_queue
                                                           bdp = fec_enet_get_nextdesc(txq->dirty_tx, fep, queue_id);
                                                           This bdp is the bdp reserved for the first segment. Given
                                                           that this bdp BD_ENET_TX_READY bit is not set and txq->cur_tx
                                                           is already pointed to a bdp beyond this one. We think this is a
                                                           completed bdp and try to reclaim it.
          update the bdp for the first segment
          update txq->cur_tx
      
      So we shouldn't update the txq->cur_tx until all the update to the
      bdps used for fragments are performed. Also add the corresponding
      memory barrier to guarantee that the update to the bdps, dirty_tx and
      cur_tx performed in the proper order.
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4bc44c6
  13. 07 8月, 2015 1 次提交
  14. 01 8月, 2015 3 次提交
    • C
      gianfar: Enable device wakeup when appropriate · b0734b6d
      Claudiu Manoil 提交于
      The wol_en flag is 0 by default anyway, and we have the
      following inconsistency: a MAGIC packet wol capable eth
      interface is registered as a wake-up source but unable
      to wake-up the system as wol_en is 0 (wake-on flag set to 'd').
      Calling set_wakeup_enable() at netdev open is just redundant
      because wol_en is 0 by default.
      Let only ethtool call set_wakeup_enable() for now.
      
      The bflock is obviously obsoleted, its utility has been corroded
      over time.  The bitfield flags used today in gianfar are accessed
      only on the init/ config path, with no real possibility of
      concurrency - nothing that would justify smth. like bflock.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0734b6d
    • C
      gianfar: Fix suspend/resume for wol magic packet · 614b4242
      Claudiu Manoil 提交于
      If we disable NAPI in the first place we can mask the device's
      interrupts (and halt it) without fearing that imask may be
      concurrently accessed from interrupt context, so there's
      no need to do local_irq_save() around gfar_halt_nodisable().
      lock_rx_qs()/unlock_tx_qs() are just obsoleted and potentially
      buggy routines.  The txlock is currently used in the driver only
      to manage TX congestion, it has nothing to do with halting the
      device.  With these changes, the TX processing is stopped before
      gfar_halt().
      
      Compact gfar_halt() is used instead of gfar_halt_nodisable(),
      as it disables Rx/TX DMA h/w blocks and the Rx/TX h/w queues.
      gfar_start() re-enables all these blocks on resume.  Enabling
      the magic-packet mode remains the same, note that the RX block
      is re-enabled just before entering sleep mode.
      
      Add IRQF_NO_SUSPEND flag for the error interrupt line, to signal
      that the interrupt line must remain active during sleep in order
      to wake the system by magic packet (MAG) reception interrupt.
      (On some systems the MAG interrupt did trigger w/o this flag
      as well, but on others it didn't.)
      
      Without these fixes, when suspended during fair Tx traffic the
      interface occasionally failed to be woken up by magic packet.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      614b4242
    • C
      gianfar: Fix warning when CONFIG_PM off · 84868305
      Claudiu Manoil 提交于
      CC      drivers/net/ethernet/freescale/gianfar.o
      drivers/net/ethernet/freescale/gianfar.c:568:13: warning: 'lock_tx_qs'
      defined but not used [-Wunused-function]
       static void lock_tx_qs(struct gfar_private *priv)
                   ^
      drivers/net/ethernet/freescale/gianfar.c:576:13: warning: 'unlock_tx_qs'
      defined but not used [-Wunused-function]
       static void unlock_tx_qs(struct gfar_private *priv)
                   ^
      Reported-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84868305
  15. 30 7月, 2015 1 次提交
  16. 27 7月, 2015 3 次提交
  17. 18 7月, 2015 1 次提交
  18. 16 7月, 2015 5 次提交
    • C
      gianfar: Add paged allocation and Rx S/G · 75354148
      Claudiu Manoil 提交于
      The eTSEC h/w is capable of scatter/gather on the receive side
      too if MAXFRM > MRBLR, when the allowed maximum Rx frame size
      is set to be greater than the maximum Rx buffer size (MRBLR).
      It's about time the driver makes use of this h/w capability,
      by supporting fixed buffer sizes and Rx S/G.
      
      The buffer size given to eTSEC for reception is fixed to
      1536B (must be multiple of 64), which is the same default
      buffer size as before, used to accommodate standard MTU
      (1500B) size frames.  As before, eTSEC can receive frames of
      up to 9600B.  Individual Rx buffers are mapped to page halves
      (page size for eTSEC systems is 4KB).  The skb is built around
      the first buffer of a frame (using build_skb()).  In case the
      frame spans multiple buffers, the trailing buffers are added
      as Rx fragments to the skb.  The last buffer in frame is marked
      by the L status flag.  A mechanism is in place to reuse the pages
      owned by the driver (for Rx) for subsequent receptions.
      
      Supporting fixed size buffers allows the implementation of Rx S/G,
      which in turn removes the memory pressure issues the driver had
      before when MTU was set for jumbo frame reception.
      Also, in most cases, the Rx path becomes faster due to Rx page
      reusal, since the overhead of allocating new rx buffers is removed
      from the fast path.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75354148
    • C
      gianfar: Use ndev, more Rx path cleanup · f23223f1
      Claudiu Manoil 提交于
      Use "ndev" instead of "dev", as the rx queue back pointer
      to a net_device struct, to avoid name clashing with a
      "struct device" reference.  This prepares the addition of a
      "struct device" back pointer to the rx queue structure.
      
      Remove duplicated rxq registration in the process.
      Move napi_gro_receive() outside gfar_process_frame().
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f23223f1
    • C
      gianfar: Fix and cleanup rxbd status handling · f966082e
      Claudiu Manoil 提交于
      There are several (long standing) problems about how the status
      field of the rx buffer descriptor (rxbd) is currently handled on
      the error path:
      - too many unnecessary 16bit reads of the two halves of the rxbd
      status field (32bit), also resulting in overuse of endianness
      convesion macros;
      - "bdp->status = RXBD_LARGE" makes no sense, since the "large"
      flag is read only (only eTSEC can write it), and trying to clear
      the other status bits is also error prone in this context
      (most of the rx status bits are read only anyway).
      
      This is fixed with a single 32bit read of the "status" field,
      and then the appropriate 16bit shifting is applied to access
      the various status bits or the rx frame length. Also corrected
      the use of the RXBD_LARGE flag.
      
      Additional fix:
      "rx_over_errors" stat is incremented instead of "rx_crc_errors"
      in case of RXBD_OVERRUN occurrence.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f966082e
    • C
      gianfar: Bundle Rx allocation, cleanup · 76f31e8b
      Claudiu Manoil 提交于
      Use a more common consumer/ producer index design to improve
      rx buffer allocation.  Instead of allocating a single new buffer
      (skb) on each iteration, bundle the allocation of several rx
      buffers at a time.  This also opens the path for further memory
      optimizations.
      
      Remove useless check of rxq->rfbptr, since this patch touches
      rx pause frame handling code as well.  rxq->rfbptr is always
      initialized as part of Rx BD ring init.
      Remove redundant (and misleading) 'amount_pull' parameter.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76f31e8b
    • F
      Revert "net: fec: Ensure clocks are enabled while using mdio bus" · c9805b99
      Fabio Estevam 提交于
      This reverts commit 6c3e921b.
      
      commit 6c3e921b ("net: fec: Ensure clocks are enabled while using mdio
       bus") prevents the kernel to boot on mx6 boards, so let's revert it.
      Reported-by: NTyler Baker <tyler.baker@linaro.org>
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9805b99
  19. 09 7月, 2015 1 次提交
    • A
      net: fec: Ensure clocks are enabled while using mdio bus · 6c3e921b
      Andrew Lunn 提交于
      When a switch is attached to the mdio bus, the mdio bus can be used
      while the interface is not open. If the IPG clock is not enabled, MDIO
      reads/writes will simply time out.
      
      Add support for runtime PM to control this clock. Enable/disable this
      clock using runtime PM, with open()/close() and mdio read()/write()
      function triggering runtime PM operations. Since PM is optional, the
      IPG clock is enabled at probe and is no longer modified by
      fec_enet_clk_enable(), thus if PM is not enabled in the kernel, it is
      guaranteed the clock is running when MDIO operations are performed.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NFugang Duan <B38611@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c3e921b
  20. 29 6月, 2015 1 次提交
    • G
      net: fec: don't access RACC register when not available · 18803495
      Greg Ungerer 提交于
      Not all silicon implementations of the Freescale FEC hardware module
      have the RACC (Receive Accelerator Function) register, so we should not
      be trying to access it on those that don't. Currently none of the ColdFire
      based parts with a FEC have it.
      
      Support for RACC was introduced by commit 4c09eed9 ("net: fec: Enable imx6
      enet checksum acceleration"). A fix was introduced in commit d1391930
      ("net: fec: Fix build for MCF5272") that disables its use on the ColdFire
      M5272 part, but it doesn't fix the general case of other ColdFire parts.
      
      To fix we create a quirk flag, FEC_QUIRK_HAS_RACC, and check it before
      working with the RACC register.
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18803495
  21. 25 6月, 2015 1 次提交
  22. 23 6月, 2015 3 次提交
    • N
      net: fec: init MAC prior to mii bus probe · 55dd2753
      Nimrod Andy 提交于
      Below case causes mii bus probe failed:
      ifconfig eth0 down -> suspend/resume with Mega/fax mix off -> ifconfig eth0 up
      
      In i.MX6SX/i.MX7D chip, Mega/fast mix off feature is supported that means most of
      SOC power will be off including ENET MAC for power saving. Once ENET MAC power
      off, all initialized MAC registers reset to default, so in the case, it must
      init MAC prior to mii bus probe.
      Signed-off-by: NFugang Duan <B38611@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55dd2753
    • P
      drivers/net: remove all references to obsolete Ethernet-HOWTO · 138b15ed
      Paul Gortmaker 提交于
      This howto made sense in the 1990s when users had to manually configure
      ISA cards with jumpers or vendor utilities, but with the implementation
      of PCI it became increasingly less and less relevant, to the point where
      it has been well over a decade since I last updated it.  And there is
      no value in anyone else taking over updating it either.
      
      However the references to it continue to spread as boiler plate text
      from one Kconfig file into the next.  We are not doing end users any
      favours by pointing them at this old document, so lets kill it with
      fire, once and for all, to hopefully stop any further spread.
      
      No code is changed in this commit, just Kconfig help text.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      138b15ed
    • A
      net: fs_enet: Fix NETIF_F_SG feature for Freescale MPC5121 · 26c0a14f
      Alexander Popov 提交于
      Commit 4fc9b87b ("net: fs_enet: Implement NETIF_F_SG feature")
      brings a trouble to Freescale MPC512x: a kernel oops happens
      during sending non-linear sk_buff with .data not aligned by 4.
      
      Log quotation:
      
      Unable to handle kernel paging request for data at address 0xe467c000
      Faulting instruction address: 0xc000cd44
      Oops: Kernel access of bad area, sig: 11 [#1]
      MPC512x generic
      Modules linked in:
      CPU: 0 PID: 984 Comm: kworker/0:1H Not tainted 4.1.0-rc8-00024-gbb16140a #2
      Workqueue: rpciod rpc_async_schedule
      task: cf364a50 ti: cf362000 task.ti: cf362000
      NIP: c000cd44 LR: c000c720 CTR: 00000206
      REGS: cf363ac0 TRAP: 0300   Not tainted  (4.1.0-rc8-00024-gbb16140a)
      MSR: 00009032 <EE,ME,IR,DR,RI>  CR: 42004082  XER: 00000000
      DAR: e467c000 DSISR: 20000000
      GPR00: c0279e24 cf363b70 cf364a50 e467c000 00000206 0000001f 00000001 00000001
      GPR08: 00000000 e467c000 e46800be 000139a6 82002082 00000000 c002e46c cf3c3680
      GPR16: c044cb30 c04b0000 cf363c48 00000000 00000001 fde0315c 00000000 0000000b
      GPR24: 0000002c 000040be cf339aa0 0000000b 00000001 cf873210 00282f85 00000000
      NIP [c000cd44] clean_dcache_range+0x1c/0x30
      LR [c000c720] dma_direct_map_page+0x40/0x94
      Call Trace:
      [cf363b70] [cf339b60] 0xcf339b60 (unreliable)
      [cf363b90] [c0279e24] fs_enet_start_xmit+0x1c8/0x42c
      [cf363bd0] [c02ff710] dev_hard_start_xmit+0x2dc/0x3d4
      [cf363c40] [c0319c60] sch_direct_xmit+0xcc/0x1cc
      [cf363c70] [c02ff9c0] __dev_queue_xmit+0x1b8/0x47c
      [cf363ca0] [c032a3e8] ip_finish_output+0x1fc/0x9a8
      [cf363ce0] [c032c31c] ip_send_skb+0x1c/0xa4
      [cf363cf0] [c035112c] udp_send_skb+0xe4/0x2e8
      [cf363d10] [c0351368] udp_push_pending_frames+0x38/0x84
      [cf363d20] [c03537b8] udp_sendpage+0x134/0x174
      [cf363d70] [c0384fd4] xs_sendpages+0x21c/0x250
      [cf363db0] [c03852bc] xs_udp_send_request+0x50/0xf8
      [cf363de0] [c0382f08] xprt_transmit+0x64/0x280
      [cf363e20] [c038017c] call_transmit+0x168/0x234
      [cf363e40] [c0387918] __rpc_execute+0x88/0x2b0
      [cf363e80] [c00296f8] process_one_work+0x124/0x2fc
      [cf363ea0] [c0029a00] worker_thread+0x130/0x480
      [cf363ef0] [c002e528] kthread+0xbc/0xd0
      [cf363f40] [c000e4a8] ret_from_kernel_thread+0x5c/0x64
      Instruction dump:
      7c70faa6 60630800 7c70fba6 4c00012c 4e800020 38a0001f 7c632878 7c832050
      7c842a14 5484d97f 4d820020 7c8903a6 <7c00186c> 38630020 4200fff8 7c0004ac
      ---[ end trace c846c1eceb513c85 ]---
      
      The reason:
      
      MPC5121 FEC requires 4-byte alignment for TX data buffer and calls
      tx_skb_align_workaround() for copying sk_buff with not aligned .data to a new
      sk_buff with aligned one. But tx_skb_align_workaround() uses
      skb_copy_from_linear_data() which doesn't work for non-linear sk_buff:
      a new sk_buff has non-zero nr_frags and zero .data_len.
      
      So improve the condition of calling tx_skb_align_workaround() and use
      skb_linearize() in it.
      Signed-off-by: NAlexander Popov <alex.popov@linux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26c0a14f
  23. 12 6月, 2015 1 次提交
  24. 08 6月, 2015 1 次提交
    • F
      net: fec: ptp: correct the ENET_ATCOR value · 34270f5f
      Fugang Duan 提交于
      The current driver adjust freq formula is:
      fe * diff = ppb * pc
      Note:
        fe: ENET ref clock frequency in Hz
        diff = inc_corr - inc: difference between default increment and correction increment
        ppb: parts per billion adjustment from base
        pc: correction period (in number of fe clock cycles)
      
      The correction increment will be used after N cycles of regular increments,
      not every N cycles (with N being the correction period). For example, set ENET_ATCOR=4,
      INC=8, INC_CORR=9, there will be 4 increments of 8 (ENET_ATINC[INC]) , followed by 1
      increment of 9 (ENET_ATINC[INC_CORR]).
      
      So, the correct formula is:
      	fe * diff = ppb * (pc + 1)
      
      For ENET_ATCOR, a value 0 disables the correction counter and no corrections occur.
      So base on the origin formula, set pc = pc > 1 ? pc - 1 : pc.
      Signed-off-by: NFugang Duan <B38611@freescale.com>
      Signed-off-by: NFrank Li <Frank.Li@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34270f5f