14838 Commits

Author SHA1 Message Date
Ben Hutchings
0c9f5ecd01 usbnet: Set link down initially for drivers that update link state
Some usbnet drivers update link state while others do not due to
hardware limitations.  Add a flag to distinguish those that do, and
set the link down initially for their devices.

This is intended to fix this bug: http://bugs.debian.org/444043

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-21 23:23:07 -06:00
Jussi Kivilinna
ccd966624c asix: check packet size against mtu+ETH_HLEN instead of ETH_FRAME_LEN
Driver checks received packet is too large in asix_rx_fixup() and fails if it is. Problem is
that MTU might be set larger than 1500 and asix fails to work correctly with VLAN tagged
packets. The check should be 'dev->net->mtu + ETH_HLEN' instead.

Tested with AX88772.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-21 23:20:01 -06:00
Neil Jones
8452f6b61d drivers/net/usb/asix.c: Fix unaligned accesses
Using this driver can cause unaligned accesses in the IP layer
This has been fixed by aligning the skb data correctly using the
spare room left over by the 4 byte header inserted between packets
by the device.

Signed-off-by: Neil Jones <NeilJay@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-21 23:17:23 -06:00
Jussi Kivilinna
b51f816291 asix: fix setting mac address for AX88772
Setting new MAC address only worked when device was set to promiscuous mode.
Fix MAC address by writing new address to device using undocumented command
AX_CMD_READ_NODE_ID+1. Patch is tested with AX88772 device.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-21 23:16:37 -06:00
Anton Vorontsov
38962b9aff spi: prefix modalias with "spi:"
This makes it consistent with other buses (platform, i2c, vio, ...).  I'm
not sure why we use the prefixes, but there must be a reason.

This was easy enough to do it, and I did it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Samuel Ortiz <sameo@openedhand.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Acked-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-03 05:36:50 -06:00
Matt Sealey
5ca1e7b5e3 rt2800lib.c reappears. 2010-08-25 20:09:35 -05:00
Matt Sealey
a055a4143e rt2x00 updates 2010-08-23 11:50:09 -05:00
Jason Chen
e33df3d953 ENGR00124760 fec: set mac address correctly
Fix dynamicly set mac address make network hang issue.

Signed-off-by: Jason Chen <b02280@freescale.com>
2010-08-10 11:51:18 -05:00
Niu Xule
f38b509a2c ENGR00124252 MX28: Support Switch port0 as ethernet port
The L2 Switch have 4 ports,
and the port0 can be used as ethernet port
when Switch is configured to operate
as a 3-Port Switch (Switch Mode).

Signed-off-by: Niu Xule <b23300@freescale.com>
2010-08-10 11:51:11 -05:00
Peter Chen
c83903e8db ENGR00124167 [mfg-tool]: Enhancement the UTP protocol
Enhancement the UTP protocol and give more comments
for source code

Signed-off-by: Peter Chen <b29397@freescale.com>
2010-08-10 11:50:47 -05:00
Xiexiaobo
414ff9f16f ENGR00123808 MX28: Add dual FEC 1588 timer support
The ENET 1588 driver only support one FEC port,
this patch add dual FEC 1588 functions support.

Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
2010-08-10 11:50:41 -05:00
Niu Xule
1630780652 ENGR00123741 MX28: Add IOCTL commands to L2 switch driver
L2 switch driver command line controlling support

Signed-off-by: Niu Xule <b23300@freescale.com>
2010-08-10 11:50:36 -05:00
Jason Liu
f4760024a9 ENGR00123446 Can not get ip address after ifconfig eth0 down
-Fix the fec_enet_mdio_write function with correct FEC_MMFR_OP_WRITE
-Correct comments "start a read op" inside the fec_enet_mdio_write function
-Need do fec_restart in fec open since we do fec_stop in fec close
-Need do phy_stop in fec close to set the correct phy state machine

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:50:29 -05:00
Bryan Wu
4c0e351a62 netdev/fec: fix ifconfig eth0 down hang issue
BugLink: http://bugs.launchpad.net/bugs/559065

In fec open/close function, we need to use phy_connect and phy_disconnect
operation before we start/stop phy. Otherwise it will cause system hang.

Only call fec_enet_mii_probe() in open function, because the first open
action will cause NULL pointer error.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Colin King <colin.king@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2010-08-10 11:50:27 -05:00
Anton Vorontsov
8e982ef543 phylib: Move workqueue initialization to a proper place
commit 541cd3ee00a4fe975b22fac6a3bc846bacef37f7 ("phylib: Fix deadlock
on resume") caused TI DaVinci EMAC ethernet driver to oops upon resume:

 PM: resume of devices complete after 237.098 msecs
 Restarting tasks ... done.
 kernel BUG at kernel/workqueue.c:354!
 Unable to handle kernel NULL pointer dereference at virtual address 00000000
 [...]
 Backtrace:
 [<c002c598>] (__bug+0x0/0x2c) from [<c0052a54>] (queue_delayed_work_on+0x74/0xf8)
 [<c00529e0>] (queue_delayed_work_on+0x0/0xf8) from [<c0052b30>] (queue_delayed_work+0x2c/0x30)

The oops pops up because TI DaVinci EMAC driver detaches PHY on
suspend and attaches it back on resume. Attaching makes phylib call
phy_start_machine() that initializes a workqueue. On the other hand,
PHY's resume routine will call phy_start_machine() again, and that
will cause the oops since we just destroyed the already scheduled
workqueue.

This patch fixes the issue by moving workqueue initialization to
phy_device_create().

p.s. We don't see this oops with ucc_geth and gianfar drivers because
they perform a fine-grained suspend, i.e. they just stop the PHYs
without detaching.

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-10 11:50:22 -05:00
Anton Vorontsov
d78f3d35b3 phylib: Properly reinitialize PHYs after hibernation
Since hibernation assumes power loss, we should fully reinitialize
PHYs (including platform fixups), as if PHYs were just attached.

This patch factors phy_init_hw() out of phy_attach_direct(), then
converts mdio_bus to dev_pm_ops and adds an appropriate restore()
callback.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-10 11:50:21 -05:00
Anton Vorontsov
347b7f1281 phylib: Fix deadlock on resume
Sometimes kernel hangs on resume with the following trace:

 ucc_geth e0102000.ucc: resume
 INFO: task bash:1764 blocked for more than 120 seconds.
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 bash          D 0fecf43c     0  1764   1763 0x00000000
 Call Trace:
 [cf9a7c10] [c0012868] ret_from_except+0x0/0x14 (unreliable)
 --- Exception: cf9a7ce0 at __switch_to+0x4c/0x6c
     LR = 0xcf9a7cc0
 [cf9a7cd0] [c0008c14] __switch_to+0x4c/0x6c (unreliable)
 [cf9a7ce0] [c028bcfc] schedule+0x158/0x260
 [cf9a7d10] [c028c720] __mutex_lock_slowpath+0x80/0xd8
 [cf9a7d40] [c01cf388] phy_stop+0x20/0x70
 [cf9a7d50] [c01d514c] ugeth_resume+0x6c/0x13c
 [...]

Here is why.

On suspend:

- PM core starts suspending devices, ucc_geth_suspend gets called;

- ucc_geth calls phy_stop() on suspend. Note that phy_stop() is
  mostly asynchronous so it doesn't block ucc_geth's suspend routine,
  it just sets PHY_HALTED state and disables PHY's interrupts;

- Suddenly the state machine gets scheduled, it grabs the phydev->lock
  mutex and tries to process the PHY_HALTED state, so it calls
  phydev->adjust_link(phydev->attached_dev). In ucc_geth case
  adjust_link() calls msleep(), which reschedules the code flow back to
  PM core, which now finishes suspend and so we end up sleeping with
  phydev->lock mutex held.

On resume:

- PM core starts resuming devices (notice that nobody rescheduled
  the state machine yet, so the mutex is still held), the core calls
  ucc_geth's resume routine;

- ucc_geth_resume restarts the PHY with phy_stop()/phy_start()
  sequence, and the phy_*() calls are trying to grab the phydev->lock
  mutex. Here comes the deadlock.

This patch fixes the issue by stopping the state machine on suspend
and starting it again on resume.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-10 11:50:21 -05:00
Niu Xule
8c5d22499b ENGR00123078-2 MX28: L2 Switch support
L2 Switch support

Signed-off-by: Niu Xule <b23300@freescale.com>
2010-08-10 11:50:16 -05:00
Xie Xiaobo
19bb66e24a ENGR00123296 MX5: Fix FEC compiling error
1. One variable declaration was controlled by ARCH_MXS, but it was
used by other platforms, So remove the ARCH_MXS flags controlling.
2. Added judgement for FEC 1588 interrupt enablement.

Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
2010-08-10 11:50:12 -05:00
Xiexiaobo
9e4ac5e73b ENGR00122832-2 MX28: Support for IEEE 1588 interface functionality
Supply the 1588 support for MX28 FEC.

Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
2010-08-10 11:50:11 -05:00
Jason
c44b119b86 ENGR00122142-3 fec: Add shared mdio bus for dual MAC
MX28 has two MAC,but External PHY can only be configed by MAC0
which means PHY1 should be configed by MAC0 according to IC spec.
This patch enable dual ENET support. If want to test rootfs from
eth1, can add ip=:::::eth1:dhcp in the command line

Signed-off-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:50:00 -05:00
Rob Herring
6615c0116f ENGR00122142-1 fec: fix RMII with phylib
This fixes RMII support which was broken by phylib support.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:49:59 -05:00
Bryan Wu
a1d1a6ba44 UBUNTU: SAUCE: (upstream) netdev/fec: fix performance impact from mdio poll operation
BugLink: http://bugs.launchpad.net/bugs/546649
BugLink: http://bugs.launchpad.net/bugs/457878

After introducing phylib supporting, users experienced performace drop. That is
because of the mdio polling operation of phylib. Use msleep to replace the busy
waiting cpu_relax() and remove the warning message.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
2010-08-10 11:49:58 -05:00
Bryan Wu
d3cb95c9ed UBUNTU: SAUCE: (upstream) netdev/fec: fix phy_speed caculating
BugLink: http://bugs.launchpad.net/bugs/546649
BugLink: http://bugs.launchpad.net/bugs/457878

 - remove duplicated phy_speed caculation
 - fix the phy_speed caculation according to the DataSheet

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
2010-08-10 11:49:57 -05:00
Bryan Wu
7299891410 netdev/fec: fix compiling warning
BugLink: http://bugs.launchpad.net/bugs/457878

Missed to set .ndo_do_ioctl as fec_enet_ioctl, so will generate a compiling
warning due to nobody uses fec_enet_ioctl. This patch fixed that.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Amit Kucheria <amit.kucheria@canonical.com>
Acked-by: Colin King <colin.king@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2010-08-10 11:49:57 -05:00
Bryan Wu
e94b913d8e netdev/fec.c: add phylib supporting to enable carrier detection
netdev/fec.c: add phylib supporting to enable carrier detection

BugLink: http://bugs.launchpad.net/bugs/457878

 - removed old MII phy control code
 - add phylib supporting
 - add ethtool interface to make user space NetworkManager works

This patch is ready for upstream, it will be pushed to upstream for merge

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Amit Kucheria <amit.kucheria@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2010-08-10 11:49:56 -05:00
Alan Tull
4f61210f20 ENGR00123047 move atheros fw to firmware imx repository
Firmware will be copied to the /lib/firmware/ath6k/AR6102 directory
so change the path in the driver.

Signed-off-by: Alan Tull <r80115@freescale.com>
2010-08-10 11:49:50 -05:00
Richard Zhao
a54c57ea1d ENGR00122879 ath6kl: set default ifname to wlan%d
It's easy for ChromiumOS to use.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
2010-08-10 11:49:35 -05:00
William Lai
8e5646f52e ENGR00122723 CAN: Enable the adaptive bitrate setting
Enable the adaptive bitrate setting, according to the clock rate.
And the bitrate can be changed by the proc file.

Signed-off-by: William Lai <b04597@freescale.com>
2010-08-10 11:49:29 -05:00
William Lai
85e33be8be ENGR00122399-2 MX53 CAN: MBM word access only
The MBM can only be accessed in word, removing the potential
bit fields side effect intrudued by the different tool chain.

Signed-off-by: William Lai <b04597@freescale.com>
2010-08-10 11:49:28 -05:00
Richard Zhao
7f6076dd6d ENGR00122691-1 Add atheros driver ath6kl
Integrate atheros driver package from atheros company.
It's mainly for AR6003.

Signed-off-by: Nathan Cheng <Nathan.Cheng@Atheros.com>
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
2010-08-10 11:49:27 -05:00
Robby Cai
1300f40504 ENGR00122636-4 [MX23] Port SPI ethernet driver to MXS
Port SPI ethernet( enc28j60 ) driver to MXS

Signed-off-by: Robby Cai <R63905@freescale.com>
2010-08-10 11:49:23 -05:00
Xinyu Chen
e148a45ce4 ENGR00121653 MX53 Add FEC support
Add FEC support for MX53 EVK

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-08-10 11:48:28 -05:00
William Lai
ccad5474a6 ENGR00120661-1 MX28 CAN: MX28 platform support
CAN supported on MX28 platform.

Signed-off-by: William Lai <b04597@freescale.com>
2010-08-10 11:47:48 -05:00
Jason
4b91878877 ENGR00120715 MX28:Fix FEC MAC not set correclty
FEC MAC not set correclty on MX28 EVK board

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:47:46 -05:00
Jason
d52e598394 ENGR00120558 FEC Fix broken and warnings on MXC
FEC Fix broken and warnings on MXC.
-use the fec_platform_data structure of kernel fec.h, remove
the redefinion from mach/mxc.h

-use dsv_phy_done completion to make sure fec clk not disabled
during phy discovery operation.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:47:41 -05:00
Jason
f61cc66aea ENGR00117744-2 i.MX28 EVK ENET(Single) support
FEC driver support for i.MX28

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:47:31 -05:00
Rob Herring
183afb82e4 ENGR00121296: imx51: rename mx51 to mx5
Rename mx51 to mx5 for common source for MX5x family

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:47:12 -05:00
William Lai
7646b3ff2f ENGR00120455-1 CAN: Pass the default setting through platform_data
Initialize the default Flexcan device setting, by passing the
predefined parameters through platform_data.

Signed-off-by: William Lai <b04597@freescale.com>
2010-08-10 11:46:44 -05:00
William Lai
dc809e8cf8 ENGR00120372 CAN: Clock source for FlexCAN module can not be changed
Change the function strcasecmp(buf, "osc") to strncasecmp(buf, "osc",
3), which only compare the first 3bytes.

Signed-off-by: William Lai <b04597@freescale.com>
2010-08-10 11:46:38 -05:00
Jun Li
491ec33463 ENGR00119899 Add FEC iomux config and PHY reset.
FEC driver of 2.6.31 kernel remove pin iomux config and PHY reset,
which is in fec_gpio_active() needed for i.MX25 and i.MX35.

Signed-off-by: Li Jun <r65092@freescale.com>
2010-08-10 11:46:32 -05:00
Lily Zhang
dd3541d01b ENGR00118714 Disable FEC clock when it's not used
Disable FEC clock when it's not used in 31 kernel

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-08-10 11:45:45 -05:00
Lily Zhang
f6939b6d05 ENGR00118698 Fix FEC resume issue
FEC driver is stopped in suspend state. So FEC driver should restart
instead of initialization in resume state

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-08-10 11:45:44 -05:00
Rob Herring
be0524d38f ENGR00117389 Port 5.0.0 release to 2.6.31
This is i.MX BSP 5.0.0 release ported to 2.6.31

Signed-off-by: Rob Herring <r.herring@freescale.com>
Signed-off-by: Alan Tull <r80115@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-08-10 11:44:41 -05:00
Rob Herring
04e16e7967 enc28j60: enhancements for stmp3xxx boards
Get mac addr from otp bits
Add suspend/resume

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:34 -05:00
Rob Herring
7413e00614 cs8900: add support for i.MX platforms
Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:32 -05:00
Rob Herring
321db35ca2 smsc911x: add imx cpld spi register access
Add custom register read/write functions. Some i.MX 3-stack boards
have CPLD to do spi to parallel bus translation to talk to smsc911x.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:28 -05:00
Rob Herring
d901b1687c smsc911x: Add phy suspend and resume
Most of the smsc9xxx power consumption is in the phy, so
we need to suspend the phy.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:28 -05:00
Rob Herring
0fcb4ff094 fec: fix uninitialized rx buffer usage
The fec driver was enabling receive buffer descriptor without allocating
the buffers. Make sure the buffer descriptors are initialized to not
start receiving packets.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:27 -05:00
Rob Herring
a8da586928 fec: Add RMII gasket support
New versions of FEC support reduced MII interface. Currently only MX25
supports this.

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:26 -05:00