summaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)Author
2013-11-22ENGR00258885 flexcan: fix errata ERR005829 that MB may fail to be sentDong Aisheng
This is an issue from IC errata ERR005829 which is described as follows: ---------------------------------------------------------- FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process. The following conditions are necessary to have the issue. - Only one MB is configured to be transmitted - The write which enables the MB to be transmitted (write on Control status word) happens during a specific clock during the arbitration process. After this arbitration process occurs, the bus goes to Idle state and no new message is received on bus. For example: 1) MB13 is deactivated on RxIntermission (write 0x0 on CODE field from Control Status word) - First write on CODE 2) Reconfigure the ID and data fields 3) Enable the MB13 to be transmitted on BusIdle (write 0xC on Code field) - Second write on code 4) CAN bus keeps in Idle state 5) No write on Control status from any MB happens. During the second write on code (step 3), the write must happen one clock before the current MB13 is to be scanned by arbitration process. In this case, it does not detect the new code (0xC) and no new arbitration is scheduled. The suggested workaround which is implemented in this patch is: The workaround consists of executing two extra steps: 6. Reserve the first valid mailbox as an inactive mailbox (CODE=0b1000). If RX FIFO is disabled, this mailbox must be MB0. Otherwise, the first valid mailbox can be found by using table "RX FIFO filters" on FlexCAN3 chapter. 7. Write twice INACTIVE code (0b1000) into the first valid mailbox. Note: The first mailbox cannot be used for reception or transmission process. ------------------------------------------------------------- Note: Although the currently flexcan driver does not have the step 1 to run, it's also possible to meet this issue in theory because we can not predict when the arbitration is scheduled. With a modified can-utils/canfdttest tool simulating Pingpong test, we were able to reproduce this issue after running a about one day. After applying this patch, we ran six days and did not see the issue happen again on two mx6q sabrelite boards. Note: with a few minors change for new kernel and change errata id from ERR005641 to ERR005829 which is the open one in freescale website. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 872eb1691afb83a2760052c615ed410a7cfe71e0) (cherry picked from commit e15728d9b51ea5d1b2914c0b6af058cc33d59af6)
2013-11-22ENGR00288569: net:fec_ptp: fix the potential issue for storing timestampFugang Duan
The timestamps generated in the i.MX drivers are generated by the nanoseconds part coming from the 1588 clock. But the number of seconds are maintained in a private structure of the interface. Those are updated in a 1588 clock rollover interrupt. The timestamp is generated right before a rollover of a second and the timestamp value is constructed afterwards. Therefore the bigger part of the timestamp is wrong (the second). commit:54181c1d83e04b18e63c7723ac80f974b760e019 Suggested solution (pseudo-code): If( actual-time.nsec < timestamp.nsec ) Timestamp.sec = fpp->prtc -1; Else Timestamp.sec = fpp->prtc; But it is not perfect and there still exist potenitial second sync issue. So, the patch Suggested solution (pseudo-code): If( actual-time.nsec < timestamp.nsec && !FEC_IEVENT[TS_TIMER] ) Timestamp.sec = fpp->prtc -1; Else Timestamp.sec = fpp->prtc; Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit 430dc3830e80a749666f9eb2aa9feba55823c6eb)
2013-11-22ENGR00277698 net:fec: avoid kernel dump for skb page allocation failFugang Duan
Fast reproduce steps: 1. set kernel parameter mem=500M, after kernel up, run below steps. 1. mount 10.192.225.224:/nfsroot /media/Videos/224nfsroot -t nfs -o rw,nolock,addr=10.192.225.224 2. cd /media/Videos/224nfsroot/gst-sanity-test 3. ./linux_recording_sanity_test.sh recording_playback_cmd.txt kernel dump: -------------------------------------------------------------- Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB kswapd0: page allocation failure: order:0, mode:0x20 CPU: 0 PID: 54 Comm: kswapd0 Tainted: G W 3.10.17-16884-gc530ac0 #239 [<80013c4c>] (unwind_backtrace+0x0/0xf8) from [<80011704>] (show_stack+0x10/0x14) [<80011704>] (show_stack+0x10/0x14) from [<8008bb7c>] (warn_alloc_failed+0xd0/0x114) [<8008bb7c>] (warn_alloc_failed+0xd0/0x114) from [<8008e860>] (__alloc_pages_nodemask+0x5e0/0x8b8) [<8008e860>] (__alloc_pages_nodemask+0x5e0/0x8b8) from [<804cceb8>] (__netdev_alloc_frag+0x9c/0x138) [<804cceb8>] (__netdev_alloc_frag+0x9c/0x138) from [<804cddc4>] (__netdev_alloc_skb+0x40/0xe0) [<804cddc4>] (__netdev_alloc_skb+0x40/0xe0) from [<8037dc8c>] (fec_enet_rx_napi+0x268/0x7e0) [<8037dc8c>] (fec_enet_rx_napi+0x268/0x7e0) from [<804d7cf8>] (net_rx_action+0x94/0x160) [<804d7cf8>] (net_rx_action+0x94/0x160) from [<8002c8fc>] (__do_softirq+0xe8/0x1d0) [<8002c8fc>] (__do_softirq+0xe8/0x1d0) from [<8002ca8c>] (do_softirq+0x4c/0x58) [<8002ca8c>] (do_softirq+0x4c/0x58) from [<8002ccf4>] (irq_exit+0x90/0xc8) [<8002ccf4>] (irq_exit+0x90/0xc8) from [<8000ea88>] (handle_IRQ+0x3c/0x94) [<8000ea88>] (handle_IRQ+0x3c/0x94) from [<8000855c>] (gic_handle_irq+0x28/0x5c) [<8000855c>] (gic_handle_irq+0x28/0x5c) from [<8000de00>] (__irq_svc+0x40/0x50) Exception stack(0xac21be08 to 0xac21be50) be00: 80ca16f0 00000000 0000bf28 0000bf28 80ca16c8 ac449c00 be20: 000006a4 00000000 00000000 00000000 000003a4 00000000 00000000 ac21be50 be40: 800bf9e4 805fc0d4 600f0013 ffffffff [<8000de00>] (__irq_svc+0x40/0x50) from [<805fc0d4>] (_raw_spin_lock+0x38/0x3c) [<805fc0d4>] (_raw_spin_lock+0x38/0x3c) from [<800bf9e4>] (put_super+0x18/0x3c) [<800bf9e4>] (put_super+0x18/0x3c) from [<800c0968>] (prune_super+0x13c/0x17c) [<800c0968>] (prune_super+0x13c/0x17c) from [<80093ff8>] (shrink_slab+0x88/0x218) [<80093ff8>] (shrink_slab+0x88/0x218) from [<8009637c>] (kswapd+0x510/0x80c) [<8009637c>] (kswapd+0x510/0x80c) from [<80042d64>] (kthread+0xa4/0xb0) [<80042d64>] (kthread+0xa4/0xb0) from [<8000e258>] (ret_from_fork+0x14/0x3c) -------------------------------------------------------------- Firstly, alloc_page() try to allocate page from pcp high speed cached page or free_list by calling get_page_from_freelist(). If failed, and then use low speed allocation mechanism by calling __alloc_pages_slowpath(), which may allocate from reclaimed pages and kernel dump the memory allocate info. Still don't find the root cause, this patch avoid the kernel dump in temporarily. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit 20a0a6b28587ad3aceeaaf71bf91a17162b941e3)
2013-11-18ENGR00288342 net:fec_ptp: fix the potential issue for storing timestampFugang Duan
The timestamps generated in the i.MX drivers are generated by the nanoseconds part coming from the 1588 clock. But the number of seconds are maintained in a private structure of the interface. Those are updated in a 1588 clock rollover interrupt. The timestamp is generated right before a rollover of a second and the timestamp value is constructed afterwards. Therefore the bigger part of the timestamp is wrong (the second). Suggested solution (pseudo-code): If( actual-time.nsec < timestamp.nsec ) Timestamp.sec = fpp->prtc -1; Else Timestamp.sec = fpp->prtc; Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-11-14ENGR00288046: net:fec_ptp: fix WARNING caused by mutex_trylock run in ↵Fugang Duan
interrupt context Kernel warning dump by enable kernel config "CONFIG_DEBUG_MUTEXES": ------------[ cut here ]------------ WARNING: at kernel/mutex.c:577 mutex_trylock+0x180/0x1d0() DEBUG_LOCKS_WARN_ON(in_interrupt()) Modules linked in: CPU: 0 PID: 68 Comm: kworker/0:2 Tainted: G W 3.10.17-16855-ga44de14 #1325 Workqueue: events phy_state_machine [<80014cbc>] (unwind_backtrace+0x0/0x138) from [<8001251c>] (show_stack+0x10/0x14) [<8001251c>] (show_stack+0x10/0x14) from [<80026754>] (warn_slowpath_common+0x4c/0x68) [<80026754>] (warn_slowpath_common+0x4c/0x68) from [<80026804>] (warn_slowpath_fmt+0x30/0x40) [<80026804>] (warn_slowpath_fmt+0x30/0x40) from [<8069f6b0>] (mutex_trylock+0x180/0x1d0) [<8069f6b0>] (mutex_trylock+0x180/0x1d0) from [<804dce7c>] (clk_prepare_lock+0xc/0xd8) [<804dce7c>] (clk_prepare_lock+0xc/0xd8) from [<804ddbcc>] (clk_get_rate+0xc/0x5c) [<804ddbcc>] (clk_get_rate+0xc/0x5c) from [<803b7528>] (fec_ptp_start_cyclecounter+0x1c/0x198) [<803b7528>] (fec_ptp_start_cyclecounter+0x1c/0x198) from [<803b5928>] (fec_restart+0x6e8/0x870) [<803b5928>] (fec_restart+0x6e8/0x870) from [<803b5d50>] (fec_enet_adjust_link+0x7c/0xb4) [<803b5d50>] (fec_enet_adjust_link+0x7c/0xb4) from [<803b07b8>] (phy_state_machine+0xfc/0x394) [<803b07b8>] (phy_state_machine+0xfc/0x394) from [<8003f03c>] (process_one_work+0x198/0x428) [<8003f03c>] (process_one_work+0x198/0x428) from [<8003fd24>] (worker_thread+0x144/0x3a4) [<8003fd24>] (worker_thread+0x144/0x3a4) from [<800458d8>] (kthread+0xa4/0xb0) [<800458d8>] (kthread+0xa4/0xb0) from [<8000ebd8>] (ret_from_fork+0x14/0x3c) ---[ end trace d1930b3e1c195329 ]--- Root cause: Worker thread call netif_tx_lock_bh() to diable the softirq preempt, and then call clk_get_rate() to get ptp clock rate. In fact, netif_tx_lock_bh()->local_bh_disable(), which make in_interrupt() to be ture. clk_get_rate()->clk_prepare_lock()->mutex_trylock(), and mutex_trylock() cannot use at interrupt context, otherwise there have kernel dump. So, remove the clk_get_rate() in there. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-11-12ENGR00287512 net:fec: fix WARNING caused by lack of calling dma_mapping_error()Fugang Duan
Enable CONFIG_HAVE_DMA_API_DEBUG, the kernel dump warning: ------------[ cut here ]------------ WARNING: at lib/dma-debug.c:937 check_unmap+0x43c/0x7d8() fec 2188000.ethernet: DMA-API: device driver failed to check map error[device address=0x00000000383a8040] [size=2048 bytes] [mapped as single] Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17-16827-g9cdb0ba-dirty #188 [<80013c4c>] (unwind_backtrace+0x0/0xf8) from [<80011704>] (show_stack+0x10 [<80011704>] (show_stack+0x10/0x14) from [<80025614>] (warn_slowpath_common [<80025614>] (warn_slowpath_common+0x4c/0x6c) from [<800256c8>] (warn_slowp [<800256c8>] (warn_slowpath_fmt+0x30/0x40) from [<8026bfdc>] (check_unmap+0 [<8026bfdc>] (check_unmap+0x43c/0x7d8) from [<8026c584>] (debug_dma_unmap_p [<8026c584>] (debug_dma_unmap_page+0x6c/0x78) from [<8038049c>] (fec_enet_r [<8038049c>] (fec_enet_rx_napi+0x254/0x8a8) from [<804dc8c0>] (net_rx_actio [<804dc8c0>] (net_rx_action+0x94/0x160) from [<8002c758>] (__do_softirq+0xe [<8002c758>] (__do_softirq+0xe8/0x1d0) from [<8002c8e8>] (do_softirq+0x4c/0 [<8002c8e8>] (do_softirq+0x4c/0x58) from [<8002cb50>] (irq_exit+0x90/0xc8) [<8002cb50>] (irq_exit+0x90/0xc8) from [<8000ea88>] (handle_IRQ+0x3c/0x94) [<8000ea88>] (handle_IRQ+0x3c/0x94) from [<8000855c>] (gic_handle_irq+0x28/ [<8000855c>] (gic_handle_irq+0x28/0x5c) from [<8000de00>] (__irq_svc+0x40/0 Exception stack(0x815a5f38 to 0x815a5f80) 5f20: 815a5f80 3b9aca 5f40: 0fe52383 00000002 0dd8950e 00000002 81e7b080 00000000 00000000 815ac4 5f60: 806032ec 00000000 00000017 815a5f80 80059028 8041fc4c 60000013 ffffff [<8000de00>] (__irq_svc+0x40/0x50) from [<8041fc4c>] (cpuidle_enter_state+0 [<8041fc4c>] (cpuidle_enter_state+0x50/0xf0) from [<8041fd94>] (cpuidle_idl [<8041fd94>] (cpuidle_idle_call+0xa8/0x14c) from [<8000edac>] (arch_cpu_idl [<8000edac>] (arch_cpu_idle+0x10/0x4c) from [<800582f8>] (cpu_startup_entry [<800582f8>] (cpu_startup_entry+0x60/0x130) from [<80bc7a48>] (start_kernel [<80bc7a48>] (start_kernel+0x2d0/0x328) from [<10008074>] (0x10008074) ---[ end trace c6edec32436e0042 ]--- Because dma-debug add new interfaces to debug dma mapping errors, pls refer to: http://lwn.net/Articles/516640/ After dma mapping, it must call dma_mapping_error() to check mapping error, otherwise the map_err_type alway is MAP_ERR_NOT_CHECKED, check_unmap() define the mapping is not checked and dump the error msg. So, and dma_mapping_error() checking to fix the WARNING. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-11-11ENGR00279944 ath6kl: sdio: fix system panic when doing wifi stress testJason Liu
When did the wifi test, meet one following kernel panic: Unable to handle kernel paging request at virtual address 1a480000 pgd = 80004000 [1a480000] *pgd=00000000 Internal error: Oops: 805 [#1] SMP ARM Modules linked in: ath6kl_sdio ath6kl_core [last unloaded: ath6kl_core] CPU: 0 PID: 1953 Comm: kworker/u4:0 Not tainted 3.10.9-1.0.0_alpha+dbf364b #1 Workqueue: ath6kl ath6kl_sdio_write_async_work [ath6kl_sdio] task: dcc9a680 ti: dc9ae000 task.ti: dc9ae000 PC is at v7_dma_clean_range+0x20/0x38 LR is at dma_cache_maint_page+0x50/0x54 pc : [<8001a6f8>] lr : [<800170fc>] psr: 20000093 sp : dc9afcf8 ip : 8001a748 fp : 00000004 r10: 00000000 r9 : 00000001 r8 : 00000000 r7 : 00000001 r6 : 00000000 r5 : 80cb7000 r4 : 03f9a480 r3 : 0000001f r2 : 00000020 r1 : 1a480000 r0 : 1a480000 Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 6cc5004a DAC: 00000015 Process kworker/u4:0 (pid: 1953, stack limit = 0xdc9ae238) Stack: (0xdc9afcf8 to 0xdc9b0000) fce0: 80c9b29c 00000000 fd00: 00000000 80017134 8001a748 dc302ac0 00000000 00000000 dc454a00 80c12ed8 fd20: dc115410 80017238 00000000 dc454a10 00000001 80017588 00000001 00000000 fd40: 00000000 dc302ac0 dc9afe38 dc9afe68 00000004 80c12ed8 00000000 dc454a00 fd60: 00000004 80436f88 00000000 00000000 00000600 0000ffff 0000000c 80c113c4 fd80: 80c9b29c 00000001 00000004 dc115470 60000013 dc302ac0 dc46e000 dc302800 fda0: dc9afe10 dc302b78 60000013 dc302ac0 dc46e000 00000035 dc46e5b0 80438c90 fdc0: dc9afe10 dc302800 dc302800 dc9afe68 dc9afe38 80424cb4 00000005 dc9afe10 fde0: dc9afe20 80424de8 dc9afe10 dc302800 dc46e910 80424e90 dc473c00 dc454f00 fe00: 000001b5 7f619d64 dcc7c830 00000000 00000000 dc9afe38 dc9afe68 00000000 fe20: 00000000 00000000 dc9afe28 dc9afe28 80424d80 00000000 00000035 9cac0034 fe40: 00000000 00000000 00000000 00000000 000001b5 00000000 00000000 00000000 fe60: dc9afe68 dc9afe10 3b9aca00 00000000 00000080 00000034 00000000 00000100 fe80: 00000000 00000000 dc9afe10 00000004 dc454a00 00000000 dc46e010 dc46e96c fea0: dc46e000 dc46e964 00200200 00100100 dc46e910 7f619ec0 00000600 80c0e770 fec0: dc15a900 dcc7c838 00000000 dc46e954 8042d434 dcc44680 dc46e954 dc004400 fee0: dc454500 00000000 00000000 dc9ae038 dc004400 8003c450 dcc44680 dc004414 ff00: dc46e954 dc454500 00000001 dcc44680 dc004414 dcc44698 dc9ae000 dc9ae030 ff20: 00000001 dc9ae000 dc004400 8003d158 8003d020 00000000 00000000 80c53941 ff40: dc9aff64 dcb71ea0 00000000 dcc44680 8003d020 00000000 00000000 00000000 ff60: 00000000 80042480 00000000 00000000 000000f8 dcc44680 00000000 00000000 ff80: dc9aff80 dc9aff80 00000000 00000000 dc9aff90 dc9aff90 dc9affac dcb71ea0 ffa0: 800423cc 00000000 00000000 8000e018 00000000 00000000 00000000 00000000 ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 ... ---[ end trace 0c038f0b8e0b67a3 ]--- The kernel panic is caused by the sg_buf is not set correctly with the following code when compiled with Yocto GCC 4.8.1: drivers/net/wireless/ath/ath6kl/hif.h: struct hif_scatter_req { struct list_head list; /* address for the read/write operation */ u32 addr; ... /* bounce buffer for upper layers to copy to/from */ u8 *virt_dma_buf; struct hif_scatter_item scat_list[1]; u32 scat_q_depth; }; (Note: the scat_req.scat_list[] will dynamiclly grow with run-time) drivers/net/wireless/ath/ath6kl/sdio.c: ath6kl_sdio_setup_scat_data(...) /* assemble SG list */ for (i = 0; i < scat_req->scat_entries; i++, sg++) { ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n", i, scat_req->scat_list[i].buf, scat_req->scat_list[i].len); sg_set_buf(sg, scat_req->scat_list[i].buf, scat_req->scat_list[i].len); } The GCC 4.8.1 compiler will not do the for-loop till scat_entries, instead, it only run one round loop. This may be caused by that the GCC 4.8.1 thought that the scat_list only have one item and then no need to do full iteration, but this is simply wrong by looking at the assebly code. This will cause the sg buffer not get set when scat_entries > 1 and thus lead to kernel panic. This patch is a workaround to the GCC 4.8.1 complier issue by passing the entry address of the scat_req->scat_list to the for-loop and interate it, then, GCC 4.8.1 will do the full for-loop correctly. (Note: This issue not observed with GCC 4.7.2, only found on the GCC 4.8.1) This patch does not change any function logic and no any performance downgrade. Signed-off-by: Jason Liu <r64343@freescale.com>
2013-11-08ENGR00286724-8 can: flexcan: add self wakeup supportDong Aisheng
If wakeup is enabled, enter stop mode, else enter disabled mode. Self wake can only work on stop mode. For imx6q, the stop request has to be mannually assert on IOMUX GPR13[28:29] register, we use syscon to control that bit. Signed-off-by: Dong Aisheng <b29396@freescale.com>
2013-11-08ENGR00286724-1 net: flexcan: using per clock for clock rate calculationDong Aisheng
The per clock is used for the output clock. Signed-off-by: Dong Aisheng <b29396@freescale.com>
2013-11-06ENGR00286416 net:fec: Pinctrl PM: add net device running status checkFugang Duan
In below case: ifconfig eth0 down echo mem > /sys/power/state After resume, fec pin status set to default, which is not expected and cost unnecessary power. So, add net device running status check before calling Pinctrl PM APIs. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-11-04ENGR00286017: net:fec: fix clock enable/disable usecount mismatchFugang Duan
Reproduce: 1. Boot up kernel with DHCP; 2. ifconfig eth0 down; 3. echo mem > /sys/power/state; There have clock enable/disable usecount mismatch warning dump. Fix this by checking device's netif_running state is up and then enable/disable clock. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00283540-02: net: fec: use pinctrl PM helpersFugang Duan
when system suspend, need to set pins to low power state to save IO power consumption, there are three states of pinctrl: "default", "idle" and "sleep". Currently enet supports default and sleep state. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Anson Huang <b20788@freescale.com>
2013-10-30ENGR00265935 net: fec: add pm_qos to avoid cpu enter to wait modeFugang Duan
Since imx6q/dl enet cannot wake up wait mode, which cause performance drops. Add pm_qos to request low cpu latency to avoid enter to wait mode. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00279948 net: fec: add clock control to save powerFugang Duan
- After probe, disable all clocks incluing ipg, ahb, enet_out, ptp clock. - Open ethx interface enable necessary clocks. Close ethx interface disable all clocks. - Correct the MDIO clock source. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00276335 net:fec: fix build warningFugang Duan
drivers/net/ethernet/freescale/fec_main.c:864 warning: 'vlan_tag' may be used uninitialized in this function note: 'vlan_tag' was declared here Compiler with the warning option: -Wuninitialized, the warning will be reported. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00275974-3 [iMX6x] Add busfreq support to the driversRanjani Vaidyanathan
Add request_bus_freq() and release_bus_freq() calls to the various drivers to ensure that the DDR and AHB are the requested frequency before the driver starts its task. Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2013-10-30ENGR00275619 net: fec: set reset phy gpio to high in .probe().Fugang Duan
In .probe() call fec_of_init() to parse phy reset gpio, and request the gpio for later use. For the init, we must set the gpio to high to let phy power on. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00275469 net:fec: move devm_* and of_* apis to probe functionFugang Duan
fec_reset_phy() function is called in fec_enet_open(). And fec_reset_phy() call of_get_named_gpio() and devm_gpio_request_one() apis, which makes no sense since the two apis do something that should only be done at .probe() time. So move two functions into fec_probe() and only leave gpio_set_value() and msleep() calls in fec_reset_phy(). And remove fec_free_reset_gpio() function. Signed-off-by: Fugang Duan <B38611@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org>
2013-10-30ENGR00275371 net: fec: PTP: Add ptp support for IXXAT stackLuwei Zhou
These patch add ptp support for IXXAT stack. Cherry picked from commit 1c8839574ac87826f53b96f987975a9bb1d72915. Signed-off-by: Luwei Zhou <B45643@freescale.com>
2013-10-30ENGR00275246-05: net: fec: add mac address init for imx25/imx53 fecFugang Duan
Add mac address init for imx25/imx53 fec in restart function. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30ENGR00275246-04: net: fec: fix phy reset operationFugang Duan
Current driver only do phy reset in probe function, which is not right. Since some phy clock is disabled after module probe, the phy enter abnormal status, which needs do reset to recovery the phy. And do ifconfig ethx up/down test, the phy also enter abnormal status. The log as: libphy: 2188000.ethernet:04 - Link is Up - 10/Full libphy: 2188000.ethernet:04 - Link is Up - 100/Full libphy: 2188000.ethernet:04 - Link is Down libphy: 2188000.ethernet:04 - Link is Up - 10/Half libphy: 2188000.ethernet:04 - Link is Up - 10/Full libphy: 2188000.ethernet:04 - Link is Up - 100/Full ... So, do phy reset if ethx up/down or do clock enable/disable operation. Signed-off-by: Fugang Duan <B38611@freescale.com>
2013-10-30net/fec: Don't let ndo_start_xmit return NETDEV_TX_BUSY without linkUwe Kleine-König
Don't test for having link and let hardware deal with this situation. Without this patch I see a machine running an -rt patched Linux being stuck in sch_direct_xmit when it looses link while there is still a packet to be sent. In this case the fec_enet_start_xmit routine returned NETDEV_TX_BUSY which makes the network stack reschedule the packet and so sch_direct_xmit calls fec_enet_start_xmit again. I failed to reproduce a complete hang without -rt, but I think the problem exists there, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: workaround stop tx during errata ERR006358Frank Li
If the ready bit in the transmit buffer descriptor (TxBD[R]) is previously detected as not set during a prior frame transmission, then the ENET_TDAR[TDAR] bit is cleared at a later time, even if additional TxBDs were added to the ring and the ENET_TDAR[TDAR] bit is set. This results in frames not being transmitted until there is a 0-to-1 transition on ENET_TDAR[TDAR]. Workarounds: code can use the transmit frame interrupt flag (ENET_EIR[TXF]) as a method to detect whether the ENET has completed transmission and the ENET_TDAR[TDAR] has been cleared. If ENET_TDAR[TDAR] is detected as cleared when packets are queued and waiting for transmit, then a write to the TDAR bit will restart TxBD processing. This case main happen when loading is light. A ethernet package may not send out utile next package put into tx queue. How to test: while [ true ] do ping <IP> -s 10000 -w 4 ping <IP> -s 6000 -w 2 ping <IP> -s 4000 -w 2 ping <IP> -s 10000 -w 2 done You will see below result in overnight test. 6008 bytes from 10.192.242.116: seq=1 ttl=128 time=0.722 ms 4008 bytes from 10.192.242.116: seq=0 ttl=128 time=1001.008 ms 4008 bytes from 10.192.242.116: seq=1 ttl=128 time=1.010 ms 10008 bytes from 10.192.242.116: seq=0 ttl=128 time=0.896 ms After apply this patch, >1000ms delay disappear. Signed-off-by: Frank Li <Frank.Li@freescale.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Add MODULE_ALIASFabio Estevam
Add MODULE_ALIAS, so that auto module loading can work. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: Add VLAN receive HW support.Jim Baxter
This enables the driver to take advantage of the FEC VLAN indicator to improve performance. Signed-off-by: Jim Baxter <jim_baxter@mentor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: Fix RMON registers on imx6Jim Baxter
commit 38ae92d "fec: Add support for reading RMON registers" causes the imx6Q to crash. This fixes it by only enabling the RMON registers, the registers are already cleared by the MAC being reset. Signed-off-by: Jim Baxter <jim_baxter@mentor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: Fix Transmitted bytes counterJim Baxter
The tx_bytes field was not being updated so the network card statistics showed 0.0B transmitted. Signed-off-by: Jim Baxter <jim_baxter@mentor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: Fix multicast list setup in fec_restart().Christoph Müllner
Setup the multicast list of the net_device instead of clearing it blindly. This restores the multicast groups in case of a link down/up event or when resuming from suspend. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Add support for reading RMON registersChris Healy
Add ethtool operation to read RMON registers. Tested against net-next on i.MX28. v2: make conditional on #ifndef CONFIG_M5272 Signed-off-by: Chris Healy <cphealy@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Add support to restart autonegotiateChris Healy
Add ethtool operation to restart autonegotiation via the PHY. Tested on i.MX28EVK. Signed-off-by: Chris Healy <cphealy@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: fec: Convert to use devm_ioremap_resourceTushar Behera
Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). Signed-off-by: Tushar Behera <tushar.behera@linaro.org> CC: netdev@vger.kernel.org CC: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Only pass pdev in fec_ptp_init()Fabio Estevam
Passing pdev in fec_ptp_init() is enough, since we can get ndev locally. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30net: ethernet: remove unnecessary platform_set_drvdata()Jingoo Han
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Roland Stigge <stigge@antcom.de> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Tested-by: Roland Stigge <stigge@antcom.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Handle the regulator in suspend/resumeFabio Estevam
In order to save power, let's disable the regulator in the suspend function and enable it in resume. Tested on a mx28evk board. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Remove irqs firstFabio Estevam
During probe the clocks are enabled prior than the acquiring the interrupts. In the remove function we need to do the opposite: first remove the interrupts and then disable the clocks. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Disable the PHY regulator on error and removalFabio Estevam
In the case of error during probe, disable the PHY regulator. Do the same in fec_drv_remove(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Invert the order of error path sequenceFabio Estevam
Currently when fec_enet_init fails it jumps to 'failed_init' error path, which will attemp to free the interrupts. This is wrong because at this point the interrupts have not even been acquired. Swap failed_init/failed_irq to fix the error path. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Place the phy regulator in the private structureFabio Estevam
Instead of using a local reg_phy structure, let's put it inside the private structure, so that we are able to have access to the regulator structure even when we are outside fec_probe(). This is in preparation for controlling the FEC PHY regulator in the suspend and resume functions. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Use DIV_ROUND_UP macroFabio Estevam
Use the standard DIV_ROUND_UP macro in order to provide better readability. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-30fec: Let device core handle pinctrlFabio Estevam
Since commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl, so remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-10-13net: qmi_wwan: add new Qualcomm devicesBjørn Mork
commit 0470667caa8261beb8a9141102b04a5357dd45b5 upstream. Adding the device list from the Windows driver description files included with a new Qualcomm MDM9615 based device, "Alcatel-sbell ASB TL131 TDD LTE", from China Mobile. This device is tested and verified to work. The others are assumed to work based on using the same Windows driver. Many of these devices support multiple QMI/wwan ports, requiring multiple interface matching entries. All devices are composite, providing a mix of one or more serial, storage or Android Debug Brigde functions in addition to the wwan function. This device list included an update of one previously known device, which was incorrectly assumed to have a Gobi 2K layout. This is corrected. Reported-by: 王康 <scateu@gmail.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13p54usb: add USB ID for Corega WLUSB2GTST USB adapterChristian Lamparter
commit 1e43692cdb7cc445d6347d8a5207d9cef0c71434 upstream. Added USB ID for Corega WLUSB2GTST USB adapter. Reported-by: Joerg Kalisch <the_force@gmx.de> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13rtlwifi: Align private space in rtl_priv structLarry Finger
commit 60ce314d1750fef843e9db70050e09e49f838b69 upstream. The private array at the end of the rtl_priv struct is not aligned. On ARM architecture, this causes an alignment trap and is fixed by aligning that array with __align(sizeof(void *)). That should properly align that space according to the requirements of all architectures. Reported-by: Jason Andrews <jasona@cadence.com> Tested-by: Jason Andrews <jasona@cadence.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13mwifiex: fix PCIe hs_cfg cancel cmd timeoutBing Zhao
commit b7be1522def9a9988b67afd0be999c50a96394b5 upstream. For pcie8897, the hs_cfg cancel command (0xe5) times out when host comes out of suspend. This is caused by an incompleted host sleep handshake between driver and firmware. Like SDIO interface, PCIe also needs to go through firmware power save events to complete the handshake for host sleep configuration. Only USB interface doesn't require power save events for hs_cfg. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13mwifiex: fix hang issue for USB chipsetsAmitkumar Karwar
commit bd1c6142edce787b8ac1be15635f845aa9905333 upstream. Bug 60815 - Interface hangs in mwifiex_usb https://bugzilla.kernel.org/show_bug.cgi?id=60815 We have 4 bytes of interface header for packets delivered to SDIO and PCIe, but not for USB interface. In Tx AMSDU case, currently 4 bytes of garbage data is unnecessarily appended for USB packets. This sometimes leads to a firmware hang, because it may not interpret the data packet correctly. Problem is fixed by removing this redundant headroom for USB. Tested-by: Dmitry Khromov <icechrome@gmail.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13mwifiex: fix NULL pointer dereference in usb suspend handlerBing Zhao
commit 346ece0b7ba2730b4d633b9e371fe55488803102 upstream. Bug 60815 - Interface hangs in mwifiex_usb https://bugzilla.kernel.org/show_bug.cgi?id=60815 [ 2.883807] BUG: unable to handle kernel NULL pointer dereference at 0000000000000048 [ 2.883813] IP: [<ffffffff815a65e0>] pfifo_fast_enqueue+0x90/0x90 [ 2.883834] CPU: 1 PID: 3220 Comm: kworker/u8:90 Not tainted 3.11.1-monotone-l0 #6 [ 2.883834] Hardware name: Microsoft Corporation Surface with Windows 8 Pro/Surface with Windows 8 Pro, BIOS 1.03.0450 03/29/2013 On Surface Pro, suspend to ram gives a NULL pointer dereference in pfifo_fast_enqueue(). The stack trace reveals that the offending call is clearing carrier in mwifiex_usb suspend handler. Since commit 1499d9f "mwifiex: don't drop carrier flag over suspend" has removed the carrier flag handling over suspend/resume in SDIO and PCIe drivers, I'm removing it in USB driver too. This also fixes the bug for Surface Pro. Tested-by: Dmitry Khromov <icechrome@gmail.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13brcmfmac: obtain platform data upon module initializationArend van Spriel
commit db4efbbeb457b6f9f4d8c4b090d1170d12f026e1 upstream. The driver uses platform_driver_probe() to obtain platform data if any. However, that function is placed in the .init section so it must be called upon driver module initialization. The problem was reported by Fenguang Wu resulting in a kernel oops because the .init section was already freed. [ 48.966342] Switched to clocksource tsc [ 48.970002] kernel tried to execute NX-protected page - exploit attempt? (uid: 0) [ 48.970851] BUG: unable to handle kernel paging request at ffffffff82196446 [ 48.970957] IP: [<ffffffff82196446>] classes_init+0x26/0x26 [ 48.970957] PGD 1e76067 PUD 1e77063 PMD f388063 PTE 8000000002196163 [ 48.970957] Oops: 0011 [#1] [ 48.970957] CPU: 0 PID: 17 Comm: kworker/0:1 Not tainted 3.11.0-rc7-00444-gc52dd7f #23 [ 48.970957] Workqueue: events brcmf_driver_init [ 48.970957] task: ffff8800001d2000 ti: ffff8800001d4000 task.ti: ffff8800001d4000 [ 48.970957] RIP: 0010:[<ffffffff82196446>] [<ffffffff82196446>] classes_init+0x26/0x26 [ 48.970957] RSP: 0000:ffff8800001d5d40 EFLAGS: 00000286 [ 48.970957] RAX: 0000000000000001 RBX: ffffffff820c5620 RCX: 0000000000000000 [ 48.970957] RDX: 0000000000000001 RSI: ffffffff816f7380 RDI: ffffffff820c56c0 [ 48.970957] RBP: ffff8800001d5d50 R08: ffff8800001d2508 R09: 0000000000000002 [ 48.970957] R10: 0000000000000000 R11: 0001f7ce298c5620 R12: ffff8800001c76b0 [ 48.970957] R13: ffffffff81e91d40 R14: 0000000000000000 R15: ffff88000e0ce300 [ 48.970957] FS: 0000000000000000(0000) GS:ffffffff81e84000(0000) knlGS:0000000000000000 [ 48.970957] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 48.970957] CR2: ffffffff82196446 CR3: 0000000001e75000 CR4: 00000000000006b0 [ 48.970957] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 48.970957] DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000 [ 48.970957] Stack: [ 48.970957] ffffffff816f7df8 ffffffff820c5620 ffff8800001d5d60 ffffffff816eeec9 [ 48.970957] ffff8800001d5de0 ffffffff81073dc5 ffffffff81073d68 ffff8800001d5db8 [ 48.970957] 0000000000000086 ffffffff820c5620 ffffffff824f7fd0 0000000000000000 [ 48.970957] Call Trace: [ 48.970957] [<ffffffff816f7df8>] ? brcmf_sdio_init+0x18/0x70 [ 48.970957] [<ffffffff816eeec9>] brcmf_driver_init+0x9/0x10 [ 48.970957] [<ffffffff81073dc5>] process_one_work+0x1d5/0x480 [ 48.970957] [<ffffffff81073d68>] ? process_one_work+0x178/0x480 [ 48.970957] [<ffffffff81074188>] worker_thread+0x118/0x3a0 [ 48.970957] [<ffffffff81074070>] ? process_one_work+0x480/0x480 [ 48.970957] [<ffffffff8107aa17>] kthread+0xe7/0xf0 [ 48.970957] [<ffffffff810829f7>] ? finish_task_switch.constprop.57+0x37/0xd0 [ 48.970957] [<ffffffff8107a930>] ? __kthread_parkme+0x80/0x80 [ 48.970957] [<ffffffff81a6923a>] ret_from_fork+0x7a/0xb0 [ 48.970957] [<ffffffff8107a930>] ? __kthread_parkme+0x80/0x80 [ 48.970957] Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc <cc> cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc [ 48.970957] RIP [<ffffffff82196446>] classes_init+0x26/0x26 [ 48.970957] RSP <ffff8800001d5d40> [ 48.970957] CR2: ffffffff82196446 [ 48.970957] ---[ end trace 62980817cd525f14 ]--- Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Tested-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13ll_temac: Reset dma descriptors indexes on ndo_openRicardo Ribalda
[ Upstream commit 7167cf0e8cd10287b7912b9ffcccd9616f382922 ] The dma descriptors indexes are only initialized on the probe function. If a packet is on the buffer when temac_stop is called, the dma descriptors indexes can be left on a incorrect state where no other package can be sent. So an interface could be left in an usable state after ifdow/ifup. This patch makes sure that the descriptors indexes are in a proper status when the device is open. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13bonding: Fix broken promiscuity reference counting issueNeil Horman
[ Upstream commit 5a0068deb611109c5ba77358be533f763f395ee4 ] Recently grabbed this report: https://bugzilla.redhat.com/show_bug.cgi?id=1005567 Of an issue in which the bonding driver, with an attached vlan encountered the following errors when bond0 was taken down and back up: dummy1: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken. The error occurs because, during __bond_release_one, if we release our last slave, we take on a random mac address and issue a NETDEV_CHANGEADDR notification. With an attached vlan, the vlan may see that the vlan and bond mac address were in sync, but no longer are. This triggers a call to dev_uc_add and dev_set_rx_mode, which enables IFF_PROMISC on the bond device. Then, when we complete __bond_release_one, we use the current state of the bond flags to determine if we should decrement the promiscuity of the releasing slave. But since the bond changed promiscuity state during the release operation, we incorrectly decrement the slave promisc count when it wasn't in promiscuous mode to begin with, causing the above error Fix is pretty simple, just cache the bonding flags at the start of the function and use those when determining the need to set promiscuity. This is also needed for the ALLMULTI flag Reported-by: Mark Wu <wudxw@linux.vnet.ibm.com> CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Mark Wu <wudxw@linux.vnet.ibm.com> CC: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13dm9601: fix IFF_ALLMULTI handlingPeter Korsgaard
[ Upstream commit bf0ea6380724beb64f27a722dfc4b0edabff816e ] Pass-all-multicast is controlled by bit 3 in RX control, not bit 2 (pass undersized frames). Reported-by: Joseph Chang <joseph_chang@davicom.com.tw> Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>