aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
Commit message (Collapse)AuthorAgeFilesLines
* ar71xx: ag71xx: Fix broken networking on some devices (FS#2177)Petr Štetiar2019-04-081-2/+3
| | | | | | | | | It was reported, that latest ar71xx builds have broken networking on TP-Link TL-WPA8630 and Nanostation M5 XW devices and that by reverting the offending commit, everything is back to normal. Fixes: d3506d1 ("ar71xx: ag71xx: fix compile error when enabling debug") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ar71xx: ag71xx: fix compile error when enabling debugKoen Vandeputte2019-03-051-6/+5
| | | | | | | | | | | | | | | | | | | | | | | Starting from kernel 4.5, phy_id needs to be fetched from a different location. not doing so results in this compile error: drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c: In function 'ag71xx_phy_connect_multi': drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c:133:35: error: 'struct mdio_device' has no member named 'phy_id' ag->mii_bus->mdio_map[phy_addr]->phy_id); ^ ./include/linux/printk.h:137:18: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~~~~~~~~~ drivers/net/ethernet/atheros/ag71xx/ag71xx.h:72:27: note: in expansion of macro 'pr_debug' #define DBG(fmt, args...) pr_debug(fmt, ## args) ^~~~~~~~ drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c:130:3: note: in expansion of macro 'DBG' DBG("%s: PHY found at %s, uid=%08x\n", ^~~ scripts/Makefile.build:326: recipe for target 'drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.o' failed Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* Revert "ar71xx: ag71xx: Prevent kernel oops for board def"Jo-Philipp Wich2018-08-011-15/+1
| | | | | | | | | | | This reverts commit 7a3e133751870a3431e2430386a77a002eb24117. This change reportedly breaks connectivity on some ar71xx devices, so revert it for now. Ref: https://github.com/openwrt/openwrt/pull/1217#issuecomment-409708087 Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "ar71xx: ag71xx: Add connect message: fixed phy"Jo-Philipp Wich2018-08-011-7/+0
| | | | | | | | | | | This reverts commit 0b9f4e880807e3cfd22d12b929202e1edcdc577c. This change reportedly breaks connectivity on some ar71xx devices, so revert it for now. Ref: https://github.com/openwrt/openwrt/pull/1217#issuecomment-409708087 Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "ar71xx: ag71xx_phy: Fix compilation for debug messages"Jo-Philipp Wich2018-08-011-4/+2
| | | | | | | | This reverts commit 2655fbe8efb2a596aa8db92cffa817e3bf0c64ea. The patch introduces syntax errors, revert it for now. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* ar71xx: ag71xx: Prevent kernel oops for board defDaniel F. Dickinson2018-07-301-1/+15
| | | | | | | | | | | The driver is written in such a way that with a board defintion that connects a fixed phy, mdio, and switch in a certain way, a kernel oops could result because of lack of previously probed mdio bus. This commit allows for easier debugging in this case by casting the correct blame with serial console messages. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: ag71xx: Add connect message: fixed phyDaniel F. Dickinson2018-07-301-0/+7
| | | | | | | | It's a little noisier but makes it obvious when the ar7240 switch was connected to the MDIO bus, and to which phy device (or the failure to do so). Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: ag71xx_phy: Fix compilation for debug messagesDaniel F. Dickinson2018-07-301-2/+4
| | | | | | | | | | | NB: Error only appears with ag71xx debug messages and dynamic printk enabled. This is probably why no one has caught it before. Previously phy probe debug messages used old (now wrong) functions to get the phy name for printing. There was also the chance of a NULL pointer in the event no phy_device was found. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: Add kernel 4.9 supportHauke Mehrtens2017-10-111-1/+27
| | | | | | | | | | | | | This add support for kernel 4.9 to the ar71xx target. It was compile tested with the generic, NAND and mikrotik subtarget. Multiple members of the community tested it on their boards and did not report any major problem so far. Especially the NAND part received some changes to adapt to the new kernel APIs. The serial driver hack used for the Arduino Yun was not ported because the kernel changed there a lot. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ar71xx: ag71xx: fix a race involving netdev registrationGabor Juhos2013-11-081-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, phy_connect before register_netdev. This is because register_netdev runs the netdev notifiers, which can race with the rest of the initialization in ag71xx_probe. In my case this manifested in two ways: 1) If ag71xx is compiled as a module and inserted after netifd has started, netifd is notified by register_netdev before the call to ag71xx_phy_connect. netifd tries to bring the interface up, which calls ag71xx_open, which in turn enters ag71xx_phy_start. This keys off ag->phy_dev (which is still NULL) and thinks this is a fixed-link board, and enters ag71xx_link_adjust. This looks at ag->speed which is not yet initialized and hits the BUG() in the switch (ag->speed) in ag71xx_link_adjust. This is the wrong code path for ag71xx_phy_start - my board has PHYs that need to be brought up with phy_start. Doing ag71xx_phy_connect before register_netdev ensures that ag->phy_dev is non-NULL before ag71xx_phy_start is ever called. 2) When ag71xx is built into the kernel, and netconsole is enabled, there is a gap in the initial burst of replayed printks right after the netdev comes up. My assumption is that netconsole is also triggered by a netdev notifier, and part of this printk burst happens before the call into ag71xx_phy_connect, so part of the burst is lost while the PHY comes up. This patch fixes the gap - all the printks before eth0 comes up are bursted in full when netconsole initializes. ag71xx_phy_connect_xxx no longer runs with a registered netdev, so the logging has been adjusted accordingly to avoid "unregistered net_device" or "eth%d" messages in dmesg. Signed-off-by: Catalin Patulea <cat@vv.carleton.ca> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38689
* ar71xx: add linux 3.10Felix Fietkau2013-07-091-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37214
* ar71xx: remove __dev{init,exit} annotations from kernel filesGabor Juhos2013-02-191-1/+1
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35687
* ar71xx: ag71xx: don't start/stop built-in switch w/o mii_bus_devGabor Juhos2012-12-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to do that causes a NULL pointer dereference: CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 801d170c, ra == 801d18d4 Oops[#1]: Cpu 0 $ 0 : 00000000 00000000 00000000 00000001 $ 4 : 00000000 802e6390 ffff8f45 00000001 $ 8 : 804b5360 ffffff80 802f93bc 00000000 $12 : 802f93e8 00000000 00000000 00000000 $16 : 8381aba0 8381aba0 00000000 00000000 $20 : 8295eff0 00000032 80000000 004101b8 $24 : 00000000 777265b0 $28 : 82936000 82937cf0 00420000 801d18d4 Hi : 00000000 Lo : 00000001 epc : 801d170c ar7240sw_reset+0x1c/0x19c Tainted: G O ra : 801d18d4 ag71xx_ar7240_start+0x28/0xc0 Status: 1100fc03 KERNEL EXL IE Cause : 00800008 BadVA : 00000000 PrId : 00019750 (MIPS 74Kc) Modules linked in: ath79_wdt ohci_hcd ledtrig_usbdev ledtrig_netdev nf_nat_irc nf_nat_ftp nf_conntrack_irc nf_conntrack_ftp ipt_MASQUERADE iptable_nat nf_nat pppoe xt_conntrack xt_CT xt_NOTRACK iptable_raw xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack ehci_hcd pppox ipt_REJECT xt_TCPMSS xt_LOG xt_comment xt_multiport xt_mac xt_limit iptable_mangle iptable_filter ip_tables xt_tcpudp x_tab les ppp_async ppp_generic slhc ath9k(O) ath9k_common(O) ath9k_hw(O) ath(O) mac80211(O) usbcore usb_common nls_base crc_ccitt cfg80211(O) c ompat(O) arc4 aes_generic crypto_blkcipher cryptomgr aead crypto_hash crypto_algapi ledtrig_timer ledtrig_default_on leds_gpio gpio_button _hotplug(O) Process netifd (pid: 677, threadinfo=82936000, task=82cbe140, tls=77803750) Stack : ffffffff 80087900 00000001 82937d74 8381aba0 8381aba0 00000000 00000000 8295eff0 801d18d4 8295eff0 801fa4a4 00420000 80092158 00000002 8381aba0 8381a800 00000000 00000080 801cf900 8027e720 00000000 00000000 8009223c 8381a800 8381a82c 8027e720 00000000 00000000 7f9d14f0 00420000 801ec08c 8381a800 801ebfb0 33000000 82937e30 00000001 8381a800 00001003 801ec348 ... Call Trace: [<801d170c>] ar7240sw_reset+0x1c/0x19c [<801d18d4>] ag71xx_ar7240_start+0x28/0xc0 [<801cf900>] ag71xx_open+0x1d0/0x258 [<801ec08c>] __dev_open+0xcc/0x130 [<801ec348>] __dev_change_flags+0xc0/0x160 [<801ec490>] dev_change_flags+0x20/0x6c [<801ec5c8>] dev_ifsioc+0xec/0x348 [<801ecdb8>] dev_ioctl+0x594/0x67c [<800ec00c>] do_vfs_ioctl+0x598/0x5ec [<800ec0b0>] sys_ioctl+0x50/0x90 [<8006a3c4>] stack_done+0x20/0x40 Code: afbf0024 afb40020 afb10014 <8c910000> 00809021 24100104 24130704 8e440000 02002821 Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34848
* ar71xx: merge files-3.2 to filesGabor Juhos2012-02-101-0/+235
SVN-Revision: 30405