aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-06-22r8169: RxConfig hack for the 8168evl.françois romieu1-0/+1
The 8168evl (RTL_GIGA_MAC_VER_34) based Gigabyte GA-990FXA motherboards are very prone to NETDEV watchdog problems without this change. See https://bugzilla.kernel.org/show_bug.cgi?id=42899 for instance. I don't know why it *works*. It's depressingly effective though. For the record: - the problem may go along IOMMU (AMD-Vi) errors but it really looks like a red herring. - the patch sets the RX_MULTI_EN bit. If the 8168c doc is any guide, the chipset now fetches several Rx descriptors at a time. - long ago the driver ignored the RX_MULTI_EN bit. e542a2269f232d61270ceddd42b73a4348dee2bb changed the RxConfig settings. Whatever the problem it's now labeled a regression. - Realtek's own driver can identify two different 8168evl devices (CFG_METHOD_16 and CFG_METHOD_17) where the r8169 driver only sees one. It sucks. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-10r8169: avoid NAPI scheduling delay.françois romieu1-5/+1
While reworking the r8169 driver a few months ago to perform the smallest amount of work in the irq handler, I took care of avoiding any irq mask register operation in the slow work dedicated user context thread. The slow work thread scheduled an extra round of NAPI work which would ultimately set the irq mask register as required, thus keeping such irq mask operations in the NAPI handler. It would eventually race with the irq handler and delay NAPI execution for - assuming no further irq - a whole ksoftirqd period. Mildly a problem for rare link changes or corner case PCI events. The race was always lost after the last bh disabling lock had been removed from the work thread and people started wondering where those pesky "NOHZ: local_softirq_pending 08" messages came from. Actually the irq mask register _can_ be set up directly in the slow work thread. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Reported-by: Dave Jones <davej@redhat.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-01r8169: call netif_napi_del at errpaths and at driver unloadDevendra Naga1-0/+3
when register_netdev fails, the init'ed NAPIs by netif_napi_add must be deleted with netif_napi_del, and also when driver unloads, it should delete the NAPI before unregistering netdevice using unregister_netdev. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-018139cp/8139too: terminate the eeprom access with the right opmodeJason Wang2-2/+2
Currently, we terminate the eeprom access through clearing the CS by: RTL_W8 (Cfg9346, ~EE_CS); or writeb (~EE_CS, ee_addr); This would left the eeprom into "Config. Register Write Enable:" state which is not expcted as the highest two bits were set to 0x11 ( expected is the "Normal" mode (0x00)). Solving this by write 0x0 instead of ~EE_CS when terminating the eeprom access. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-018139cp: set ring address before enabling receiverJason Wang1-11/+11
Currently, we enable the receiver before setting the ring address which could lead the card DMA into unexpected areas. Solving this by set the ring address before enabling the receiver. btw. I find and test this in qemu as I didn't have a 8139cp card in hand. please review it carefully. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-22Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-1/+1
Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
2012-05-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-6/+10
2012-05-08r8169: fix unsigned int wraparound with TSOJulien Ducourthial1-6/+10
The r8169 may get stuck or show bad behaviour after activating TSO : the net_device is not stopped when it has no more TX descriptors. This problem comes from TX_BUFS_AVAIL which may reach -1 when all transmit descriptors are in use. The patch simply tries to keep positive values. Tested with 8111d(onboard) on a D510MO, and with 8111e(onboard) on a Zotac 890GXITX. Signed-off-by: Julien Ducourthial <jducourt@free.fr> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-17r8169: support the new RTL8411 chip.Hayes Wang1-2/+138
Compared with previous chipsets, it needs no special action trough the jumbo{enable/disable} helpers to operate with jumbo frames. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
2012-04-17r8169: adjust some functions of 8111fHayes Wang1-52/+47
Put some settings of 8111f into one function which may be reused. Signed-off-by: Hayes Wang <hayeswang@realtek.com>
2012-04-17r8169: support the new RTL8402 chip.Hayes Wang1-1/+121
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
2012-04-17r8169: add device specific CSI access helpers.Hayes Wang1-106/+194
New chipsets need it. Signed-off-by: Hayes Wang <hayeswang@realtek.com>
2012-04-17r8169: modify pll power functionHayes Wang1-7/+30
Adjust r810x_pll_power_down, r810x_pll_power_up, and r8168_pll_power_up. Always power up device during rtl_open. For r810x, turn off more power when the WOL is disabled. Signed-off-by: Hayes Wang <hayeswang@realtek.com>
2012-04-17r8169: 8168c and later require bit 0x20 to be set in Config2 for PME signaling.Francois Romieu1-0/+6
The new 84xx stopped flying below the radars. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-04-17r8169: Config1 is read-only on 8168c and later.Francois Romieu1-2/+13
Suggested by Hayes. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-04-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-2/+8
Conflicts: drivers/net/ethernet/atheros/atlx/atl1.c drivers/net/ethernet/atheros/atlx/atl1.h Resolved a conflict between a DMA error bug fix and NAPI support changes in the atl1 driver. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-138139cp: set intr mask after its handler is registeredJason Wang1-2/+8
We set intr mask before its handler is registered, this does not work well when 8139cp is sharing irq line with other devices. As the irq could be enabled by the device before 8139cp's hander is registered which may lead unhandled irq. Fix this by introducing an helper cp_irq_enable() and call it after request_irq(). Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2-2/+3
2012-04-08Merge branch 'master' into for-nextJiri Kosina4-781/+952
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
2012-04-078139too: dev->{base_addr, irq} removal.Francois Romieu1-80/+56
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
2012-04-078139cp: stop using net_device.{base_addr, irq}.Francois Romieu1-10/+11
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
2012-04-04r8169: Support the get_ts_info ethtool method.Richard Cochran1-0/+1
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-03r8169: enable napi on resume.Artem Savkov1-0/+3
NAPI is disabled during suspend and needs to be enabled on resume. Without this the driver locks up during resume in rtl_reset_work() trying to disable NAPI again. Signed-off-by: Artem Savkov <artem.savkov@gmail.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-28Remove all #inclusions of asm/system.hDavid Howells2-2/+0
Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <dhowells@redhat.com>
2012-03-28r8169.c: fix comment typoJustin P. Mattock1-1/+1
The below patch fixes a typo that I found while reading the code. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-03-11r8169: enable transmit time stamping.Richard Cochran1-0/+2
This patch has been tested on a machine with the Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05). Cc: Realtek linux nic maintainers <nic_swsd@realtek.com> Cc: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-10r8169: stop using net_device.{base_addr, irq}.Francois Romieu1-7/+5
The driver does not need this leftover of the ISA drivers era. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move rtl_cfg_info closer to its caller.Francois Romieu1-61/+57
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move the netpoll handler after the irq handler.Francois Romieu1-11/+9
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move rtl8169_open after rtl_task it depends on.Francois Romieu1-87/+81
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move rtl_set_rx_mode before its rtl_hw_start callers.Francois Romieu1-51/+50
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move net_device_ops beyond the methods it references.Francois Romieu1-29/+20
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move the driver probe method to the end of the driver file.Francois Romieu1-246/+246
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-10r8169: move the driver removal method to the end of the driver file.Francois Romieu1-29/+29
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-03-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+5
2012-03-06r8169: runtime resume before shutdown.françois romieu1-0/+5
With runtime PM, if the ethernet cable is disconnected, the device is transitioned to D3 state to conserve energy. If the system is shutdown in this state, any register accesses in rtl_shutdown are dropped on the floor. As the device was programmed by .runtime_suspend() to wake on link changes, it is thus brought back up as soon as the link recovers. Resuming every suspended device through the driver core would slow things down and it is not clear how many devices really need it now. Original report and D0 transition patch by Sameer Nanda. Patch has been changed to comply with advices by Rafael J. Wysocki and the PM folks. Reported-by: Sameer Nanda <snanda@chromium.org> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Rafael J. Wysocki <rjw@sisk.pl> Cc: Hayes Wang <hayeswang@realtek.com> Cc: Alan Stern <stern@rowland.harvard.edu> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-068139too: Add 64bit statisticsJunchang Wang1-8/+38
Switch to use ndo_get_stats64 to get 64bit statistics. Two sync entries are used (one for Rx and one for Tx). Signed-off-by: Junchang Wang <junchangwang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+8
Conflicts: drivers/net/vmxnet3/vmxnet3_drv.c Small vmxnet3 conflict with header size bug fix in 'net'. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-06r8169: add byte queue limit support.Igor Maravic1-5/+22
Nothing fancy: - sent bytes count is notified in the start_xmit path right before updating the owner bit in the hardware Tx descriptor (E. Dumazet) - avoid useless tp->dev dereferencing in start_xmit (E. Dumazet) Use of netdev_reset_queue is favored over proper accounting in rtl8169_tx_clear_range since the latter would need more work for the same result (nb: said accounting degenerates to nothing in xmit_frags). Signed-off-by: Igor Maravic <igorm@etf.rs> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
2012-03-06r8169: add 64bit statistics.Junchang Wang1-14/+45
Switch to use ndo_get_stats64 to get 64bit statistics. Two sync entries are used (one for Rx and one for Tx). Signed-off-by: Junchang Wang <junchangwang@gmail.com> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
2012-03-02r8169: corrupted IP fragments fix for large mtu.françois romieu1-0/+8
Noticed with the 8168d (-vb-gr, aka RTL_GIGA_MAC_VER_26). ConfigX registers should only be written while the Config9346 lock is held. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Reported-by: Nick Bowler <nbowler@elliptictech.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24r8169: Support RX-FCS flag.Ben Greear1-1/+5
This allows the NIC to receive the Ethernet FCS and pass it up the stack, allowing sniffers and other interested programs to inspect the FCS. Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-24r8169: Support RX-ALL flag.Ben Greear1-13/+38
This allows the NIC to receive packets with bad FCS and Runts, which can help when sniffing. NOTE: r8169, at least on my NIC, silently drops packets with bad FCS instead of counting them. It seems they are only received in any fashion if the RxCRC flag is set (which this patch allows). Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-248139too: Support RX-FCS flag.Ben Greear1-1/+5
This allows the NIC to pass the Ethernet FCS on up the stack, and is useful when sniffing networks. Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-248139too: Support RX-ALL logic.Ben Greear1-0/+52
This allows the NIC to receive Runts and frames with bad Ethernet Frame Checksums (FCS). Useful to sniffing & diagnosing bad networks. Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-08netdev: ethernet dev_alloc_skb to netdev_alloc_skbPradeep A. Dalvi1-1/+1
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet - Removed extra skb->dev = dev after netdev_alloc_skb Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31drivers/net: Remove alloc_etherdev error messagesJoe Perches2-5/+2
alloc_etherdev has a generic OOM/unable to alloc message. Remove the duplicative messages after alloc_etherdev calls. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31r8169: spinlock redux.Francois Romieu1-8/+0
rtl8169_get_regs operates under RTNL and rtl task mutex whereas rtl_set_rx_mode is either called under RTNL or rtl task mutex protection. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-01-31r8169: avoid a useless work scheduling.Francois Romieu1-1/+3
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Suggested-by: Michał Mirosław <mirqus@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com>
2012-01-31r8169: move task enable boolean to bitfield.Francois Romieu1-6/+7
Simpler, more consistent, with negligible cost in non-critical paths. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Suggested-by: Michał Mirosław <mirqus@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com>