summaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)Author
2016-06-24MLK-12706-2 net: bcmdhd: set the bcmdhd driver default build inHaibo Chen
Bcmdhd wifi driver default build as module, now default build in this wifi driver. To support this build in feature, this patch add flag ENABLE_INSMOD_NO_FW_LOAD, and use extern function sdio_reset_comm() as instead. Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2016-03-09MLK-12496 bcmdhd: update driver to Broadcom official released version 141.88Dong Aisheng
Some major fixes delivered by Broadcom. 1. Initialize nd_config parameter of cfg80211_wowlan to NULL 2. Avoid using hardcoded dummy channel number while creating p2p interface 3. Avoid creation of multiple instance of wl_event_handler thread. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit 934f70e3af6af4e887a2c3027e19db2122efd1cb)
2016-03-04MLK-12478-1 can: flexcan: add LPSR mode supportDong Aisheng
For MX7D LPSR mode, the controller will lost power and got the configuration state lost after system resume back. So we need to set pinctrl state again and re-start chip to do re-configuration after resume. For wakeup case, we also need re-configure the chip in case the state got lost. For interface is not up before suspend case, we don't need re-configure as it will be configured by user later by interface up. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit c26587d5ba9e30fce318c2fea516e9e4a6bde9ca)
2016-02-19net: fec: fix fec_enet_get_free_txdesc_numTroy Kisky
When first initialized, cur_tx points to the 1st entry in the queue, and dirty_tx points to the last. At this point, fec_enet_get_free_txdesc_num will return tx_ring_size -2. If tx_ring_size -2 entries are now queued, then fec_enet_get_free_txdesc_num should return 0, but it returns tx_ring_size instead. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-19net: fec: fix rx error countsTroy Kisky
On an overrun, the other flags are not valid, so don't check them. Also, don't pass bad frames up the stack. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-19net: fec: stop the "rcv is not +last, " error messagesTroy Kisky
Setting the FTRL register will stop the fec from trying to use multiple receive buffers. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-19MLK-11051 net: phy: mdio_bus: don't call .phy_suspendi() when netdev is NULLFugang Duan
In .mdio_bus_phy_may_suspend(), there check netdev is NULL to judge to set phy to suspend status. netdev is NULL has three cases: - phy is not found - phy is found, match to general phy driver - phy is found, match to specifical phy driver Case 1: phy is not found, cannot communicate by MDIO bus. Case 2: phy is found: if phy dev driver probe/bind err, netdev is not __open__ status, mdio bus is unregistered. if phy is detached, phy had entered suspended status. Case 3: phy is found, phy is detached, phy had entered suspended status. So, in here, it shouldn't set phy to suspend by calling mdio bus. In i.MX6UL evk/arm2 board, if down the ethx interface and do suspend/resume, system will hang. Because after ethx down all clocks are gated off, for general phy driver, unbind the phy device, for specifical phy driver, no unbind the device, and the original driver call mdio bus to set phy to suspend during system suspend, so system will hang since there have mdio register access. The patch can fix it. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked and merged from commit: ccbbf6172860e310858169a4e551ebf072c2f1a5) Conflicts: drivers/net/phy/mdio_bus.c
2016-02-16MLK-12077-3 bcmdhd: fix bcmdhd system resume crash issue.Dong Aisheng
bcmdhd can't support removing host during suspend and driver crash when detect card after resume due to no response to CMD7. It looks bcmdhd has a special requirement to enumerate card by itself which is incompatible with current MMC core. So implement post-cd feature to allow driver to detect card as it wants, then we add back non-removable capability to avoid MMC core to redetect card after resume. root@imx6qdlsolo:~# echo standby > /sys/power/state PM: Syncing filesystems ... done. PM: Preparing system for standby sleep Freezing user space processes ... (elapsed 0.001 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. PM: Entering standby sleep evbug: Event. Dev: input3, Type: 0, Code: 0, Value: 1 evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 1 PM: suspend of devices complete after 652.363 msecs PM: suspend devices took 0.660 seconds PM: late suspend of devices complete after 1.148 msecs PM: noirq suspend of devices complete after 1.043 msecs Disabling non-boot CPUs ... CPU1: shutdown Enabling non-boot CPUs ... CPU1 is up PM: noirq resume of devices complete after 0.534 msecs PM: early resume of devices complete after 0.553 msecs evbug: Event. Dev: input2, Type: 1, Code: 116, Value: 1 evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 0 evbug: Event. Dev: input2, Type: 1, Code: 116, Value: 0 evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 0 mmc1: error -110 during resume (card was removed?) PM: resume of devices complete after 605.525 msecs PM: resume devices took 0.610 seconds PM: Finishing wakeup. Restarting tasks ... done. WARNING: driver bcmsdh_sdmmc did not remove its interrupt handler! root@imx6qdlsolo:~# Unable to handle kernel NULL pointer dereference at virtual address 0000022c pgd = 80004000 [0000022c] *pgd=00000000 Internal error: Oops: 17 [#1] PREEMPT SMP ARM Modules linked in: bcmdhd evbug ov5647_camera_mipi mxc_mipi_csi mx6s_capture CPU: 1 PID: 780 Comm: kworker/u4:4 Not tainted 4.1.15-01434-g70f4b36 #1310 Hardware name: Freescale i.MX7 Dual (Device Tree) Workqueue: kmmcd mmc_rescan task: a974af80 ti: a846e000 task.ti: a846e000 PC is at _raw_spin_lock_irqsave+0x1c/0x5c LR is at get_parent_ip+0x10/0x2c pc : [<8077b9d4>] lr : [<8005207c>] psr: 60050093 sp : a846fc20 ip : 0001001f fp : a800b000 r10: 00000000 r9 : 00000001 r8 : 0000022c r7 : 00000002 r6 : 0000022c r5 : a0050013 r4 : 0000022c r3 : a974af80 r2 : 00000001 r1 : a846fc44 r0 : 00000000 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: a951406a DAC: 00000015 Process kworker/u4:4 (pid: 780, stack limit = 0xa846e210) Stack: (0xa846fc20 to 0xa8470000) fc20: 00000000 a846fc50 a846fc44 80061808 00000000 000001dc 00000000 805037fc fc40: 8d89d5ec 00000000 a974af80 80053e88 00000000 00000000 ab7293c0 00000000 fc60: 7f09c828 000000c9 7f09c828 a916a804 00000001 0001001f a800b000 7f0698a4 fc80: a974afc8 00000001 00000000 00000000 00012ebc a974af80 00000001 80ad46c0 fca0: a974af80 00000000 a8eeccc0 00000001 0001001f a846fd04 00000000 7f099440 fcc0: a800b000 7f0699c4 a846fcdf 00000000 00000001 7f068834 a937c900 0105c688 fce0: a846fd04 a8e20000 00000000 00000001 00000000 7f071f08 a846fd04 a80a0000 fd00: ffffffff 00000000 ffffffff a8e20000 a8e20000 00000000 7f099440 00000000 fd20: 00000000 7f099440 a800b000 7f072f4c a974af80 00000000 00000000 80778564 fd40: a846fd54 a9346550 80330028 00000001 a846e000 a8e20000 7f099440 00000000 fd60: 18005000 a8eeccc0 00000000 7f099440 a800b000 7f073744 a846fd8c 80052130 fd80: a9273898 00000000 a800b000 a8e20000 7f099440 00000001 a8eec200 a9270000 fda0: 00000000 7f099440 a800b000 7f07cd3c 80b81100 8040003f a800b000 00000000 fdc0: 00000000 a8e20000 7f099440 a9270000 a9273000 a9270000 00000000 7f099440 fde0: a800b000 7f02df4c 00000001 a8e20000 7f099440 a8eec200 00000000 a916e008 fe00: 00000000 a90bfb00 a800b000 7f074cbc a9270000 7f099440 a8e20000 00000000 fe20: a8f81610 7f0765ec 7f0765b0 a8eeccc0 a855df40 7f069310 a916a800 a8eec200 fe40: 7f09b414 7f06a950 7f06a908 a8f81608 a8f81600 8050e8b8 a8f81608 7f09b414 fe60: 80b22c70 80379744 a974af80 a8f8163c a8f81608 803797d4 00000005 a81ce930 fe80: a8f81608 8037923c a8f81608 a8f81608 80b93cf4 80376504 a846fea0 800e0e3c fea0: 00000000 00000000 a8f81608 000000bd a833f000 00000000 00000000 8050ed04 fec0: 00000001 8050dd8c 400f8c0f a833f000 ffffff92 a833f000 a81ce600 8050de30 fee0: 8050ddbc a833f240 a833f1dc 80506048 a90bfb00 a833f240 a800b000 a81ce600 ff00: 00000000 800462f0 a81ce600 80043c94 00000000 a800b000 a90bfb18 a800b014 ff20: a846e000 00000088 80b39379 a90bfb00 a800b000 8004654c 80ad4100 a800b164 ff40: a90bfb00 00000000 a84856c0 a90bfb00 80046500 00000000 00000000 00000000 ff60: 00000000 8004b1e8 2df9acc7 00000000 b5f3ff89 a90bfb00 00000000 00000000 ff80: a846ff80 a846ff80 00000000 00000000 a846ff90 a846ff90 a846ffac a84856c0 ffa0: 8004b10c 00000000 00000000 8000f568 00000000 00000000 00000000 00000000 ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 ecd61557 f82769f5 [<8077b9d4>] (_raw_spin_lock_irqsave) from [<80061808>] (add_wait_queue+0x20/0x48) [<80061808>] (add_wait_queue) from [<805037fc>] (__mmc_claim_host+0x58/0x1b0) [<805037fc>] (__mmc_claim_host) from [<7f0698a4>] (sdioh_request_byte+0x1cc/0x2a4 [bcmdhd]) [<7f0698a4>] (sdioh_request_byte [bcmdhd]) from [<7f0699c4>] (sdioh_cfg_write+0x20/0x28 [bcmdhd]) [<7f0699c4>] (sdioh_cfg_write [bcmdhd]) from [<7f068834>] (bcmsdh_cfg_write+0x90/0xdc [bcmdhd]) [<7f068834>] (bcmsdh_cfg_write [bcmdhd]) from [<7f071f08>] (dhdsdio_clk_kso_enab+0x38/0x168 [bcmdhd]) [<7f071f08>] (dhdsdio_clk_kso_enab [bcmdhd]) from [<7f072f4c>] (dhdsdio_clk_devsleep_iovar+0xf4/0x5f4 [bcmdhd]) [<7f072f4c>] (dhdsdio_clk_devsleep_iovar [bcmdhd]) from [<7f073744>] (dhdsdio_bussleep+0x2f8/0x4dc [bcmdhd]) [<7f073744>] (dhdsdio_bussleep [bcmdhd]) from [<7f07cd3c>] (dhd_bus_stop+0x2e8/0x3f0 [bcmdhd]) [<7f07cd3c>] (dhd_bus_stop [bcmdhd]) from [<7f02df4c>] (dhd_detach+0x2a4/0x438 [bcmdhd]) [<7f02df4c>] (dhd_detach [bcmdhd]) from [<7f074cbc>] (dhdsdio_release+0x4c/0x1dc [bcmdhd]) [<7f074cbc>] (dhdsdio_release [bcmdhd]) from [<7f0765ec>] (dhdsdio_disconnect+0x3c/0xa0 [bcmdhd]) [<7f0765ec>] (dhdsdio_disconnect [bcmdhd]) from [<7f069310>] (bcmsdh_remove+0x3c/0x60 [bcmdhd]) [<7f069310>] (bcmsdh_remove [bcmdhd]) from [<7f06a950>] (bcmsdh_sdmmc_remove+0x48/0x60 [bcmdhd]) [<7f06a950>] (bcmsdh_sdmmc_remove [bcmdhd]) from [<8050e8b8>] (sdio_bus_remove+0x30/0xf8) [<8050e8b8>] (sdio_bus_remove) from [<80379744>] (__device_release_driver+0x70/0xe4) [<80379744>] (__device_release_driver) from [<803797d4>] (device_release_driver+0x1c/0x28) [<803797d4>] (device_release_driver) from [<8037923c>] (bus_remove_device+0xd8/0x104) [<8037923c>] (bus_remove_device) from [<80376504>] (device_del+0x10c/0x210) [<80376504>] (device_del) from [<8050ed04>] (sdio_remove_func+0x1c/0x28) [<8050ed04>] (sdio_remove_func) from [<8050dd8c>] (mmc_sdio_remove+0x40/0x70) [<8050dd8c>] (mmc_sdio_remove) from [<8050de30>] (mmc_sdio_detect+0x74/0x100) [<8050de30>] (mmc_sdio_detect) from [<80506048>] (mmc_rescan+0xb8/0x314) [<80506048>] (mmc_rescan) from [<800462f0>] (process_one_work+0x120/0x330) [<800462f0>] (process_one_work) from [<8004654c>] (worker_thread+0x4c/0x480) [<8004654c>] (worker_thread) from [<8004b1e8>] (kthread+0xdc/0xf4) [<8004b1e8>] (kthread) from [<8000f568>] (ret_from_fork+0x14/0x2c) Code: f10c0080 e3a00001 ebe359b1 f594f000 (e1943f9f) Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit 8f998ca4d07aa93460ac7769c1f2b3be0c36fc78)
2016-02-16MLK-12077-2 bcmdhd: fix module re-load crash issueDong Aisheng
Fix the following crash during module removing. root@imx6qdlsolo:~# modprobe -r bcmdhd dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3271, ampdu_hostreorder get failed Err = -1 dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3294 failed to enable/disable bdcv2 tlv signaling Err = -1 dhd_detach(): thread:dhd_watchdog_thread:34f terminated OK dhd_dpc_thread: Unexpected up_cnt 0 dhd_detach(): thread:dhd_dpc:350 terminated OK CFG80211-ERROR) wl_event_handler : was terminated wl_destroy_event_handler(): thread:wl_event_handler:34e terminated OK ------------[ cut here ]------------ Kernel BUG at 800e0f40 [verbose debug info unavailable] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM Modules linked in: bcmdhd(-) evbug ov5647_camera_mipi mxc_mipi_csi mx6s_capture [last unloaded: bcmdhd] CPU: 0 PID: 854 Comm: modprobe Not tainted 4.1.15-01434-g70f4b36 #1311 Hardware name: Freescale i.MX7 Dual (Device Tree) task: a97fc4c0 ti: a912e000 task.ti: a912e000 PC is at kfree+0x188/0x18c LR is at wiphy_unregister+0x17c/0x204 pc : [<800e0f40>] lr : [<80712184>] psr: 400d0013 sp : a912fe30 ip : 00080353 fp : a8647970 r10: 7f219440 r9 : a9420140 r8 : ac75fa60 r7 : a9420000 r6 : 00000000 r5 : 00000000 r4 : a9420140 r3 : 00000000 r2 : 00000000 r1 : 07ffffff r0 : 00353443 Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: a940c06a DAC: 00000015 Process modprobe (pid: 854, stack limit = 0xa912e210) Stack: (0xa912fe30 to 0xa9130000) fe20: 7f219440 a9420140 00000000 00000000 fe40: a9420000 a94203a0 a9420140 7f219440 a8647970 80712184 00000000 7f219440 fe60: a8647970 805e1994 7f21d5d8 a8500000 a8574840 a94203a0 00000000 a8647000 fe80: a94203a0 7f1cb9ec 00000000 00000000 a8644000 a8647000 a8644000 7f21d5d8 fea0: 7f219440 7f1adf28 00000001 a956d000 7f219440 a9770440 00000000 8000f644 fec0: a912e000 00000000 002691a0 7f1f4cbc a8644000 7f219440 a956d000 00000000 fee0: 00000081 7f1f65ec 7f1f65b0 a9770b40 a9770b00 7f1e9310 a96f6000 a9770440 ff00: 7f21b414 7f1ea950 7f1ea908 a8fdba08 a8fdba00 8050ee74 a8fdba08 7f21b414 ff20: a8fdba3c 80379744 7f21b414 a8fdba08 7f21b414 80379ed4 7f21b414 002691dc ff40: 002691a0 803794a4 7f21b478 7f1ff6bc 7f1ff690 8008fec0 00000000 646d6362 ff60: c0006468 00000000 a97fc8b8 00000000 a97fc8b8 00000000 80b41528 a97fc4c0 ff80: 002691a0 80049c60 a8576540 a912e000 8000f644 0012ffb0 00000006 002691a0 ffa0: 002691dc 8000f4c0 002691a0 002691dc 002691dc 00000800 76e72f78 00000000 ffc0: 002691a0 002691dc 002691a0 00000081 00000001 00000000 00000001 002691a0 ffe0: 76e388a0 7ec089f4 0001f008 76e388ac 600d0010 002691dc 00656e6f 635f6c77 [<800e0f40>] (kfree) from [<80712184>] (wiphy_unregister+0x17c/0x204) [<80712184>] (wiphy_unregister) from [<7f1cb9ec>] (wl_free_wdev+0x40/0x148 [bcmdhd]) [<7f1cb9ec>] (wl_free_wdev [bcmdhd]) from [<7f1adf28>] (dhd_detach+0x280/0x438 [bcmdhd]) [<7f1adf28>] (dhd_detach [bcmdhd]) from [<7f1f4cbc>] (dhdsdio_release+0x4c/0x1dc [bcmdhd]) [<7f1f4cbc>] (dhdsdio_release [bcmdhd]) from [<7f1f65ec>] (dhdsdio_disconnect+0x3c/0xa0 [bcmdhd]) [<7f1f65ec>] (dhdsdio_disconnect [bcmdhd]) from [<7f1e9310>] (bcmsdh_remove+0x3c/0x60 [bcmdhd]) [<7f1e9310>] (bcmsdh_remove [bcmdhd]) from [<7f1ea950>] (bcmsdh_sdmmc_remove+0x48/0x60 [bcmdhd]) [<7f1ea950>] (bcmsdh_sdmmc_remove [bcmdhd]) from [<8050ee74>] (sdio_bus_remove+0x30/0xf8) [<8050ee74>] (sdio_bus_remove) from [<80379744>] (__device_release_driver+0x70/0xe4) [<80379744>] (__device_release_driver) from [<80379ed4>] (driver_detach+0xac/0xb0) [<80379ed4>] (driver_detach) from [<803794a4>] (bus_remove_driver+0x4c/0xa0) [<803794a4>] (bus_remove_driver) from [<7f1ff6bc>] (dhd_module_cleanup+0x2c/0x3c [bcmdhd]) [<7f1ff6bc>] (dhd_module_cleanup [bcmdhd]) from [<8008fec0>] (SyS_delete_module+0x174/0x1b8) [<8008fec0>] (SyS_delete_module) from [<8000f4c0>] (ret_fast_syscall+0x0/0x3c) Code: e1a03007 e28dd004 e8bd4ff0 eafffd59 (e7f001f2) ---[ end trace 49de84cadd3d030b ]--- Segmentation fault root@imx6qdlsolo:~# Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit ae2685263abef87f6be50e62c9422500a8af2e45)
2016-02-16MLK-12077-1 bcmdhd: add Broadcom bcmdhd engineering release for 4.1 kernelDong Aisheng
Broadcom bcmdhd engineering release for 4.1 kernel Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit 3db5d6ddb1201ab31f63994a1027a4915419783e)
2016-01-20MLK-12254 bcmdhd: fix warning when connect adhoc networkDong Aisheng
When connect adhoc network, we got below warning, it's caused by network stack changes during kernel upgrade. root@imx6qdlsolo:/mnt/nfs/vte_mx63# iw wlan0 ibss join TestAdhoc1 2412 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 1251 at /home/bamboo/build/4.1.X-1.0.0_ga/fsl-imx-fb/temp_build_dir/build_fsl-imx-fb/tmp/work-shared/imx6qdlsolo/kernel-source/net/wireless/ibss.c:67 wl_notify_connect_status+0x7b0/0x10f0 [bcmdhd]() root@imx6qdlsolo:/mnt/nfs/vte_mx6Modules linked in:3# bcmdhd ov5642_camera ov5640_camera_mipi_int ov5640_camera_int mxc_dcic galcore(O) mxc_v4l2_capture ipu_bg_overlay_sdc ipu_still v4l2_int_device ipu_prp_enc ipu_csi_enc ipu_fg_overlay_sdc evbug CPU: 1 PID: 1251 Comm: wl_event_handle Tainted: G O 4.1.8-1.0.0+g87e6c2f #1 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [<80015d84>] (unwind_backtrace) from [<80012728>] (show_stack+0x10/0x14) [<80012728>] (show_stack) from [<80750a54>] (dump_stack+0x84/0xc4) [<80750a54>] (dump_stack) from [<80032f3c>] (warn_slowpath_common+0x80/0xb0) [<80032f3c>] (warn_slowpath_common) from [<80033008>] (warn_slowpath_null+0x1c/0x24) [<80033008>] (warn_slowpath_null) from [<7f100060>] (wl_notify_connect_status+0x7b0/0x10f0 [bcmdhd]) [<7f100060>] (wl_notify_connect_status [bcmdhd]) from [<7f0f05bc>] (wl_event_handler+0x198/0x26c [bcmdhd]) [<7f0f05bc>] (wl_event_handler [bcmdhd]) from [<8004b588>] (kthread+0xdc/0xf4) [<8004b588>] (kthread) from [<8000f528>] (ret_from_fork+0x14/0x2c) ---[ end trace 40b45ccda84900ce ]--- Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2016-01-14MLK-12180 net: fec: add return value check after calling .of_property_read_u32()Fugang Duan
Add return value check after calling .of_property_read_u32() to avoid the warning reported by coverity. Signed-off-by: Fugang Duan <B38611@freescale.com>
2016-01-14net: fec: fix the race between xmit and bdp reclaiming pathKevin Hao
When we transmit a fragmented skb, we may run into a race like the following scenario (assume txq->cur_tx is next to txq->dirty_tx): cpu 0 cpu 1 fec_enet_txq_submit_skb reserve a bdp for the first fragment fec_enet_txq_submit_frag_skb update the bdp for the other fragment update txq->cur_tx fec_enet_tx_queue bdp = fec_enet_get_nextdesc(txq->dirty_tx, fep, queue_id); This bdp is the bdp reserved for the first segment. Given that this bdp BD_ENET_TX_READY bit is not set and txq->cur_tx is already pointed to a bdp beyond this one. We think this is a completed bdp and try to reclaim it. update the bdp for the first segment update txq->cur_tx So we shouldn't update the txq->cur_tx until all the update to the bdps used for fragments are performed. Also add the corresponding memory barrier to guarantee that the update to the bdps, dirty_tx and cur_tx performed in the proper order. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-14MLK-12160 net: fec: disable all irqs during normal suspendFugang Duan
During normal suspend process, disable all irqs to avoid the late TXF interrupt comming after clocks disabled that accessing registers cause system hang. Signed-off-by: Fugang Duan <B38611@freescale.com>
2016-01-14MLK-12064 can: flexcan: fix timeout when set small bitrateDong Aisheng
Current we can meet timeout issue when setting a small bitrate like 10000 as follows: root@imx6qdlsolo:~# ip link set can0 up type can bitrate 10000 A link change request failed with some changes committed already. Interface can0 may have been left with an inconsistent configuration, please check. RTNETLINK answers: Connection timed out It is caused by calling of flexcan_chip_unfreeze() timeout. Originally the code is using usleep_range(10, 20) for unfreeze operation, but the patch (8badd65 can: flexcan: avoid calling usleep_range from interrupt context) changed it into udelay(10) which is only a half delay of before, there're also some other delay changes. After only changed unfreeze delay back to udelay(20), the issue is gone. So other timeout values are kept the same as 8badd65 changed. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2016-01-14MA-7253 bcmdhd: avoid null interface before update tx statusHaoran Wang
Avoid to access the null interface before update tx status. This patch workaround to fix the panic when the p2p connection disconnect in the p2p stress test. The interface will be released during the disconnect process. Fixed coding style issue by Aisheng. Acked-by: Dong Aisheng <aisheng.dong@freescale.com> Signed-off-by: Haoran Wang <b50027@freescale.com> (cherry picked from commit 4e093820e74a83d86f3bb0dadc1054e3ddb8248c)
2016-01-14MLK-11794 bcmdhd: prevent driver to use scatter list DMA if host not supportDong Aisheng
Current driver will meet the following warning on MX6SL platform which does not support ADMA. It is caused by the driver is using fixed scatter gather DMA not matter whether the host supports or not. Then the host without ADMA capability will warning if found the DMA sg_count is non-1. Change the driver a bit to avoid multi DMA scatter list if found the host->max_segs is only 1 to fix the issue. root@imx6slevk:~# udhcpc -i wlan0 udhcpc (v1.23.1) started Sending discover... Sending select for 192.168.1.11... Lease of 192.168.1.11 obtained, lease time 86400 /etc/udhcpc.d/50default: Adding DNS 192.168.1.1 root@imx6slevk:~# ------------[ cut here ]------------ WARNING: CPU: 0 PID: 954 at /home/jenkins/jobs/Standalone-X11_with_mfgtools/workspace/temp_build_dir/build_fsl-imx-internal-x11/tmp/work-shared/imx6slevk/kernel-source/drivers/mmc/host/sdhci.c:839 sdhci_send_command+0xc64/0xd10() Modules linked in: bcmdhd evbug [last unloaded: bcmdhd] CPU: 0 PID: 954 Comm: dhd_dpc Tainted: G W 3.14.52-1.1.0_ga+g76946e8 #1 [<80014a68>] (unwind_backtrace) from [<80011758>] (show_stack+0x10/0x14) [<80011758>] (show_stack) from [<80720180>] (dump_stack+0x7c/0xbc) [<80720180>] (dump_stack) from [<80031df8>] (warn_slowpath_common+0x70/0x8c) [<80031df8>] (warn_slowpath_common) from [<80031eb0>] (warn_slowpath_null+0x1c/0x24) [<80031eb0>] (warn_slowpath_null) from [<804d5d2c>] (sdhci_send_command+0xc64/0xd10) [<804d5d2c>] (sdhci_send_command) from [<804d74e8>] (sdhci_request+0xc0/0x1f0) [<804d74e8>] (sdhci_request) from [<804c218c>] (__mmc_start_req+0x60/0x84) [<804c218c>] (__mmc_start_req) from [<804c25a4>] (mmc_wait_for_req+0x10/0x20) [<804c25a4>] (mmc_wait_for_req) from [<7f27ff6c>] (sdioh_request_packet_chain+0x368/0x400 [bcmdhd]) [<7f27ff6c>] (sdioh_request_packet_chain [bcmdhd]) from [<7f280da4>] (sdioh_request_buffer+0x124/0x294 [bcmdhd]) [<7f280da4>] (sdioh_request_buffer [bcmdhd]) from [<7f27f6dc>] (bcmsdh_send_buf+0x94/0x108 [bcmdhd]) [<7f27f6dc>] (bcmsdh_send_buf [bcmdhd]) from [<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25+0x80/0x220 [bcmdhd]) [<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25 [bcmdhd]) from [<7f28f454>] (dhdsdio_txpkt.constprop.24+0x928/0xa2c [bcmdhd]) [<7f28f454>] (dhdsdio_txpkt.constprop.24 [bcmdhd]) from [<7f28f6b0>] (dhdsdio_sendfromq+0x158/0x3c4 [bcmdhd]) [<7f28f6b0>] (dhdsdio_sendfromq [bcmdhd]) from [<7f2913d4>] (dhdsdio_dpc+0x2e8/0x1034 [bcmdhd]) [<7f2913d4>] (dhdsdio_dpc [bcmdhd]) from [<7f24a270>] (dhd_dpc_thread+0xe8/0x124 [bcmdhd]) [<7f24a270>] (dhd_dpc_thread [bcmdhd]) from [<8004ca6c>] (kthread+0xcc/0xe4) [<8004ca6c>] (kthread) from [<8000e500>] (ret_from_fork+0x14/0x34) Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> (cherry picked from commit 77ff69e3d3a82c4fcf2d6c6d2a904d4fc1793542)
2016-01-14MLK-11833 bcmdhd: pull back sdpcm_hdrlen length from old skb for new skbDong Aisheng
Pull back sdpcm_hdrlen length from old skb as new skb here is passed to postprocessing. This is a generic fix. We must have it regardless of host is non scatter-gather or scatter gather capable. Suggested by: Vinayak Kamath <vinayak.kamath@broadcom.com> Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> (cherry picked from commit 45c96b8881eaa2b073b9dfa2a44229accd7409b7) (cherry picked from commit b72fea1818e92d18affe88a90f6f2460eab74360)
2016-01-14MLK-11763-1 bcmdhd: make the driver work for 4.1 kernelDong Aisheng
Fixing a lot of compiling issues due to kernel upgrade and then make it work on 4.1 kernel. Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
2016-01-14MLK-10584 bcmdhd: fix connect Adhoc network warningsDong Aisheng
As part of starting up IBSS, CFG80211 driver needs BSS information to be plumbed into it. Hence in DHD we call cfg80211_infrom_bss() and it needs whole frame consist of IEs contained in beacon frame. But FW was passing frame buffer with some extra bytes preceded and when same is plumbed into CFG80211 it was not able to decode the frame and it ignores the frame as result we get such warnings. Using latest FW delivered by Broadcom to fix the issue. As well as wl_cfg80211.c changes are essential. This change is actually fix certain warnings seen when moving between IBSS and BSS network mode. Changes must be done in wl_cfg80211_change_virtual_iface() which you can find at wl_cfg80211.c and this file is not specific wl tool. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit a6a35af7350b26c1e30cc14aa2ad6e117ab260dc)
2016-01-14MLK-10717 bcmdhd: fix rmmod warnings when associated with APDong Aisheng
Should call cfg80211_disconnected() when do rmmod if associcated with AP before.. root@imx7d_all:~# modprobe -r bcmdhd dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3268, ampdu_hostreorder get failed Err = -1 dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3291 failed to enable/disable bdcv2 tlv signaling Err = -1 CFG80211-ERROR) wl_cfg80211_disconnect : Reason 3 dhd_prot_ioctl : bus is down. we have nothing to do CFG80211-ERROR) wl_cfg80211_disconnect : error (-1) ------------[ cut here ]------------ WARNING: CPU: 1 PID: 1057 at net/wireless/core.c:953 cfg80211_netdev_notifier_call+0x3f4/0x468() Modules linked in: bcmdhd(-) evbug CPU: 1 PID: 1057 Comm: modprobe Not tainted 3.14.38-02140-g3418ee9 #1074 [<80014a40>] (unwind_backtrace) from [<80011698>] (show_stack+0x10/0x14) [<80011698>] (show_stack) from [<80705f90>] (dump_stack+0x7c/0xbc) [<80705f90>] (dump_stack) from [<8002fbe0>] (warn_slowpath_common+0x6c/0x88) [<8002fbe0>] (warn_slowpath_common) from [<8002fc98>] (warn_slowpath_null+0x1c/0x24) [<8002fc98>] (warn_slowpath_null) from [<806b2d4c>] (cfg80211_netdev_notifier_call+0x3f4/0x468) [<806b2d4c>] (cfg80211_netdev_notifier_call) from [<8004e044>] (notifier_call_chain+0x44/0x84) [<8004e044>] (notifier_call_chain) from [<8004e148>] (raw_notifier_call_chain+0x18/0x20) [<8004e148>] (raw_notifier_call_chain) from [<8059b218>] (rollback_registered_many+0x1dc/0x340) [<8059b218>] (rollback_registered_many) from [<8059b3a4>] (rollback_registered+0x28/0x3c) [<8059b3a4>] (rollback_registered) from [<8059c658>] (unregister_netdevice_queue+0x54/0xb0) [<8059c658>] (unregister_netdevice_queue) from [<8059c6cc>] (unregister_netdev+0x18/0x20) [<8059c6cc>] (unregister_netdev) from [<7f00ef84>] (dhd_detach+0x238/0x474 [bcmdhd]) [<7f00ef84>] (dhd_detach [bcmdhd]) from [<7f05621c>] (dhdsdio_release+0x40/0x1c0 [bcmdhd]) [<7f05621c>] (dhdsdio_release [bcmdhd]) from [<7f0569fc>] (dhdsdio_disconnect+0x3c/0x94 [bcmdhd]) [<7f0569fc>] (dhdsdio_disconnect [bcmdhd]) from [<7f0493a8>] (bcmsdh_remove+0x3c/0x60 [bcmdhd]) [<7f0493a8>] (bcmsdh_remove [bcmdhd]) from [<7f04ade8>] (bcmsdh_sdmmc_remove+0x4c/0x64 [bcmdhd]) [<7f04ade8>] (bcmsdh_sdmmc_remove [bcmdhd]) from [<804baff8>] (sdio_bus_remove+0x30/0xf8) [<804baff8>] (sdio_bus_remove) from [<80346c94>] (__device_release_driver+0x70/0xcc) [<80346c94>] (__device_release_driver) from [<803473bc>] (driver_detach+0xac/0xb0) [<803473bc>] (driver_detach) from [<80346994>] (bus_remove_driver+0x4c/0xa0) [<80346994>] (bus_remove_driver) from [<7f05f930>] (dhd_module_cleanup+0x2c/0x3c [bcmdhd]) [<7f05f930>] (dhd_module_cleanup [bcmdhd]) from [<80084c54>] (SyS_delete_module+0x11c/0x17c) [<80084c54>] (SyS_delete_module) from [<8000e3e0>] (ret_fast_syscall+0x0/0x30) ---[ end trace 89522c1a1370465d ]--- dhd_detach(): thread:dhd_watchdog_thread:291 terminated OK dhd_dpc_thread: Unexpected up_cnt 0 dhd_detach(): thread:dhd_dpc:292 terminated OK CFG80211-ERROR) wl_event_handler : was terminated wl_destroy_event_handler(): thread:wl_event_handler:290 terminated OK unregister wifi platform drivers wifi_platform_bus_enumerate device present 0 mmc1: card 0001 removed Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 740bef7011441010f6183662d452304dca7c7adf)
2016-01-14MLK-11065-8 bcmdhd: fixed build errors with 3.9.2 toolchainDong Aisheng
CC [M] drivers/net/wireless/bcmdhd/dhd_ip.o LD [M] fs/udf/udf.o drivers/net/wireless/bcmdhd/dhd_common.c:108:22: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] DHD_COMPILED " on " __DATE__ " at " __TIME__; ^ drivers/net/wireless/bcmdhd/dhd_common.c:108:38: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time] DHD_COMPILED " on " __DATE__ " at " __TIME__; Drop debug version with build date/time. The kernel already has this information, and individual drivers shouldn't duplicate that. This also eliminates the use of __DATE__ and __TIME__, which make the build non-deterministic. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 3f47e9588c8acf5c4cc5079e746bc05e7d5c69ec)
2016-01-14MLK-11065-7 bcmdhd: call wifi_card_detect in wifi_platform_bus_enumerateDong Aisheng
Without this, WiFi can not work when re-insmod module because the card is not reset in rmmod. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 25ce53802b419f3b2002c5345abee1b85827c688)
2016-01-14MLK-11065-6 bcmdhd: fix warning when rmmod moduleDong Aisheng
root@imx7d_all:~# rmmod bcmdhd dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3268, ampdu_hostreorder get failed Err = -1 dhd_prot_ioctl : bus is down. we have nothing to do dhd_wlfc_deinit():3291 failed to enable/disable bdcv2 tlv signaling Err = -1 dhd_detach(): thread:dhd_watchdog_thread:2d4 terminated OK dhd_dpc_thread: Unexpected up_cnt 0 dhd_detach(): thread:dhd_dpc:2d5 terminated OK CFG80211-ERROR) wl_event_handler : was terminated wl_destroy_event_handler(): thread:wl_event_handler:2d3 terminated OK ------------[ cut here ]------------ Kernel BUG at 800d12b0 [verbose debug info unavailable] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM Modules linked in: bcmdhd(-) evbug CPU: 0 PID: 755 Comm: rmmod Not tainted 3.14.28-7D_alpha #1 task: a8a31680 ti: a841a000 task.ti: a841a000 PC is at kfree+0x17c/0x180 LR is at wiphy_unregister+0x15c/0x1cc pc : [<800d12b0>] lr : [<806b0cf8>] psr: 40070013 sp : a841be28 ip : 00000000 fp : a901396c r10: 7f078dc0 r9 : a9240120 r8 : a9240380 r7 : a9240000 r6 : a9010000 r5 : ab73af20 r4 : a9240120 r3 : 00000000 r2 : ab75a000 r1 : 00000000 r0 : 7f079220 Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: a863406a DAC: 00000015 Process rmmod (pid: 755, stack limit = 0xa841a238) Stack: (0xa841be28 to 0xa841c000) be20: 7f079220 a9240120 00000000 a9010000 a9240000 a9240380 be40: a9240120 7f078dc0 a901396c 806b0cf8 00000000 7f078dc0 a901396c 805962b4 be60: 7f07cea0 a8433800 a8ae3840 a9240380 a9010000 a9013000 a9240380 7f02b088 be80: 00000000 00000000 a9010000 a9013000 a9010000 7f07cea0 7f078dc0 7f00f00c bea0: 00000001 a850f800 7f078dc0 a865b3c0 00000081 8000e5e4 a841a000 00000000 bec0: 00000000 7f05588c 7f078dc0 a850f800 00000000 7f056080 7f056044 a865b180 bee0: a865b340 7f048944 a8fe7800 a865b3c0 7f07acd4 7f04a37c 7f04a330 a8487408 bf00: a8487400 804baf10 a8487408 7f07acd4 a848743c 803476b4 7f07acd4 a8487408 bf20: 7f07acd4 80347dc4 7f07acd4 7f07ad38 00000800 803473b4 00000000 7f05f158 bf40: 7f05f12c 80083be8 00000000 00000000 7f07ad38 00000800 a841bf4c 646d6362 bf60: 00006468 00000000 8108f030 a8a31680 a8a31a30 00000000 00000000 8004605c bf80: a89c4d80 a841a018 8000e5e4 a841bfb0 a841a000 00011330 00000000 7ecc5e1c bfa0: 00000002 8000e460 00000000 7ecc5e1c 01b05d3c 00000800 76f26104 00002002 bfc0: 00000000 7ecc5e1c 00000002 00000081 7ecc5f0a 00000001 01b05d08 00000000 bfe0: 76eebeb0 7ecc5bfc 00016e3c 76eebebc 60080010 01b05d3c efdff749 faff7bf3 [<800d12b0>] (kfree) from [<806b0cf8>] (wiphy_unregister+0x15c/0x1cc) [<806b0cf8>] (wiphy_unregister) from [<7f02b088>] (wl_free_wdev+0x2c/0xf8 [bcmdhd]) [<7f02b088>] (wl_free_wdev [bcmdhd]) from [<7f00f00c>] (dhd_detach+0x274/0x430 [bcmdhd]) [<7f00f00c>] (dhd_detach [bcmdhd]) from [<7f05588c>] (dhdsdio_release+0x40/0x1cc [bcmdhd]) [<7f05588c>] (dhdsdio_release [bcmdhd]) from [<7f056080>] (dhdsdio_disconnect+0x3c/0xa0 [bcmdhd]) [<7f056080>] (dhdsdio_disconnect [bcmdhd]) from [<7f048944>] (bcmsdh_remove+0x3c/0x60 [bcmdhd]) [<7f048944>] (bcmsdh_remove [bcmdhd]) from [<7f04a37c>] (bcmsdh_sdmmc_remove+0x4c/0x64 [bcmdhd]) [<7f04a37c>] (bcmsdh_sdmmc_remove [bcmdhd]) from [<804baf10>] (sdio_bus_remove+0x30/0xf8) [<804baf10>] (sdio_bus_remove) from [<803476b4>] (__device_release_driver+0x70/0xcc) [<803476b4>] (__device_release_driver) from [<80347dc4>] (driver_detach+0xac/0xb0) [<80347dc4>] (driver_detach) from [<803473b4>] (bus_remove_driver+0x4c/0xa0) [<803473b4>] (bus_remove_driver) from [<7f05f158>] (dhd_module_cleanup+0x2c/0x3c [bcmdhd]) [<7f05f158>] (dhd_module_cleanup [bcmdhd]) from [<80083be8>] (SyS_delete_module+0x11c/0x17c) [<80083be8>] (SyS_delete_module) from [<8000e460>] (ret_fast_syscall+0x0/0x30) Code: e1a01005 e1a02006 e8bd4ff8 eafffef1 (e7f001f2) ---[ end trace ca749705cd612037 ]--- Segmentation fault Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 8d019afe680fd7f20e42159daf2da7d9bfc94577)
2016-01-14MLK-11065-4 wireless: make bcmdhd wireless driver functionallyDong Aisheng
1. Add dummy regulator in dts which is must required by bcmdhd driver 2. Workaround to add dummy sdio_reset_comm as suggested by Broadcom guy because driver always failed in this function porting from Android kernel, root cause unknown. 3. enable driver dts function, inband irq, built as module 4. comment out the hard code in wifi_plat_dev_drv_probe which has to parse oob irq gpio properties and gpio regulators from device tree even the driver does not use it. 5. warning fix Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit fb572304245ab19b79a101c66f0c658a555cc3fe)
2016-01-14MLK-11065-3 wireless: bcmdhd: make work driver on 3.14 kernelDong Aisheng
Add missing file delivered by Broadcom to make driver work on L3.14.y kernel. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit b795547e37c3b68ed019e5d0b9daa3fc6474f623)
2016-01-14MLK-11065-2 wireless: add bcmdhd wireless driver into compilationDong Aisheng
Add bcmdhd driver into compilation Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit ca87be10e248965ed724b2f28e76f78187c22161)
2016-01-14MLK-11065-1 wireless: add bcmdhd_1_141_72 driverDong Aisheng
It's default driver delivered by Broadcom. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 5595dca69a1135dba8a1fbc9159d00cf31356c1a)
2016-01-14MLK-10211 can: flexcan: fix resume failed issueDong Aisheng
We can observe the following error during system resume. dpm_run_callback(): platform_pm_resume+0x0/0x4c returns -110 PM: Device 2090000.can failed to resume: error -110 It is caused by the flexcan is in disable state and the clock is disabled by default while the CAN is not up. During resume, the calling of flexcan_chip_enable will obviously fail due to no clock. The issue only happened when CAN device is not up. If CAN is up, clock is there and no issue will happen. Because the CAN is always in disabled state by default if it's not up. We don't have to disable it again during suspend and enable it after resume. This patch simply the suspend/resume to only enter/exit disabled mode if CAN is up. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit d976d7c9d408c1275075d5870ccf6cb425720434)
2016-01-14MLK-10131 flexcan: fix wakeup unwork issueDong Aisheng
Original code will always disable flexcan during suspend no matter whether wakeup feature is enabled. It's caused by merge issue when doing kernel upgrade. Fix it by removing that disable code. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 55c8670332973d3184816d3d16c2c3e07681c781)
2016-01-14MLK-10131 ENGR00300439-5 can: flexcan: parse stop mode control bits from ↵Dong Aisheng
device tree Starting from IMX6, the flexcan stop mode control bits is SoC specific, move it out of IP driver and parse it from devicetree. It's good from maintain perspective and can avoid adding too many SoC specifi bits in driver but with no IP changes when the IMX SoC series keep growing. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 97b99b59c9f09d58ea35f3c0cf58665c20f2e292) (cherry picked from commit 6355208605715f7cb9ea8c37e29c577785f66898) Conflicts: arch/arm/boot/dts/imx6qdl.dtsi
2016-01-14MLK-10131 ENGR00286724-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> (cherry picked from commit 7f8ef8eeb2bd93d75eb4c970bcaabcfd499d348d) (cherry picked from commit 496fef522e515488147cce3adcc7f101bb532805)
2016-01-14MLK-10131 ENGR00286724-4 can: flexcan: add platform_data for transceiver_switchDong Aisheng
It's used for transceiver_switch. NOTE: it's newly added since it's deleted by upstream before. However, the driver is still using it, so have to add it. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 53109634188e672b807a7256afbf10db0d9a6574)
2016-01-14MLK-11704 net: fec: fix MDIO read/write timeout when ethx down/up after ↵Fugang Duan
suspend/resume This reverts commit 12fee3d24574bd084e8b6fa1dcaf84a084298c9a. The commit:12fee3d24574 intruduce MDIO read/write timeout when Ethernet down and up after Mega/Fast off. The patch just revert the patch. Signed-off-by: Fugang Duan <B38611@freescale.com>
2016-01-14net: fec: add netif status check before set mac addressNimrod Andy
There exist one issue by below case that case system hang: ifconfig eth0 down ifconfig eth0 hw ether 00:10:19:19:81:19 After eth0 down, all fec clocks are gated off. In the .fec_set_mac_address() function, it will set new MAC address to registers, which causes system hang. So it needs to add netif status check to avoid registers access when clocks are gated off. Until eth0 up the new MAC address are wrote into related registers. V2: As Lucas Stach's suggestion, add a comment in the code to explain why it needed. CC: Lucas Stach <l.stach@pengutronix.de> CC: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-14MLK-11307 net: fec: disable timer interrupt when link down and suspendFugang Duan
There exists one issue in Android environment when do power key on/off test that cause system hang. Because suspend function disable enet all clocks while timer interrupt comming that introduces registers access. When link down and suspend, the timer interrupt is not necessary to enable, so disable it. Signed-off-by: Fugang Duan <B38611@freescale.com> Tested-by: Fugang Duan <B38611@freescale.com> Tested-by: Chen Guoyin <B07211@freescale.com> Tested-by: Zhu Wenbo <B52619@freescale.com> (cherry picked from commit: 048f62891bc4936991fd58dbaf4a606a30282404)
2016-01-14MLK-9786 net: fec: Add busfreq support to the driverFugang Duan
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: Fugang Duan <B38611@freescale.com>
2016-01-14MLK-10919 net: phy: micrel: add ksz8081 resume functionFugang Duan
Add ksz8081 resume function since the phy has some non-standard register init process that has some fixup. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: 65c6e997b8e020b9e87d1af23c94c15c13e3d2e3)
2016-01-14MLK-11274 net: fec: add mii bus up_failed flag to reflect the real statusFugang Duan
Add mii bus up_failed flag to reflect the real mii bus status. Signed-off-by: Fugang Duan <B38611@freescale.com> Reported-and-tested-by: Zhang Sanshan <B51434@freescale.com> (cherry picked from commit: ea348e597501d44841a28d8ee099361e89d63520)
2016-01-14MLK-10939-01 net: fec: add stop mode support for dts register setFugang Duan
The current driver support stop mode by calling machine api. The patch add dts support to set gpr register for stop request. After magic pattern comming during system suspend status, system will be waked up, and irq handler will be running, there have enet register access. Since all clocks are disabled in suspend, and clocks are enabled after resume function. But irq handler run before resume function. For imx7d chip, access register need some clocks enabled, otherwise system hang. So the patch also disable wake up irq in the suspend, after resume back enable the irq, which can avoid system hang issue. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry pick and merge from commit: 8da4f80af0913781a4f9d50917c1dd66180e519d)
2016-01-14MLK-10724-6 net: fec: add i.mx6ul enet supportAnson Huang
i.MX6UL enet is the lite edition of i.MX6Q enet, don't support Gbps mode. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: 32a2c3878322d8322a29c52af18de7707134ca1c)
2016-01-14MLK-10474 net: fec: remove frag number checkFugang Duan
Since TSO has no frag list, the frag number is zero. Remove the frag number check to fix kernel dump issue when SW TSO feature enable. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: 670cd419ffa15bbe967c6e11d9435faadd6790f3)
2016-01-14net: fec: fix the warning found by dma debugNimrod Andy
Enable kernel config "CONFIG_HAVE_DMA_API_DEBUG", FEC have kernel warning: [ 6.650444] fec 2188000.ethernet: DMA-API: device driver tries to free DMA memory it has not allocated [ 6.664289] Modules linked in: [ 6.667378] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.19.0-rc4-00688-g8834016-dirty #150 [ 6.675841] Hardware name: Freescale i.MX6 SoloX (Device Tree) [ 6.681698] Backtrace: [ 6.684189] [<80011e3c>] (dump_backtrace) from [<80011fdc>] (show_stack+0x18/0x1c) [ 6.691789] r6:80890154 r5:00000000 r4:00000000 r3:00000000 [ 6.697533] [<80011fc4>] (show_stack) from [<806d2d88>] (dump_stack+0x80/0x9c) [ 6.704799] [<806d2d08>] (dump_stack) from [<8002a4e4>] (warn_slowpath_common+0x7c/0xb4) [ 6.712917] r5:00000445 r4:00000000 [ 6.716544] [<8002a468>] (warn_slowpath_common) from [<8002a5c0>] (warn_slowpath_fmt+0x38/0x40) [ 6.725265] r8:809a2ee8 r7:00000000 r6:00000000 r5:00000000 r4:00000042 [ 6.732087] [<8002a58c>] (warn_slowpath_fmt) from [<802d6268>] (check_unmap+0x86c/0x98c) [ 6.740202] r3:808c79bc r2:8089060c [ 6.743826] [<802d59fc>] (check_unmap) from [<802d65e4>] (debug_dma_unmap_page+0x80/0x88) [ 6.752029] r10:00000000 r9:00000000 r8:00000000 r7:00000001 r6:be12a410 r5:00000000 [ 6.759967] r4:00000042 [ 6.762538] [<802d6564>] (debug_dma_unmap_page) from [<80440248>] (fec_enet_rx_napi+0x7ec/0xb9c) [ 6.771345] r7:00000400 r6:be3e4000 r5:bf08fa20 r4:be036000 [ 6.777094] [<8043fa5c>] (fec_enet_rx_napi) from [<8056ae24>] (net_rx_action+0x134/0x324) [ 6.785297] r10:be089e60 r9:80998180 r8:ffff8d68 r7:0000012c r6:00000040 r5:00000001 [ 6.793239] r4:be036718 [ 6.795801] [<8056acf0>] (net_rx_action) from [<8002db24>] (__do_softirq+0x138/0x2d0) [ 6.803655] r10:00000003 r9:00000003 r8:80996378 r7:8099c080 r6:00000100 r5:8099c08c [ 6.811593] r4:00000000 [ 6.814157] [<8002d9ec>] (__do_softirq) from [<8002dd00>] (run_ksoftirqd+0x44/0x5c) [ 6.821836] r10:00000000 r9:00000000 r8:809b133c r7:00000000 r6:00000001 r5:00000000 [ 6.829775] r4:be027e80 [ 6.832346] [<8002dcbc>] (run_ksoftirqd) from [<80048290>] (smpboot_thread_fn+0x154/0x1c4) [ 6.840649] [<8004813c>] (smpboot_thread_fn) from [<80044780>] (kthread+0xdc/0xf8) [ 6.848224] r10:00000000 r8:00000000 r7:8004813c r6:be027e80 r5:be027ec0 r4:00000000 [ 6.856179] [<800446a4>] (kthread) from [<8000ebc8>] (ret_from_fork+0x14/0x2c) [ 6.863425] r7:00000000 r6:00000000 r5:800446a4 r4:be027ec0 [ 6.869156] ---[ end trace 861cf914d2461a8b ]--- There have one bug in .fec_enet_tx_queue() function to unmap the DMA memory: For SG or TSO, get one buffer descriptor and then unmap the related DMA memory, and then get the next buffer descriptor, loop to while() to check "TX_READY". If "TX_READY" bit still __IS__ existed in the BD (The next fraglist or next TSO packet is not transmited complitely), exit the current clean work. When the next work is triggered, it still repeat above step with the same BD. The potential issue is that unmap the same DMA memory for multiple times. The patch fix the clean work for SG and TSO packet. Reported-by: Anand Moon <moon.linux@yahoo.com> Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-14MLK-10410 net: fec: fix enet warning issue by suspend/resumeFugang Duan
When down eth0 on i.MX6SX platform and then do suspend/resume operation, there have one kernel dump. The patch fix the warning issue. After eth interface down, it is not necessary to init phydev to NULL since it do this in driver remove and eth open fucntion. Signed-off-by: Fugang Duan <B38611@freescale.com>
2016-01-14MLK-9919 net: fec: reinit MAC0 MII bus for MAC1 use after resume backFugang Duan
i.MX6SX-AI board has two enet MACs (MAC0 and MAC1), they share MAC0 MII bus. When PHY0 don't connect to enet MAC0, MAC0 mii bus probe phy0 failed, and the net interface is set to unattach mode. During suspend resume test, driver don't reinit MAC0 after resume back, so MII bus don't work that causes MAC1 also cannot access PHY1. The patch just is workaround that reinit MAC0 MII bus for MAC1 using. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: b730adeef4f9b44e302c793cbef35ea74f24fbef)
2016-01-14MLK-9691 net: fec: call .pm_qos_remove_request() in .ndo_stop() callbackFugang Duan
Call .pm_qos_remove_request() in .ndo_stop() callback to avoid kernel warning during enet open/close test. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: f81c176d36b8189220a729d723801d2cdd495108)
2016-01-14MLK-11285-02 net:fec: add enet AVB Ubuntu Gstreamer demo supportFugang Duan
Support Gstreamer AVB demo support. ring1 -> ClassA, ring2 -> ClassB, ring0 -> Best Effort For QoS: ring1 > ring2 > ring0 For bandwidth reverse: 50% bandwidth -> ClassA 33% bandwidth -> ClassB 17% bandwidth -> Best effort queue In general, ClassA run audio, ClassB run video. Since AVB demo use big bandwidth streaming, video cost more than 33Mbps bandwidth, and with Qos limitation: ClassA >= ClassB > Best effort, so we have to change ring2 bandwidth equal to ring1 bandwidth (50%). After validate on FPGA, AVB demo can work fine for audio and video. Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit 93d6579a7b3d2dafa721c835df5d5f7d30ed386e)
2016-01-14MLK-11285-01 net: fec: handle WAIT mode issue for imx6qdlShawn Guo
This is a combination of commits 919d46e37e04 (ENGR00265935 net: fec: add pm_qos to avoid cpu enter to wait mode) and 8a12c90c9974 (ENGR00313685-14 net: fec: check workaround for FEC_QUIRK_BUG_WAITMODE) from imx_3.10.y branch. It's added for imx_3.14.y branch to work around imx6qdl issue ERR006687 (ENET: Only the ENET wake-up interrupt request can wake the system from Wait mode). Signed-off-by: Shawn Guo <shawn.guo@freescale.com> (cherry-pick and merge from commit: 4f406fae257cc7945a0e3a425213440bb12ba345)
2016-01-14freescale: remove incorrect copied commentJacob Keller
The comment in question is word-for-word copied from ixgbe, and clearly has no meaning in freescale's driver. (it even says 'return an error' when the code clearly does not). Remove the comment as it is obviously incorrect and not applicable to the code as it is today. CC: Pantelis Antoniou <pantelis.antoniou@gmail.com> CC: Vitaly Bordug <vbordug@ru.mvista.com> CC: <linuxppc-dev@lists.ozlabs.org> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-14net: fec: ptp: correct the ENET_ATCOR valueFugang Duan
The current driver adjust freq formula is: fe * diff = ppb * pc Note: fe: ENET ref clock frequency in Hz diff = inc_corr - inc: difference between default increment and correction increment ppb: parts per billion adjustment from base pc: correction period (in number of fe clock cycles) The correction increment will be used after N cycles of regular increments, not every N cycles (with N being the correction period). For example, set ENET_ATCOR=4, INC=8, INC_CORR=9, there will be 4 increments of 8 (ENET_ATINC[INC]) , followed by 1 increment of 9 (ENET_ATINC[INC_CORR]). So, the correct formula is: fe * diff = ppb * (pc + 1) For ENET_ATCOR, a value 0 disables the correction counter and no corrections occur. So base on the origin formula, set pc = pc > 1 ? pc - 1 : pc. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Frank Li <Frank.Li@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>