1. 16 1月, 2015 4 次提交
    • T
      net: davinci_emac: Fix incomplete code for getting the phy from device tree · 1d82ffa6
      Tony Lindgren 提交于
      Looks like the phy_id is never set up beyond getting the phandle.
      Note that we can remove the ifdef for phy_node as there is a stub
      for of_phy_connec() if CONFIG_OF is not set.
      
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d82ffa6
    • T
      net: davinci_emac: Free clock after checking the frequency · 0f537273
      Tony Lindgren 提交于
      We only use clk_get() to get the frequency, the rest is done by
      the runtime PM calls. Let's free the clock too.
      
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f537273
    • T
      net: davinci_emac: Fix runtime pm calls for davinci_emac · b5133e7a
      Tony Lindgren 提交于
      Commit 3ba97381 ("net: ethernet: davinci_emac: add pm_runtime support")
      added support for runtime PM, but it causes issues on omap3 related devices
      that actually gate the clocks:
      
      Unhandled fault: external abort on non-linefetch (0x1008)
      ...
      [<c04160f0>] (emac_dev_getnetstats) from [<c04d6a3c>] (dev_get_stats+0x78/0xc8)
      [<c04d6a3c>] (dev_get_stats) from [<c04e9ccc>] (rtnl_fill_ifinfo+0x3b8/0x938)
      [<c04e9ccc>] (rtnl_fill_ifinfo) from [<c04eade4>] (rtmsg_ifinfo+0x68/0xd8)
      [<c04eade4>] (rtmsg_ifinfo) from [<c04dd35c>] (register_netdevice+0x3a0/0x4ec)
      [<c04dd35c>] (register_netdevice) from [<c04dd4bc>] (register_netdev+0x14/0x24)
      [<c04dd4bc>] (register_netdev) from [<c041755c>] (davinci_emac_probe+0x408/0x5c8)
      [<c041755c>] (davinci_emac_probe) from [<c0396d78>] (platform_drv_probe+0x48/0xa4)
      
      Let's fix it by moving the pm_runtime_get() call earlier, and also add it to
      the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync()
      as we don't want to have deferred_resume happen. And let's also check the
      return value for pm_runtime_get_sync() as noted by Felipe Balbi <balbi@ti.com>.
      
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Acked-by: NMark A. Greer <mgreer@animalcreek.com>
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5133e7a
    • T
      net: davinci_emac: Fix hangs with interrupts · cd2d6d33
      Tony Lindgren 提交于
      On davinci_emac, we have pulse interrupts. This means that we need to
      clear the EOI bits when disabling interrupts as otherwise the interrupts
      keep happening. And we also need to not clear the EOI bits again when
      enabling the interrupts as otherwise we will get tons of:
      
      unexpected IRQ trap at vector 00
      
      These errors almost certainly mean that the omap-intc.c is signaling
      a spurious interrupt with the reserved irq 127 as we've seen earlier
      on omap3.
      
      Let's fix the issue by clearing the EOI bits when disabling the
      interrupts. Let's also keep the comment for "Rx Threshold and Misc
      interrupts are not enabled" for both enable and disable so people
      are aware of this when potentially adding more support.
      
      Note that eventually we should handle the RX and TX interrupts
      separately like cpsw is now doing. However, so far I have not seen
      any issues with this based on my testing, so it seems to behave a
      little different compared to the cpsw that had a similar issue.
      
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd2d6d33
  2. 10 9月, 2014 1 次提交
  3. 03 6月, 2014 1 次提交
  4. 23 5月, 2014 1 次提交
  5. 14 5月, 2014 1 次提交
  6. 25 3月, 2014 2 次提交
    • C
      net: davinci_emac: Fix rollback of emac_dev_open() · cd11cf50
      Christian Riesch 提交于
      If an error occurs during the initialization in emac_dev_open() (the
      driver's ndo_open function), interrupts, DMA descriptors etc. must be freed.
      The current rollback code is buggy in several ways.
      
        1) Freeing the interrupts. The current code will not free all interrupts
           that were requested by the driver. Furthermore,  the code tries to do a
           platform_get_resource(priv->pdev, IORESOURCE_IRQ, -1) in its last
           iteration.
      
           This patch fixes these bugs.
      
        2) Wrong order of err: and rollback: labels. If the setup of the PHY in
           the code fails, the interrupts that have been requested before are
           not freed:
      
              request irq
                      if requesting irqs fails, goto rollback
              setup phy
                      if phy setup fails, goto err
              return 0
      
           rollback:
              free irqs
           err:
      
           This patch brings the code into the correct order.
      
        3) The code calls napi_enable() and emac_int_enable(), but does not
           undo both in case of an error.
      
           This patch adds calls of emac_int_disable() and napi_disable() to the
           rollback code.
      
        4) RX DMA descriptors are not freed in case of an error: Right before
           requesting the irqs, the function creates DMA descriptors for the
           RX channel. These RX descriptors are never freed when we jump to either
           rollback or err.
      
           This patch adds code for freeing the DMA descriptors in the case of
           an initialization error. This required a modification of
           cpdma_ctrl_stop() in davinci_cpdma.c: We must be able to call this
           function to free the DMA descriptors while the DMA channels are
           in IDLE state (before cpdma_ctlr_start() was called).
      
      Tested on a custom board with the Texas Instruments AM1808.
      Signed-off-by: NChristian Riesch <christian.riesch@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd11cf50
    • C
      net: davinci_emac: Replace devm_request_irq with request_irq · 33b7107f
      Christian Riesch 提交于
      In commit 6892b41d
      
      Author: Lad, Prabhakar <prabhakar.csengg@gmail.com>
      Date:   Tue Jun 25 21:24:51 2013 +0530
      net: davinci: emac: Convert to devm_* api
      
      the call of request_irq is replaced by devm_request_irq and the call
      of free_irq is removed. But since interrupts are requested in
      emac_dev_open, doing ifconfig up/down on the board requests the
      interrupts again each time, causing devm_request_irq to fail. The
      interface is dead until the device is rebooted.
      
      This patch reverts said commit partially: It changes the driver back
      to use request_irq instead of devm_request_irq, puts free_irq back in
      place, but keeps the remaining changes of the original patch.
      Reported-by: NJon Ringle <jon@ringle.org>
      Signed-off-by: NChristian Riesch <christian.riesch@omicron.at>
      Cc: Lad, Prabhakar <prabhakar.csengg@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33b7107f
  7. 06 12月, 2013 1 次提交
    • T
      net: davinci_emac: Fix platform data handling and make usable for am3517 · dd0df47d
      Tony Lindgren 提交于
      When booted with device tree, we may still have platform data passed
      as auxdata. For am3517 this is needed for passing the interrupt_enable
      and interrupt_disable callbacks that access the omap system control module
      registers. These callback functions will eventually go away when we have
      a separate system control module driver.
      
      Some of the things that are currently passed as platform data we don't need
      to set up as device tree properties as they are always the same on am3517.
      So let's use a new compatible flag for those so we can get those from
      the device tree match data.
      
      Also note that we need to fix setting of phy_dev to NULL instead of an empty
      string as the code later on uses that to find the first phy on the mdio bus.
      This seems to have been caused by 5d69e007 (net: davinci_emac: switch to
      new mdio).
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dd0df47d
  8. 22 10月, 2013 1 次提交
  9. 03 10月, 2013 1 次提交
  10. 31 8月, 2013 1 次提交
  11. 04 8月, 2013 1 次提交
  12. 02 7月, 2013 1 次提交
  13. 26 6月, 2013 2 次提交
  14. 28 5月, 2013 1 次提交
  15. 25 4月, 2013 1 次提交
  16. 28 3月, 2013 1 次提交
  17. 27 3月, 2013 1 次提交
  18. 21 3月, 2013 1 次提交
  19. 18 3月, 2013 1 次提交
  20. 13 2月, 2013 1 次提交
  21. 22 1月, 2013 1 次提交
  22. 19 1月, 2013 1 次提交
    • M
      net: ethernet: davinci_cpdma: Add boundary for rx and tx descriptors · fae50823
      Mugunthan V N 提交于
      When there is heavy transmission traffic in the CPDMA, then Rx descriptors
      memory is also utilized as tx desc memory looses all rx descriptors and the
      driver stops working then.
      
      This patch adds boundary for tx and rx descriptors in bd ram dividing the
      descriptor memory to ensure that during heavy transmission tx doesn't use
      rx descriptors.
      
      This patch is already applied to davinci_emac driver, since CPSW and
      davici_dmac shares the same CPDMA, moving the boundry seperation from
      Davinci EMAC driver to CPDMA driver which was done in the following
      commit
      
      commit 86d8c07f
      Author: Sascha Hauer <s.hauer@pengutronix.de>
      Date:   Tue Jan 3 05:27:47 2012 +0000
      
          net/davinci: do not use all descriptors for tx packets
      
          The driver uses a shared pool for both rx and tx descriptors.
          During open it queues fixed number of 128 descriptors for receive
          packets. For each received packet it tries to queue another
          descriptor. If this fails the descriptor is lost for rx.
          The driver has no limitation on tx descriptors to use, so it
          can happen during a nmap / ping -f attack that the driver
          allocates all descriptors for tx and looses all rx descriptors.
          The driver stops working then.
          To fix this limit the number of tx descriptors used to half of
          the descriptors available, the rx path uses the other half.
      
          Tested on a custom board using nmap / ping -f to the board from
          two different hosts.
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fae50823
  23. 15 1月, 2013 1 次提交
  24. 07 1月, 2013 1 次提交
  25. 04 1月, 2013 1 次提交
  26. 04 12月, 2012 1 次提交
  27. 23 7月, 2012 2 次提交
  28. 19 7月, 2012 1 次提交
  29. 11 7月, 2012 2 次提交
  30. 24 4月, 2012 1 次提交
    • A
      net/davinci_emac: fix failing PHY connect attempts · 1ab8be4a
      Anatolij Gustschin 提交于
      PHY connect attempts fail if no PHY id is specified in the emac platform
      data and another mdio bus has been registered before 'davinci_mdio' bus. In
      this case when configuring the interface, there will be an attempt to
      connect to already attached PHY on the previously registered mdio bus:
      
      net eth1: PHY already attached
      net eth1: could not connect to phy smsc911x-0:01
      IP-Config: Failed to open eth1
      IP-Config: Device `eth1' not found
      
      Fix this by modifying match_first_device() to match first PHY device
      on 'davinci_mdio' bus.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ab8be4a
  31. 04 4月, 2012 1 次提交
  32. 24 2月, 2012 2 次提交