LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 5/5] net: make mpc5200 fec driver use of_mdio infrastructure
From: Anton Vorontsov @ 2009-03-10 19:16 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, jgarzik, afleming, linux-kernel, netdev
In-Reply-To: <20090310152224.12455.99348.stgit@localhost.localdomain>

On Tue, Mar 10, 2009 at 09:22:24AM -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
[...]
> +static int mpc52xx_fec_notifier_phy_add(struct notifier_block *nb,
> +					unsigned long event, void *_dev)
> +{
[...]
> +	rc = phy_connect_direct(priv->ndev, priv->phydev,
> +				mpc52xx_fec_adjust_link, 0, 0);
> +	if (rc) {
> +		dev_err(dev, "phy_connect_direct() failed\n");
> +		return 0;
> +	}
> +
> +	rc = register_netdev(priv->ndev);
> +	if (rc) {
> +		phy_disconnect(priv->phydev);
> +		dev_err(dev, "register_netdev() failed\n");
> +	}
> +
> +	return 0;
> +}
[...]
>  static int __devinit
>  mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
> @@ -896,7 +874,6 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
[...]
> +	/* Register the new network device immediately if we don't need
> +	 * to wait for a phy_device first. */
> +	if (!priv->phy_node) {
> +		if (priv->seven_wire_mode)
> +			dev_info(&ndev->dev, "using 7-wire PHY mode\n");
> +		else
> +			dev_info(&ndev->dev, "Fixed speed MII link: %i%cD\n",
> +				 priv->speed, priv->duplex ? 'F' : 'H');
> +		rv = register_netdev(ndev);
> +		if (rv < 0)
> +			goto probe_error;
>  	}
[...]

Two registration points for the netdev... That's ugly. :-/

What problem are you trying to solve w/ these patches, btw?

`ifconfig ethX up` is safe even w/o PHY attached.

All the (user-visible) changes is that we no longer have "ethX"
until PHY is registered, and I can't say that this is good either.

Previously you'd have ethX all the time, and `ifconfig ethX up`
would report user-friendly "PHY not attached" error. Now we have
to guess why ethX isn't there.

I can't say that the probing code is much prettier or easier to
understand... But maybe there are some other problems that you're
solving, which I don't see so far?

That is, can you explain why the changes are needed? Did you
consider other solutions?


Thanks!

p.s.
> eliminates the assumption that the PHY for the FEC is always
> attached to the FEC's own MDIO bus. With this patch, the FEC can
> use a PHY attached to any MDIO bus if it is described in the device
> tree.

AFAIK, Gianfar and UCC Geth drivers can do this too, so I'm assuming
that this isn't the cause for these major changes.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Please pull from 'next' branch
From: Kumar Gala @ 2009-03-10 19:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

Please pull from 'next' branch of

	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git next

to receive the following updates:

(The i2c patch was ack'd by Ben Dooks & cpm_uart has historically gone via
powerpc tree as a PPC specific driver).

 Documentation/powerpc/dts-bindings/fsl/ssi.txt |    2 +
 arch/powerpc/boot/dts/gef_sbc610.dts           |    2 -
 arch/powerpc/boot/dts/mpc8610_hpcd.dts         |    2 +
 arch/powerpc/include/asm/mmu.h                 |    4 +-
 arch/powerpc/kernel/cputable.c                 |    3 +
 arch/powerpc/mm/tlb_nohash_low.S               |   44 +++++++++++++++++++++----
 arch/powerpc/platforms/83xx/usb.c              |    3 +
 arch/powerpc/sysdev/fsl_soc.c                  |    4 ++
 arch/powerpc/sysdev/ipic.c                     |    6 +--
 drivers/i2c/busses/i2c-mpc.c                   |    9 +----
 drivers/serial/cpm_uart/cpm_uart_core.c        |   14 ++++++-
 11 files changed, 69 insertions(+), 24 deletions(-)

Anton Vorontsov (1):
      powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers

Da Yu (1):
      powerpc/83xx: Fix the interrupt loss problem on ipic

Kumar Gala (1):
      powerpc/fsl-booke: Add support for tlbilx instructions

Martyn Welch (1):
      powerpc/86xx: Correct local bus registers in GE Fanuc SBC610 dts file

Timur Tabi (2):
      i2c-mpc: do not allow interruptions when waiting for I2C to complete
      powerpc: add fsl,fifo-depth property to Freescale SSI device nodes

Xiaotian Feng (1):
      cpm_uart: fix non-console port startup bug

^ permalink raw reply

* Re: [PATCH] efp: Fix efp dependence
From: Kumar Gala @ 2009-03-10 18:57 UTC (permalink / raw)
  To: Liu Yu; +Cc: linuxppc-dev
In-Reply-To: <1236654589-6624-1-git-send-email-yu.liu@freescale.com>


On Mar 9, 2009, at 10:09 PM, Liu Yu wrote:

> There is no dependece between efp and math-emu.
> But when disalbe math-emu, the efp code cannot be built.
> This patch fixes it.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> It would be nice to see this patch go along with 2.6.29

not critical enough for .29.  applied to next for .30

(you can always ask for it get pulled in for .29.1)

- k

^ permalink raw reply

* Re: [patch 1/1] powerpc: remove setup_irq(NULL action) in ksi8560
From: Kumar Gala @ 2009-03-10 18:53 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linux PPC Development
In-Reply-To: <20090310184154.535895939@linutronix.de>


On Mar 10, 2009, at 1:43 PM, Thomas Gleixner wrote:

> setup_irq(0, NULL) is broken as setup_irq() dereferences action
> unconditionally.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> CC: Kumar Gala <galak@kernel.crashing.org>
> CC: Linux PPC Development <linuxppc-dev@ozlabs.org>
> ---
> arch/powerpc/platforms/85xx/ksi8560.c |    2 --
> 1 file changed, 2 deletions(-)

applied to next

- k

^ permalink raw reply

* [patch 1/1] powerpc: remove setup_irq(NULL action) in ksi8560
From: Thomas Gleixner @ 2009-03-10 18:43 UTC (permalink / raw)
  To: Linux PPC Development

setup_irq(0, NULL) is broken as setup_irq() dereferences action
unconditionally.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
CC: Kumar Gala <galak@kernel.crashing.org>
CC: Linux PPC Development <linuxppc-dev@ozlabs.org>
---
 arch/powerpc/platforms/85xx/ksi8560.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-2.6-tip/arch/powerpc/platforms/85xx/ksi8560.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/85xx/ksi8560.c
+++ linux-2.6-tip/arch/powerpc/platforms/85xx/ksi8560.c
@@ -106,8 +106,6 @@ static void __init ksi8560_pic_init(void
 	cpm2_pic_init(np);
 	of_node_put(np);
 	set_irq_chained_handler(irq, cpm2_cascade);
-
-	setup_irq(0, NULL);
 #endif
 }
 

^ permalink raw reply

* [PATCH] powerpc 4xx EMAC driver: device name reported on timeout is not correct
From: Mikhail Zolotaryov @ 2009-03-10 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

Hi,

not critical problem here.

IBM EMAC driver performs device reset (drivers/net/ibm_newemac/core.c: 
emac_probe() -> emac_init_phy() -> emac_reset()) before registering 
appropriate net_device (emac_probe() -> register_netdev()), so 
net_device name contains raw format string during EMAC reset ("eth%d").

If the case of reset timeout, emac_report_timeout_error() function is 
called to report an error. The problem is this function uses net_device 
name to report device related, which is not correct, as a result in the 
kernel log buffer we see:

eth%d: reset timeout

The solution is to print device_node full_name instead. After applying 
the patch proposed, error string is like the following:

/plb/opb/ethernet@ef600e00: reset timeout


Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>



[-- Attachment #2: emac_report_timeout_error.patch --]
[-- Type: text/plain, Size: 441 bytes --]

--- linux-2.6/drivers/net/ibm_newemac/core.c.orig	2009-03-10 20:24:12.000000000 +0200
+++ linux-2.6/drivers/net/ibm_newemac/core.c		2009-03-10 20:29:12.000000000 +0200
@@ -134,7 +134,7 @@
 				  EMAC_FTR_440EP_PHY_CLK_FIX))
 		DBG(dev, "%s" NL, error);
 	else if (net_ratelimit())
-		printk(KERN_ERR "%s: %s\n", dev->ndev->name, error);
+		printk(KERN_ERR "%s: %s\n", dev->ofdev->node->full_name, error);
 }
 
 /* EMAC PHY clock workaround:

^ permalink raw reply

* Re: net_device_ops support in bridging and fec_mpc52xx.c
From: Grant Likely @ 2009-03-10 17:36 UTC (permalink / raw)
  To: David Miller; +Cc: linuxppc-dev, netdev, henk.stegeman, bridge, jgarzik
In-Reply-To: <20090310.101959.142777275.davem@davemloft.net>

On Tue, Mar 10, 2009 at 11:19 AM, David Miller <davem@davemloft.net> wrote:
> Send it to netdev, CC:'d to me, Jeff hasn't been handling networking
> driver changes for a while now.

Ah, okay.  I didn't know.  I looked in MAINTAINERS today, and Jeff is
listed there for NETWORK DEVICE DRIVERS.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: net_device_ops support in bridging and fec_mpc52xx.c
From: David Miller @ 2009-03-10 17:19 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev, netdev, henk.stegeman, bridge, jgarzik
In-Reply-To: <fa686aa40903101013j2324e8acw18830c930e12ae46@mail.gmail.com>

From: Grant Likely <grant.likely@secretlab.ca>
Date: Tue, 10 Mar 2009 11:13:02 -0600

> Hi Henk,
> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
 ...
> Jeff, after Henk provides his s-o-b line, do you want to pick it up,
> or should I merge it through my mpc52xx powerpc tree (via benh).

Send it to netdev, CC:'d to me, Jeff hasn't been handling networking
driver changes for a while now.

^ permalink raw reply

* Re: net_device_ops support in bridging and fec_mpc52xx.c
From: Grant Likely @ 2009-03-10 17:13 UTC (permalink / raw)
  To: Henk Stegeman; +Cc: linuxppc-dev, bridge, Jeff Garzik, netdev
In-Reply-To: <ae4f76fd0902190145r7ed5fadbwfca18c97dbfc9ed1@mail.gmail.com>

Hi Henk,

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Can you please repost with a blurb for the commit description and your
signed-off-by line?  The blub below makes sense in the context of this
mailing list thread, but it won't be very useful for someone looking
at the commit message in git.  Also, your patch is line-wrap damaged
(cut and paste into your mail client doesn't usually work) and has
inconsistent whitespace (run it through scripts/checkpatch.pl).

Jeff, after Henk provides his s-o-b line, do you want to pick it up,
or should I merge it through my mpc52xx powerpc tree (via benh).

Thanks,
g.

On Thu, Feb 19, 2009 at 3:45 AM, Henk Stegeman <henk.stegeman@gmail.com> wr=
ote:
> I must have made a mistake when I tested the previous patch, I
> discovered later it still had errors:
> - I had accidentally removed the base address in the fec_mpc52xx driver.
> - The priv->phydev pointer was sometimes not initialized (NULL) but
> still passed by the fec_mpc52xx driver, this pointer is then used
> unchecked by the eth_tool_* functions (used by bridging to determine
> port priority). As far as I see this depends on whether
> mpc52xx_fec_open (or mpc52xx_fec_close) is called which in turn call
> mpc52xx_init_phy to initialize priv->phydev. My work around checks the
> priv->phydev pointer in the fec_mpc52xx driver and returns -ENODEV to
> indicate there's no physical device. Big chance this is not the right
> way to handle the problem, but it works, hopefully someone with some
> more fundamental Linux network driver experience can pick this up or
> give me some hints on this.
>
> At least bridging now works on my board in combination with the
> fec_mpc52xx driver.
>
> ifconfig eth0 0.0.0.0 down
> ifconfig eth1 0.0.0.0 down
> brctl addbr br0
> brctl setfd br0 0
> brctl stp br0 off
> ifconfig br0 192.168.1.30 down
> ifconfig br0 up
> brctl addif br0 eth0
> ifconfig eth0 up
> brctl addif br0 eth1
> ifconfig eth1 up
>
>
> diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
> index cd8e98b..e228973 100644
> --- a/drivers/net/fec_mpc52xx.c
> +++ b/drivers/net/fec_mpc52xx.c
> @@ -847,24 +847,40 @@ static void mpc52xx_fec_get_drvinfo(struct
> net_device *dev,
> =A0static int mpc52xx_fec_get_settings(struct net_device *dev, struct
> ethtool_cmd *cmd)
> =A0{
> =A0 =A0 =A0 =A0struct mpc52xx_fec_priv *priv =3D netdev_priv(dev);
> +
> + =A0 =A0 =A0 if (!priv->phydev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
> +
> =A0 =A0 =A0 =A0return phy_ethtool_gset(priv->phydev, cmd);
> =A0}
>
> =A0static int mpc52xx_fec_set_settings(struct net_device *dev, struct
> ethtool_cmd *cmd)
> =A0{
> =A0 =A0 =A0 =A0struct mpc52xx_fec_priv *priv =3D netdev_priv(dev);
> +
> + =A0 =A0 =A0 if (!priv->phydev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
> +
> =A0 =A0 =A0 =A0return phy_ethtool_sset(priv->phydev, cmd);
> =A0}
>
> =A0static u32 mpc52xx_fec_get_msglevel(struct net_device *dev)
> =A0{
> =A0 =A0 =A0 =A0struct mpc52xx_fec_priv *priv =3D netdev_priv(dev);
> +
> + =A0 =A0 =A0 if (!priv->phydev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0;
> +
> =A0 =A0 =A0 =A0return priv->msg_enable;
> =A0}
>
> =A0static void mpc52xx_fec_set_msglevel(struct net_device *dev, u32 level=
)
> =A0{
> =A0 =A0 =A0 =A0struct mpc52xx_fec_priv *priv =3D netdev_priv(dev);
> +
> + =A0 =A0 =A0 if (!priv->phydev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return;
> +
> =A0 =A0 =A0 =A0priv->msg_enable =3D level;
> =A0}
>
> @@ -882,12 +898,31 @@ static int mpc52xx_fec_ioctl(struct net_device
> *dev, struct ifreq *rq, int cmd)
> =A0{
> =A0 =A0 =A0 =A0struct mpc52xx_fec_priv *priv =3D netdev_priv(dev);
>
> + =A0 =A0 =A0 if (!priv->phydev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
> +
> =A0 =A0 =A0 =A0return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
> =A0}
>
> =A0/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 */
> =A0/* OF Driver =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> =A0/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 */
> +static const struct net_device_ops mpc52xx_fec_netdev_ops =3D {
> + =A0 =A0 =A0 .ndo_open =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_open,
> + =A0 =A0 =A0 .ndo_stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_close=
,
> + =A0 =A0 =A0 .ndo_start_xmit =A0 =A0 =A0 =A0 =3D mpc52xx_fec_hard_start_=
xmit,
> + =A0 =A0 =A0 .ndo_tx_timeout =A0 =A0 =A0 =A0 =3D mpc52xx_fec_tx_timeout,
> + =A0 =A0 =A0 .ndo_get_stats =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_get_stats=
,
> + =A0 =A0 =A0 .ndo_set_multicast_list =3D mpc52xx_fec_set_multicast_list,
> + =A0 =A0 =A0 .ndo_validate_addr =A0 =A0 =A0=3D eth_validate_addr,
> + =A0 =A0 =A0 .ndo_set_mac_address =A0 =A0=3D mpc52xx_fec_set_mac_address=
,
> + =A0 =A0 =A0 .ndo_do_ioctl =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_ioctl,
> +
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> + =A0 =A0 =A0 .ndo_poll_controller =A0 =A0 =3D mpc52xx_fec_poll_controlle=
r,
> +#endif
> +};
> +
>
> =A0static int __devinit
> =A0mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *mat=
ch)
> @@ -929,20 +964,10 @@ mpc52xx_fec_probe(struct of_device *op, const
> struct of_device_id *match)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EBUSY;
>
> =A0 =A0 =A0 =A0/* Init ether ndev with what we have */
> - =A0 =A0 =A0 ndev->open =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_open;
> - =A0 =A0 =A0 ndev->stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_close=
;
> - =A0 =A0 =A0 ndev->hard_start_xmit =A0 =3D mpc52xx_fec_hard_start_xmit;
> - =A0 =A0 =A0 ndev->do_ioctl =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_ioctl;
> =A0 =A0 =A0 =A0ndev->ethtool_ops =A0 =A0 =A0 =3D &mpc52xx_fec_ethtool_ops=
;
> - =A0 =A0 =A0 ndev->get_stats =A0 =A0 =A0 =A0 =3D mpc52xx_fec_get_stats;
> - =A0 =A0 =A0 ndev->set_mac_address =A0 =3D mpc52xx_fec_set_mac_address;
> - =A0 =A0 =A0 ndev->set_multicast_list =3D mpc52xx_fec_set_multicast_list=
;
> - =A0 =A0 =A0 ndev->tx_timeout =A0 =A0 =A0 =A0=3D mpc52xx_fec_tx_timeout;
> =A0 =A0 =A0 =A0ndev->watchdog_timeo =A0 =A0=3D FEC_WATCHDOG_TIMEOUT;
> =A0 =A0 =A0 =A0ndev->base_addr =A0 =A0 =A0 =A0 =3D mem.start;
> -#ifdef CONFIG_NET_POLL_CONTROLLER
> - =A0 =A0 =A0 ndev->poll_controller =3D mpc52xx_fec_poll_controller;
> -#endif
> + =A0 =A0 =A0 ndev->netdev_ops =3D &mpc52xx_fec_netdev_ops;
>
> =A0 =A0 =A0 =A0priv->t_irq =3D priv->r_irq =3D ndev->irq =3D NO_IRQ; /* I=
RQ are free for now */
>
>
>
> On Wed, Feb 18, 2009 at 10:48 PM, David Miller <davem@davemloft.net> wrot=
e:
>> From: Henk Stegeman <henk.stegeman@gmail.com>
>> Date: Wed, 18 Feb 2009 11:41:14 +0100
>>
>> Please CC: netdev, now added, on all networking reports and patches.
>>
>> Thank you.
>>
>>> I discovered the hard way that because linux bridging uses
>>> net_device_ops, bridging only works with network drivers that publish
>>> their device operations trough net_device_ops.
>>>
>>> In my case running:
>>>
>>> brctl addif br0 eth0 (where eth0 fec_mpc52xx.c did not yet support
>>> net_device_ops) gave me a:
>>>
>>> Unable to handle kernel paging request...
>>>
>>> After changing fec_mpc52xx.c to support net_device_ops the problem was =
fixed.
>>>
>>> If possible some kind of detection in the bridging software is i think
>>> mostly appreciated for early detection of this problem, as it is
>>> pretty hard to relate the error message to a not updated driver.
>>>
>>> cheers,
>>>
>>> Henk
>>>
>>> diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
>>> index cd8e98b..a2841eb 100644
>>> --- a/drivers/net/fec_mpc52xx.c
>>> +++ b/drivers/net/fec_mpc52xx.c
>>> @@ -888,6 +888,22 @@ static int mpc52xx_fec_ioctl(struct net_device
>>> *dev, struct ifreq *rq, int cmd)
>>> =A0/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D */
>>> =A0/* OF Driver =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
>>> =A0/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D */
>>> +static const struct net_device_ops mpc52xx_fec_netdev_ops =3D {
>>> + =A0 =A0 =A0 .ndo_open =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_ope=
n,
>>> + =A0 =A0 =A0 .ndo_stop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_clo=
se,
>>> + =A0 =A0 =A0 .ndo_start_xmit =A0 =A0 =A0 =A0 =3D mpc52xx_fec_hard_star=
t_xmit,
>>> + =A0 =A0 =A0 .ndo_tx_timeout =A0 =A0 =A0 =A0 =3D mpc52xx_fec_tx_timeou=
t,
>>> + =A0 =A0 =A0 .ndo_get_stats =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_get_sta=
ts,
>>> + =A0 =A0 =A0 .ndo_set_multicast_list =3D mpc52xx_fec_set_multicast_lis=
t,
>>> + =A0 =A0 =A0 .ndo_validate_addr =A0 =A0 =A0=3D eth_validate_addr,
>>> + =A0 =A0 =A0 .ndo_set_mac_address =A0 =A0=3D mpc52xx_fec_set_mac_addre=
ss,
>>> + =A0 =A0 =A0 .ndo_do_ioctl =A0 =A0 =A0 =A0 =A0 =3D mpc52xx_fec_ioctl,
>>> +
>>> +#ifdef CONFIG_NET_POLL_CONTROLLER
>>> + =A0 =A0 =A0 .ndo_poll_controller =A0 =A0 =3D mpc52xx_fec_poll_control=
ler,
>>> +#endif
>>> +};
>>> +
>>>
>>> =A0static int __devinit
>>> =A0mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *m=
atch)
>>> @@ -929,20 +945,7 @@ mpc52xx_fec_probe(struct of_device *op, const
>>> struct of_device_id *match)
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EBUSY;
>>>
>>> =A0 =A0 =A0 /* Init ether ndev with what we have */
>>> - =A0 =A0 ndev->open =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_open;
>>> - =A0 =A0 ndev->stop =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_close;
>>> - =A0 =A0 ndev->hard_start_xmit =A0 =3D mpc52xx_fec_hard_start_xmit;
>>> - =A0 =A0 ndev->do_ioctl =A0 =A0 =A0 =A0 =A0=3D mpc52xx_fec_ioctl;
>>> - =A0 =A0 ndev->ethtool_ops =A0 =A0 =A0 =3D &mpc52xx_fec_ethtool_ops;
>>> - =A0 =A0 ndev->get_stats =A0 =A0 =A0 =A0 =3D mpc52xx_fec_get_stats;
>>> - =A0 =A0 ndev->set_mac_address =A0 =3D mpc52xx_fec_set_mac_address;
>>> - =A0 =A0 ndev->set_multicast_list =3D mpc52xx_fec_set_multicast_list;
>>> - =A0 =A0 ndev->tx_timeout =A0 =A0 =A0 =A0=3D mpc52xx_fec_tx_timeout;
>>> - =A0 =A0 ndev->watchdog_timeo =A0 =A0=3D FEC_WATCHDOG_TIMEOUT;
>>> - =A0 =A0 ndev->base_addr =A0 =A0 =A0 =A0 =3D mem.start;
>>> -#ifdef CONFIG_NET_POLL_CONTROLLER
>>> - =A0 =A0 ndev->poll_controller =3D mpc52xx_fec_poll_controller;
>>> -#endif
>>> + =A0 =A0 ndev->netdev_ops =3D &mpc52xx_fec_netdev_ops;
>>>
>>> =A0 =A0 =A0 priv->t_irq =3D priv->r_irq =3D ndev->irq =3D NO_IRQ; /* IR=
Q are free for now */
>>> _______________________________________________
>>> Linuxppc-dev mailing list
>>> Linuxppc-dev@ozlabs.org
>>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 7/7] powerpc/ps3: Add rtc-ps3
From: Geoff Levand @ 2009-03-10 16:18 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-m68k, Alessandro Zummo, rtc-linux, linux-parisc,
	linux-kernel, Kyle McMartin, linuxppc-dev, Paul Mundt,
	Dann Frazier
In-Reply-To: <1236605183-22718-8-git-send-email-Geert.Uytterhoeven@sonycom.com>

On 03/09/2009 06:26 AM, Geert Uytterhoeven wrote:
> Create a real RTC driver for PS3, and unhook the deprecated
> ppc_md.[gs]et_rtc_time.
> 
> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> ---
>  arch/powerpc/include/asm/ps3.h        |    3 +
>  arch/powerpc/platforms/ps3/os-area.c  |    2 +
>  arch/powerpc/platforms/ps3/platform.h |    2 -
>  arch/powerpc/platforms/ps3/setup.c    |    2 -
>  arch/powerpc/platforms/ps3/time.c     |   26 ++++-----
>  drivers/rtc/Kconfig                   |    9 +++
>  drivers/rtc/Makefile                  |    1 +
>  drivers/rtc/rtc-ps3.c                 |  105 +++++++++++++++++++++++++++++++++
>  8 files changed, 132 insertions(+), 18 deletions(-)
>  create mode 100644 drivers/rtc/rtc-ps3.c

Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>

^ permalink raw reply

* [PATCH v2] powerpc/mpc52xx: add Phytec phyCORE-MPC5200B-IO board (pcm032)
From: Wolfram Sang @ 2009-03-10 16:03 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40903010648q238380acy34b58e04226d8014@mail.gmail.com>

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
Changes since V1:
* removed defconfig
* reworked localbus node

 arch/powerpc/boot/dts/pcm032.dts             |  392 ++++++++++++++++++++++++++
 arch/powerpc/platforms/52xx/Kconfig          |    1 +
 arch/powerpc/platforms/52xx/mpc5200_simple.c |    3 +-
 3 files changed, 395 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/pcm032.dts

diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts
new file mode 100644
index 0000000..0300426
--- /dev/null
+++ b/arch/powerpc/boot/dts/pcm032.dts
@@ -0,0 +1,392 @@
+/*
+ * phyCORE-MPC5200B-IO (pcm032) board Device Tree Source
+ *
+ * Copyright (C) 2006-2009 Pengutronix
+ * Sascha Hauer <s.hauer@pengutronix.de>
+ * Juergen Beisert <j.beisert@pengutronix.de>
+ * Wolfram Sang <w.sang@pengutronix.de>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+	model = "phytec,pcm032";
+	compatible = "phytec,pcm032";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	interrupt-parent = <&mpc5200_pic>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,5200@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <32>;
+			i-cache-line-size = <32>;
+			d-cache-size = <0x4000>;	// L1, 16K
+			i-cache-size = <0x4000>;	// L1, 16K
+			timebase-frequency = <0>;	// from bootloader
+			bus-frequency = <0>;		// from bootloader
+			clock-frequency = <0>;		// from bootloader
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x08000000>;	// 128MB
+	};
+
+	soc5200@f0000000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc5200b-immr";
+		ranges = <0 0xf0000000 0x0000c000>;
+		bus-frequency = <0>;		// from bootloader
+		system-frequency = <0>;		// from bootloader
+
+		cdm@200 {
+			compatible = "fsl,mpc5200b-cdm","fsl,mpc5200-cdm";
+			reg = <0x200 0x38>;
+		};
+
+		mpc5200_pic: interrupt-controller@500 {
+			// 5200 interrupts are encoded into two levels;
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
+			reg = <0x500 0x80>;
+		};
+
+		timer@600 {	// General Purpose Timer
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x600 0x10>;
+			interrupts = <1 9 0>;
+			fsl,has-wdt;
+		};
+
+		timer@610 {	// General Purpose Timer
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x610 0x10>;
+			interrupts = <1 10 0>;
+		};
+
+		gpt2: timer@620 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x620 0x10>;
+			interrupts = <1 11 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpt3: timer@630 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x630 0x10>;
+			interrupts = <1 12 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpt4: timer@640 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x640 0x10>;
+			interrupts = <1 13 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpt5: timer@650 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x650 0x10>;
+			interrupts = <1 14 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpt6: timer@660 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x660 0x10>;
+			interrupts = <1 15 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpt7: timer@670 {	// General Purpose Timer in GPIO mode
+			compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
+			reg = <0x670 0x10>;
+			interrupts = <1 16 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		rtc@800 {	// Real time clock
+			compatible = "fsl,mpc5200b-rtc","fsl,mpc5200-rtc";
+			reg = <0x800 0x100>;
+			interrupts = <1 5 0 1 6 0>;
+		};
+
+		can@900 {
+			compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
+			interrupts = <2 17 0>;
+			reg = <0x900 0x80>;
+		};
+
+		can@980 {
+			compatible = "fsl,mpc5200b-mscan","fsl,mpc5200-mscan";
+			interrupts = <2 18 0>;
+			reg = <0x980 0x80>;
+		};
+
+		gpio_simple: gpio@b00 {
+			compatible = "fsl,mpc5200b-gpio","fsl,mpc5200-gpio";
+			reg = <0xb00 0x40>;
+			interrupts = <1 7 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		gpio_wkup: gpio@c00 {
+			compatible = "fsl,mpc5200b-gpio-wkup","fsl,mpc5200-gpio-wkup";
+			reg = <0xc00 0x40>;
+			interrupts = <1 8 0 0 3 0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+
+		spi@f00 {
+			compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
+			reg = <0xf00 0x20>;
+			interrupts = <2 13 0 2 14 0>;
+		};
+
+		usb@1000 {
+			compatible = "fsl,mpc5200b-ohci","fsl,mpc5200-ohci","ohci-be";
+			reg = <0x1000 0xff>;
+			interrupts = <2 6 0>;
+		};
+
+		dma-controller@1200 {
+			compatible = "fsl,mpc5200b-bestcomm","fsl,mpc5200-bestcomm";
+			reg = <0x1200 0x80>;
+			interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
+			              3 4 0  3 5 0  3 6 0  3 7 0
+			              3 8 0  3 9 0  3 10 0  3 11 0
+			              3 12 0  3 13 0  3 14 0  3 15 0>;
+		};
+
+		xlb@1f00 {
+			compatible = "fsl,mpc5200b-xlb","fsl,mpc5200-xlb";
+			reg = <0x1f00 0x100>;
+		};
+
+		ac97@2000 {	/* PSC1 is ac97 */
+			compatible = "fsl,mpc5200b-psc-ac97","fsl,mpc5200-psc-ac97";
+			cell-index = <0>;
+			reg = <0x2000 0x100>;
+			interrupts = <2 1 0>;
+		};
+
+		/* PSC2 port is used by CAN1/2 */
+
+		serial@2400 { /* PSC3 in UART mode */
+			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
+			cell-index = <2>;
+			reg = <0x2400 0x100>;
+			interrupts = <2 3 0>;
+		};
+
+		/* PSC4 is ??? */
+
+		/* PSC5 is ??? */
+
+		serial@2c00 { /* PSC6 in UART mode */
+			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
+			cell-index = <5>;
+			reg = <0x2c00 0x100>;
+			interrupts = <2 4 0>;
+		};
+
+		ethernet@3000 {
+			compatible = "fsl,mpc5200b-fec","fsl,mpc5200-fec";
+			reg = <0x3000 0x400>;
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			interrupts = <2 5 0>;
+			phy-handle = <&phy0>;
+		};
+
+		mdio@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,mpc5200b-mdio","fsl,mpc5200-mdio";
+			reg = <0x3000 0x400>;	// fec range, since we need to setup fec interrupts
+			interrupts = <2 5 0>;	// these are for "mii command finished", not link changes & co.
+
+			phy0: ethernet-phy@0 {
+				reg = <0>;
+			};
+		};
+
+		ata@3a00 {
+			compatible = "fsl,mpc5200b-ata","fsl,mpc5200-ata";
+			reg = <0x3a00 0x100>;
+			interrupts = <2 7 0>;
+		};
+
+		i2c@3d00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
+			reg = <0x3d00 0x40>;
+			interrupts = <2 15 0>;
+			fsl5200-clocking;
+		};
+
+		i2c@3d40 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
+			reg = <0x3d40 0x40>;
+			interrupts = <2 16 0>;
+			fsl5200-clocking;
+			rtc@51 {
+				compatible = "nxp,pcf8563";
+				reg = <0x51>;
+			};
+			eeprom@52 {
+				compatible = "at24,24c32";
+				reg = <0x52>;
+			};
+		};
+
+		sram@8000 {
+			compatible = "fsl,mpc5200b-sram","fsl,mpc5200-sram";
+			reg = <0x8000 0x4000>;
+		};
+	};
+
+	pci@f0000d00 {
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		compatible = "fsl,mpc5200b-pci","fsl,mpc5200-pci";
+		reg = <0xf0000d00 0x100>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+		interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
+				 0xc000 0 0 2 &mpc5200_pic 1 1 3
+				 0xc000 0 0 3 &mpc5200_pic 1 2 3
+				 0xc000 0 0 4 &mpc5200_pic 1 3 3
+
+				 0xc800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
+				 0xc800 0 0 2 &mpc5200_pic 1 2 3
+				 0xc800 0 0 3 &mpc5200_pic 1 3 3
+				 0xc800 0 0 4 &mpc5200_pic 0 0 3>;
+		clock-frequency = <0>; // From boot loader
+		interrupts = <2 8 0 2 9 0 2 10 0>;
+		bus-range = <0 0>;
+		ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000
+			  0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
+			  0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
+	};
+
+	localbus {
+		compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
+
+		#address-cells = <2>;
+		#size-cells = <1>;
+
+		ranges = <0 0 0xfe000000 0x02000000
+			  1 0 0xfc000000 0x02000000
+			  2 0 0xfbe00000 0x00200000
+			  3 0 0xf9e00000 0x02000000
+			  4 0 0xf7e00000 0x02000000
+			  5 0 0xe6000000 0x02000000
+			  6 0 0xe8000000 0x02000000
+			  7 0 0xea000000 0x02000000>;
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 0x02000000>;
+			bank-width = <4>;
+			#size-cells = <1>;
+			#address-cells = <1>;
+
+			partition@0 {
+				label = "ubootl";
+				reg = <0x00000000 0x00040000>;
+			};
+			partition@40000 {
+				label = "kernel";
+				reg = <0x00040000 0x001c0000>;
+			};
+			partition@200000 {
+				label = "jffs2";
+				reg = <0x00200000 0x01d00000>;
+			};
+			partition@1f00000 {
+				label = "uboot";
+				reg = <0x01f00000 0x00040000>;
+			};
+			partition@1f40000 {
+				label = "env";
+				reg = <0x01f40000 0x00040000>;
+			};
+			partition@1f80000 {
+				label = "oftree";
+				reg = <0x01f80000 0x00040000>;
+			};
+			partition@1fc0000 {
+				label = "space";
+				reg = <0x01fc0000 0x00040000>;
+			};
+		};
+
+		sram@2,0 {
+			compatible = "mtd-ram";
+			reg = <2 0 0x00200000>;
+			bank-width = <2>;
+		};
+
+                /*
+		 * example snippets for FPGA
+		 *
+		 * fpga@3,0 {
+		 *         compatible = "fpga_driver";
+		 *         reg = <3 0 0x02000000>;
+		 *         bank-width = <4>;
+		 * };
+		 *
+		 * fpga@4,0 {
+		 *         compatible = "fpga_driver";
+		 *         reg = <4 0 0x02000000>;
+		 *         bank-width = <4>;
+		 * };
+                 */
+
+                /*
+		 * example snippets for free chipselects
+                 *
+		 * device@5,0 {
+		 *         compatible = "custom_driver";
+		 *         reg = <5 0 0x02000000>;
+		 * };
+                 *
+		 * device@6,0 {
+		 *         compatible = "custom_driver";
+		 *         reg = <6 0 0x02000000>;
+		 * };
+                 *
+		 * device@7,0 {
+		 *         compatible = "custom_driver";
+		 *         reg = <7 0 0x02000000>;
+		 * };
+                 */
+	};
+};
+
diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index 0465e5b..75f82ab 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -24,6 +24,7 @@ config PPC_MPC5200_SIMPLE
 	  are:
 	     intercontrol,digsy-mtc
 	     phytec,pcm030
+	     phytec,pcm032
 	     promess,motionpro
 	     schindler,cm5200
 	     tqc,tqm5200
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c
index d5e1471..c31e5b5 100644
--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
@@ -51,8 +51,9 @@ static void __init mpc5200_simple_setup_arch(void)
 /* list of the supported boards */
 static char *board[] __initdata = {
 	"intercontrol,digsy-mtc",
-	"promess,motionpro",
 	"phytec,pcm030",
+	"phytec,pcm032",
+	"promess,motionpro",
 	"schindler,cm5200",
 	"tqc,tqm5200",
 	NULL
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 5/5] net: make mpc5200 fec driver use of_mdio infrastructure
From: Grant Likely @ 2009-03-10 15:22 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik
In-Reply-To: <20090310150751.12455.70598.stgit@localhost.localdomain>

From: Grant Likely <grant.likely@secretlab.ca>

The patch reworks the MPC5200 Fast Ethernet Controller (FEC) driver to
use the of_mdio infrastructure for registering PHY devices from data out
openfirmware device tree, and eliminates the assumption that the PHY
for the FEC is always attached to the FEC's own MDIO bus.  With this
patch, the FEC can use a PHY attached to any MDIO bus if it is described
in the device tree.
---

 drivers/net/Kconfig           |    2 
 drivers/net/fec_mpc52xx.c     |  220 ++++++++++++++++++-----------------------
 drivers/net/fec_mpc52xx_phy.c |   30 ++----
 3 files changed, 109 insertions(+), 143 deletions(-)


diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6bdfd47..5b74a9a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1854,7 +1854,7 @@ config FEC_MPC52xx
 
 config FEC_MPC52xx_MDIO
 	bool "MPC52xx FEC MDIO bus driver"
-	depends on FEC_MPC52xx
+	depends on FEC_MPC52xx && OF_MDIO
 	default y
 	---help---
 	  The MPC5200's FEC can connect to the Ethernet either with
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 049b0a7..4efcd47 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -43,11 +43,9 @@
 
 #define DRIVER_NAME "mpc52xx-fec"
 
-#define FEC5200_PHYADDR_NONE	(-1)
-#define FEC5200_PHYADDR_7WIRE	(-2)
-
 /* Private driver data structure */
 struct mpc52xx_fec_priv {
+	struct net_device *ndev;
 	int duplex;
 	int speed;
 	int r_irq;
@@ -59,10 +57,12 @@ struct mpc52xx_fec_priv {
 	int msg_enable;
 
 	/* MDIO link details */
-	int phy_addr;
-	unsigned int phy_speed;
+	struct notifier_block notifier;
+	unsigned int mdio_speed;
+	struct device_node *phy_node;
 	struct phy_device *phydev;
 	enum phy_state link;
+	int seven_wire_mode;
 };
 
 
@@ -210,66 +210,6 @@ static void mpc52xx_fec_adjust_link(struct net_device *dev)
 		phy_print_status(phydev);
 }
 
-static int mpc52xx_fec_init_phy(struct net_device *dev)
-{
-	struct mpc52xx_fec_priv *priv = netdev_priv(dev);
-	struct phy_device *phydev;
-	char phy_id[BUS_ID_SIZE];
-
-	snprintf(phy_id, sizeof(phy_id), "%x:%02x",
-			(unsigned int)dev->base_addr, priv->phy_addr);
-
-	priv->link = PHY_DOWN;
-	priv->speed = 0;
-	priv->duplex = -1;
-
-	phydev = phy_connect(dev, phy_id, &mpc52xx_fec_adjust_link, 0, PHY_INTERFACE_MODE_MII);
-	if (IS_ERR(phydev)) {
-		dev_err(&dev->dev, "phy_connect failed\n");
-		return PTR_ERR(phydev);
-	}
-	dev_info(&dev->dev, "attached phy %i to driver %s\n",
-			phydev->addr, phydev->drv->name);
-
-	priv->phydev = phydev;
-
-	return 0;
-}
-
-static int mpc52xx_fec_phy_start(struct net_device *dev)
-{
-	struct mpc52xx_fec_priv *priv = netdev_priv(dev);
-	int err;
-
-	if (priv->phy_addr < 0)
-		return 0;
-
-	err = mpc52xx_fec_init_phy(dev);
-	if (err) {
-		dev_err(&dev->dev, "mpc52xx_fec_init_phy failed\n");
-		return err;
-	}
-
-	/* reset phy - this also wakes it from PDOWN */
-	phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
-	phy_start(priv->phydev);
-
-	return 0;
-}
-
-static void mpc52xx_fec_phy_stop(struct net_device *dev)
-{
-	struct mpc52xx_fec_priv *priv = netdev_priv(dev);
-
-	if (!priv->phydev)
-		return;
-
-	phy_disconnect(priv->phydev);
-	/* power down phy */
-	phy_stop(priv->phydev);
-	phy_write(priv->phydev, MII_BMCR, BMCR_PDOWN);
-}
-
 static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
 		struct mii_ioctl_data *mii_data, int cmd)
 {
@@ -279,16 +219,6 @@ static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
 	return phy_mii_ioctl(priv->phydev, mii_data, cmd);
 }
 
-static void mpc52xx_fec_phy_hw_init(struct mpc52xx_fec_priv *priv)
-{
-	struct mpc52xx_fec __iomem *fec = priv->fec;
-
-	if (priv->phydev)
-		return;
-
-	out_be32(&fec->mii_speed, priv->phy_speed);
-}
-
 static int mpc52xx_fec_open(struct net_device *dev)
 {
 	struct mpc52xx_fec_priv *priv = netdev_priv(dev);
@@ -319,9 +249,14 @@ static int mpc52xx_fec_open(struct net_device *dev)
 		goto free_irqs;
 	}
 
-	err = mpc52xx_fec_phy_start(dev);
-	if (err)
-		goto free_skbs;
+	if (priv->phydev) {
+		/* reset phy - this also wakes it from PDOWN */
+		priv->link = PHY_DOWN;
+		priv->speed = 0;
+		priv->duplex = -1;
+		phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
+		phy_start(priv->phydev);
+	}
 
 	bcom_enable(priv->rx_dmatsk);
 	bcom_enable(priv->tx_dmatsk);
@@ -332,9 +267,6 @@ static int mpc52xx_fec_open(struct net_device *dev)
 
 	return 0;
 
- free_skbs:
-	mpc52xx_fec_free_rx_buffers(dev, priv->rx_dmatsk);
-
  free_irqs:
 	free_irq(priv->t_irq, dev);
  free_2irqs:
@@ -360,7 +292,11 @@ static int mpc52xx_fec_close(struct net_device *dev)
 	free_irq(priv->r_irq, dev);
 	free_irq(priv->t_irq, dev);
 
-	mpc52xx_fec_phy_stop(dev);
+	if (priv->phydev) {
+		/* power down phy */
+		phy_stop(priv->phydev);
+		phy_write(priv->phydev, MII_BMCR, BMCR_PDOWN);
+	}
 
 	return 0;
 }
@@ -700,7 +636,7 @@ static void mpc52xx_fec_hw_init(struct net_device *dev)
 	/* set phy speed.
 	 * this can't be done in phy driver, since it needs to be called
 	 * before fec stuff (even on resume) */
-	mpc52xx_fec_phy_hw_init(priv);
+	out_be32(&fec->mii_speed, priv->mdio_speed);
 }
 
 /**
@@ -736,7 +672,7 @@ static void mpc52xx_fec_start(struct net_device *dev)
 	rcntrl = FEC_RX_BUFFER_SIZE << 16;	/* max frame length */
 	rcntrl |= FEC_RCNTRL_FCE;
 
-	if (priv->phy_addr != FEC5200_PHYADDR_7WIRE)
+	if (!priv->seven_wire_mode)
 		rcntrl |= FEC_RCNTRL_MII_MODE;
 
 	if (priv->duplex == DUPLEX_FULL)
@@ -802,8 +738,6 @@ static void mpc52xx_fec_stop(struct net_device *dev)
 
 	/* Stop FEC */
 	out_be32(&fec->ecntrl, in_be32(&fec->ecntrl) & ~FEC_ECNTRL_ETHER_EN);
-
-	return;
 }
 
 /* reset fec and bestcomm tasks */
@@ -821,9 +755,11 @@ static void mpc52xx_fec_reset(struct net_device *dev)
 
 	mpc52xx_fec_hw_init(dev);
 
-	phy_stop(priv->phydev);
-	phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
-	phy_start(priv->phydev);
+	if (priv->phydev) {
+		phy_stop(priv->phydev);
+		phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
+		phy_start(priv->phydev);
+	}
 
 	bcom_fec_rx_reset(priv->rx_dmatsk);
 	bcom_fec_tx_reset(priv->tx_dmatsk);
@@ -888,6 +824,48 @@ static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 /* ======================================================================== */
 /* OF Driver                                                                */
 /* ======================================================================== */
+static int mpc52xx_fec_notifier_phy_add(struct notifier_block *nb,
+					unsigned long event, void *_dev)
+{
+	struct device *dev = _dev;
+	struct mpc52xx_fec_priv *priv;
+	unsigned long flags;
+	int rc;
+
+	priv = container_of(nb, struct mpc52xx_fec_priv, notifier);
+
+	/* Check if this is the phy that we're interested in */
+	if ((event != BUS_NOTIFY_ADD_DEVICE) ||
+	    (dev_archdata_get_node(&dev->archdata) != priv->phy_node))
+		return 0;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	if (priv->phydev) {
+		spin_unlock_irqrestore(&priv->lock, flags);
+		return 0;
+	}
+	priv->phydev = container_of(dev, struct phy_device, dev);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	rc = bus_unregister_notifier(&mdio_bus_type, &priv->notifier);
+	if (rc)
+		dev_warn(dev, "bus_unregister_notifier() failed\n");
+
+	rc = phy_connect_direct(priv->ndev, priv->phydev,
+				mpc52xx_fec_adjust_link, 0, 0);
+	if (rc) {
+		dev_err(dev, "phy_connect_direct() failed\n");
+		return 0;
+	}
+
+	rc = register_netdev(priv->ndev);
+	if (rc) {
+		phy_disconnect(priv->phydev);
+		dev_err(dev, "register_netdev() failed\n");
+	}
+
+	return 0;
+}
 
 static int __devinit
 mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
@@ -896,7 +874,6 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 	struct net_device *ndev;
 	struct mpc52xx_fec_priv *priv = NULL;
 	struct resource mem;
-	struct device_node *phy_node;
 	const phandle *phy_handle;
 	const u32 *prop;
 	int prop_size;
@@ -910,6 +887,7 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 		return -ENOMEM;
 
 	priv = netdev_priv(ndev);
+	priv->ndev = ndev;
 
 	/* Reserve FEC control zone */
 	rv = of_address_to_resource(op->node, 0, &mem);
@@ -943,6 +921,8 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	ndev->poll_controller = mpc52xx_fec_poll_controller;
 #endif
+	SET_NETDEV_DEV(ndev, &op->dev);
+
 
 	priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */
 
@@ -992,14 +972,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 	 */
 
 	/* Start with safe defaults for link connection */
-	priv->phy_addr = FEC5200_PHYADDR_NONE;
 	priv->speed = 100;
 	priv->duplex = DUPLEX_HALF;
-	priv->phy_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1;
-
-	/* the 7-wire property means don't use MII mode */
-	if (of_find_property(op->node, "fsl,7-wire-mode", NULL))
-		priv->phy_addr = FEC5200_PHYADDR_7WIRE;
+	priv->mdio_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1;
 
 	/* The current speed preconfigures the speed of the MII link */
 	prop = of_get_property(op->node, "current-speed", &prop_size);
@@ -1009,40 +984,37 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 	}
 
 	/* If there is a phy handle, setup link to that phy */
+	priv->notifier.notifier_call = mpc52xx_fec_notifier_phy_add;
 	phy_handle = of_get_property(op->node, "phy-handle", &prop_size);
-	if (phy_handle && (prop_size >= sizeof(phandle))) {
-		phy_node = of_find_node_by_phandle(*phy_handle);
-		prop = of_get_property(phy_node, "reg", &prop_size);
-		if (prop && (prop_size >= sizeof(u32)))
-			if ((*prop >= 0) && (*prop < PHY_MAX_ADDR))
-				priv->phy_addr = *prop;
-		of_node_put(phy_node);
+	if (phy_handle && (prop_size >= sizeof(phandle)))
+		priv->phy_node = of_find_node_by_phandle(*phy_handle);
+	if (priv->phy_node)
+		bus_register_notifier_alldev(&mdio_bus_type, &priv->notifier);
+
+	/* the 7-wire property means don't use MII mode */
+	if (of_find_property(op->node, "fsl,7-wire-mode", NULL)) {
+		if (priv->phy_node)
+			dev_err(&op->dev, "warning: 'fsl,7-wire-mode' is"
+				" illegal when 'phy-handle' is present\n");
+		else
+			priv->seven_wire_mode = 1;
 	}
 
 	/* Hardware init */
 	mpc52xx_fec_hw_init(ndev);
-
 	mpc52xx_fec_reset_stats(ndev);
 
-	SET_NETDEV_DEV(ndev, &op->dev);
-
-	/* Register the new network device */
-	rv = register_netdev(ndev);
-	if (rv < 0)
-		goto probe_error;
-
-	/* Now report the link setup */
-	switch (priv->phy_addr) {
-	 case FEC5200_PHYADDR_NONE:
-		dev_info(&ndev->dev, "Fixed speed MII link: %i%cD\n",
-			 priv->speed, priv->duplex ? 'F' : 'H');
-		break;
-	 case FEC5200_PHYADDR_7WIRE:
-		dev_info(&ndev->dev, "using 7-wire PHY mode\n");
-		break;
-	 default:
-		dev_info(&ndev->dev, "Using PHY at MDIO address %i\n",
-			 priv->phy_addr);
+	/* Register the new network device immediately if we don't need
+	 * to wait for a phy_device first. */
+	if (!priv->phy_node) {
+		if (priv->seven_wire_mode)
+			dev_info(&ndev->dev, "using 7-wire PHY mode\n");
+		else
+			dev_info(&ndev->dev, "Fixed speed MII link: %i%cD\n",
+				 priv->speed, priv->duplex ? 'F' : 'H');
+		rv = register_netdev(ndev);
+		if (rv < 0)
+			goto probe_error;
 	}
 
 	/* We're done ! */
@@ -1050,10 +1022,8 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
 
 	return 0;
 
-
 	/* Error handling - free everything that might be allocated */
 probe_error:
-
 	irq_dispose_mapping(ndev->irq);
 
 	if (priv->rx_dmatsk)
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
index dd9bfa4..261a5e7 100644
--- a/drivers/net/fec_mpc52xx_phy.c
+++ b/drivers/net/fec_mpc52xx_phy.c
@@ -14,12 +14,14 @@
 #include <linux/netdevice.h>
 #include <linux/phy.h>
 #include <linux/of_platform.h>
+#include <linux/of_mdio.h>
 #include <asm/io.h>
 #include <asm/mpc52xx.h>
 #include "fec_mpc52xx.h"
 
 struct mpc52xx_fec_mdio_priv {
 	struct mpc52xx_fec __iomem *regs;
+	int mdio_irqs[PHY_MAX_ADDR];
 };
 
 static int mpc52xx_fec_mdio_transfer(struct mii_bus *bus, int phy_id,
@@ -27,7 +29,7 @@ static int mpc52xx_fec_mdio_transfer(struct mii_bus *bus, int phy_id,
 {
 	struct mpc52xx_fec_mdio_priv *priv = bus->priv;
 	struct mpc52xx_fec __iomem *fec;
-	int tries = 100;
+	int tries = 3;
 
 	value |= (phy_id << FEC_MII_DATA_PA_SHIFT) & FEC_MII_DATA_PA_MSK;
 	value |= (reg << FEC_MII_DATA_RA_SHIFT) & FEC_MII_DATA_RA_MSK;
@@ -38,7 +40,7 @@ static int mpc52xx_fec_mdio_transfer(struct mii_bus *bus, int phy_id,
 
 	/* wait for it to finish, this takes about 23 us on lite5200b */
 	while (!(in_be32(&fec->ievent) & FEC_IEVENT_MII) && --tries)
-		udelay(5);
+		msleep(1);
 
 	if (!tries)
 		return -ETIMEDOUT;
@@ -64,7 +66,6 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
 {
 	struct device *dev = &of->dev;
 	struct device_node *np = of->node;
-	struct device_node *child = NULL;
 	struct mii_bus *bus;
 	struct mpc52xx_fec_mdio_priv *priv;
 	struct resource res = {};
@@ -85,23 +86,10 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
 	bus->write = mpc52xx_fec_mdio_write;
 
 	/* setup irqs */
-	bus->irq = kmalloc(sizeof(bus->irq[0]) * PHY_MAX_ADDR, GFP_KERNEL);
-	if (bus->irq == NULL) {
-		err = -ENOMEM;
-		goto out_free;
-	}
+	bus->irq = priv->mdio_irqs;
 	for (i=0; i<PHY_MAX_ADDR; i++)
 		bus->irq[i] = PHY_POLL;
 
-	while ((child = of_get_next_child(np, child)) != NULL) {
-		int irq = irq_of_parse_and_map(child, 0);
-		if (irq != NO_IRQ) {
-			const u32 *id = of_get_property(child, "reg", NULL);
-			if (id)
-				bus->irq[*id] = irq;
-		}
-	}
-
 	/* setup registers */
 	err = of_address_to_resource(np, 0, &res);
 	if (err)
@@ -122,10 +110,18 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
 	out_be32(&priv->regs->mii_speed,
 		((mpc52xx_find_ipb_freq(of->node) >> 20) / 5) << 1);
 
+	/* Mask out all from auto probing.  Instead the PHYs listed in
+	 * device tree are populated after the bus has been registered
+	 */
+	bus->phy_mask = -1;
+
 	err = mdiobus_register(bus);
 	if (err)
 		goto out_unmap;
 
+	/* Populate the PHY devices from the device tree */
+	of_register_phy_devices(bus, np);
+
 	return 0;
 
  out_unmap:

^ permalink raw reply related

* [PATCH 4/5] openfirmware: Add OF phylib support code
From: Grant Likely @ 2009-03-10 15:22 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik
In-Reply-To: <20090310150751.12455.70598.stgit@localhost.localdomain>

From: Grant Likely <grant.likely@secretlab.ca>

Add support for parsing the device tree for PHY devices on an MDIO bus

CC: Andy Fleming <afleming@freescale.com>
CC: linuxppc-dev@ozlabs.org
CC: devtree-discuss@ozlabs.org

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/of/Kconfig      |    6 ++++
 drivers/of/Makefile     |    1 +
 drivers/of/of_mdio.c    |   70 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/of_mdio.h |   20 +++++++++++++
 4 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 drivers/of/of_mdio.c
 create mode 100644 include/linux/of_mdio.h


diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index f821dbc..6fe043b 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -19,3 +19,9 @@ config OF_SPI
 	depends on OF && PPC_OF && SPI
 	help
 	  OpenFirmware SPI accessors
+
+config OF_MDIO
+	def_tristate PHYLIB
+	depends on OF && PHYLIB
+	help
+	  OpenFirmware MDIO bus (Ethernet PHY) accessors
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index 4c3c6f8..bdfb5f5 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_OF_DEVICE) += device.o platform.o
 obj-$(CONFIG_OF_GPIO)   += gpio.o
 obj-$(CONFIG_OF_I2C)	+= of_i2c.o
 obj-$(CONFIG_OF_SPI)	+= of_spi.o
+obj-$(CONFIG_OF_MDIO)	+= of_mdio.o
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
new file mode 100644
index 0000000..6a7d4b2
--- /dev/null
+++ b/drivers/of/of_mdio.c
@@ -0,0 +1,70 @@
+/*
+ * OF helpers for the MDIO (Ethernet PHY) API
+ *
+ * Copyright (c) 2009 Secret Lab Technologies, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This file provides helper functions for extracting PHY device information
+ * out of the OpenFirmware device tree and using it to populate an mii_bus.
+ */
+
+#include <linux/phy.h>
+#include <linux/of.h>
+#include <linux/of_mdio.h>
+#include <linux/module.h>
+
+void of_register_phy_devices(struct mii_bus *mdio, struct device_node *np)
+{
+	struct phy_device *phy;
+	struct device_node *child;
+	int rc;
+
+	for_each_child_of_node(np, child) {
+		const u32 *addr;
+		int len;
+
+		addr = of_get_property(child, "reg", &len);
+		if (!addr || len < sizeof(*addr) || *addr >= 32 || *addr < 0) {
+			dev_err(&mdio->dev, "%s has invalid PHY address\n",
+				child->full_name);
+			continue;
+		}
+
+		if (mdio->irq) {
+			mdio->irq[*addr] = irq_of_parse_and_map(child, 0);
+			if (!mdio->irq[*addr])
+				mdio->irq[*addr] = PHY_POLL;
+		}
+
+		phy = get_phy_device(mdio, *addr);
+		if (!phy) {
+			dev_err(&mdio->dev, "error probing PHY at address %i\n",
+				*addr);
+			continue;
+		}
+		phy_scan_fixups(phy);
+
+		/* Associate the OF node with the device structure so it
+		 * can be looked up later */
+		of_node_get(child);
+		dev_archdata_set_node(&phy->dev.archdata, child);
+
+		/* All data is now stored in the phy struct; register it */
+		rc = phy_device_register(phy);
+		if (rc) {
+			phy_device_free(phy);
+			of_node_put(child);
+			continue;
+		}
+
+		dev_dbg(&mdio->dev, "registered phy %s at address %i\n",
+			child->name, *addr);
+	}
+}
+EXPORT_SYMBOL(of_register_phy_devices);
+
+MODULE_LICENSE("GPL");
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
new file mode 100644
index 0000000..9ea9745
--- /dev/null
+++ b/include/linux/of_mdio.h
@@ -0,0 +1,20 @@
+/*
+ * OF helpers for the MDIO (Ethernet PHY) API
+ *
+ * Copyright (c) 2009 Secret Lab Technologies, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __LINUX_OF_MDIO_H
+#define __LINUX_OF_MDIO_H
+
+#include <linux/phy.h>
+#include <linux/of.h>
+
+void of_register_phy_devices(struct mii_bus *mdio, struct device_node *np);
+
+#endif /* __LINUX_OF_MDIO_H */

^ permalink raw reply related

* [PATCH 3/5] phylib: add *_direct() variants of phy_connect and phy_attach functions
From: Grant Likely @ 2009-03-10 15:22 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik
In-Reply-To: <20090310150751.12455.70598.stgit@localhost.localdomain>

From: Grant Likely <grant.likely@secretlab.ca>

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: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/net/phy/phy_device.c |  118 ++++++++++++++++++++++++++++++------------
 include/linux/phy.h          |    5 ++
 2 files changed, 90 insertions(+), 33 deletions(-)


diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 793332f..238d21e 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -290,6 +290,33 @@ void phy_prepare_link(struct phy_device *phydev,
 }
 
 /**
+ * phy_connect_direct - connect an ethernet device to a specific phy_device
+ * @dev: the network device to connect
+ * @phydev: the pointer to the phy device
+ * @handler: callback function for state change notifications
+ * @flags: PHY device's dev_flags
+ * @interface: PHY device's interface
+ */
+int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
+		       void (*handler)(struct net_device *), u32 flags,
+		       phy_interface_t interface)
+{
+	int rc;
+
+	rc = phy_attach_direct(dev, phydev, flags, interface);
+	if (rc)
+		return rc;
+
+	phy_prepare_link(phydev, handler);
+	phy_start_machine(phydev, NULL);
+	if (phydev->irq > 0)
+		phy_start_interrupts(phydev);
+
+	return 0;
+}
+EXPORT_SYMBOL(phy_connect_direct);
+
+/**
  * phy_connect - connect an ethernet device to a PHY device
  * @dev: the network device to connect
  * @bus_id: the id string of the PHY device to connect
@@ -310,18 +337,21 @@ struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
 		phy_interface_t interface)
 {
 	struct phy_device *phydev;
+	struct device *d;
+	int rc;
 
-	phydev = phy_attach(dev, bus_id, flags, interface);
-
-	if (IS_ERR(phydev))
-		return phydev;
-
-	phy_prepare_link(phydev, handler);
-
-	phy_start_machine(phydev, NULL);
+	/* Search the list of PHY devices on the mdio bus for the
+	 * PHY with the requested name */
+	d = bus_find_device_by_name(&mdio_bus_type, NULL, bus_id);
+	if (!d) {
+		pr_err("PHY %s not found\n", bus_id);
+		return ERR_PTR(-ENODEV);
+	}
+	phydev = to_phy_device(d);
 
-	if (phydev->irq > 0)
-		phy_start_interrupts(phydev);
+	rc = phy_attach_direct(dev, phydev, flags, interface);
+	if (rc)
+		return ERR_PTR(rc);
 
 	return phydev;
 }
@@ -345,9 +375,9 @@ void phy_disconnect(struct phy_device *phydev)
 EXPORT_SYMBOL(phy_disconnect);
 
 /**
- * phy_attach - attach a network device to a particular PHY device
+ * phy_attach_direct - attach a network device to a given PHY device pointer
  * @dev: network device to attach
- * @bus_id: PHY device to attach
+ * @phydev: Pointer to phy_device to attach
  * @flags: PHY device's dev_flags
  * @interface: PHY device's interface
  *
@@ -358,22 +388,10 @@ EXPORT_SYMBOL(phy_disconnect);
  *     the attaching device, and given a callback for link status
  *     change.  The phy_device is returned to the attaching driver.
  */
-struct phy_device *phy_attach(struct net_device *dev,
-		const char *bus_id, u32 flags, phy_interface_t interface)
+int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
+		      u32 flags, phy_interface_t interface)
 {
-	struct bus_type *bus = &mdio_bus_type;
-	struct phy_device *phydev;
-	struct device *d;
-
-	/* Search the list of PHY devices on the mdio bus for the
-	 * PHY with the requested name */
-	d = bus_find_device_by_name(bus, NULL, bus_id);
-	if (d) {
-		phydev = to_phy_device(d);
-	} else {
-		printk(KERN_ERR "%s not found\n", bus_id);
-		return ERR_PTR(-ENODEV);
-	}
+	struct device *d = &phydev->dev;
 
 	/* Assume that if there is no driver, that it doesn't
 	 * exist, and we should use the genphy driver. */
@@ -386,13 +404,12 @@ struct phy_device *phy_attach(struct net_device *dev,
 			err = device_bind_driver(d);
 
 		if (err)
-			return ERR_PTR(err);
+			return err;
 	}
 
 	if (phydev->attached_dev) {
-		printk(KERN_ERR "%s: %s already attached\n",
-				dev->name, bus_id);
-		return ERR_PTR(-EBUSY);
+		dev_err(&dev->dev, "PHY already attached\n");
+		return -EBUSY;
 	}
 
 	phydev->attached_dev = dev;
@@ -410,13 +427,48 @@ struct phy_device *phy_attach(struct net_device *dev,
 		err = phy_scan_fixups(phydev);
 
 		if (err < 0)
-			return ERR_PTR(err);
+			return err;
 
 		err = phydev->drv->config_init(phydev);
 
 		if (err < 0)
-			return ERR_PTR(err);
+			return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(phy_attach_direct);
+
+/**
+ * phy_attach - attach a network device to a particular PHY device
+ * @dev: network device to attach
+ * @bus_id: Bus ID of PHY device to attach
+ * @flags: PHY device's dev_flags
+ * @interface: PHY device's interface
+ *
+ * Description: Same as phy_attach_direct() except that a PHY bus_id
+ *     string is passed instead of a pointer to a struct phy_device.
+ */
+struct phy_device *phy_attach(struct net_device *dev,
+		const char *bus_id, u32 flags, phy_interface_t interface)
+{
+	struct bus_type *bus = &mdio_bus_type;
+	struct phy_device *phydev;
+	struct device *d;
+	int rc;
+
+	/* Search the list of PHY devices on the mdio bus for the
+	 * PHY with the requested name */
+	d = bus_find_device_by_name(bus, NULL, bus_id);
+	if (!d) {
+		pr_err("PHY %s not found\n", bus_id);
+		return ERR_PTR(-ENODEV);
 	}
+	phydev = to_phy_device(d);
+
+	rc = phy_attach_direct(dev, phydev, flags, interface);
+	if (rc)
+		return ERR_PTR(rc);
 
 	return phydev;
 }
diff --git a/include/linux/phy.h b/include/linux/phy.h
index a47d64f..97405f2 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -442,8 +442,13 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
 int phy_device_register(struct phy_device *phy);
 int phy_clear_interrupt(struct phy_device *phydev);
 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
+int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
+		u32 flags, phy_interface_t interface);
 struct phy_device * phy_attach(struct net_device *dev,
 		const char *bus_id, u32 flags, phy_interface_t interface);
+int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
+		void (*handler)(struct net_device *), u32 flags,
+		phy_interface_t interface);
 struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
 		void (*handler)(struct net_device *), u32 flags,
 		phy_interface_t interface);

^ permalink raw reply related

* [PATCH 2/5] phylib: rework to prepare for OF registration of PHYs
From: Grant Likely @ 2009-03-10 15:22 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik
In-Reply-To: <20090310150751.12455.70598.stgit@localhost.localdomain>

From: Grant Likely <grant.likely@secretlab.ca>

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: Grant Likely <grant.likely@secretlab.ca>
CC: linuxppc-dev@ozlabs.org
CC: netdev@vger.kernel.org
CC: Andy Fleming <afleming@freescale.com>
---

 drivers/net/phy/mdio_bus.c   |   29 +++-------------------------
 drivers/net/phy/phy_device.c |   43 ++++++++++++++++++++++++++++++++++++++----
 include/linux/phy.h          |    1 +
 3 files changed, 43 insertions(+), 30 deletions(-)


diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 811a637..3c39c7b 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -112,7 +112,6 @@ int mdiobus_register(struct mii_bus *bus)
 		bus->reset(bus);
 
 	for (i = 0; i < PHY_MAX_ADDR; i++) {
-		bus->phy_map[i] = NULL;
 		if ((bus->phy_mask & (1 << i)) == 0) {
 			struct phy_device *phydev;
 
@@ -149,6 +148,7 @@ void mdiobus_unregister(struct mii_bus *bus)
 	for (i = 0; i < PHY_MAX_ADDR; i++) {
 		if (bus->phy_map[i])
 			device_unregister(&bus->phy_map[i]->dev);
+		bus->phy_map[i] = NULL;
 	}
 }
 EXPORT_SYMBOL(mdiobus_unregister);
@@ -187,35 +187,12 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
 	if (IS_ERR(phydev) || phydev == NULL)
 		return phydev;
 
-	/* There's a PHY at this address
-	 * We need to set:
-	 * 1) IRQ
-	 * 2) bus_id
-	 * 3) parent
-	 * 4) bus
-	 * 5) mii_bus
-	 * And, we need to register it */
-
-	phydev->irq = bus->irq != NULL ? bus->irq[addr] : PHY_POLL;
-
-	phydev->dev.parent = bus->parent;
-	phydev->dev.bus = &mdio_bus_type;
-	dev_set_name(&phydev->dev, PHY_ID_FMT, bus->id, addr);
-
-	phydev->bus = bus;
-
-	/* Run all of the fixups for this PHY */
-	phy_scan_fixups(phydev);
-
-	err = device_register(&phydev->dev);
+	err = phy_device_register(phydev);
 	if (err) {
-		printk(KERN_ERR "phy %d failed to register\n", addr);
 		phy_device_free(phydev);
-		phydev = NULL;
+		return NULL;
 	}
 
-	bus->phy_map[addr] = phydev;
-
 	return phydev;
 }
 EXPORT_SYMBOL(mdiobus_scan);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0a06e4f..793332f 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -39,10 +39,6 @@ MODULE_DESCRIPTION("PHY library");
 MODULE_AUTHOR("Andy Fleming");
 MODULE_LICENSE("GPL");
 
-static struct phy_driver genphy_driver;
-extern int mdio_bus_init(void);
-extern void mdio_bus_exit(void);
-
 void phy_device_free(struct phy_device *phydev)
 {
 	kfree(phydev);
@@ -53,6 +49,10 @@ static void phy_device_release(struct device *dev)
 	phy_device_free(to_phy_device(dev));
 }
 
+static struct phy_driver genphy_driver;
+extern int mdio_bus_init(void);
+extern void mdio_bus_exit(void);
+
 static LIST_HEAD(phy_fixup_list);
 static DEFINE_MUTEX(phy_fixup_lock);
 
@@ -166,6 +166,10 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
 	dev->addr = addr;
 	dev->phy_id = phy_id;
 	dev->bus = bus;
+	dev->dev.parent = bus->parent;
+	dev->dev.bus = &mdio_bus_type;
+	dev->irq = bus->irq != NULL ? bus->irq[addr] : PHY_POLL;
+	dev_set_name(&dev->dev, PHY_ID_FMT, bus->id, addr);
 
 	dev->state = PHY_DOWN;
 
@@ -237,6 +241,37 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
 }
 
 /**
+ * phy_device_register - Register the phy device on the MDIO bus
+ * @phy_device: phy_device structure to be added to the MDIO bus
+ */
+int phy_device_register(struct phy_device *phydev)
+{
+	int err;
+
+	/* Don't register a phy if one is already registered at this
+	 * address */
+	if (phydev->bus->phy_map[phydev->addr])
+		return -EINVAL;
+	phydev->bus->phy_map[phydev->addr] = phydev;
+
+	/* Run all of the fixups for this PHY */
+	phy_scan_fixups(phydev);
+
+	err = device_register(&phydev->dev);
+	if (err) {
+		pr_err("phy %d failed to register\n", phydev->addr);
+		goto out;
+	}
+
+	return 0;
+
+ out:
+	phydev->bus->phy_map[phydev->addr] = NULL;
+	return err;
+}
+EXPORT_SYMBOL(phy_device_register);
+
+/**
  * phy_prepare_link - prepares the PHY layer to monitor link status
  * @phydev: target phy_device struct
  * @handler: callback function for link status change notifications
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d7e54d9..a47d64f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -439,6 +439,7 @@ static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
 
 int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
 struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
+int phy_device_register(struct phy_device *phy);
 int phy_clear_interrupt(struct phy_device *phydev);
 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
 struct phy_device * phy_attach(struct net_device *dev,

^ permalink raw reply related

* [PATCH 1/5] drivers/base: Add bus_register_notifier_alldev() variant
From: Grant Likely @ 2009-03-10 15:22 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik
In-Reply-To: <20090310150751.12455.70598.stgit@localhost.localdomain>

From: Grant Likely <grant.likely@secretlab.ca>

bus_register_notifier_alldev() is a variation on bus_register_notifier()
which also triggers the notifier callback for devices already on the bus
and already bound to drivers.

This function is useful for the case where a driver needs to get a
reference to a struct device other than the one it is bound to and
it is not known if the device will be bound before or after this
function is called.  For example, an Ethernet device connected to
a PHY that is probed separately.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: linux-kernel@vger.kernel.org
CC: linuxppc-dev@ozlabs.org
CC: Greg Kroah-Hartman <gregkh@suse.de>
---

 drivers/base/bus.c     |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/device.h |    2 ++
 2 files changed, 49 insertions(+), 0 deletions(-)


diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 83f32b8..6edde85 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -962,6 +962,53 @@ int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb)
 }
 EXPORT_SYMBOL_GPL(bus_register_notifier);
 
+/**
+ * bus_register_notifier_alldev_helper - internal support function
+ * Used by bus_register_notifier_alldev() to create ADD and BOUND events
+ * for devices.
+ */
+static int bus_register_notifier_alldev_helper(struct device *dev, void *data)
+{
+	struct notifier_block *nb = data;
+	nb->notifier_call(nb, BUS_NOTIFY_ADD_DEVICE, dev);
+	if (dev->driver)
+		nb->notifier_call(nb, BUS_NOTIFY_BOUND_DRIVER, dev);
+	return 0;
+}
+
+/**
+ * bus_register_notifier_alldev - Register for bus events; include existing devs
+ * @bus: pointer to bus_type
+ * @nb: pointer to notifier block to register with the bus
+ *
+ * Similar to bus_register_notifier() except it also generates events for
+ * devices already on the bus when the notifier is registered.  When this
+ * function is called the notifier is called once for each device with
+ * the BUS_NOTIFY_ADD_DEVICE event, and once for each device registered to
+ * a driver * with the BUS_NOTIFY_BOUND_DRIVER event.
+ *
+ * There is a small chance that the notifier could be called more than once
+ * for a device.  This would happen if a new device was registered on the bus
+ * or bound to a driver between the call to bus_register_notifier() and the
+ * call to bus_for_each_dev().  The only way I can see to protect against
+ * this would be to take the klist_devices spinlock while calling the
+ * notifier; but that would be a Very Bad Thing (tm).  Caller needs to be
+ * aware that a notifier called before this function returns might get
+ * called a second time on the same device.
+ */
+int bus_register_notifier_alldev(struct bus_type *b, struct notifier_block *nb)
+{
+	int ret;
+
+	ret = bus_register_notifier(b, nb);
+	if (ret == 0) {
+		bus_for_each_dev(b, NULL, nb,
+				 bus_register_notifier_alldev_helper);
+	}
+	return ret;
+}
+EXPORT_SYMBOL_GPL(bus_register_notifier_alldev);
+
 int bus_unregister_notifier(struct bus_type *bus, struct notifier_block *nb)
 {
 	return blocking_notifier_chain_unregister(&bus->p->bus_notifier, nb);
diff --git a/include/linux/device.h b/include/linux/device.h
index 47f343c..95a7d2b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -103,6 +103,8 @@ struct notifier_block;
 
 extern int bus_register_notifier(struct bus_type *bus,
 				 struct notifier_block *nb);
+extern int bus_register_notifier_alldev(struct bus_type *b,
+					struct notifier_block *nb);
 extern int bus_unregister_notifier(struct bus_type *bus,
 				   struct notifier_block *nb);
 

^ permalink raw reply related

* [PATCH 0/5] Retrieving Ethernet PHY wireup from the OF device tree
From: Grant Likely @ 2009-03-10 15:21 UTC (permalink / raw)
  To: afleming, linuxppc-dev, linux-kernel, netdev, jgarzik

Hi all,

This series reworks some of the phylib code to allow PHY descriptions and
connections to be extracted from the OF device tree.  MDIO bus drivers gain
a common helper function for parsing the PHY data and registering new
phy_devices to match.  Ethernet controller drivers gain the ability to
resolve to a phy_device from a device tree phandle.

One notable aspect is that the Ethernet controller driver doesn't know
if the phy_device is registered before or after the Ethernet driver.  This
series adds a function to the device model core code to make it simple for
the driver to register a bus notifier (mdio_bus in this case), which gets
called both for existing devices and for future device registrations.  The
advantage of this is that the driver doesn't need to know or care when the
device actually shows up.  It just knows that its callback will get called
when the device is available.  I think this is a good approach, but I'd
appreciate some feedback on it.

Cheers,
g.

drivers/base/bus.c            |   47 +++++++++
 drivers/net/Kconfig           |    2 +-
 drivers/net/fec_mpc52xx.c     |  220 ++++++++++++++++++-----------------------
 drivers/net/fec_mpc52xx_phy.c |   30 +++---
 drivers/net/phy/mdio_bus.c    |   29 +-----
 drivers/net/phy/phy_device.c  |  161 +++++++++++++++++++++++-------
 drivers/of/Kconfig            |    6 +
 drivers/of/Makefile           |    1 +
 drivers/of/of_mdio.c          |   70 +++++++++++++
 include/linux/device.h        |    2 +
 include/linux/of_mdio.h       |   20 ++++
 include/linux/phy.h           |    6 +
 12 files changed, 388 insertions(+), 206 deletions(-)

--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Fix MPC8572DS PCI protected interrupt sources
From: Kumar Gala @ 2009-03-10 14:43 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Ted Peters
In-Reply-To: <1236695923-20119-1-git-send-email-galak@kernel.crashing.org>


On Mar 10, 2009, at 9:38 AM, Kumar Gala wrote:

> From: Ted Peters <ted.peters@freescale.com>
>
> The PCI irqs for the protected sources where not correct for PCI PHBs
>
> Signed-off-by: Ted Peters <ted.peters@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts |    2 +-
> arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts |    2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)

applied to next

- k

^ permalink raw reply

* [PATCH] powerpc/85xx: Fix MPC8572DS PCI protected interrupt sources
From: Kumar Gala @ 2009-03-10 14:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Ted Peters

From: Ted Peters <ted.peters@freescale.com>

The PCI irqs for the protected sources where not correct for PCI PHBs

Signed-off-by: Ted Peters <ted.peters@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts |    2 +-
 arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index 15d9e35..32178bf 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -227,7 +227,7 @@
 			device_type = "open-pic";
 			protected-sources = <
 			31 32 33 37 38 39       /* enet2 enet3 */
-			76 77 78 79 27 42	/* dma2 pci2 serial*/
+			76 77 78 79 26 42	/* dma2 pci2 serial*/
 			0xe0 0xe1 0xe2 0xe3     /* msi */
 			0xe4 0xe5 0xe6 0xe7
 			>;
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index eace811..159cb3a 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -186,7 +186,7 @@
 			protected-sources = <
 			18 16 10 42 45 58	/* MEM L2 mdio serial crypto */
 			29 30 34 35 36 40	/* enet0 enet1 */
-			24 26 20 21 22 23	/* pcie0 pcie1 dma1 */
+			24 25 20 21 22 23	/* pci0 pci1 dma1 */
 			43			/* i2c */
 			0x1 0x2 0x3 0x4         /* pci slot */
 			0x9 0xa 0xb 0xc         /* usb */
-- 
1.5.6.6

^ permalink raw reply related

* Re: 2.6.29-rc7-git2 : crash in kmem_list3_init()
From: Sachin P. Sant @ 2009-03-10 14:22 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linuxppc-dev, cl
In-Reply-To: <20090310134610.GB13020@csn.ul.ie>

Mel Gorman wrote:
>
> Well, the machine must have started with some kernel. What mainline
> version does that correspond to and can you bisect it?
>   
The last booted kernel was a 2.6.25 based kernel. I am trying to find out
the last good kernel.org kernel. I should have that information by tomorrow.


> What is the base page size of the test kernel - 4K or 64K? Depending on
> which one it is, the start of node 1 may not be MAX_ORDER-aligned, gets
> overlapped with node-0 and goes downhill from there.
>   
The kernel is configured with 64K pages.

Thanks
-Sachin


-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

^ permalink raw reply

* 转发: powerpc 405ex emac1 problem connect to single Giga phy
From: zhong wang @ 2009-03-10 14:17 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3141 bytes --]







Hello all: 
  We use the AMCC PowerPC 405ex through emac1 way RGMII with realtek RTL8211 Giga phy linked to, At present the PHY Address is: 00110 
add delay  2ns for RGMII 
CONFIG[8:5]:AUTO_Negotiation 
1111=NWay,advertise ,all capabilities,prefer Slave 
mode;1=RGMII mode 
Clk on the hardware no problem, Mdio, mdc even on, but at Llinux / driver / net / ibm-newemac / core.c discovered phy address, phy ID at  .Config file has joined 
     NETDEVICE = Y 
     PHYLIB=Y 
     REALTEK-PHY=Y 
   But will be compiled under the best Uimage to board, the feeling of the PHY the driver has not been mounted use. The following is a kernel information :

PPC 4xx OCP EMAC driver, version 3.54 
MAL v2 /plb/mcmal, 2 TX channels, 2 RX channels 
RGMII /plb/opb/emac-rgmii@ef600b00 initialized with MDIO support 
/plb/opb/emac-rgmii@ef600b00: input 0 in RGMII mode 
eth0: EMAC-0 /plb/opb/ethernet@ef600900, MAC 00:47:41:52:52:59 
/plb/opb/emac-rgmii@ef600b00: input 1 in RGMII mode 
/plb/opb/ethernet@ef600a00: find TRL 821X Giga PHY(0x4) 
  
  But also in Llinux / driver / net / ibm-newemac / phy.c also add the operation of RTL8211bg as follows: 
#define RTL821x_PHYSR            0x11 
#define RTL821x_PHYSR_DUPLEX    0x2000 
#define RTL821x_PHYSR_SPEED       0xc000 
#define RTL821x_INER        0x12 
#define RTL821x_INER_INIT      0x6400 
#define RTL821x_INSR        0x13 
static int rtl821x_init(struct mii_phy *phy) 
{ 
       phy_write(phy, RTL821x_INER, 0x6400); //enable interrupt 
              return  0; 
} 
  
static struct mii_phy_ops rtl821x_phy_ops = { 
       .init         = rtl821x_init, 
       .setup_aneg    = genmii_setup_aneg, 
       .setup_forced  = genmii_setup_forced, 
       .poll_link = genmii_poll_link, 
       .read_link       = genmii_read_link 
}; 
  
static struct mii_phy_def rtl821x_phy_def = { 
       .phy_id           = 0x001cc912,  // for rtl8211 single phy 
   // .phy_id         = 0x001cc960,   for 8366sr inside phy 4 
       .phy_id_mask = 0x001fffff, 
       .name             = "RTL 821X Giga Phy", 
       .features  = PHY_GBIT_FEATURES, 
       //.flags           = PHY_HAS_INTERRUPT, 
       .ops        = &rtl821x_phy_ops 
  
  But will be compiled under the best Uimage to board, the feeling of the PHY the driver has not been mounted use. The following is a kernel information 
     After IP with a good PC PING board, Return Request Time Out! Troublesome players you look at what questions are 
  
      Connection diagram, see attachment 
  
                                leowang 
                                2009:03:10


好玩贺卡等你发,邮箱贺卡全新上线!


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/

[-- Attachment #2: Connection diagram.pdf --]
[-- Type: application/pdf, Size: 11298 bytes --]

^ permalink raw reply

* Next 10: Badness at mm/allocpercpu.c:123
From: Sachin P. Sant @ 2009-03-10 14:12 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, linux-next, LKML
In-Reply-To: <20090310195534.8f8f3c7a.sfr@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 2318 bytes --]

While booting Next 20090310 on a powerpc box (Power6 9117-MMA)
i observed the following badness :

[    0.339662] ------------[ cut here ]------------
[    0.339666] Badness at mm/allocpercpu.c:123
[    0.339670] NIP: c0000000001129dc LR: c0000000001129b8 CTR: 0000000000000000
[    0.339676] REGS: c0000000fe1efa10 TRAP: 0700   Not tainted  (2.6.29-rc7-next-20090310)
[    0.339681] MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24000024  XER: 20000002
[    0.339695] TASK = c0000000fe1dd3d0[1] 'swapper' THREAD: c0000000fe1ec000 CPU: 0
[    0.339701] GPR00: 0000000000000001 c0000000fe1efc90 c000000000948660 c0000000fe019000
[    0.339711] GPR04: 0000000000000000 0000000000000000 c0000000fe019080 c00000000122e980
[    0.339721] GPR08: 0000000000000000 c000000001467dec c0000000fe0e2610 c0000000fe1dd3d0
[    0.339732] GPR12: 0000000044000022 c000000000a22300 c000000000733ad0 c00000000065e0c5
[    0.339742] GPR16: 0000000003c33a08 0000000000000000 c000000000733a08 0000000002f1fc90
[    0.339752] GPR20: c000000000733a20 c000000000679b30 0000000000000000 0000000002f1fc90
[    0.339763] GPR24: 0000000000000000 0000000000000000 c000000000670ccd 0000000000000001
[    0.339773] GPR28: c0000000fe019000 0000000000000080 c0000000008cb908 0000000000000100
[    0.339788] NIP [c0000000001129dc] .__alloc_percpu+0x7c/0x244
[    0.339793] LR [c0000000001129b8] .__alloc_percpu+0x58/0x244
[    0.339798] Call Trace:
[    0.339801] [c0000000fe1efc90] [c0000000001129b8] .__alloc_percpu+0x58/0x244 (unreliable)
[    0.339810] [c0000000fe1efdc0] [c00000000007ce84] .__create_workqueue_key+0x74/0x2a0
[    0.339819] [c0000000fe1efe70] [c000000000716990] .cpuset_init_smp+0x78/0xa4
[    0.339827] [c0000000fe1eff00] [c000000000700334] .kernel_init+0x16c/0x224
[    0.339834] [c0000000fe1eff90] [c00000000002adc8] .kernel_thread+0x54/0x70
[    0.339839] Instruction dump:
[    0.339843] 3863007f 78630624 4bffb94d 60000000 2bbd0008 7c7c1b78 40fd0030 e93e8010
[    0.339856] 80090000 7c000034 5400d97e 78000020 <0b000000> 2fa00000 41fe0010 e93e8010

I have attached the dmesg log here.

Next 20090306 had the same problem, while 20090305 did not.

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------


[-- Attachment #2: dmesg_next_20090310 --]
[-- Type: text/plain, Size: 12751 bytes --]

Using 006299d6 bytes for initrd buffer
Please wait, loading kernel...
Allocated 01600000 bytes for kernel @ 03500000
   Elf64 kernel loaded...
Loading ramdisk...
ramdisk loaded 006299d6 @ 01600000
OF stdout device is: /vdevice/vty@30000000
Hypertas detected, assuming LPAR !
command line: root=/dev/sda5 sysrq=1 insmod=sym53c8xx insmod=ipr crashkernel=512M-:256M  
memory layout at init:
  alloc_bottom : 00000000049c0000
  alloc_top    : 0000000008000000
  alloc_top_hi : 0000000008000000
  rmo_top      : 0000000008000000
  ram_top      : 0000000008000000
Looking for displays
instantiating rtas at 0x00000000074e0000 ... done
boot cpu hw idx 0000000000000000
starting cpu hw idx 0000000000000002... done
copying OF device tree ...
Building dt strings...
Building dt structure...
Device tree strings 0x0000000004bd0000 -> 0x0000000004bd15d3
Device tree struct  0x0000000004be0000 -> 0x0000000004c00000
Calling quiesce ...
returning from prom_init
[    0.000000] Crash kernel location must be 0x2000000
[    0.000000] Reserving 256MB of memory at 32MB for crashkernel (System RAM: 4096MB)
[    0.000000] Phyp-dump disabled at boot time
[    0.000000] Using pSeries machine description
[    0.000000] Using 1TB segments
[    0.000000] Found initrd at 0xc000000001600000:0xc000000001c299d6
[    0.000000] console [udbg0] enabled
[    0.000000] Partition configured for 4 cpus.
[    0.000000] CPU maps initialized for 2 threads per core
[    0.000000] Starting Linux PPC64 #1 SMP Tue Mar 10 17:25:05 IST 2009
[    0.000000] -----------------------------------------------------
[    0.000000] ppc64_pft_size                = 0x1a
[    0.000000] physicalMemorySize            = 0x100000000
[    0.000000] htab_hash_mask                = 0x7ffff
[    0.000000] -----------------------------------------------------
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.29-rc7-next-20090310 (root@llm62) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #1 SMP Tue Mar 10 17:25:05 IST 2009
[    0.000000] [boot]0012 Setup Arch
[    0.000000] EEH: No capable adapters found
[    0.000000] PPC64 nvram contains 15360 bytes
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00010000
[    0.000000]   Normal   0x00010000 -> 0x00010000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00010000
[    0.000000] [boot]0015 Setup Done
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 65448
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: root=/dev/sda5 sysrq=1 insmod=sym53c8xx insmod=ipr crashkernel=512M-:256M  
[    0.000000] NR_IRQS:512
[    0.000000] [boot]0020 XICS Init
[    0.000000] [boot]0021 XICS Done
[    0.000000] PID hash table entries: 4096 (order: 12, 32768 bytes)
[    0.000000] clocksource: timebase mult[7d0000] shift[22] registered
[    0.000054] Console: colour dummy device 80x25
[    0.000086] console handover: boot [udbg0] -> real [hvc0]
[    0.000113] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.000118] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.000121] ... MAX_LOCK_DEPTH:          48
[    0.000124] ... MAX_LOCKDEP_KEYS:        8191
[    0.000128] ... CLASSHASH_SIZE:          4096
[    0.000132] ... MAX_LOCKDEP_ENTRIES:     8192
[    0.000135] ... MAX_LOCKDEP_CHAINS:      16384
[    0.000139] ... CHAINHASH_SIZE:          8192
[    0.000142]  memory used by lock dependency info: 4607 kB
[    0.000146]  per task-struct memory footprint: 1920 bytes
[    0.000476] Dentry cache hash table entries: 524288 (order: 6, 4194304 bytes)
[    0.001534] Inode-cache hash table entries: 262144 (order: 5, 2097152 bytes)
[    0.002663] allocated 2621440 bytes of page_cgroup
[    0.002667] please try cgroup_disable=memory option if you don't want
[    0.002672] freeing bootmem node 0
[    0.079853] Memory: 3864320k/4194304k available (7552k kernel code, 329984k reserved, 1984k data, 10855k bss, 384k init)
[    0.080373] Calibrating delay loop... 1022.36 BogoMIPS (lpj=5111808)
[    0.330475] Security Framework initialized
[    0.330481] SELinux:  Disabled at boot.
[    0.330541] Mount-cache hash table entries: 4096
[    0.333232] Initializing cgroup subsys ns
[    0.333237] Initializing cgroup subsys cpuacct
[    0.333242] Initializing cgroup subsys memory
[    0.333251] Initializing cgroup subsys devices
[    0.333257] Initializing cgroup subsys freezer
[    0.334039] Processor 1 found.
[    0.338524] Processor 2 found.
[    0.339010] Processor 3 found.
[    0.339021] Brought up 4 CPUs
[    0.339662] ------------[ cut here ]------------
[    0.339666] Badness at mm/allocpercpu.c:123
[    0.339670] NIP: c0000000001129dc LR: c0000000001129b8 CTR: 0000000000000000
[    0.339676] REGS: c0000000fe1efa10 TRAP: 0700   Not tainted  (2.6.29-rc7-next-20090310)
[    0.339681] MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24000024  XER: 20000002
[    0.339695] TASK = c0000000fe1dd3d0[1] 'swapper' THREAD: c0000000fe1ec000 CPU: 0
[    0.339701] GPR00: 0000000000000001 c0000000fe1efc90 c000000000948660 c0000000fe019000 
[    0.339711] GPR04: 0000000000000000 0000000000000000 c0000000fe019080 c00000000122e980 
[    0.339721] GPR08: 0000000000000000 c000000001467dec c0000000fe0e2610 c0000000fe1dd3d0 
[    0.339732] GPR12: 0000000044000022 c000000000a22300 c000000000733ad0 c00000000065e0c5 
[    0.339742] GPR16: 0000000003c33a08 0000000000000000 c000000000733a08 0000000002f1fc90 
[    0.339752] GPR20: c000000000733a20 c000000000679b30 0000000000000000 0000000002f1fc90 
[    0.339763] GPR24: 0000000000000000 0000000000000000 c000000000670ccd 0000000000000001 
[    0.339773] GPR28: c0000000fe019000 0000000000000080 c0000000008cb908 0000000000000100 
[    0.339788] NIP [c0000000001129dc] .__alloc_percpu+0x7c/0x244
[    0.339793] LR [c0000000001129b8] .__alloc_percpu+0x58/0x244
[    0.339798] Call Trace:
[    0.339801] [c0000000fe1efc90] [c0000000001129b8] .__alloc_percpu+0x58/0x244 (unreliable)
[    0.339810] [c0000000fe1efdc0] [c00000000007ce84] .__create_workqueue_key+0x74/0x2a0
[    0.339819] [c0000000fe1efe70] [c000000000716990] .cpuset_init_smp+0x78/0xa4
[    0.339827] [c0000000fe1eff00] [c000000000700334] .kernel_init+0x16c/0x224
[    0.339834] [c0000000fe1eff90] [c00000000002adc8] .kernel_thread+0x54/0x70
[    0.339839] Instruction dump:
[    0.339843] 3863007f 78630624 4bffb94d 60000000 2bbd0008 7c7c1b78 40fd0030 e93e8010 
[    0.339856] 80090000 7c000034 5400d97e 78000020 <0b000000> 2fa00000 41fe0010 e93e8010 
[    0.348162] net_namespace: 2160 bytes
[    0.348476] NET: Registered protocol family 16
[    0.348532] IBM eBus Device Driver
[    0.352290] PCI: Probing PCI hardware
[    0.354439] bio: create slab <bio-0> at 0
[    0.355321] SCSI subsystem initialized
[    0.355468] usbcore: registered new interface driver usbfs
[    0.355500] usbcore: registered new interface driver hub
[    0.355577] usbcore: registered new device driver usb
[    0.380869] NET: Registered protocol family 2
[    0.470537] IP route cache hash table entries: 32768 (order: 2, 262144 bytes)
[    0.471080] TCP established hash table entries: 131072 (order: 5, 2097152 bytes)
[    0.471514] TCP bind hash table entries: 65536 (order: 5, 3670016 bytes)
[    0.473611] TCP: Hash tables configured (established 131072 bind 65536)
[    0.473618] TCP reno registered
[    0.500558] NET: Registered protocol family 1
[    0.500632] Unpacking initramfs... done
[    0.645207] Freeing initrd memory: 6310k freed
[    0.658465] IOMMU table initialized, virtual merging enabled
[    0.659595] ====[ backtrace testing ]===========
[    0.659599] Testing a backtrace from process context.
[    0.659603] The following trace is a kernel self test and not a bug!
[    0.659607] Call Trace:
[    0.659613] [c0000000fe1efc70] [c000000000011608] .show_stack+0x6c/0x16c (unreliable)
[    0.659622] [c0000000fe1efd20] [c0000000000a6758] .backtrace_regression_test+0x44/0x134
[    0.659630] [c0000000fe1efe10] [c000000000009254] .do_one_initcall+0x80/0x1a4
[    0.659638] [c0000000fe1eff00] [c000000000700370] .kernel_init+0x1a8/0x224
[    0.659645] [c0000000fe1eff90] [c00000000002adc8] .kernel_thread+0x54/0x70
[    0.659650] Testing a backtrace from irq context.
[    0.659654] The following trace is a kernel self test and not a bug!
[    0.659664] Call Trace:
[    0.659668] [c000000001f9fcf0] [c000000000011608] .show_stack+0x6c/0x16c (unreliable)
[    0.659676] [c000000001f9fda0] [c0000000000a66f0] .backtrace_test_irq_callback+0x18/0x3c
[    0.659684] [c000000001f9fe20] [c00000000006bfa0] .tasklet_action+0x100/0x1d0
[    0.659691] [c000000001f9fec0] [c00000000006ce20] .__do_softirq+0xe8/0x1f8
[    0.659698] [c000000001f9ff90] [c00000000002ac04] .call_do_softirq+0x14/0x24
[    0.659704] [c0000000fe257db0] [c00000000000d4fc] .do_softirq+0x90/0x110
[    0.659711] [c0000000fe257e50] [c00000000006c49c] .ksoftirqd+0xbc/0x18c
[    0.659718] [c0000000fe257f00] [c000000000081cec] .kthread+0x80/0xcc
[    0.659725] [c0000000fe257f90] [c00000000002adc8] .kernel_thread+0x54/0x70
[    0.659733] Testing a saved backtrace.
[    0.659736] The following trace is a kernel self test and not a bug!
[    0.659741]  [<c0000000000a680c>] .backtrace_regression_test+0xf8/0x134
[    0.659747]  [<c000000000009254>] .do_one_initcall+0x80/0x1a4
[    0.659753]  [<c000000000700370>] .kernel_init+0x1a8/0x224
[    0.659759]  [<c00000000002adc8>] .kernel_thread+0x54/0x70
[    0.659764] ====[ end of backtrace testing ]====
[    0.659795] audit: initializing netlink socket (disabled)
[    0.659810] type=2000 audit(1236686641.658:1): initialized
[    0.679339] Kprobe smoke test started
[    0.890631] Kprobe smoke test passed successfully
[    0.890700] rcu-torture:--- Start of test: nreaders=8 nfakewriters=4 stat_interval=0 verbose=0 test_no_idle_hz=0 shuffle_interval=3 stutter=5 irqreader=1
[    0.891677] HugeTLB registered 16 MB page size, pre-allocated 0 pages
[    0.891682] HugeTLB registered 16 GB page size, pre-allocated 0 pages
[    0.892086] VFS: Disk quotas dquot_6.5.2
[    0.892203] Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
[    0.892884] msgmni has been set to 7556
[    0.893258] alg: No test for stdrng (krng)
[    0.893329] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    0.893335] io scheduler noop registered
[    0.893339] io scheduler anticipatory registered
[    0.893343] io scheduler deadline registered
[    0.893396] io scheduler cfq registered (default)
[    0.893490] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.893495] rpaphp: RPA HOT Plug PCI Controller Driver version: 0.1
[    0.895965] Generic RTC Driver v1.07
[    0.895999] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.896309] input: Macintosh mouse button emulation as /devices/virtual/input/input0
[    0.896362] Uniform Multi-Platform E-IDE driver
[    0.896423] ide-gd driver 1.18
[    0.896625] ibmvscsi 30000002: SRP_VERSION: 16.a
[    0.896717] scsi0 : IBM POWER Virtual SCSI Adapter 1.5.8
[    0.896983] ibmvscsi 30000002: partner initialization complete
[    0.896991] ibmvscsi 30000002: sent SRP login
[    0.897062] ibmvscsi 30000002: SRP_LOGIN succeeded
[    0.897104] ibmvscsi 30000002: host srp version: 16.a, host partition VIO (1), OS 3, max io 1048576
[    0.910829] scsi 0:0:1:0: Direct-Access     AIX      VDASD            0001 PQ: 0 ANSI: 3
[    0.911151] scsi 0:0:2:0: CD-ROM            AIX      VOPTA                 PQ: 0 ANSI: 4
[    0.966517] ibmvfc: IBM Virtual Fibre Channel Driver version: 1.0.4 (November 14, 2008)
[    0.966616] scsi 0:0:1:0: Attached scsi generic sg0 type 0
[    0.966661] scsi 0:0:2:0: Attached scsi generic sg1 type 5
[    0.966739] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.966793] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.966835] uhci_hcd: USB Universal Host Controller Interface driver
[    1.000469] mice: PS/2 mouse device common for all mice
[    1.040547] EDAC MC: Ver: 2.1.0 Mar 10 2009
[    1.041711] usbcore: registered new interface driver hiddev
[    1.041743] usbcore: registered new interface driver usbhid
[    1.041749] usbhid: v2.6:USB HID core driver
[    1.042399] TCP cubic registered
[    1.042405] NET: Registered protocol family 15
[    1.042574] registered taskstats version 1
[    1.042745] Freeing unused kernel memory: 384k freed
doing fast boot
[    1.074740] SysRq : Changing Loglevel
[    1.074747] Loglevel set to 1
FATAL: Module ibmvscsic not found.
Creating device nodes with udev
Boot logging started on /dev/hvc0(/dev/console) at Tue Mar 10 12:04:02 2009


^ permalink raw reply

* Re: 2.6.29-rc7-git2 : crash in kmem_list3_init()
From: Mel Gorman @ 2009-03-10 13:46 UTC (permalink / raw)
  To: Sachin P. Sant; +Cc: linuxppc-dev, cl
In-Reply-To: <49B60371.7050508@in.ibm.com>

On Tue, Mar 10, 2009 at 11:36:41AM +0530, Sachin P. Sant wrote:
> Sachin P. Sant wrote:
>> sure if this is a new problem or a recurring one. Will try booting
>> some older kernels on this box and will report the results.
> I tried few older kernels till 2.6.28 and all of them had the
> same problem.
>

Well, the machine must have started with some kernel. What mainline
version does that correspond to and can you bisect it?

What is the base page size of the test kernel - 4K or 64K? Depending on
which one it is, the start of node 1 may not be MAX_ORDER-aligned, gets
overlapped with node-0 and goes downhill from there.

> I also tried using SLUB instead of SLAB. That also failed to
> boot with following trace.
>
> Unable to handle kernel paging request for data at address 0xc000000070001030
> Faulting instruction address: 0xc00000000011c7e0
> cpu 0x0: Vector: 300 (Data Access) at [c000000000ac39a0]
>    pc: c00000000011c7e0: .new_slab+0x2b8/0x33c
>    lr: c00000000011c7dc: .new_slab+0x2b4/0x33c
>    sp: c000000000ac3c20
>   msr: 8000000000009032
>   dar: c000000070001030
> dsisr: 42000000
>  current = 0xc0000000009ea4b0
>  paca    = 0xc000000000b53480
>    pid   = 0, comm = swapper
> enter ? for help
> [c000000000ac3cc0] c00000000011dc28 .kmem_cache_open+0x1a4/0x448
> [c000000000ac3d90] c00000000011f5dc .create_kmalloc_cache+0x78/0x100
> [c000000000ac3e40] c000000000948bec .kmem_cache_init+0x8c/0x1c8
> [c000000000ac3ee0] c000000000920a5c .start_kernel+0x360/0x480
> [c000000000ac3f90] c0000000000083d8 .start_here_common+0x1c/0x44
>
> Complete dmesg log attached. Is there anything else i can try ?
>

^ permalink raw reply

* Re: Oops with 2.6.29-rc7 on POWER5
From: Josh Boyer @ 2009-03-10 11:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Alan Cox
In-Reply-To: <1236645375.7260.200.camel@pasglop>

On Tue, Mar 10, 2009 at 11:36:15AM +1100, Benjamin Herrenschmidt wrote:
>On Mon, 2009-03-09 at 20:05 -0400, Josh Boyer wrote:
>> [c00000000fffb830] [c0000000005fe504] .mutex_lock_nested+0x78/0x4b0
>> (unreliable)
>> [c00000000fffb950] [c00000000039d520] .echo_char_raw+0x40/0x98
>> [c00000000fffb9f0] [c00000000039fd68] .n_tty_receive_buf+0xb48/0x1104
>> [c00000000fffbbb0] [c0000000003a3a08] .flush_to_ldisc+0x160/0x244
>> [c00000000fffbc80] [c0000000003a3b5c] .tty_flip_buffer_push+0x70/0x9c
>> [c00000000fffbd10] [c0000000003b9e94] .hvsi_interrupt+0x464/0x590
>> [c00000000fffbe50] [c000000000119168] .handle_IRQ_event+0x60/0xdc
>> [c00000000fffbef0] [c00000000011baf0] .handle_fasteoi_irq+0x108/0x1a8
>> 
>Do that patch help ?

Yes.  No more oopses on the hvc console when I hit 'enter'.

>Alan, any comment about the races talked about in those comments ? Are
>they still something I should worry about ?

If not, we should look at getting this into 2.6.29.  I know it's getting
very late, but having kernels oops whenever someone hits enter on the
console probably isn't very good either.

josh

^ permalink raw reply

* Re: [rtc-linux] Re: [PATCH 7/7] powerpc/ps3: Add rtc-ps3
From: Alessandro Zummo @ 2009-03-10  9:39 UTC (permalink / raw)
  To: rtc-linux
  Cc: linux-m68k, linux-parisc, linux-kernel, Kyle McMartin,
	linuxppc-dev, Paul Mundt, Geert.Uytterhoeven, Dann Frazier
In-Reply-To: <alpine.LRH.2.00.0903101015470.24318@vixen.sonytel.be>

On Tue, 10 Mar 2009 10:21:14 +0100 (CET)
Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:

> Alessandro prefers not to have generic RTC drivers on top of some other
> abstraction, but wants platform/chip-specific drivers under drivers/rtc/
> instead. The goal is to convert all RTC drivers buried in platform code
> to separate RTC drivers.
> 
> (Alessandro, please correct me if I'm wrong)

 yes, that's my dream :)

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox