1. 08 7月, 2009 1 次提交
  2. 06 7月, 2009 1 次提交
  3. 18 6月, 2009 2 次提交
  4. 03 6月, 2009 1 次提交
  5. 27 5月, 2009 1 次提交
  6. 19 5月, 2009 2 次提交
  7. 28 4月, 2009 1 次提交
  8. 27 4月, 2009 1 次提交
  9. 22 4月, 2009 1 次提交
  10. 21 4月, 2009 1 次提交
  11. 02 4月, 2009 2 次提交
  12. 29 3月, 2009 1 次提交
  13. 28 3月, 2009 1 次提交
    • A
      ucc_geth: Fix three oopses in PHY {de,}initialization code · 79675900
      Anton Vorontsov 提交于
      When there are no free snums, UCC ethernet should gracefully fail, but
      currently it oopses this way:
      
        # ifconfig eth0 up
        fill_init_enet_entries: Can not get SNUM.
        ucc_geth_startup: Can not fill p_init_enet_param_shadow.
        eth0: Cannot configure net device, aborting.
        Unable to handle kernel paging request for data at address 0x00000190
        Faulting instruction address: 0xc0294c88
        Oops: Kernel access of bad area, sig: 11 [#1]
        [...]
        NIP [c0294c88] mutex_lock+0x0/0x1c
        LR [c01b6be8] phy_stop+0x20/0x70
        Call Trace:
        [efb25da0] [efb2eb60] 0xefb2eb60 (unreliable)
        [efb25db0] [c01b2058] ucc_geth_stop+0x2c/0x8c
        [efb25dd0] [c01b4194] ucc_geth_open+0x48/0x27c
        [efb25df0] [c020eec0] dev_open+0xc0/0x118
        [...]
      
      This is because the ucc_geth_stop() routine assumes that ugeth->phydev
      is always initialized by the ucc_geth_open(), while it is not in case
      of errors.
      
      If we add a check to the ucc_geth_stop(), then another oops pops up:
      
        Unable to handle kernel paging request for data at address 0x00000004
        Faulting instruction address: 0xc01b46a4
        Oops: Kernel access of bad area, sig: 11 [#1]
        [...]
        NIP [c01b46a4] adjust_link+0x20/0x1b4
        LR [c01b770c] phy_state_machine+0xdc/0x44c
        Call Trace:
        [ef83bf10] [c021b388] linkwatch_schedule_work+0x74/0xf8 (unreliable)
        [ef83bf40] [c01b770c] phy_state_machine+0xdc/0x44c
        [ef83bf60] [c004c13c] run_workqueue+0xb8/0x148
        [ef83bf90] [c004c870] worker_thread+0x70/0xd0
        [ef83bfd0] [c00505fc] kthread+0x48/0x84
        [ef83bff0] [c000f464] kernel_thread+0x4c/0x68
        [...]
      
      That one happens because ucc_geth_stop() does not call phy_disconnect()
      and so phylib state machine is running without any idea that a MAC has
      just died.
      
      Also, when device tree specifies fixed-link, and CONFIG_FIXED_PHY
      is disabled, we'll get this oops:
      
        0:01 not found
        eth2: Could not attach to PHY
        eth2: Cannot initialize PHY, aborting.
        Unable to handle kernel paging request for data at address 0x00000190
        Faulting instruction address: 0xc02967d0
        Oops: Kernel access of bad area, sig: 11 [#1]
        [...]
        NIP [c02967d0] mutex_lock+0x0/0x1c
        LR [c01b6bcc] phy_stop+0x20/0x70
        Call Trace:
        [ef82be50] [efb6bb60] 0xefb6bb60 (unreliable)
        [ef82be60] [c01b2058] ucc_geth_stop+0x2c/0x8c
        [ef82be80] [c01b4194] ucc_geth_open+0x48/0x27c
        [ef82bea0] [c0210a04] dev_open+0xc0/0x118
        [ef82bec0] [c020f85c] dev_change_flags+0x84/0x1ac
        [ef82bee0] [c037b768] ic_open_devs+0x168/0x2bc
        [ef82bf20] [c037ca98] ip_auto_config+0x90/0x28c
        [ef82bf60] [c0001b9c] do_one_initcall+0x34/0x1a0
        [ef82bfd0] [c035e240] do_initcalls+0x38/0x58
        [ef82bfe0] [c035e2c4] kernel_init+0x30/0x90
        [ef82bff0] [c000f464] kernel_thread+0x4c/0x68
        [...]
      
      And again, ucc_geth_stop() assumes that ugeth->phydev is there, while
      it isn't.
      
      This patch fixes all three oopses simply by rearranging some code:
      
      - In ucc_geth_open(): move init_phy() call to the beginning, so
        that we only call ucc_geth_stop() with a PHY attached;
      - Move phy_disconnect() call from ucc_geth_close() to
        ucc_geth_stop(), so that we'll always disconnect the PHY.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79675900
  14. 25 3月, 2009 2 次提交
  15. 24 3月, 2009 1 次提交
  16. 23 3月, 2009 1 次提交
    • A
      ucc_geth: Fix oops when using fixed-link support · 61fa9dcf
      Anton Vorontsov 提交于
      commit b1c4a9dd ("ucc_geth: Change
      uec phy id to the same format as gianfar's") introduced a regression
      in the ucc_geth driver that causes this oops when fixed-link is used:
      
      Unable to handle kernel paging request for data at address 0x00000000
      Faulting instruction address: 0xc0151270
      Oops: Kernel access of bad area, sig: 11 [#1]
      TMCUTU
      NIP: c0151270 LR: c0151270 CTR: c0017760
      REGS: cf81fa60 TRAP: 0300   Not tainted  (2.6.29-rc8)
      MSR: 00009032 <EE,ME,IR,DR>  CR: 24024042  XER: 20000000
      DAR: 00000000, DSISR: 20000000
      TASK = cf81cba0[1] 'swapper' THREAD: cf81e000
      GPR00: c0151270 cf81fb10 cf81cba0 00000000 c0272e20 c025f354 00001e80
      cf86b08c
      GPR08: d1068200 cffffb74 06000000 d106c200 42024042 10085148 0fffd000
      0ffc81a0
      GPR16: 00000001 00000001 00000000 007ffeb0 00000000 0000c000 cf83f36c
      cf83f000
      GPR24: 00000030 cf83f360 cf81fb20 00000000 d106c200 20000000 00001e80
      cf83f360
      NIP [c0151270] ucc_geth_open+0x330/0x1efc
      LR [c0151270] ucc_geth_open+0x330/0x1efc
      Call Trace:
      [cf81fb10] [c0151270] ucc_geth_open+0x330/0x1efc (unreliable)
      [cf81fba0] [c0187638] dev_open+0xbc/0x12c
      [cf81fbc0] [c0187e38] dev_change_flags+0x8c/0x1b0
      
      This patch fixes the issue by removing offending (and somewhat
      duplicate) code from init_phy() routine, and changes _probe()
      function to use uec_mdio_bus_name().
      
      Also, since we fully construct phy_bus_id in the _probe() routine,
      we no longer need ->phy_address and ->mdio_bus fields in
      ucc_geth_info structure.
      
      I wish the patch would be a bit shorter, but it seems like the only
      way to fix the issue in a sane way. Luckily, the patch has been
      tested with real PHYs and fixed-link, so no further regressions
      expected.
      Reported-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Tested-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61fa9dcf
  17. 05 2月, 2009 1 次提交
  18. 30 1月, 2009 1 次提交
  19. 22 1月, 2009 1 次提交
  20. 11 1月, 2009 1 次提交
    • T
      ucc_geth: use correct UCCE macros · 3bc53427
      Timur Tabi 提交于
      The UCC Event Register (UCCE) already has unambigous macro definitions in qe.h,
      so we should not be defining our own in the UCC Ethernet driver.
      
      Removed unused local variable 'dev' from ucc_geth_poll(), which fixes
      a warning caused by commit 908a7a16
      ("net: Remove unused netdev arg from some NAPI interfaces.").
      
      Replaced in_be/out_be pairs with setbits32 or clrbits32, where applicable.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bc53427
  21. 26 12月, 2008 1 次提交
  22. 23 12月, 2008 1 次提交
  23. 19 12月, 2008 6 次提交
    • A
      ucc_geth: Remove UGETH_FILTERING dead code · 221b3d60
      Anton Vorontsov 提交于
      The code appears to be dead: nobody call these functions, plus build
      breaks when UGETH_FILTERING is enabled:
      
      ucc_geth.c:1848: warning: 'struct enet_addr' declared inside parameter list
      ucc_geth.c:1848: warning: its scope is only this definition or declaration, which is probably not what you want
      ucc_geth.c: In function 'ugeth_82xx_filtering_get_match_addr_in_hash':
      ucc_geth.c:1856: error: dereferencing pointer to incomplete type
      ucc_geth.c:1874: error: dereferencing pointer to incomplete type
      ucc_geth.c:1877: warning: return from incompatible pointer type
      ucc_geth.c: At top level:
      ucc_geth.c:1885: warning: 'struct enet_addr' declared inside parameter list
      ucc_geth.c: In function 'ugeth_82xx_filtering_add_addr_in_hash':
      ucc_geth.c:1894: error: dereferencing pointer to incomplete type
      ucc_geth.c:1909: warning: passing argument 2 of 'ugeth_82xx_filtering_get_match_addr_in_hash' from incompatible pointer type
      ucc_geth.c:1909: warning: assignment from incompatible pointer type
      ucc_geth.c:1918: error: dereferencing pointer to incomplete type
      ucc_geth.c: At top level:
      ucc_geth.c:1928: warning: 'struct enet_addr' declared inside parameter list
      ucc_geth.c: In function 'ugeth_82xx_filtering_clear_addr_in_hash':
      ucc_geth.c:1947: warning: passing argument 2 of 'ugeth_82xx_filtering_get_match_addr_in_hash' from incompatible pointer type
      ucc_geth.c:1947: warning: assignment from incompatible pointer type
      ucc_geth.c:1954: error: dereferencing pointer to incomplete type
      ucc_geth.c: At top level:
      ucc_geth.c:2060: warning: 'struct enet_addr' declared inside parameter list
      ucc_geth.c: In function 'ugeth_82xx_filtering_add_addr_in_paddr':
      ucc_geth.c:2064: error: dereferencing pointer to incomplete type
      ucc_geth.c:2073: error: dereferencing pointer to incomplete type
      ucc_geth.c:2075: warning: passing argument 2 of 'hw_add_addr_in_paddr' from incompatible pointer type
      make[2]: *** [ucc_geth.o] Error 1
      
      The code is there since the driver was merged, and nobody seem to be
      interested in fixing or actually using it. If we ever want the
      filtering support, we can always revert the patch and fix it, but so
      far it just draws reader's attention.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      221b3d60
    • A
      ucc_geth: Fix IO memory (un)mapping code · 3e73fc9a
      Anton Vorontsov 提交于
      The driver doesn't check ioremap() return value, and doesn't free the
      remapped memory.
      
      This patch fixes it.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e73fc9a
    • A
      ucc_geth: Cleanup repetitive ucc_geth_memclean() calls · ba574696
      Anton Vorontsov 提交于
      No need to call ucc_geth_memclean() so many times, just check for
      errors in ucc_geth_open(), and call ucc_geth_stop() in case of errors.
      
      The ucc_geth_stop() may be called anytime and will do the right thing.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba574696
    • A
      ucc_geth: Fix IRQ freeing code in ucc_geth_open() · 67c2fb8f
      Anton Vorontsov 提交于
      open() routine calls stop() in case of errors, the function will try
      to free the requested IRQ. But we don't know if it was actually
      requested, so the code might issue bogus free_irq(0, dev) call.
      
      Fix this by rearranging the code so that now request_irq() is the last
      call in the open() routine, and move free_irq() into the close().
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67c2fb8f
    • A
      ucc_geth: Fix TX watchdog timeout handling · 1762a29a
      Anton Vorontsov 提交于
      The timeout handling code is currently broken in several ways:
      
      - It calls stop() (which frees all the memory and IRQ), and then
        calls startup() (which won't re-request IRQ, neither it will
        re-init the Fast UCC structure).
      - It calls these routines from the softirq context, which is wrong,
        since stop() calls free_irq() (which might sleep) and startup()
        allocates things with GFP_KERNEL.
      - It won't soft-reset the PHY. We need the PHY reset for at least
        MPC8360E-MDS boards with Marvell 88E1111 PHY, the PHY won't recover
        from timeouts w/o the reset.
      
      So the patch fixes these problems by implementing the workqueue for the
      timeout handling, and there we fully re-open the device via close() and
      open() calls. The close/open paths do the right things, and I can see
      that the driver actually survive the timeouts.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1762a29a
    • A
      ucc_geth: Fix endless loop in stop_{tx,rx} routines · b3431c64
      Anton Vorontsov 提交于
      Currently the routines wait for the various bits w/o an assumption that
      bits may never get set. When timeouts happen I see that these bits never
      get set and so the routines hang the kernel.
      
      With this patch we'll wait the graceful stop for 100 ms, and then will
      simply exit. There is nothing* we can do about that, but it's OK since
      we'll do full reset later.
      
      * Well, actually, there is also not-graceful variant for the TX stop,
        but specs says that we never should use it.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3431c64
  24. 11 11月, 2008 1 次提交
  25. 04 11月, 2008 1 次提交
  26. 25 9月, 2008 1 次提交
  27. 21 7月, 2008 1 次提交
    • A
      ucc_geth: do not touch net queue in adjust_link phylib callback · ebbdbd7c
      Anton Vorontsov 提交于
      If the net queue has not been started, we'll get this nice oops
      and non-working ethernet:
      
      ------------[ cut here ]------------
      Kernel BUG at c01f4648 [verbose debug info unavailable]
      Oops: Exception in kernel mode, sig: 5 [#1]
      MPC836x RDK
      Modules linked in:
      NIP: c01f4648 LR: c01c0a10 CTR: c01c08e4
      REGS: cf839e40 TRAP: 0700   Not tainted  (2.6.26-05254-gc7b9969)
      MSR: 00021032 <ME,IR,DR>  CR: 22042044  XER: 00000000
      TASK = cf828c30[4] 'events/0' THREAD: cf838000
      GPR00: c01c0a10 cf839ef0 cf828c30 c035ceb0 cf8469a0 00000064 00000000 00000000
      GPR08: c035ceb0 00000001 00000001 cf99c280 22044044 7ca81020 0fffc000 00000000
      GPR16: 0fff2544 0fff63c0 00000000 0fff78e0 0ffa5580 00000004 00000000 00000000
      GPR24: 02082000 cf9d0000 d1068000 00009032 cf846800 cf846b80 00000001 00000014
      NIP [c01f4648] __netif_schedule+0x28/0x8c
      LR [c01c0a10] adjust_link+0x12c/0x1e4
      Call Trace:
      [cf839ef0] [c0380f50] 0xc0380f50 (unreliable)
      [cf839f10] [c01c0a10] adjust_link+0x12c/0x1e4
      [cf839f40] [c01c2628] phy_state_machine+0x2e0/0x448
      [cf839f60] [c00425e8] run_workqueue+0xc8/0x168
      [cf839f90] [c0042c6c] worker_thread+0x70/0xd0
      [cf839fd0] [c0046954] kthread+0x48/0x84
      [cf839ff0] [c0012488] kernel_thread+0x44/0x60
      Instruction dump:
      7c0803a6 4e800020 3d20c036 9421ffe0 7c0802a6 7c681b78 3929ceb0 7c694a78
      7d290034 90010024 bfa10014 5529d97e <0f090000> 39600002 38030024 7d200028
      ---[ end trace a57d367843bd2904 ]---
      
      Since the driver is using phylib (which is doing netif_carrier_on/off()),
      we should simply remove netif_tx_schedule_all() from adjust_link().
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebbdbd7c
  28. 18 7月, 2008 1 次提交
  29. 11 7月, 2008 1 次提交
  30. 30 6月, 2008 1 次提交
  31. 22 5月, 2008 1 次提交