1. 05 2月, 2009 3 次提交
  2. 01 2月, 2009 2 次提交
    • A
      gianfar: Fix sparse warnings · b2f66d18
      Anton Vorontsov 提交于
      This patch fixes following sparse warnings:
      
        CHECK   gianfar_ethtool.c
      gianfar_ethtool.c:610:26: warning: symbol 'gfar_ethtool_ops' was not declared. Should it be static?
        CHECK   gianfar_mii.c
      gianfar_mii.c:108:35: warning: cast adds address space to expression (<asn:2>)
      gianfar_mii.c:119:35: warning: cast adds address space to expression (<asn:2>)
      gianfar_mii.c:128:35: warning: cast adds address space to expression (<asn:2>)
      gianfar_mii.c:272:5: warning: cast removes address space of expression
      gianfar_mii.c:271:15: warning: cast adds address space to expression (<asn:2>)
      gianfar_mii.c:340:11: warning: cast adds address space to expression (<asn:2>)
        CHECK   gianfar_sysfs.c
      gianfar_sysfs.c:84:1: warning: symbol 'dev_attr_bd_stash' was not declared. Should it be static?
      gianfar_sysfs.c:133:1: warning: symbol 'dev_attr_rx_stash_size' was not declared. Should it be static?
      gianfar_sysfs.c:175:1: warning: symbol 'dev_attr_rx_stash_index' was not declared. Should it be static?
      gianfar_sysfs.c:213:1: warning: symbol 'dev_attr_fifo_threshold' was not declared. Should it be static?
      gianfar_sysfs.c:250:1: warning: symbol 'dev_attr_fifo_starve' was not declared. Should it be static?
      gianfar_sysfs.c:287:1: warning: symbol 'dev_attr_fifo_starve_off' was not declared. Should it be static?
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2f66d18
    • A
      gianfar: Implement proper, per netdevice wakeup management · 2884e5cc
      Anton Vorontsov 提交于
      This patch implements wakeup management for the gianfar driver.
      
      The driver should set wakeup enable if WOL is enabled, so that
      phylib won't power off an attached PHY.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2884e5cc
  3. 27 1月, 2009 1 次提交
    • A
      gianfar: Revive VLAN support · cd1f55a5
      Anton Vorontsov 提交于
      commit 77ecaf2d ("gianfar: Fix VLAN
      HW feature related frame/buffer size calculation") wrongly removed
      priv->vlgrp assignment, and now priv->vlgrp is always NULL.
      
      This patch fixes the issue, plus fixes following sparse warning
      introduced by the same commit:
      gianfar.c:1406:13: warning: context imbalance in 'gfar_vlan_rx_register' - wrong count at exit
      
      gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries
      to return w/o dropping the lock.
      
      According to net/8021q/vlan.c VLAN core issues rx_register() callback:
      1. In register_vlan_dev() only on a newly created group;
      2. In unregister_vlan_dev() only if the group becomes empty.
      
      Thus the check in the gianfar driver isn't needed.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Acked-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd1f55a5
  4. 22 1月, 2009 1 次提交
  5. 13 1月, 2009 1 次提交
    • A
      gianfar: Fix soft lockup with multi-interrupt TSECs · a6d0b91a
      Anton Vorontsov 提交于
      This patch fixes following bug:
      
      BUG: soft lockup - CPU#0 stuck for 61s! [S03mountvirtfs-:922]
      Modules linked in:
      NIP: c006505c LR: c00675f0 CTR: c0020438
      REGS: c7a1db90 TRAP: 0901   Not tainted  (2.6.28-rc8-01311-g8c7396ae)
      MSR: 00009032 <EE,ME,IR,DR>  CR: 28248442  XER: 20000000
      TASK = c7a288a0[922] 'S03mountvirtfs-' THREAD: c7a1c000
      GPR00: 00009032 c7a1dc40 c7a288a0 00000024 c79a1840 00000000 00000300 00000020
      GPR08: c035f97c 00000000 00004008 c04d5210 00000000
      NIP [c006505c] handle_IRQ_event+0x34/0xb0
      LR [c00675f0] handle_level_irq+0xa8/0x144
      Call Trace:
      [c7a1dc40] [c00204d8] ipic_mask_irq+0xa0/0xb4 (unreliable)
      [c7a1dc60] [c00675f0] handle_level_irq+0xa8/0x144
      [c7a1dc80] [c00067f8] do_IRQ+0x78/0x108
      [c7a1dc90] [c0014d7c] ret_from_except+0x0/0x14
      --- Exception: 501 at gfar_schedule_cleanup+0x54/0x7c
          LR = gfar_transmit+0x14/0x28
      [c7a1dd50] [c0352a3c] _spin_unlock_irqrestore+0x18/0x30 (unreliable)
      [c7a1dd60] [c01f49a8] gfar_transmit+0x14/0x28
      [c7a1dd70] [c0065084] handle_IRQ_event+0x5c/0xb0
      [c7a1dd90] [c00675f0] handle_level_irq+0xa8/0x144
      [c7a1ddb0] [c00067f8] do_IRQ+0x78/0x108
      [c7a1ddc0] [c0014d7c] ret_from_except+0x0/0x14
      --- Exception: 501 at up_read+0x10/0x48
          LR = do_page_fault+0x2b0/0x3e0
      [c7a1de80] [c7a177e8] 0xc7a177e8 (unreliable)
      [c7a1de90] [c0017964] do_page_fault+0x2b0/0x3e0
      [c7a1df40] [c0014b14] handle_page_fault+0xc/0x80
      --- Exception: 301 at 0xfe98b7c
          LR = 0xfe989c0
      Instruction dump:
      7c0802a6 bf810010 7c9f2378 7c7c1b78 90010024 80040004 70090020 40820010
      7c0000a6 60008000 7c000124 3bc00000 <3ba00000> 48000010 83ff0014 2f9f0000
      
      
      The bug introduced by commit 8c7396ae
      ("gianfar: Merge Tx and Rx interrupt for scheduling clean up ring").
      
      The commit merged TX and RX interrupt code into a single routine that
      schedules NAPI, but no locks were introduced. This causes irq races, so
      when irqs are enabled and netif_rx_schedule_prep() returns 0, nobody
      disable the interrupts again. This leads to interrupt storm and finally
      to the lockup.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6d0b91a
  6. 11 1月, 2009 1 次提交
  7. 09 1月, 2009 1 次提交
  8. 07 1月, 2009 1 次提交
  9. 23 12月, 2008 1 次提交
  10. 18 12月, 2008 5 次提交
  11. 17 12月, 2008 9 次提交
  12. 15 11月, 2008 1 次提交
  13. 11 11月, 2008 1 次提交
  14. 04 11月, 2008 1 次提交
  15. 31 10月, 2008 2 次提交
    • T
      gianfar: Don't reset TBI<->SerDes link if it's already up · bdb59f94
      Trent Piepho 提交于
      The link may be up already via the chip's reset strapping, or though action
      of U-Boot, or from the last time the interface was brought up.  Resetting
      the link causes it to go down for several seconds.  This can significantly
      increase the time from power-on to DHCP completion and a device being
      accessible to the network.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Acked-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      bdb59f94
    • T
      gianfar: Fix race in TBI/SerDes configuration · c132419e
      Trent Piepho 提交于
      The init_phy() function attaches to the PHY, then configures the
      SerDes<->TBI link (in SGMII mode).  The TBI is on the MDIO bus with the PHY
      (sort of) and is accessed via the gianfar's MDIO registers, using the
      functions gfar_local_mdio_read/write(), which don't do any locking.
      
      The previously attached PHY will start a work-queue on a timer, and
      probably an irq handler as well, which will talk to the PHY and thus use
      the MDIO bus.  This uses phy_read/write(), which have locking, but not
      against the gfar_local_mdio versions.
      
      The result is that PHY code will try to use the MDIO bus at the same time
      as the SerDes setup code, corrupting the transfers.
      
      Setting up the SerDes before attaching to the PHY will insure that there is
      no race between the SerDes code and *our* PHY, but doesn't fix everything.
      Typically the PHYs for all gianfar devices are on the same MDIO bus, which
      is associated with the first gianfar device.  This means that the first
      gianfar's SerDes code could corrupt the MDIO transfers for a different
      gianfar's PHY.
      
      The lock used by phy_read/write() is contained in the mii_bus structure,
      which is pointed to by the PHY.  This is difficult to access from the
      gianfar drivers, as there is no link between a gianfar device and the
      mii_bus which shares the same MDIO registers.  As far as the device layer
      and drivers are concerned they are two unrelated devices (which happen to
      share registers).
      
      Generally all gianfar devices' PHYs will be on the bus associated with the
      first gianfar.  But this might not be the case, so simply locking the
      gianfar's PHY's mii bus might not lock the mii bus that the SerDes setup
      code is going to use.
      
      We solve this by having the code that creates the gianfar platform device
      look in the device tree for an mdio device that shares the gianfar's
      registers.  If one is found the ID of its platform device is saved in the
      gianfar's platform data.
      
      A new function in the gianfar mii code, gfar_get_miibus(), can use the bus
      ID to search through the platform devices for a gianfar_mdio device with
      the right ID.  The platform device's driver data is the mii_bus structure,
      which the SerDes setup code can use to lock the current bus.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      CC: Andy Fleming <afleming@freescale.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c132419e
  16. 28 10月, 2008 1 次提交
  17. 22 10月, 2008 1 次提交
  18. 09 10月, 2008 1 次提交
    • T
      gianfar: Create net device with carrier down · d3eab82b
      Trent Piepho 提交于
      The device's carrier status is controlled via the functions
      netif_carrier_on() and netif_carrier_off().  These set or clear a bit
      indicating the carrier (aka lower level link) is down, and if the state
      changed, they fire off a routing netlink event.
      
      Add a call to netif_carrier_off() before register_netdev() so that the
      newly created device will be set to carrier down.  Then when the carrier
      comes up for the first time, a netlink event will be generated, as the
      carrier changed from down to up.  Otherwise the initial carrier up will
      appear to be changing the status from up to up, and so no event is
      generated since that's not a change.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3eab82b
  19. 27 8月, 2008 1 次提交
    • S
      net: don't grab a mutex within a timer context in gianfar · ab939905
      Sebastian Siewior 提交于
      I got the following backtrace while network was unavailble:
      
      |NETDEV WATCHDOG: eth0: transmit timed out
      |BUG: sleeping function called from invalid context at /home/bigeasy/git/linux-2.6-powerpc/kernel/mutex.c:87
      |in_atomic():1, irqs_disabled():0
      |Call Trace:
      |[c0383d90] [c0006dd8] show_stack+0x48/0x184 (unreliable)
      |[c0383db0] [c001e938] __might_sleep+0xe0/0xf4
      |[c0383dc0] [c025a43c] mutex_lock+0x24/0x3c
      |[c0383de0] [c019005c] phy_stop+0x20/0x70
      |[c0383df0] [c018d4ec] stop_gfar+0x28/0xf4
      |[c0383e10] [c018e8c4] gfar_timeout+0x30/0x60
      |[c0383e20] [c01fe7c0] dev_watchdog+0xa8/0x144
      |[c0383e30] [c002f93c] run_timer_softirq+0x148/0x1c8
      |[c0383e60] [c002b084] __do_softirq+0x5c/0xc4
      |[c0383e80] [c00046fc] do_softirq+0x3c/0x54
      |[c0383e90] [c002ac60] irq_exit+0x3c/0x5c
      |[c0383ea0] [c000b378] timer_interrupt+0xe0/0xf8
      |[c0383ec0] [c000e5ac] ret_from_except+0x0/0x18
      |[c0383f80] [c000804c] cpu_idle+0xcc/0xdc
      |[c0383fa0] [c025c07c] etext+0x7c/0x90
      |[c0383fc0] [c0338960] start_kernel+0x294/0x2a8
      |[c0383ff0] [c00003dc] skpinv+0x304/0x340
      |------------[ cut here ]------------
      
      The phylock was once a spinlock but got changed into a mutex via
      commit 35b5f6b1 aka [PHYLIB: Locking fixes for PHY I/O potentially sleeping]
      Signed-off-by: NSebastian Siewior <bigeasy@linutronix.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ab939905
  20. 14 8月, 2008 1 次提交
  21. 07 8月, 2008 1 次提交
  22. 21 7月, 2008 1 次提交
    • A
      gianfar: do not touch net queue in adjust_link phylib callback · afc07946
      Anton Vorontsov 提交于
      If the net queue has not been started, we'll get this nice oops
      and non-working ethernet:
      
      PHY: 0:01 - Link is Up - 1000/Full
      ------------[ cut here ]------------
      kernel BUG at net/core/dev.c:1328!
      Oops: Exception in kernel mode, sig: 5 [#1]
      MPC837x RDB
      Modules linked in:
      NIP: c02544a0 LR: c01a17d0 CTR: c01a16ac
      REGS: cf837e40 TRAP: 0700   Not tainted  (2.6.26-05253-g14b395e3)
      MSR: 00021032 <ME,IR,DR>  CR: 22042044  XER: 00000000
      TASK = cf819400[5] 'events/0' THREAD: cf836000
      GPR00: c01a17d0 cf837ef0 cf819400 c03d8d08 cf8469a0 00000064 00000000 00000000
      GPR08: c03d8d08 00000001 00000001 cf899ba0 22044044 00000000 0fffd000 00000000
      GPR16: 0fff3028 0fff6cf0 00000000 0fff8390 0ff494a0 00000004 00000000 00000000
      GPR24: c0361a00 00001058 cf9f6600 00009032 cf846800 cf846b80 00000001 00000014
      NIP [c02544a0] __netif_schedule+0x28/0x8c
      LR [c01a17d0] adjust_link+0x124/0x1cc
      Call Trace:
      [cf837ef0] [c03fb3a0] 0xc03fb3a0 (unreliable)
      [cf837f10] [c01a17d0] adjust_link+0x124/0x1cc
      [cf837f40] [c01a8e28] phy_state_machine+0x2e0/0x448
      [cf837f60] [c0040254] run_workqueue+0xc8/0x168
      [cf837f90] [c00408d8] worker_thread+0x70/0xd0
      [cf837fd0] [c0044630] kthread+0x48/0x84
      [cf837ff0] [c0012610] kernel_thread+0x44/0x60
      Instruction dump:
      7c0803a6 4e800020 3d20c03e 9421ffe0 7c0802a6 7c681b78 39298d08 7c694a78
      7d290034 90010024 bfa10014 5529d97e <0f090000> 39600002 38030024 7d200028
      ---[ end trace 13dfd73ee42d0c30 ]---
      
      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>
      afc07946
  23. 18 7月, 2008 1 次提交
  24. 17 7月, 2008 1 次提交