summaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon/ethernet-rgmii.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: octeon: stop using cvmx_helper_link_autoconf()Aaro Koskinen2016-09-121-1/+4
| | | | | | | | Stop using cvmx_helper_link_autoconf(). We want to remove it in the future, as it duplicates link state information into platform code for no reason. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* net: ethernet: octeon: use phydev from struct net_devicePhilippe Reynes2016-08-211-1/+1
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon: refactor rgmii 10 mbps preamble error checkingAaro Koskinen2016-02-111-215/+72
| | | | | | | | | | | | | | | | | | | | | Refactor RGMII 10 Mbps preamble error checking. The current implementation does not work correctly in phydev mode since only the link status changes trigger the callback, and if we stay on 10 Mbps operation the periodic checks for error counters are never done. Provide a periodic worker also during the phydev operation, and notify the link status changes through the phydev instead of the inband status change interrupt. This also has the benefit that we don't need to use legacy CVMX MDIO calls to check the PHY state, and we can avoid races that trigger bogus "Using 10Mbps with software preamble removal" logs when interfaces are being bringed up. It also avoids some corner-case crashes when the in-band interrupt triggers while the interface is being taken down. Tested on EdgeRouter Lite & D-Link DSR-1000N. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging:octeon:removed blank line after {Bhumika Goyal2016-02-071-4/+0
| | | | | | | | Removed blank line after curly braces. Found using checkpatch.pl. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* net: ethernet-rgmii.c: Fix breakage from moving phdev busAndrew Lunn2016-01-101-3/+3
| | | | | | | | The mdio device patches moved the bus member in phy_device into a substructure. This driver got missed. Fix it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* staging: octeon-ethernet: drop poll_now parameter from cvm_oct_common_openAaro Koskinen2015-10-171-1/+1
| | | | | | | Drop redundant poll_now parameter from cvm_oct_common_open. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: rgmii: poll link status on openAaro Koskinen2015-10-171-1/+1
| | | | | | | | | Get the initial link status already on open instead of postponing it to the periodic poll task. This unifies the behaviour with other interfaces types. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon: fix coding style warnings for block commentsOkash Khawaja2015-08-071-3/+4
| | | | | | | | | | The Linux kernel coding style suggests starting every line in a block comment with an asterisk and finishing the block comment with */ on a separate line. This patch fixes those warnings, clearing all warnings and errors in this file, as reported by the checkpatch script. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: update boilerplate commentsAaro Koskinen2015-04-301-20/+4
| | | | | | | | Update boilerplate comments to be more terse by removing redundant information. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: eliminate USE_10MBPS_PREAMBLE_WORKAROUND defineAaro Koskinen2015-04-301-11/+3
| | | | | | | We have the workaround always enabled, so eliminate a redundant #define. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: rgmii: use function to configure hw preambleAaro Koskinen2015-04-301-49/+35
| | | | | | | Use a function to enable/disable HW preamble checking to avoid copy paste. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: rgmii: refactor gmx block interrupt handlingAaro Koskinen2015-04-301-82/+41
| | | | | | | Code for gmx0 and gmx1 block is identical, move it into a function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: consolidate carrier notificationsAaro Koskinen2015-04-301-16/+3
| | | | | | | Always use cvm_oct_note_carrier() to avoid copy-pasted code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: move ndo_stop to common initAaro Koskinen2015-04-301-1/+0
| | | | | | | | All init functions call ndo_stop if it's defined, so move it to common function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: consolidate ndo_stop functionsAaro Koskinen2015-04-301-13/+0
| | | | | | | All ndo_stop functions are identical. Get rid of duplicated code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: consolidate ndo_open functionsAaro Koskinen2015-04-301-31/+1
| | | | | | | | ndo_open for rgmii, sgmii and xaui are almost identical. Put the common code in a single function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon: Combined seperate strings.Gulsah Kose2014-10-021-6/+3
| | | | | | | | This patch fixes "quoted string split across lines" checkpatch.pl warning in ethernet-rgmii.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon: Fix missing blank line warning.Melike Yurtoglu2014-09-281-0/+5
| | | | | | | | Fixes "Missing a blank line after declarations" checkpatch.pl warning in ethernet-rgmii.c Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: Move PHY activation to .ndo_open().David Daney2014-06-191-5/+18
| | | | | | | | | | | | | | | | | This prevents PHY not found types of errors for PHY drivers that are probed after the Ethernet driver is probed, because the ifconfig UP is done from userspace after all drivers have been probed. Also avoid the cvmx-helper-board.c PHY code if a real PHY driver is present, this allows a bootloader supplied device tree to specify the PHY information rather than having to modify the code for each different board. Tested-by: Alex Smith <alex.smith@imgtec.com> Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Alex Smith <alex.smith@imgtec.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/octeon:ethernet-rgmii.c: Fix line over 80 characters.Aybuke Ozdemir2014-03-181-6/+12
| | | | | | | | checkpatch.pl issues with line over 80 characters in ethernet-rgmii.c Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: octeon: Fix coding stylebahar sahin2014-03-071-2/+1
| | | | | | | | This patch removes unnecessary braces to fix a checkpatch.pl warning. Signed-off-by: bahar sahin <baharxf@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: make global_register_lock staticAaro Koskinen2014-03-041-1/+1
| | | | | | | Make global_register_lock static to eliminate a sparse warning. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-ethernet: rgmii: enable interrupts that we can handleAaro Koskinen2013-09-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable only those interrupts that we can handle & acknowledge in the interrupt handler. At least on EdgeRouter Lite, the hardware may occasionally interrupt with some error condition when the physical link status changes frequently. Since the interrupt condition is not acked properly, this leads to the following warning and the IRQ gets disabled completely: [ 41.324700] eth0: Link down [ 44.324721] eth0: 1000 Mbps Full duplex, port 0, queue 0 [ 44.885590] irq 117: nobody cared (try booting with the "irqpoll" option) [ 44.892397] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-rc5-edge-los.git-27d042f-dirty-00950-gaa42f2d-dirty #8 [ 44.902825] Stack : ffffffff815c0000 0000000000000004 0000000000000003 0000000000000000 ffffffff81fd0000 ffffffff815c0000 0000000000000004 ffffffff8118530c ffffffff815c0000 ffffffff811858d8 0000000000000000 0000000000000000 ffffffff81fd0000 ffffffff81fc0000 ffffffff8152f3a0 ffffffff815b7bf7 ffffffff81fc6688 ffffffff815b8060 0000000000000000 0000000000000000 0000000000000000 ffffffff815346c8 ffffffff815346b0 ffffffff814a6a18 ffffffff8158b848 ffffffff81145614 ffffffff81593800 ffffffff81187174 ffffffff815b7d00 ffffffff8158b760 0000000000000000 ffffffff814a9184 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ffffffff811203b8 0000000000000000 0000000000000000 ... [ 44.968408] Call Trace: [ 44.970873] [<ffffffff811203b8>] show_stack+0x68/0x80 [ 44.975937] [<ffffffff814a9184>] dump_stack+0x78/0xb8 [ 44.980999] [<ffffffff811aac54>] __report_bad_irq+0x44/0x108 [ 44.986662] [<ffffffff811ab238>] note_interrupt+0x248/0x2a0 [ 44.992240] [<ffffffff811a85e4>] handle_irq_event_percpu+0x144/0x200 [ 44.998598] [<ffffffff811a86f4>] handle_irq_event+0x54/0x90 [ 45.004176] [<ffffffff811ab908>] handle_level_irq+0xd0/0x148 [ 45.009839] [<ffffffff811a7b04>] generic_handle_irq+0x34/0x50 [ 45.015589] [<ffffffff8111dae8>] do_IRQ+0x18/0x30 [ 45.020301] [<ffffffff8110486c>] plat_irq_dispatch+0x74/0xb8 [ 45.025958] [ 45.027451] handlers: [ 45.029731] [<ffffffff813fca10>] cvm_oct_rgmii_rml_interrupt [ 45.035397] Disabling IRQ #117 [ 45.038742] Port 0 receive error code 13, packet dropped [ 46.324719] eth0: Link down [ 48.324733] eth0: 1000 Mbps Full duplex, port 0, queue 0 Reported-by: "Jason A. Donenfeld" <Jason@zx2c4.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-by: David Daney <david.daney@cavium.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: devel@driverdev.osuosl.org Cc: linux-mips@linux-mips.org Cc: Jason A. Donenfeld <Jason@zx2c4.com> Cc: richard@nod.at Patchwork: https://patchwork.linux-mips.org/patch/5810/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: Octeon: Move some Ethernet support files out of staging.David Daney2011-12-071-2/+2
| | | | | | | | | | | Signed-off-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Cc: netdev@vger.kernel.org Cc: devel@driverdev.osuosl.org Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Patchwork: https://patchwork.linux-mips.org/patch/2942/ Patchwork: https://patchwork.linux-mips.org/patch/3012/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* staging: octeon-ethernet: Add missing #includes.David Daney2011-08-231-0/+1
| | | | | | | | | | I looks like something used to implicitly include linux/interrupt.h, and no longer does. Fix the resulting build error by explicitly including it. Signed-off-by: David Daney <david.daney@cavium.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: octeon: use printk_ratelimited instead of printk_ratelimitChristian Dietrich2011-06-281-16/+17
| | | | | | | As per printk_ratelimit comment, it should not be used Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: Octeon: Run phy bus accesses on a workqueue.David Daney2010-02-271-13/+42
| | | | | | | | | | | | | When directly accessing a phy, we must acquire the mdio bus lock. To do that we cannot be in interrupt context, so we need to move these operations to a workqueue. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: netdev@vger.kernel.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/965/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Staging: octeon: remove unneeded includesDavid Daney2010-02-271-1/+0
| | | | | | | | | Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: netdev@vger.kernel.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/964/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Staging: octeon-ethernet: Convert to use PHY Abstraction Layer.David Daney2009-12-171-24/+28
| | | | | | | | | The octeon-ethernet driver shares an mdio bus with the octeon-mgmt driver. Here we convert the octeon-ethernet driver to use the PHY Abstraction Layer. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Staging: octeon: don't ignore request_irq() return codeRoel Kluin2009-12-111-1/+3
| | | | | | | Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: octeon-ethernet: Convert to use net_device_ops.David Daney2009-06-241-6/+3
| | | | | | | | | | | | Convert the driver to use net_device_ops as it is now mandatory. Also compensate for the removal of struct sk_buff's dst field. The changes are mostly mechanical, the content of ethernet-common.c was moved to ethernet.c and ethernet-common.{c,h} are removed. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Staging: Add octeon-ethernet driver files.David Daney2009-06-171-0/+397
The octeon-ethernet driver supports the sgmii, rgmii, spi, and xaui ports present on the Cavium OCTEON family of SOCs. These SOCs are multi-core mips64 processors with existing support over in arch/mips. The driver files can be categorized into three basic groups: 1) Register definitions, these are named cvmx-*-defs.h 2) Main driver code, these have names that don't start cvmx-. 3) Interface specific functions and other utility code, names starting with cvmx- Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
OpenPOWER on IntegriCloud