- 05 2月, 2010 1 次提交
-
-
由 Jiri Pirko 提交于
Many drivers do this in them manually. Now they can use this function. Signed-off-by: NJiri Pirko <jpirko@redhat.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 19 1月, 2010 1 次提交
-
-
由 Anton Vorontsov 提交于
commit 541cd3ee ("phylib: Fix deadlock on resume") caused TI DaVinci EMAC ethernet driver to oops upon resume: PM: resume of devices complete after 237.098 msecs Restarting tasks ... done. kernel BUG at kernel/workqueue.c:354! Unable to handle kernel NULL pointer dereference at virtual address 00000000 [...] Backtrace: [<c002c598>] (__bug+0x0/0x2c) from [<c0052a54>] (queue_delayed_work_on+0x74/0xf8) [<c00529e0>] (queue_delayed_work_on+0x0/0xf8) from [<c0052b30>] (queue_delayed_work+0x2c/0x30) The oops pops up because TI DaVinci EMAC driver detaches PHY on suspend and attaches it back on resume. Attaching makes phylib call phy_start_machine() that initializes a workqueue. On the other hand, PHY's resume routine will call phy_start_machine() again, and that will cause the oops since we just destroyed the already scheduled workqueue. This patch fixes the issue by moving workqueue initialization to phy_device_create(). p.s. We don't see this oops with ucc_geth and gianfar drivers because they perform a fine-grained suspend, i.e. they just stop the PHYs without detaching. Reported-by: NSekhar Nori <nsekhar@ti.com> Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com> Tested-by: NSekhar Nori <nsekhar@ti.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 31 12月, 2009 1 次提交
-
-
由 Anton Vorontsov 提交于
Since hibernation assumes power loss, we should fully reinitialize PHYs (including platform fixups), as if PHYs were just attached. This patch factors phy_init_hw() out of phy_attach_direct(), then converts mdio_bus to dev_pm_ops and adds an appropriate restore() callback. Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 27 5月, 2009 1 次提交
-
-
由 David S. Miller 提交于
Just use the constant 20 to keep things working. If someone is so motivated, this can be converted over to dynamic strings. I tried and it's a lot of work. But for now this is good enough. Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 27 4月, 2009 2 次提交
-
-
由 Grant Likely 提交于
Add phy_connect_direct() and phy_attach_direct() functions so that drivers can use a pointer to the phy_device instead of trying to determine the phy's bus_id string. This patch is useful for OF device tree descriptions of phy devices where the driver doesn't need or know what the bus_id value in order to get a phy_device pointer. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Grant Likely 提交于
This patch makes changes in preparation for supporting open firmware device tree descriptions of MDIO busses. Changes include: - Cleanup handling of phy_map[] entries; they are already NULLed when registering and so don't need to be re-cleared, and it is good practice to clear them out when unregistering. - Split phy_device registration out into a new function so that the OF helpers can do two stage registration (separate allocation and registration steps). Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 14 4月, 2009 1 次提交
-
-
由 Anatolij Gustschin 提交于
Marvell 88E1121R Dual PHY device can be hardware-configured to use shared interrupt pin for both PHY ports. For such PHY configurations using shared PHY interrupt phy_interrupt() handler will also schedule a work for PHY port which didn't cause an interrupt. This patch adds a possibility for PHY drivers to provide did_interrupt() function which reports if the PHY (or a PHY port in a multi-PHY device) generated an interrupt. This function is called in phy_change() as phy_change() shouldn't proceed if it is invoked for a PHY which didn't cause an interrupt. So check for interrupt originator in phy_change() to allow early-out. Signed-off-by: NAnatolij Gustschin <agust@denx.de> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 14 3月, 2009 1 次提交
-
-
由 Marcin Slusarz 提交于
It closes a race in phy_stop_machine when reprogramming of phy_timer (from phy_state_machine) happens between del_timer_sync and cancel_work_sync. Without this change it could lead to crash if phy_device would be freed after phy_stop_machine (timer would fire and schedule freed work). Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com> Acked-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 29 11月, 2008 1 次提交
-
-
由 Giuseppe Cavallaro 提交于
This patch adds the power management support into the physical abstraction layer. Suspend and resume functions respectively turns on/off the bit 11 into the PHY Basic mode control register. Generic PHY device starts supporting PM. In order to support the wake-on LAN and avoid to put in power down the PHY device, the MDIO is aware of what the Ethernet device wants to do. Voluntary, no CONFIG_PM defines were added into the sources. Also generic suspend/resume functions are exported to allow other drivers use them (such as genphy_config_aneg etc.). Within the phy_driver_register function, we need to remove the memset. It overrides the device driver owner and it is not good. Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 09 10月, 2008 4 次提交
-
-
由 Lennert Buytenhek 提交于
Add mdiobus_{read,write} routines to allow direct reading/writing of registers on an mii bus without having to go through the PHY abstraction, and make phy_{read,write} use these primitives. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Lennert Buytenhek 提交于
Introduce the mdio_bus class, and give each 'struct mii_bus' its own 'struct device', so that mii_bus objects are represented in the device tree and can be found by querying the device tree. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Lennert Buytenhek 提交于
This patch introduces mdiobus_alloc() and mdiobus_free(), and makes all mdio bus drivers use these functions to allocate their struct mii_bus'es dynamically. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Acked-by: NAndy Fleming <afleming@freescale.com>
-
由 Lennert Buytenhek 提交于
In preparation of giving mii_bus objects a device tree presence of their own, rename struct mii_bus's ->dev argument to ->parent, since having a 'struct device *dev' that points to our parent device conflicts with introducing a 'struct device dev' representing our own device. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Acked-by: NAndy Fleming <afleming@freescale.com>
-
- 19 9月, 2008 1 次提交
-
-
由 Lennert Buytenhek 提交于
This patch splits the bus scanning code in mdiobus_register() off into a separate function, and makes this function available for calling from external code. This allows incrementally scanning an mii bus, e.g. as information about which addresses are 'safe' to scan becomes available. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NAndy Fleming <afleming@freescale.com>
-
- 07 5月, 2008 1 次提交
-
-
由 Andy Fleming 提交于
Declared some things static, declared some things in the header. Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
- 25 4月, 2008 1 次提交
-
-
由 Andy Fleming 提交于
Sometimes the specific interaction between the platform and the PHY requires special handling. For instance, to change where the PHY's clock input is, or to add a delay to account for latency issues in the data path. We add a mechanism for registering a callback with the PHY Lib to be called on matching PHYs when they are brought up, or reset. Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
- 18 4月, 2008 1 次提交
-
-
由 Paul Gortmaker 提交于
We were already doing what amounts to a get_phy_id from within get_phy_device, and rather than duplicate this for the TBIPA probing, we might as well just factor it out and make it available instead. Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
- 17 4月, 2008 2 次提交
-
-
由 Andy Fleming 提交于
Multi-line comments weren't all CodingStyle compliant Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
由 Andy Fleming 提交于
Having the id field be an int was making more complex bus topologies excessively difficult. For now, just convert it to a string, and change all instances of "bus->id = val" to snprintf(id, MII_BUS_ID_LEN, "%x", val). Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
- 03 2月, 2008 1 次提交
-
-
由 Nate Case 提交于
PHY read/write functions can potentially sleep (e.g., a PHY accessed via I2C). The following changes were made to account for this: * Change spin locks to mutex locks * Add a BUG_ON() to phy_read() phy_write() to warn against calling them from an interrupt context. * Use work queue for PHY state machine handling since it can potentially sleep * Change phydev lock from spinlock to mutex Signed-off-by: NNate Case <ncase@xes-inc.com> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jeff@garzik.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 05 12月, 2007 1 次提交
-
-
由 Anton Vorontsov 提交于
Lately I've got this nice badness on mdio bus removal: Device 'e0103120:06' does not have a release() function, it is broken and must be fixed. ------------[ cut here ]------------ Badness at drivers/base/core.c:107 NIP: c015c1a8 LR: c015c1a8 CTR: c0157488 REGS: c34bdcf0 TRAP: 0700 Not tainted (2.6.23-rc5-g9ebadfbb-dirty) MSR: 00029032 <EE,ME,IR,DR> CR: 24088422 XER: 00000000 ... [c34bdda0] [c015c1a8] device_release+0x78/0x80 (unreliable) [c34bddb0] [c01354cc] kobject_cleanup+0x80/0xbc [c34bddd0] [c01365f0] kref_put+0x54/0x6c [c34bdde0] [c013543c] kobject_put+0x24/0x34 [c34bddf0] [c015c384] put_device+0x1c/0x2c [c34bde00] [c0180e84] mdiobus_unregister+0x2c/0x58 ... Though actually there is nothing broken, it just device subsystem core expects another "pattern" of resource managment. This patch implement phy device's release function, thus we're getting rid of this badness. Also small hidden bug fixed, hope none other introduced. ;-) Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com> Acked-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 02 12月, 2007 1 次提交
-
-
由 Kim Phillips 提交于
Allow phylib specification of cases where hardware needs to configure PHYs for Internal Delay only on either RX or TX (not both). Signed-off-by: NKim Phillips <kim.phillips@freescale.com> Tested-by: NAnton Vorontsov <avorontsov@ru.mvista.com> Acked-by: NLi Yang <leoli@freescale.com> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 11 10月, 2007 1 次提交
-
-
由 Maciej W. Rozycki 提交于
Keep track of disable_irq_nosync() invocations and call enable_irq() the right number of times if work has been cancelled that would include them. Now that the call to flush_work_keventd() (problematic because of rtnl_mutex being held) has been replaced by cancel_work_sync() another issue has arisen and been left unresolved. As the MDIO bus cannot be accessed from the interrupt context the PHY interrupt handler uses disable_irq_nosync() to prevent from looping and schedules some work to be done as a softirq, which, apart from handling the state change of the originating PHY, is responsible for reenabling the interrupt. Now if the interrupt line is shared by another device and a call to the softirq handler has been cancelled, that call to enable_irq() never happens and the other device cannot use its interrupt anymore as its stuck disabled. I decided to use a counter rather than a flag because there may be more than one call to phy_change() cancelled in the queue -- a real one and a fake one triggered by free_irq() if DEBUG_SHIRQ is used, if nothing else. Therefore because of its nesting property enable_irq() has to be called the right number of times to match the number disable_irq_nosync() was called and restore the original state. This DEBUG_SHIRQ feature is also the reason why free_irq() has to be called before cancel_work_sync(). While at it I updated the comment about phy_stop_interrupts() being called from `keventd' -- this is no longer relevant as the use of cancel_work_sync() makes such an approach unnecessary. OTOH a similar comment referring to flush_scheduled_work() in phy_stop() still applies as using cancel_work_sync() there would be dangerous. Checked with checkpatch.pl and at the run time (with and without DEBUG_SHIRQ). Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org> Cc: Andy Fleming <afleming@freescale.com> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 28 4月, 2007 1 次提交
-
-
由 Kim Phillips 提交于
The RGMII spec allows compliance for devices that implement an internal delay on TXC or RXC inside the transmitter. This patch adds an RGMII_ID definition to support RGMII-ID devices in the phylib. Signed-off-by: NKim Phillips <kim.phillips@freescale.com> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 02 12月, 2006 2 次提交
-
-
由 Andy Fleming 提交于
Most PHYs connect to an ethernet controller over a GMII or MII interface. However, a growing number are connected over different interfaces, such as RGMII or SGMII. The ethernet driver will tell the PHY what type of connection it is by setting it manually, or passing it in through phy_connect (or phy_attach). Changes include: * Updates to documentation * Updates to PHY Lib consumers * Changes to PHY Lib to add interface support * Some minor changes to whitespace in phy.h * gianfar driver now detects interface and passes appropriate value to PHY Lib Signed-off-by: NAndrew Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
由 Maciej W. Rozycki 提交于
The <linux/phy.h> uses some types and macros defined in <linux/ethtool.h>, <linux/mii.h>, <linux/timer.h> and <linux/workqueue.h>, but fails to include these headers. Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org> patch-mips-2.6.18-20060920-include-phy-16 Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 13 11月, 2006 1 次提交
-
-
由 Andy Fleming 提交于
* Cleaned up interrupt mapping a little by adding a helper function which parses the irq out of the device-tree, and puts it into a resource. * Changed the arch/ppc platform files to specify PHY_POLL, instead of -1 * Changed the fixed phy to use PHY_IGNORE_INTERRUPT * Added ethtool.h and mii.h to phy.h includes Signed-off-by: NPaul Mackerras <paulus@samba.org>
-
- 20 8月, 2006 1 次提交
-
-
由 Vitaly Bordug 提交于
This makes it possible for HW PHY-less boards to utilize PAL goodies. Generic routines to connect to fixed PHY are provided, as well as ability to specify software callback that fills up link, speed, etc. information into PHY descriptor (the latter feature not tested so far). Signed-off-by: NVitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: NAndrew Morton <akpm@osdl.org> Signed-off-by: NJeff Garzik <jeff@garzik.org>
-
- 13 1月, 2006 1 次提交
-
-
由 Kumar Gala 提交于
Add the PHY_ID_FMT macro to ensure that the format of the id string used by a driver to match to its specific phy is consistent between the mdio_bus and the driver. Signed-off-by: NKumar Gala <galak@kernel.crashing.org> Signed-off-by: NAndrew Morton <akpm@osdl.org> Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
-
- 06 11月, 2005 1 次提交
-
-
由 Matt Porter 提交于
Adds a phy_mask field to struct mii_bus and uses it. This field indicates each phy address to be ignored when probing the mdio bus. This support is needed for the fs_enet and ibm_emac drivers to be converted to the generic phy layer among other drivers. Many systems lock up on probing certain phy addresses or probing doesn't return 0xffff when nothing is found at the address. A new driver I'm working on also makes use of this mask. Signed-off-by: NMatt Porter <mporter@kernel.crashing.org> Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
-
- 29 8月, 2005 1 次提交
-
-
由 Andy Fleming 提交于
This patch adds back the code that was taken out, thus re-enabling: * The PHY Layer to initialize without crashing * Drivers to actually connect to PHYs * The entire PHY Control Layer This patch is used by the gianfar driver, and other drivers which are in development. Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
-
- 11 8月, 2005 2 次提交
-
-
由 Jeff Garzik 提交于
- unexport symbols never used outside of home module - remove dead code - remove CONFIG_PHYCONTROL, make it unconditionally enabled
-
由 Jeff Garzik 提交于
Includes fixes for problems noted by Adrian Bunk, Andrew Morton, and one other person lost in the annals of history (and email folders).
-
- 31 7月, 2005 1 次提交
-
-
由 Andy Fleming 提交于
ethernet drivers to remain as ignorant as is reasonable of the connected PHY's design and operation details. Signed-off-by: NAndy Fleming <afleming@freescale.com> Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
-