LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Anton Vorontsov @ 2007-12-01 21:34 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: netdev, linux-kernel, Jeff Garzik, linuxppc-dev
In-Reply-To: <47516646.9000803@scram.de>

On Sat, Dec 01, 2007 at 02:48:54PM +0100, Jochen Friedrich wrote:
> Hi Vitaly,
> 
> > With that patch fixed.c now fully emulates MDIO bus, thus no need
> > to duplicate PHY layer functionality. That, in turn, drastically
> > simplifies the code, and drops down line count.
> >
> > As an additional bonus, now there is no need to register MDIO bus
> > for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> > There is also no more need to pre-allocate PHYs via .config option,
> > this is all now handled dynamically.
> >
> > p.s. Don't even try to understand patch content! Better: apply patch
> > and look into resulting drivers/net/phy/fixed.c.
> >   
> If i understand your code correctly, you seem to rely on the fact 
> that fixed_phy_add() is called before the fixed MDIO bus is scanned for 
> devices.

Yes, indeed. The other name of "fixed phys" are "platform phys"
or "platform MDIO bus" on which virtual PHYs are placed.

That is, these phys supposed to be created by the platform setup
code (arch/). The rationale here is: we do hardware emulation, thus
to make drivers actually see that "hardware", we have to create it
early.

> I tried to add fixed-phy support to fs_enet, but the fixed phy is not 
> found this way.
> 
> --- a/drivers/net/fs_enet/fs_enet-main.c
> +++ b/drivers/net/fs_enet/fs_enet-main.c
> @@ -36,6 +36,7 @@
>  #include <linux/fs.h>
>  #include <linux/platform_device.h>
>  #include <linux/phy.h>
> +#include <linux/phy_fixed.h>
>  
>  #include <linux/vmalloc.h>
>  #include <asm/pgtable.h>
> @@ -1174,8 +1175,24 @@ static int __devinit find_phy(struct device_node *np,
>         struct device_node *phynode, *mdionode;
>         struct resource res;
>         int ret = 0, len;
> +       const u32 *data;
> +       struct fixed_phy_status status = {};
> +
> +       data  = of_get_property(np, "fixed-link", NULL);
> +       if (data) {
> +               status.link = 1;
> +               status.duplex = data[1];
> +               status.speed  = data[2];
> +
> +               ret = fixed_phy_add(PHY_POLL, data[0], &status);
> +               if (ret)
> +                       return ret;
> +
> +               snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
> +               return 0;
> +       }
>  
> -       const u32 *data = of_get_property(np, "phy-handle", &len);
> +       data = of_get_property(np, "phy-handle", &len);
>         if (!data || len != 4)
>                 return -EINVAL;

^^ the correct solution is to implement arch_initcall function
which will create fixed PHYs, and then leave only
snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); part in the
fs_enet's find_phy().

Try add something like this to the fsl_soc.c (compile untested):

- - - -
static int __init of_add_fixed_phys(void)
{
	struct device_node *np;
	const u32 *prop;
	struct fixed_phy_status status = {};

	while ((np = of_find_node_by_name(NULL, "ethernet"))) {
		data  = of_get_property(np, "fixed-link", NULL);
		if (!data)
			continue;

		status.link = 1;
		status.duplex = data[1];
		status.speed  = data[2];

		ret = fixed_phy_add(PHY_POLL, data[0], &status);
		if (ret)
			return ret;
	}

	return 0;
}
arch_initcall(of_add_fixed_phys);
- - - -

And remove fixed_phy_add() from the fs_enet. This should work
nicely and also should be ideologically correct. ;-)

> How is this supposed to work for modules or for the
> PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned
> during fs_soc initialization but during device initialization?

We should mark fixed.c as bool. Fake/virtual/fixed/platform PHYs
creation is architecture code anyway, can't be =m.

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] [1/12] pasemi_mac: RX/TX ring management cleanup
From: Jeff Garzik @ 2007-12-01 21:54 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, netdev
In-Reply-To: <20071129025428.GB17215@lixom.net>

Olof Johansson wrote:
> pasemi_mac: RX/TX ring management cleanup
> 
> Prepare a bit for supporting multiple TX queues by cleaning up some
> of the ring management and shuffle things around a bit.
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>

applied 1-12

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Jeff Garzik @ 2007-12-01 21:59 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev, linux-kernel, netdev
In-Reply-To: <20071126142906.19642.45540.stgit@localhost.localdomain>

Vitaly Bordug wrote:
> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
> 
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
> 
> p.s. Don't even try to understand patch content! Better: apply patch
> and look into resulting drivers/net/phy/fixed.c.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>

what's the context of this patchset?  2.6.25?

it's late for 2.6.24-rc, IMO.

Do I have the latest version (sent Nov 26 @ 9:29am)?

	Jeff

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Vitaly Bordug @ 2007-12-01 22:16 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linuxppc-dev, linux-kernel, netdev
In-Reply-To: <4751D958.6060500@garzik.org>

On Sat, 01 Dec 2007 16:59:52 -0500
Jeff Garzik wrote:

> Vitaly Bordug wrote:
> > With that patch fixed.c now fully emulates MDIO bus, thus no need
> > to duplicate PHY layer functionality. That, in turn, drastically
> > simplifies the code, and drops down line count.
> > 
> > As an additional bonus, now there is no need to register MDIO bus
> > for each PHY, all emulated PHYs placed on the platform fixed MDIO
> > bus. There is also no more need to pre-allocate PHYs via .config
> > option, this is all now handled dynamically.
> > 
> > p.s. Don't even try to understand patch content! Better: apply patch
> > and look into resulting drivers/net/phy/fixed.c.
> > 
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> 
> what's the context of this patchset?  2.6.25?
> 
Fine with it.

> it's late for 2.6.24-rc, IMO.
> 
> Do I have the latest version (sent Nov 26 @ 9:29am)?
yes, that's it.

-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Vitaly Bordug @ 2007-12-01 22:22 UTC (permalink / raw)
  To: cbou; +Cc: linuxppc-dev, netdev, Jeff Garzik, linux-kernel
In-Reply-To: <20071201213403.GA2350@zarina>

On Sun, 2 Dec 2007 00:34:03 +0300
Anton Vorontsov wrote:

> > If i understand your code correctly, you seem to rely on the fact 
> > that fixed_phy_add() is called before the fixed MDIO bus is scanned
> > for devices.  
> 
> Yes, indeed. The other name of "fixed phys" are "platform phys"
> or "platform MDIO bus" on which virtual PHYs are placed.
> 
> That is, these phys supposed to be created by the platform setup
> code (arch/). The rationale here is: we do hardware emulation, thus
> to make drivers actually see that "hardware", we have to create it
> early.

well that was the intention but... The point is - as device is emulated, (nearly) everything is doable,
and the only tradeoff to consider, is how far will we go with that emulation. IOW, PHYlib could be tricked
to "do the right thing", and I thought about adding module flexibility...

But thinking more about it, it seems that BSP-code-phy-creation just sucks less and is clear enough yet flexible.
-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: ppcboot and powerpc branch question
From: Wolfgang Denk @ 2007-12-01 22:54 UTC (permalink / raw)
  To: Pagnotta, Chris; +Cc: linuxppc-embedded
In-Reply-To: <821B2170E9E7F04FA38DF7EC21DE48710BA65802@VCAEXCH01.hq.corp.viasat.com>

Dear Chris,

in message <821B2170E9E7F04FA38DF7EC21DE48710BA65802@VCAEXCH01.hq.corp.viasat.com> you wrote:
> 
> I am currently using your ELDK 4.1 Uclibc and have written various
> scripts that allow it to be used with buildroot makefiles. Are you going
> to releasing a newer version anytime soon?

Yes, we just showed ELDK 4.2 at the SPS/IPC/Drives trade show in
Nuremberg. OK, it's still beta since we wait for the final release of
Xenomai 2.4, but PPC and PPC64 beta is available for testers.

> -----Original Message-----
> From: linuxppc-embedded-bounces+chris.pagnotta=3Dviasat.com@ozlabs.org
> [mailto:linuxppc-embedded-bounces+chris.pagnotta=3Dviasat.com@ozlabs.org]=


Two remarks:
- Please don't top post / full quote. See
  http://www.netmeister.org/news/learn2quote.html
- Please post ELDK related requests on the ELDK mailing list, see
  http://lists.denx.de/mailman/listinfo/eldk

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
A good marriage would be between a blind wife and deaf husband.
                                               -- Michel de Montaigne

^ permalink raw reply

* Re: [PATCH 0/3] OF-platform PATA driver
From: Jeff Garzik @ 2007-12-01 22:54 UTC (permalink / raw)
  To: avorontsov; +Cc: Arnd Bergmann, linux-ide, linuxppc-dev, Paul Mundt
In-Reply-To: <20071127153708.GA12490@localhost.localdomain>

Anton Vorontsov wrote:
> Hi all,
> 
> Here is the second spin of the OF-platform PATA driver and
> related patches.
> 
> Changes since RFC:
> - nuked drivers/ata/pata_platform.h;
> - powerpc bits: proper localbus node added.
> 
> 
> Thanks for the previous review! This time I'm collecting acks,
> don't be shy to give 'em generously. ;-)

if (ack_collected(PaulM))
	push(ACK)
else {
	/* do nothing */
}

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
From: Stephen Rothwell @ 2007-12-01 23:27 UTC (permalink / raw)
  To: cbou; +Cc: linuxppc-dev, netdev, Jeff Garzik, linux-kernel
In-Reply-To: <20071201213403.GA2350@zarina>

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

Just a little reminder ...

On Sun, 2 Dec 2007 00:34:03 +0300 Anton Vorontsov <cbou@mail.ru> wrote:
>
> static int __init of_add_fixed_phys(void)
> {
> 	struct device_node *np;
> 	const u32 *prop;
> 	struct fixed_phy_status status = {};
> 
> 	while ((np = of_find_node_by_name(NULL, "ethernet"))) {

	for_each_node_by_name(np, "ethernet") {
(this probably does what you want instead of finding just the first
ethernet over and over again. :-))

> 		data  = of_get_property(np, "fixed-link", NULL);
> 		if (!data)
> 			continue;
> 
> 		status.link = 1;
> 		status.duplex = data[1];
> 		status.speed  = data[2];
> 
> 		ret = fixed_phy_add(PHY_POLL, data[0], &status);
> 		if (ret)
> 			return ret;
		if (ret) {
			of_put_node(np);
			retun ret;
		}
> 	}

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH 0/3] OF-platform PATA driver
From: Anton Vorontsov @ 2007-12-01 23:58 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Paul Mundt, linux-ide, Arnd Bergmann, linuxppc-dev
In-Reply-To: <4751E639.8090308@garzik.org>

On Sat, Dec 01, 2007 at 05:54:49PM -0500, Jeff Garzik wrote:
> Anton Vorontsov wrote:
> > Hi all,
> > 
> > Here is the second spin of the OF-platform PATA driver and
> > related patches.
> > 
> > Changes since RFC:
> > - nuked drivers/ata/pata_platform.h;
> > - powerpc bits: proper localbus node added.
> > 
> > 
> > Thanks for the previous review! This time I'm collecting acks,
> > don't be shy to give 'em generously. ;-)
> if (ack_collected(PaulM))
> 	push(ACK)
> else {
> 	/* do nothing */
> }

Yep, this is obvious.

Here is the algo I'm following:

while (1) {
	send_patches();

	if (ack_collected(PaulM) && ack_collected(PowerPC_people))
		break;

	sleep(wait_for_comments_timeout); <-- currently here.
}

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: serial console autodetection not working on powermac
From: Benjamin Herrenschmidt @ 2007-12-02  1:11 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20071201144021.GA13898@aepfle.de>


On Sat, 2007-12-01 at 15:40 +0100, Olaf Hering wrote:
> How is the serial console autodetection supposed to work with current
> kernels? arch/powerpc/kernel/legacy_serial.c is not compiled unless
> CONFIG_PPC_UDBG_16550 is selected.
> Even if I force this config option, legacy_serial_console remains -1 and
> the ch-a/ch-b check in check_legacy_serial_console() does not trigger.
> Can the ch-a/ch-b check in check_legacy_serial_console() trigger anyway?
> 
> The autodetection used to work in earlier kernels.
> 
> A compiletime check for CONFIG_SERIAL_PMACZILOG_TTYS is also required,
> to switch between ttyS and ttyPZ. Currently ttyS is hardcoded.

It might well have bitrotted. It should be taken out of that file
anyway. I'll have a look next week. Remind me if I forget :-)

Ben.

^ permalink raw reply

* Re: [PATCH 0/3] OF-platform PATA driver
From: Olof Johansson @ 2007-12-02  3:57 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linux-ide, Paul Mundt, Arnd Bergmann, Jeff Garzik, linuxppc-dev
In-Reply-To: <20071201235810.GA2635@zarina>

On Sun, Dec 02, 2007 at 02:58:10AM +0300, Anton Vorontsov wrote:
> On Sat, Dec 01, 2007 at 05:54:49PM -0500, Jeff Garzik wrote:
> while (1) {
> 	send_patches();
> 
> 	if (ack_collected(PaulM) && ack_collected(PowerPC_people))
> 		break;
> 
> 	sleep(wait_for_comments_timeout); <-- currently here.

I still haven't seen you address the compatible comments (that
pata-platform is suboptimal). Or did I miss some respin of the patches?


-Olof

^ permalink raw reply

* Re: [PATCH 2/3] [libata] pata_of_platform: OF-Platform PATA device driver
From: Olof Johansson @ 2007-12-02  3:59 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev, linux-ide
In-Reply-To: <20071127153908.GB14183@localhost.localdomain>

On Tue, Nov 27, 2007 at 06:39:08PM +0300, Anton Vorontsov wrote:

> +static struct of_device_id pata_of_platform_match[] = {
> +	{ .compatible = "pata-platform", },
> +};

On top of previous comment about the compatible string being
inappropriate:

You should add a MODULE_DEVICE_TABLE() entry for this. Dave Woodhouse
pointed out it's needed for autoloading modules (i.e. by the fedora
installer, etc).


-Olof

^ permalink raw reply

* Re: Linux 2.4 on ML310 with PowerPC405
From: Grant Likely @ 2007-12-02  4:30 UTC (permalink / raw)
  To: narendra sisodiya; +Cc: linuxppc-embedded
In-Reply-To: <e3fb97f30712010459y1e15f593i58381ba81487960a@mail.gmail.com>

On 12/1/07, narendra sisodiya <narendra.sisodiya@gmail.com> wrote:
> Hi all,
> I am trying to port Linux on ML310 virtex 2 pro,,
> I am unable to compile my properly,,,
> here i documented my procedure,,,
> http://placements.techfandu.org/index.php?title=Linux_kernel_on_ML310
>
> Please check out ,, where i am doing mistake

I'm sorry, but I don't understand where you are having your problems.
Specifically, what error are you getting when your kernel fails to
compile?

As for the kernel version, I do not recommend using linux 2.4 any
more.  You should consider using a 2.6 kernel instead.  I've got some
documentation on the 2.6 kernel for virtex devices here:

http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* [PATCH] gianfar: fix compile warning
From: Grant Likely @ 2007-12-02  5:10 UTC (permalink / raw)
  To: linuxppc-dev, netdev, galak, jgarzik, afleming

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

Eliminate an uninitialized variable warning.  The code is correct, but
a pointer to the automatic variable 'addr' is passed to dma_alloc_coherent.
Since addr has never been initialized, and the compiler doesn't know
what dma_alloc_coherent will do with it, it complains.

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

Jeff, this one should go in for 2.6.24

Cheers,
g.

 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 38268d7..0431e9e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev)
 {
 	struct txbd8 *txbdp;
 	struct rxbd8 *rxbdp;
-	dma_addr_t addr;
+	dma_addr_t addr = 0;
 	unsigned long vaddr;
 	int i;
 	struct gfar_private *priv = netdev_priv(dev);

^ permalink raw reply related

* [PATCH] gianfar driver: eliminate compiler warnings and unnecessary macros
From: Grant Likely @ 2007-12-02  5:12 UTC (permalink / raw)
  To: linuxppc-dev, netdev, galak, jgarzik, afleming

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

This patch eliminates the warning of unused return values when the driver
registers it sysfs files.  Now the driver will print an error if it is
unable to register the sysfs files.

It also eliminates the macros used to wrap the DEVICE_ATTR macro and the
device_create_file function call.  The macros don't reduce the number of
lines of source code in the file and the name munging makes is so that
cscope and friends don't see the references to the functions.  It's better
to just call the kernel API directly.

While we're at it, the DEVICE_ATTR instances have been moved down to
be grouped with the functions they depend on.

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

 drivers/net/gianfar_sysfs.c |   50 ++++++++++++++++++++++---------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index aec9ab1..230878b 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -37,24 +37,6 @@
 
 #include "gianfar.h"
 
-#define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct device *dev, \
-	 struct device_attribute *attr, char *buf); \
-static ssize_t gfar_set_##_name(struct device *dev, \
-		struct device_attribute *attr, \
-		const char *buf, size_t count); \
-static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
-
-#define GFAR_CREATE_FILE(_dev, _name) \
-	device_create_file(&_dev->dev, &dev_attr_##_name)
-
-GFAR_ATTR(bd_stash);
-GFAR_ATTR(rx_stash_size);
-GFAR_ATTR(rx_stash_index);
-GFAR_ATTR(fifo_threshold);
-GFAR_ATTR(fifo_starve);
-GFAR_ATTR(fifo_starve_off);
-
 static ssize_t gfar_show_bd_stash(struct device *dev,
 				  struct device_attribute *attr, char *buf)
 {
@@ -100,6 +82,8 @@ static ssize_t gfar_set_bd_stash(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash);
+
 static ssize_t gfar_show_rx_stash_size(struct device *dev,
 				       struct device_attribute *attr, char *buf)
 {
@@ -146,6 +130,9 @@ static ssize_t gfar_set_rx_stash_size(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size,
+	    gfar_set_rx_stash_size);
+
 /* Stashing will only be enabled when rx_stash_size != 0 */
 static ssize_t gfar_show_rx_stash_index(struct device *dev,
 					struct device_attribute *attr,
@@ -184,6 +171,9 @@ static ssize_t gfar_set_rx_stash_index(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index,
+	    gfar_set_rx_stash_index);
+
 static ssize_t gfar_show_fifo_threshold(struct device *dev,
 					struct device_attribute *attr,
 					char *buf)
@@ -219,6 +209,9 @@ static ssize_t gfar_set_fifo_threshold(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold,
+	    gfar_set_fifo_threshold);
+
 static ssize_t gfar_show_fifo_starve(struct device *dev,
 				     struct device_attribute *attr, char *buf)
 {
@@ -253,6 +246,8 @@ static ssize_t gfar_set_fifo_starve(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve, gfar_set_fifo_starve);
+
 static ssize_t gfar_show_fifo_starve_off(struct device *dev,
 					 struct device_attribute *attr,
 					 char *buf)
@@ -288,9 +283,13 @@ static ssize_t gfar_set_fifo_starve_off(struct device *dev,
 	return count;
 }
 
+DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off,
+	    gfar_set_fifo_starve_off);
+
 void gfar_init_sysfs(struct net_device *dev)
 {
 	struct gfar_private *priv = netdev_priv(dev);
+	int rc;
 
 	/* Initialize the default values */
 	priv->rx_stash_size = DEFAULT_STASH_LENGTH;
@@ -301,11 +300,12 @@ void gfar_init_sysfs(struct net_device *dev)
 	priv->bd_stash_en = DEFAULT_BD_STASH;
 
 	/* Create our sysfs files */
-	GFAR_CREATE_FILE(dev, bd_stash);
-	GFAR_CREATE_FILE(dev, rx_stash_size);
-	GFAR_CREATE_FILE(dev, rx_stash_index);
-	GFAR_CREATE_FILE(dev, fifo_threshold);
-	GFAR_CREATE_FILE(dev, fifo_starve);
-	GFAR_CREATE_FILE(dev, fifo_starve_off);
-
+	rc = device_create_file(&dev->dev, &dev_attr_bd_stash);
+	rc |= device_create_file(&dev->dev, &dev_attr_rx_stash_size);
+	rc |= device_create_file(&dev->dev, &dev_attr_rx_stash_index);
+	rc |= device_create_file(&dev->dev, &dev_attr_fifo_threshold);
+	rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve);
+	rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve_off);
+	if (rc)
+		dev_err(&dev->dev, "Error creating gianfar sysfs files.\n");
 }

^ permalink raw reply related

* [PATCH] Fix buglets in mpc5200 FEC code that are corrupting memory.
From: Grant Likely @ 2007-12-02  6:00 UTC (permalink / raw)
  To: linuxppc-dev, netdev, jonsmirl, jgarzik; +Cc: dwmw2, domen.puncer

From: Jon Smirl <jonsmirl@gmail.com>

This is the reason I couldn't get user space started or connect to my
nfs server. Patch is against current linus git.

mpc5200 fec driver is corrupting memory. This patch fixes two bugs
where the wrong skb buffer was being referenced.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: Domen Puncer <domen.puncer@telargo.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

Jeff, this one hasn't been picked up for 2.6.24 yet and in needs to go in.

Thanks,
g.

 drivers/net/fec_mpc52xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index a8a0ee2..ddfcc0b 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 
 		rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
 				(struct bcom_bd **)&bd);
-		dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE);
+		dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, DMA_FROM_DEVICE);
 
 		/* Test for errors in received frame */
 		if (status & BCOM_FEC_RX_BD_ERRORS) {
@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 			bcom_prepare_next_buffer(priv->rx_dmatsk);
 
 		bd->status = FEC_RX_BUFFER_SIZE;
-		bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+		bd->skb_pa = dma_map_single(&dev->dev, skb->data,
 				FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
 		bcom_submit_next_buffer(priv->rx_dmatsk, skb);

^ permalink raw reply related

* [PATCH v2 1/2] [POWERPC] Add machine initcall macros
From: Grant Likely @ 2007-12-02  6:10 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof, jwboyer

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

The machine initcall macros allow initcalls to be registered which
test machine_is() before executing the initcall.

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

 include/asm-powerpc/machdep.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 6968f43..d5cd982 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -326,5 +326,28 @@ static inline void log_error(char *buf, unsigned int err_type, int fatal)
 		ppc_md.log_error(buf, err_type, fatal);
 }
 
+#define __define_machine_initcall(mach,level,fn,id) \
+	static int __init __machine_initcall_##mach##_##fn(void) { \
+		if (machine_is(mach)) return fn(); \
+		return 0; \
+	} \
+	__define_initcall(level,__machine_initcall_##mach##_##fn,id);
+
+#define machine_core_initcall(mach,fn)		__define_machine_initcall(mach,"1",fn,1)
+#define machine_core_initcall_sync(mach,fn)	__define_machine_initcall(mach,"1s",fn,1s)
+#define machine_postcore_initcall(mach,fn)	__define_machine_initcall(mach,"2",fn,2)
+#define machine_postcore_initcall_sync(mach,fn)	__define_machine_initcall(mach,"2s",fn,2s)
+#define machine_arch_initcall(mach,fn)		__define_machine_initcall(mach,"3",fn,3)
+#define machine_arch_initcall_sync(mach,fn)	__define_machine_initcall(mach,"3s",fn,3s)
+#define machine_subsys_initcall(mach,fn)	__define_machine_initcall(mach,"4",fn,4)
+#define machine_subsys_initcall_sync(mach,fn)	__define_machine_initcall(mach,"4s",fn,4s)
+#define machine_fs_initcall(mach,fn)		__define_machine_initcall(mach,"5",fn,5)
+#define machine_fs_initcall_sync(mach,fn)	__define_machine_initcall(mach,"5s",fn,5s)
+#define machine_rootfs_initcall(mach,fn)	__define_machine_initcall(mach,"rootfs",fn,rootfs)
+#define machine_device_initcall(mach,fn)	__define_machine_initcall(mach,"6",fn,6)
+#define machine_device_initcall_sync(mach,fn)	__define_machine_initcall(mach,"6s",fn,6s)
+#define machine_late_initcall(mach,fn)		__define_machine_initcall(mach,"7",fn,7)
+#define machine_late_initcall_sync(mach,fn)	__define_machine_initcall(mach,"7s",fn,7s)
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_MACHDEP_H */

^ permalink raw reply related

* [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code
From: Grant Likely @ 2007-12-02  6:10 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof, jwboyer
In-Reply-To: <20071202061028.21193.39309.stgit@trillian.secretlab.ca>

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

This patch makes the platform code use the new machine-specific initcall
hooks.  This has the advantage of not needing to explicitly test
machine_is() at the top of every initcall function.

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

 arch/powerpc/platforms/40x/kilauea.c         |    5 +----
 arch/powerpc/platforms/40x/virtex.c          |    5 +----
 arch/powerpc/platforms/40x/walnut.c          |    5 +----
 arch/powerpc/platforms/44x/bamboo.c          |    5 +----
 arch/powerpc/platforms/44x/ebony.c           |    5 +----
 arch/powerpc/platforms/44x/sequoia.c         |    5 +----
 arch/powerpc/platforms/82xx/mpc8272_ads.c    |    5 +----
 arch/powerpc/platforms/82xx/pq2fads.c        |    5 +----
 arch/powerpc/platforms/83xx/mpc832x_mds.c    |    5 +----
 arch/powerpc/platforms/83xx/mpc832x_rdb.c    |   11 ++---------
 arch/powerpc/platforms/83xx/mpc836x_mds.c    |    5 +----
 arch/powerpc/platforms/85xx/mpc85xx_ads.c    |    5 +----
 arch/powerpc/platforms/85xx/mpc85xx_cds.c    |    6 +-----
 arch/powerpc/platforms/85xx/mpc85xx_mds.c    |    5 +----
 arch/powerpc/platforms/8xx/ep88xc.c          |    5 ++---
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 ++---
 arch/powerpc/platforms/cell/io-workarounds.c |    5 +----
 arch/powerpc/platforms/cell/iommu.c          |    5 +----
 arch/powerpc/platforms/cell/pmu.c            |    5 +----
 arch/powerpc/platforms/cell/setup.c          |    5 +----
 arch/powerpc/platforms/celleb/iommu.c        |    6 +-----
 arch/powerpc/platforms/celleb/setup.c        |    5 +----
 arch/powerpc/platforms/embedded6xx/ls_uart.c |    5 +----
 arch/powerpc/platforms/pasemi/idle.c         |    5 +----
 arch/powerpc/platforms/pasemi/setup.c        |   10 ++--------
 arch/powerpc/platforms/powermac/low_i2c.c    |    7 ++-----
 arch/powerpc/platforms/powermac/pfunc_base.c |    3 +--
 arch/powerpc/platforms/powermac/pic.c        |    3 +--
 arch/powerpc/platforms/powermac/setup.c      |   12 ++----------
 29 files changed, 35 insertions(+), 128 deletions(-)

diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
index 1bffdbd..0853db7 100644
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -29,14 +29,11 @@ static struct of_device_id kilauea_of_bus[] = {
 
 static int __init kilauea_device_probe(void)
 {
-	if (!machine_is(kilauea))
-		return 0;
-
 	of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
 
 	return 0;
 }
-device_initcall(kilauea_device_probe);
+machine_device_initcall(kilauea, kilauea_device_probe);
 
 static int __init kilauea_probe(void)
 {
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..43fcc8e 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -17,14 +17,11 @@
 
 static int __init virtex_device_probe(void)
 {
-	if (!machine_is(virtex))
-		return 0;
-
 	of_platform_bus_probe(NULL, NULL, NULL);
 
 	return 0;
 }
-device_initcall(virtex_device_probe);
+machine_device_initcall(virtex, virtex_device_probe);
 
 static int __init virtex_probe(void)
 {
diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
index ff6db24..91a5247 100644
--- a/arch/powerpc/platforms/40x/walnut.c
+++ b/arch/powerpc/platforms/40x/walnut.c
@@ -34,15 +34,12 @@ static struct of_device_id walnut_of_bus[] = {
 
 static int __init walnut_device_probe(void)
 {
-	if (!machine_is(walnut))
-		return 0;
-
 	/* FIXME: do bus probe here */
 	of_platform_bus_probe(NULL, walnut_of_bus, NULL);
 
 	return 0;
 }
-device_initcall(walnut_device_probe);
+machine_device_initcall(walnut, walnut_device_probe);
 
 static int __init walnut_probe(void)
 {
diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
index be23f11..5253996 100644
--- a/arch/powerpc/platforms/44x/bamboo.c
+++ b/arch/powerpc/platforms/44x/bamboo.c
@@ -32,14 +32,11 @@ static struct of_device_id bamboo_of_bus[] = {
 
 static int __init bamboo_device_probe(void)
 {
-	if (!machine_is(bamboo))
-		return 0;
-
 	of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
 
 	return 0;
 }
-device_initcall(bamboo_device_probe);
+machine_device_initcall(bamboo, bamboo_device_probe);
 
 static int __init bamboo_probe(void)
 {
diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c
index 6cd3476..b783c6e 100644
--- a/arch/powerpc/platforms/44x/ebony.c
+++ b/arch/powerpc/platforms/44x/ebony.c
@@ -36,14 +36,11 @@ static struct of_device_id ebony_of_bus[] = {
 
 static int __init ebony_device_probe(void)
 {
-	if (!machine_is(ebony))
-		return 0;
-
 	of_platform_bus_probe(NULL, ebony_of_bus, NULL);
 
 	return 0;
 }
-device_initcall(ebony_device_probe);
+machine_device_initcall(ebony, ebony_device_probe);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
index 21a9dd1..e5be0c7 100644
--- a/arch/powerpc/platforms/44x/sequoia.c
+++ b/arch/powerpc/platforms/44x/sequoia.c
@@ -32,14 +32,11 @@ static struct of_device_id sequoia_of_bus[] = {
 
 static int __init sequoia_device_probe(void)
 {
-	if (!machine_is(sequoia))
-		return 0;
-
 	of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
 
 	return 0;
 }
-device_initcall(sequoia_device_probe);
+machine_device_initcall(sequoia, sequoia_device_probe);
 
 static int __init sequoia_probe(void)
 {
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index fd83440..3fce6b3 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -165,14 +165,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc8272_ads))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
index 4f457a9..c5430b3 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -176,14 +176,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(pq2fads))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(pq2fads, declare_of_platform_devices);
 
 define_machine(pq2fads)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 39ee7a1..6b9d72a 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[] = {
 
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc832x_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
 
 static void __init mpc832x_sys_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index d4bd040..67a282f 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi_boardinfo = {
 
 static int __init mpc832x_spi_init(void)
 {
-	if (!machine_is(mpc832x_rdb))
-		return 0;
-
 	par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
 	par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
 	par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
@@ -79,8 +76,7 @@ static int __init mpc832x_spi_init(void)
 			    mpc83xx_spi_activate_cs,
 			    mpc83xx_spi_deactivate_cs);
 }
-
-device_initcall(mpc832x_spi_init);
+machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
 
 /* ************************************************************************
  *
@@ -123,15 +119,12 @@ static struct of_device_id mpc832x_ids[] = {
 
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc832x_rdb))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
 
 void __init mpc832x_rdb_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index e40012f..9f37718 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[] = {
 
 static int __init mpc836x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc836x_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc836x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc836x_declare_of_platform_devices);
+machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
 
 static void __init mpc836x_mds_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25..a3fa1b0 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -233,13 +233,10 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc85xx_ads))
-		return 0;
-
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4d063ee..8b1de78 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
 	struct device_node *cascade_node = NULL;
 	int cascade_irq;
 
-	if (!machine_is(mpc85xx_cds))
-		return 0;
-
 	/* Initialize the i8259 controller */
 	for_each_node_by_type(np, "interrupt-controller")
 		if (of_device_is_compatible(np, "chrp,iic")) {
@@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
 
 	return 0;
 }
-
-device_initcall(mpc85xx_cds_8259_attach);
+machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
 
 #endif /* CONFIG_PPC_I8259 */
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 61b3eed..5f68c99 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[] = {
 
 static int __init mpc85xx_publish_devices(void)
 {
-	if (!machine_is(mpc85xx_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
 
 	return 0;
 }
-device_initcall(mpc85xx_publish_devices);
+machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
 
 static void __init mpc85xx_mds_pic_init(void)
 {
diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c518b6c..88afa35 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -155,12 +155,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 static int __init declare_of_platform_devices(void)
 {
 	/* Publish the QE devices */
-	if (machine_is(ep88xc))
-		of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(ep88xc, declare_of_platform_devices);
 
 define_machine(ep88xc) {
 	.name = "Embedded Planet EP88xC",
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2cf1b6a..6ef8e9e 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -264,12 +264,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 static int __init declare_of_platform_devices(void)
 {
 	/* Publish the QE devices */
-	if (machine_is(mpc885_ads))
-		of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc885_ads, declare_of_platform_devices);
 
 define_machine(mpc885_ads) {
 	.name			= "Freescale MPC885 ADS",
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index 9d7c2ef..e3ae39c 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -309,9 +309,6 @@ static int __init spider_pci_workaround_init(void)
 {
 	struct pci_controller *phb;
 
-	if (!machine_is(cell))
-		return 0;
-
 	/* Find spider bridges. We assume they have been all probed
 	 * in setup_arch(). If that was to change, we would need to
 	 * update this code to cope with dynamically added busses
@@ -343,4 +340,4 @@ static int __init spider_pci_workaround_init(void)
 
 	return 0;
 }
-arch_initcall(spider_pci_workaround_init);
+machine_arch_initcall(cell, spider_pci_workaround_init);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index faabc3f..648077f 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -699,9 +699,6 @@ static int __init cell_iommu_init(void)
 {
 	struct device_node *np;
 
-	if (!machine_is(cell))
-		return -ENODEV;
-
 	/* If IOMMU is disabled or we have little enough RAM to not need
 	 * to enable it, we setup a direct mapping.
 	 *
@@ -744,5 +741,5 @@ static int __init cell_iommu_init(void)
 
 	return 0;
 }
-arch_initcall(cell_iommu_init);
+machine_arch_initcall(cell, cell_iommu_init);
 
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
index 1ed3036..cb0cdab 100644
--- a/arch/powerpc/platforms/cell/pmu.c
+++ b/arch/powerpc/platforms/cell/pmu.c
@@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
 	unsigned int irq;
 	int rc, node;
 
-	if (!machine_is(cell))
-		return 0;
-
 	for_each_node(node) {
 		irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
 					       (node << IIC_IRQ_NODE_SHIFT));
@@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
 
 	return 0;
 }
-arch_initcall(cbe_init_pm_irq);
+machine_arch_initcall(cell, cbe_init_pm_irq);
 
 void cbe_sync_irq(int node)
 {
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 98e7ef8..8390d2d 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -85,9 +85,6 @@ static int __init cell_publish_devices(void)
 {
 	int node;
 
-	if (!machine_is(cell))
-		return 0;
-
 	/* Publish OF platform devices for southbridge IOs */
 	of_platform_bus_probe(NULL, NULL, NULL);
 
@@ -101,7 +98,7 @@ static int __init cell_publish_devices(void)
 	}
 	return 0;
 }
-device_initcall(cell_publish_devices);
+machine_device_initcall(cell, cell_publish_devices);
 
 static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
 {
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
index 755d869..c9884f4 100644
--- a/arch/powerpc/platforms/celleb/iommu.c
+++ b/arch/powerpc/platforms/celleb/iommu.c
@@ -91,14 +91,10 @@ static struct notifier_block celleb_of_bus_notifier = {
 
 static int __init celleb_init_iommu(void)
 {
-	if (!machine_is(celleb))
-		return -ENODEV;
-
 	celleb_init_direct_mapping();
 	set_pci_dma_ops(&dma_direct_ops);
 	bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
 
 	return 0;
 }
-
-arch_initcall(celleb_init_iommu);
+machine_arch_initcall(celleb, celleb_init_iommu);
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index ddfb35a..aa18f95 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -127,9 +127,6 @@ static struct of_device_id celleb_bus_ids[] __initdata = {
 
 static int __init celleb_publish_devices(void)
 {
-	if (!machine_is(celleb))
-		return 0;
-
 	/* Publish OF platform devices for southbridge IOs */
 	of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
 
@@ -137,7 +134,7 @@ static int __init celleb_publish_devices(void)
 
 	return 0;
 }
-device_initcall(celleb_publish_devices);
+machine_device_initcall(celleb, celleb_publish_devices);
 
 define_machine(celleb) {
 	.name			= "Cell Reference Set",
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index c99264c..9d891bd 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -117,9 +117,6 @@ static int __init ls_uarts_init(void)
 	phys_addr_t phys_addr;
 	int len;
 
-	if (!machine_is(linkstation))
-		return 0;
-
 	avr = of_find_node_by_path("/soc10x/serial@80004500");
 	if (!avr)
 		return -EINVAL;
@@ -142,4 +139,4 @@ static int __init ls_uarts_init(void)
 	return 0;
 }
 
-late_initcall(ls_uarts_init);
+machine_late_initcall(linkstation, ls_uarts_init);
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index d8e1fcc..43911d8 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -74,9 +74,6 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
 
 static int __init pasemi_idle_init(void)
 {
-	if (!machine_is(pasemi))
-		return -ENODEV;
-
 #ifndef CONFIG_PPC_PASEMI_CPUFREQ
 	printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
 	current_mode = 0;
@@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)
 
 	return 0;
 }
-late_initcall(pasemi_idle_init);
+machine_late_initcall(pasemi, pasemi_idle_init);
 
 static int __init idle_param(char *p)
 {
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 3d62060..59c8371 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -126,9 +126,6 @@ static int __init pas_setup_mce_regs(void)
 	struct pci_dev *dev;
 	int reg;
 
-	if (!machine_is(pasemi))
-		return -ENODEV;
-
 	/* Remap various SoC status registers for use by the MCE handler */
 
 	reg = 0;
@@ -172,7 +169,7 @@ static int __init pas_setup_mce_regs(void)
 
 	return 0;
 }
-device_initcall(pas_setup_mce_regs);
+machine_device_initcall(pasemi, pas_setup_mce_regs);
 
 static __init void pas_init_IRQ(void)
 {
@@ -369,9 +366,6 @@ static struct of_device_id pasemi_bus_ids[] = {
 
 static int __init pasemi_publish_devices(void)
 {
-	if (!machine_is(pasemi))
-		return 0;
-
 	pasemi_pcmcia_init();
 
 	/* Publish OF platform devices for SDC and other non-PCI devices */
@@ -379,7 +373,7 @@ static int __init pasemi_publish_devices(void)
 
 	return 0;
 }
-device_initcall(pasemi_publish_devices);
+machine_device_initcall(pasemi, pasemi_publish_devices);
 
 
 /*
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index da2007e..9c9299c 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1462,9 +1462,6 @@ int __init pmac_i2c_init(void)
 		return 0;
 	i2c_inited = 1;
 
-	if (!machine_is(powermac))
-		return 0;
-
 	/* Probe keywest-i2c busses */
 	kw_i2c_probe();
 
@@ -1483,7 +1480,7 @@ int __init pmac_i2c_init(void)
 
 	return 0;
 }
-arch_initcall(pmac_i2c_init);
+machine_arch_initcall(powermac, pmac_i2c_init);
 
 /* Since pmac_i2c_init can be called too early for the platform device
  * registration, we need to do it at a later time. In our case, subsys
@@ -1515,4 +1512,4 @@ static int __init pmac_i2c_create_platform_devices(void)
 
 	return 0;
 }
-subsys_initcall(pmac_i2c_create_platform_devices);
+machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 45d54b9..db20de5 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
 
 	return 0;
 }
-
-arch_initcall(pmac_pfunc_base_install);
+machine_arch_initcall(powermac, pmac_pfunc_base_install);
 
 #ifdef CONFIG_PM
 
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 999f5e1..cd72164 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
 	sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
 	return 0;
 }
-
-subsys_initcall(init_pmacpic_sysfs);
+machine_subsys_initcall(powermac, init_pmacpic_sysfs);
 
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 02c5330..0421189 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -398,17 +398,13 @@ static int initializing = 1;
 
 static int pmac_late_init(void)
 {
-	if (!machine_is(powermac))
-		return -ENODEV;
-
 	initializing = 0;
 	/* this is udbg (which is __init) and we can later use it during
 	 * cpu hotplug (in smp_core99_kick_cpu) */
 	ppc_md.progress = NULL;
 	return 0;
 }
-
-late_initcall(pmac_late_init);
+machine_late_initcall(powermac, pmac_late_init);
 
 /*
  * This is __init_refok because we check for "initializing" before
@@ -535,9 +531,6 @@ static int __init pmac_declare_of_platform_devices(void)
 	if (machine_is(chrp))
 		return -1;
 
-	if (!machine_is(powermac))
-		return 0;
-
 	np = of_find_node_by_name(NULL, "valkyrie");
 	if (np)
 		of_platform_device_create(np, "valkyrie", NULL);
@@ -552,8 +545,7 @@ static int __init pmac_declare_of_platform_devices(void)
 
 	return 0;
 }
-
-device_initcall(pmac_declare_of_platform_devices);
+machine_device_initcall(powermac, pmac_declare_of_platform_devices);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened

^ permalink raw reply related

* Re: [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code
From: Grant Likely @ 2007-12-02  6:17 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof, jwboyer
In-Reply-To: <20071202061033.21193.64818.stgit@trillian.secretlab.ca>

On 12/1/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> This patch makes the platform code use the new machine-specific initcall
> hooks.  This has the advantage of not needing to explicitly test
> machine_is() at the top of every initcall function.

Warning: I have *not* exhaustively tested this; just spot checked in a
few places.  I'll be more thorough once I know everyone is okay with
it in principle.

Cheers,
g.

>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
>  arch/powerpc/platforms/40x/kilauea.c         |    5 +----
>  arch/powerpc/platforms/40x/virtex.c          |    5 +----
>  arch/powerpc/platforms/40x/walnut.c          |    5 +----
>  arch/powerpc/platforms/44x/bamboo.c          |    5 +----
>  arch/powerpc/platforms/44x/ebony.c           |    5 +----
>  arch/powerpc/platforms/44x/sequoia.c         |    5 +----
>  arch/powerpc/platforms/82xx/mpc8272_ads.c    |    5 +----
>  arch/powerpc/platforms/82xx/pq2fads.c        |    5 +----
>  arch/powerpc/platforms/83xx/mpc832x_mds.c    |    5 +----
>  arch/powerpc/platforms/83xx/mpc832x_rdb.c    |   11 ++---------
>  arch/powerpc/platforms/83xx/mpc836x_mds.c    |    5 +----
>  arch/powerpc/platforms/85xx/mpc85xx_ads.c    |    5 +----
>  arch/powerpc/platforms/85xx/mpc85xx_cds.c    |    6 +-----
>  arch/powerpc/platforms/85xx/mpc85xx_mds.c    |    5 +----
>  arch/powerpc/platforms/8xx/ep88xc.c          |    5 ++---
>  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 ++---
>  arch/powerpc/platforms/cell/io-workarounds.c |    5 +----
>  arch/powerpc/platforms/cell/iommu.c          |    5 +----
>  arch/powerpc/platforms/cell/pmu.c            |    5 +----
>  arch/powerpc/platforms/cell/setup.c          |    5 +----
>  arch/powerpc/platforms/celleb/iommu.c        |    6 +-----
>  arch/powerpc/platforms/celleb/setup.c        |    5 +----
>  arch/powerpc/platforms/embedded6xx/ls_uart.c |    5 +----
>  arch/powerpc/platforms/pasemi/idle.c         |    5 +----
>  arch/powerpc/platforms/pasemi/setup.c        |   10 ++--------
>  arch/powerpc/platforms/powermac/low_i2c.c    |    7 ++-----
>  arch/powerpc/platforms/powermac/pfunc_base.c |    3 +--
>  arch/powerpc/platforms/powermac/pic.c        |    3 +--
>  arch/powerpc/platforms/powermac/setup.c      |   12 ++----------
>  29 files changed, 35 insertions(+), 128 deletions(-)
>
> diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
> index 1bffdbd..0853db7 100644
> --- a/arch/powerpc/platforms/40x/kilauea.c
> +++ b/arch/powerpc/platforms/40x/kilauea.c
> @@ -29,14 +29,11 @@ static struct of_device_id kilauea_of_bus[] = {
>
>  static int __init kilauea_device_probe(void)
>  {
> -       if (!machine_is(kilauea))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
>
>         return 0;
>  }
> -device_initcall(kilauea_device_probe);
> +machine_device_initcall(kilauea, kilauea_device_probe);
>
>  static int __init kilauea_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
> index 14bbc32..43fcc8e 100644
> --- a/arch/powerpc/platforms/40x/virtex.c
> +++ b/arch/powerpc/platforms/40x/virtex.c
> @@ -17,14 +17,11 @@
>
>  static int __init virtex_device_probe(void)
>  {
> -       if (!machine_is(virtex))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, NULL, NULL);
>
>         return 0;
>  }
> -device_initcall(virtex_device_probe);
> +machine_device_initcall(virtex, virtex_device_probe);
>
>  static int __init virtex_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
> index ff6db24..91a5247 100644
> --- a/arch/powerpc/platforms/40x/walnut.c
> +++ b/arch/powerpc/platforms/40x/walnut.c
> @@ -34,15 +34,12 @@ static struct of_device_id walnut_of_bus[] = {
>
>  static int __init walnut_device_probe(void)
>  {
> -       if (!machine_is(walnut))
> -               return 0;
> -
>         /* FIXME: do bus probe here */
>         of_platform_bus_probe(NULL, walnut_of_bus, NULL);
>
>         return 0;
>  }
> -device_initcall(walnut_device_probe);
> +machine_device_initcall(walnut, walnut_device_probe);
>
>  static int __init walnut_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
> index be23f11..5253996 100644
> --- a/arch/powerpc/platforms/44x/bamboo.c
> +++ b/arch/powerpc/platforms/44x/bamboo.c
> @@ -32,14 +32,11 @@ static struct of_device_id bamboo_of_bus[] = {
>
>  static int __init bamboo_device_probe(void)
>  {
> -       if (!machine_is(bamboo))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
>
>         return 0;
>  }
> -device_initcall(bamboo_device_probe);
> +machine_device_initcall(bamboo, bamboo_device_probe);
>
>  static int __init bamboo_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c
> index 6cd3476..b783c6e 100644
> --- a/arch/powerpc/platforms/44x/ebony.c
> +++ b/arch/powerpc/platforms/44x/ebony.c
> @@ -36,14 +36,11 @@ static struct of_device_id ebony_of_bus[] = {
>
>  static int __init ebony_device_probe(void)
>  {
> -       if (!machine_is(ebony))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, ebony_of_bus, NULL);
>
>         return 0;
>  }
> -device_initcall(ebony_device_probe);
> +machine_device_initcall(ebony, ebony_device_probe);
>
>  /*
>   * Called very early, MMU is off, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
> index 21a9dd1..e5be0c7 100644
> --- a/arch/powerpc/platforms/44x/sequoia.c
> +++ b/arch/powerpc/platforms/44x/sequoia.c
> @@ -32,14 +32,11 @@ static struct of_device_id sequoia_of_bus[] = {
>
>  static int __init sequoia_device_probe(void)
>  {
> -       if (!machine_is(sequoia))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
>
>         return 0;
>  }
> -device_initcall(sequoia_device_probe);
> +machine_device_initcall(sequoia, sequoia_device_probe);
>
>  static int __init sequoia_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
> index fd83440..3fce6b3 100644
> --- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
> +++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
> @@ -165,14 +165,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
>
>  static int __init declare_of_platform_devices(void)
>  {
> -       if (!machine_is(mpc8272_ads))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL, of_bus_ids, NULL);
>         return 0;
>  }
> -device_initcall(declare_of_platform_devices);
> +machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
>
>  /*
>   * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
> index 4f457a9..c5430b3 100644
> --- a/arch/powerpc/platforms/82xx/pq2fads.c
> +++ b/arch/powerpc/platforms/82xx/pq2fads.c
> @@ -176,14 +176,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
>
>  static int __init declare_of_platform_devices(void)
>  {
> -       if (!machine_is(pq2fads))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL, of_bus_ids, NULL);
>         return 0;
>  }
> -device_initcall(declare_of_platform_devices);
> +machine_device_initcall(pq2fads, declare_of_platform_devices);
>
>  define_machine(pq2fads)
>  {
> diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
> index 39ee7a1..6b9d72a 100644
> --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
> +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
> @@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[] = {
>
>  static int __init mpc832x_declare_of_platform_devices(void)
>  {
> -       if (!machine_is(mpc832x_mds))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
>
>         return 0;
>  }
> -device_initcall(mpc832x_declare_of_platform_devices);
> +machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
>
>  static void __init mpc832x_sys_init_IRQ(void)
>  {
> diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
> index d4bd040..67a282f 100644
> --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
> +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
> @@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi_boardinfo = {
>
>  static int __init mpc832x_spi_init(void)
>  {
> -       if (!machine_is(mpc832x_rdb))
> -               return 0;
> -
>         par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
>         par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
>         par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
> @@ -79,8 +76,7 @@ static int __init mpc832x_spi_init(void)
>                             mpc83xx_spi_activate_cs,
>                             mpc83xx_spi_deactivate_cs);
>  }
> -
> -device_initcall(mpc832x_spi_init);
> +machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
>
>  /* ************************************************************************
>   *
> @@ -123,15 +119,12 @@ static struct of_device_id mpc832x_ids[] = {
>
>  static int __init mpc832x_declare_of_platform_devices(void)
>  {
> -       if (!machine_is(mpc832x_rdb))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
>
>         return 0;
>  }
> -device_initcall(mpc832x_declare_of_platform_devices);
> +machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
>
>  void __init mpc832x_rdb_init_IRQ(void)
>  {
> diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
> index e40012f..9f37718 100644
> --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
> +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
> @@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[] = {
>
>  static int __init mpc836x_declare_of_platform_devices(void)
>  {
> -       if (!machine_is(mpc836x_mds))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL, mpc836x_ids, NULL);
>
>         return 0;
>  }
> -device_initcall(mpc836x_declare_of_platform_devices);
> +machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
>
>  static void __init mpc836x_mds_init_IRQ(void)
>  {
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> index bccdc25..a3fa1b0 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -233,13 +233,10 @@ static struct of_device_id __initdata of_bus_ids[] = {
>
>  static int __init declare_of_platform_devices(void)
>  {
> -       if (!machine_is(mpc85xx_ads))
> -               return 0;
> -
>         of_platform_bus_probe(NULL, of_bus_ids, NULL);
>         return 0;
>  }
> -device_initcall(declare_of_platform_devices);
> +machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
>
>  /*
>   * Called very early, device-tree isn't unflattened
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> index 4d063ee..8b1de78 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> @@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
>         struct device_node *cascade_node = NULL;
>         int cascade_irq;
>
> -       if (!machine_is(mpc85xx_cds))
> -               return 0;
> -
>         /* Initialize the i8259 controller */
>         for_each_node_by_type(np, "interrupt-controller")
>                 if (of_device_is_compatible(np, "chrp,iic")) {
> @@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
>
>         return 0;
>  }
> -
> -device_initcall(mpc85xx_cds_8259_attach);
> +machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
>
>  #endif /* CONFIG_PPC_I8259 */
>
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> index 61b3eed..5f68c99 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
> @@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[] = {
>
>  static int __init mpc85xx_publish_devices(void)
>  {
> -       if (!machine_is(mpc85xx_mds))
> -               return 0;
> -
>         /* Publish the QE devices */
>         of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
>
>         return 0;
>  }
> -device_initcall(mpc85xx_publish_devices);
> +machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
>
>  static void __init mpc85xx_mds_pic_init(void)
>  {
> diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
> index c518b6c..88afa35 100644
> --- a/arch/powerpc/platforms/8xx/ep88xc.c
> +++ b/arch/powerpc/platforms/8xx/ep88xc.c
> @@ -155,12 +155,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
>  static int __init declare_of_platform_devices(void)
>  {
>         /* Publish the QE devices */
> -       if (machine_is(ep88xc))
> -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
> +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
>
>         return 0;
>  }
> -device_initcall(declare_of_platform_devices);
> +machine_device_initcall(ep88xc, declare_of_platform_devices);
>
>  define_machine(ep88xc) {
>         .name = "Embedded Planet EP88xC",
> diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> index 2cf1b6a..6ef8e9e 100644
> --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> @@ -264,12 +264,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
>  static int __init declare_of_platform_devices(void)
>  {
>         /* Publish the QE devices */
> -       if (machine_is(mpc885_ads))
> -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
> +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
>
>         return 0;
>  }
> -device_initcall(declare_of_platform_devices);
> +machine_device_initcall(mpc885_ads, declare_of_platform_devices);
>
>  define_machine(mpc885_ads) {
>         .name                   = "Freescale MPC885 ADS",
> diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
> index 9d7c2ef..e3ae39c 100644
> --- a/arch/powerpc/platforms/cell/io-workarounds.c
> +++ b/arch/powerpc/platforms/cell/io-workarounds.c
> @@ -309,9 +309,6 @@ static int __init spider_pci_workaround_init(void)
>  {
>         struct pci_controller *phb;
>
> -       if (!machine_is(cell))
> -               return 0;
> -
>         /* Find spider bridges. We assume they have been all probed
>          * in setup_arch(). If that was to change, we would need to
>          * update this code to cope with dynamically added busses
> @@ -343,4 +340,4 @@ static int __init spider_pci_workaround_init(void)
>
>         return 0;
>  }
> -arch_initcall(spider_pci_workaround_init);
> +machine_arch_initcall(cell, spider_pci_workaround_init);
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index faabc3f..648077f 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -699,9 +699,6 @@ static int __init cell_iommu_init(void)
>  {
>         struct device_node *np;
>
> -       if (!machine_is(cell))
> -               return -ENODEV;
> -
>         /* If IOMMU is disabled or we have little enough RAM to not need
>          * to enable it, we setup a direct mapping.
>          *
> @@ -744,5 +741,5 @@ static int __init cell_iommu_init(void)
>
>         return 0;
>  }
> -arch_initcall(cell_iommu_init);
> +machine_arch_initcall(cell, cell_iommu_init);
>
> diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
> index 1ed3036..cb0cdab 100644
> --- a/arch/powerpc/platforms/cell/pmu.c
> +++ b/arch/powerpc/platforms/cell/pmu.c
> @@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
>         unsigned int irq;
>         int rc, node;
>
> -       if (!machine_is(cell))
> -               return 0;
> -
>         for_each_node(node) {
>                 irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
>                                                (node << IIC_IRQ_NODE_SHIFT));
> @@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
>
>         return 0;
>  }
> -arch_initcall(cbe_init_pm_irq);
> +machine_arch_initcall(cell, cbe_init_pm_irq);
>
>  void cbe_sync_irq(int node)
>  {
> diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
> index 98e7ef8..8390d2d 100644
> --- a/arch/powerpc/platforms/cell/setup.c
> +++ b/arch/powerpc/platforms/cell/setup.c
> @@ -85,9 +85,6 @@ static int __init cell_publish_devices(void)
>  {
>         int node;
>
> -       if (!machine_is(cell))
> -               return 0;
> -
>         /* Publish OF platform devices for southbridge IOs */
>         of_platform_bus_probe(NULL, NULL, NULL);
>
> @@ -101,7 +98,7 @@ static int __init cell_publish_devices(void)
>         }
>         return 0;
>  }
> -device_initcall(cell_publish_devices);
> +machine_device_initcall(cell, cell_publish_devices);
>
>  static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
>  {
> diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
> index 755d869..c9884f4 100644
> --- a/arch/powerpc/platforms/celleb/iommu.c
> +++ b/arch/powerpc/platforms/celleb/iommu.c
> @@ -91,14 +91,10 @@ static struct notifier_block celleb_of_bus_notifier = {
>
>  static int __init celleb_init_iommu(void)
>  {
> -       if (!machine_is(celleb))
> -               return -ENODEV;
> -
>         celleb_init_direct_mapping();
>         set_pci_dma_ops(&dma_direct_ops);
>         bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
>
>         return 0;
>  }
> -
> -arch_initcall(celleb_init_iommu);
> +machine_arch_initcall(celleb, celleb_init_iommu);
> diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
> index ddfb35a..aa18f95 100644
> --- a/arch/powerpc/platforms/celleb/setup.c
> +++ b/arch/powerpc/platforms/celleb/setup.c
> @@ -127,9 +127,6 @@ static struct of_device_id celleb_bus_ids[] __initdata = {
>
>  static int __init celleb_publish_devices(void)
>  {
> -       if (!machine_is(celleb))
> -               return 0;
> -
>         /* Publish OF platform devices for southbridge IOs */
>         of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
>
> @@ -137,7 +134,7 @@ static int __init celleb_publish_devices(void)
>
>         return 0;
>  }
> -device_initcall(celleb_publish_devices);
> +machine_device_initcall(celleb, celleb_publish_devices);
>
>  define_machine(celleb) {
>         .name                   = "Cell Reference Set",
> diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
> index c99264c..9d891bd 100644
> --- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
> +++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
> @@ -117,9 +117,6 @@ static int __init ls_uarts_init(void)
>         phys_addr_t phys_addr;
>         int len;
>
> -       if (!machine_is(linkstation))
> -               return 0;
> -
>         avr = of_find_node_by_path("/soc10x/serial@80004500");
>         if (!avr)
>                 return -EINVAL;
> @@ -142,4 +139,4 @@ static int __init ls_uarts_init(void)
>         return 0;
>  }
>
> -late_initcall(ls_uarts_init);
> +machine_late_initcall(linkstation, ls_uarts_init);
> diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
> index d8e1fcc..43911d8 100644
> --- a/arch/powerpc/platforms/pasemi/idle.c
> +++ b/arch/powerpc/platforms/pasemi/idle.c
> @@ -74,9 +74,6 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
>
>  static int __init pasemi_idle_init(void)
>  {
> -       if (!machine_is(pasemi))
> -               return -ENODEV;
> -
>  #ifndef CONFIG_PPC_PASEMI_CPUFREQ
>         printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
>         current_mode = 0;
> @@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)
>
>         return 0;
>  }
> -late_initcall(pasemi_idle_init);
> +machine_late_initcall(pasemi, pasemi_idle_init);
>
>  static int __init idle_param(char *p)
>  {
> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index 3d62060..59c8371 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -126,9 +126,6 @@ static int __init pas_setup_mce_regs(void)
>         struct pci_dev *dev;
>         int reg;
>
> -       if (!machine_is(pasemi))
> -               return -ENODEV;
> -
>         /* Remap various SoC status registers for use by the MCE handler */
>
>         reg = 0;
> @@ -172,7 +169,7 @@ static int __init pas_setup_mce_regs(void)
>
>         return 0;
>  }
> -device_initcall(pas_setup_mce_regs);
> +machine_device_initcall(pasemi, pas_setup_mce_regs);
>
>  static __init void pas_init_IRQ(void)
>  {
> @@ -369,9 +366,6 @@ static struct of_device_id pasemi_bus_ids[] = {
>
>  static int __init pasemi_publish_devices(void)
>  {
> -       if (!machine_is(pasemi))
> -               return 0;
> -
>         pasemi_pcmcia_init();
>
>         /* Publish OF platform devices for SDC and other non-PCI devices */
> @@ -379,7 +373,7 @@ static int __init pasemi_publish_devices(void)
>
>         return 0;
>  }
> -device_initcall(pasemi_publish_devices);
> +machine_device_initcall(pasemi, pasemi_publish_devices);
>
>
>  /*
> diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
> index da2007e..9c9299c 100644
> --- a/arch/powerpc/platforms/powermac/low_i2c.c
> +++ b/arch/powerpc/platforms/powermac/low_i2c.c
> @@ -1462,9 +1462,6 @@ int __init pmac_i2c_init(void)
>                 return 0;
>         i2c_inited = 1;
>
> -       if (!machine_is(powermac))
> -               return 0;
> -
>         /* Probe keywest-i2c busses */
>         kw_i2c_probe();
>
> @@ -1483,7 +1480,7 @@ int __init pmac_i2c_init(void)
>
>         return 0;
>  }
> -arch_initcall(pmac_i2c_init);
> +machine_arch_initcall(powermac, pmac_i2c_init);
>
>  /* Since pmac_i2c_init can be called too early for the platform device
>   * registration, we need to do it at a later time. In our case, subsys
> @@ -1515,4 +1512,4 @@ static int __init pmac_i2c_create_platform_devices(void)
>
>         return 0;
>  }
> -subsys_initcall(pmac_i2c_create_platform_devices);
> +machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
> diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
> index 45d54b9..db20de5 100644
> --- a/arch/powerpc/platforms/powermac/pfunc_base.c
> +++ b/arch/powerpc/platforms/powermac/pfunc_base.c
> @@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
>
>         return 0;
>  }
> -
> -arch_initcall(pmac_pfunc_base_install);
> +machine_arch_initcall(powermac, pmac_pfunc_base_install);
>
>  #ifdef CONFIG_PM
>
> diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
> index 999f5e1..cd72164 100644
> --- a/arch/powerpc/platforms/powermac/pic.c
> +++ b/arch/powerpc/platforms/powermac/pic.c
> @@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
>         sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
>         return 0;
>  }
> -
> -subsys_initcall(init_pmacpic_sysfs);
> +machine_subsys_initcall(powermac, init_pmacpic_sysfs);
>
> diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
> index 02c5330..0421189 100644
> --- a/arch/powerpc/platforms/powermac/setup.c
> +++ b/arch/powerpc/platforms/powermac/setup.c
> @@ -398,17 +398,13 @@ static int initializing = 1;
>
>  static int pmac_late_init(void)
>  {
> -       if (!machine_is(powermac))
> -               return -ENODEV;
> -
>         initializing = 0;
>         /* this is udbg (which is __init) and we can later use it during
>          * cpu hotplug (in smp_core99_kick_cpu) */
>         ppc_md.progress = NULL;
>         return 0;
>  }
> -
> -late_initcall(pmac_late_init);
> +machine_late_initcall(powermac, pmac_late_init);
>
>  /*
>   * This is __init_refok because we check for "initializing" before
> @@ -535,9 +531,6 @@ static int __init pmac_declare_of_platform_devices(void)
>         if (machine_is(chrp))
>                 return -1;
>
> -       if (!machine_is(powermac))
> -               return 0;
> -
>         np = of_find_node_by_name(NULL, "valkyrie");
>         if (np)
>                 of_platform_device_create(np, "valkyrie", NULL);
> @@ -552,8 +545,7 @@ static int __init pmac_declare_of_platform_devices(void)
>
>         return 0;
>  }
> -
> -device_initcall(pmac_declare_of_platform_devices);
> +machine_device_initcall(powermac, pmac_declare_of_platform_devices);
>
>  /*
>   * Called very early, MMU is off, device-tree isn't unflattened
>
>


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: Linux 2.4 on ML310 with PowerPC405
From: narendra sisodiya @ 2007-12-02  6:35 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <fa686aa40712012030r6ca993aek5dd4e58c961ac6fb@mail.gmail.com>

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

Ok,, I will try with 2.6 now, and then let you know the exact errors in
complication
Thanks and regards

On Dec 2, 2007 10:00 AM, Grant Likely <grant.likely@secretlab.ca> wrote:

> On 12/1/07, narendra sisodiya <narendra.sisodiya@gmail.com> wrote:
> > Hi all,
> > I am trying to port Linux on ML310 virtex 2 pro,,
> > I am unable to compile my properly,,,
> > here i documented my procedure,,,
> > http://placements.techfandu.org/index.php?title=Linux_kernel_on_ML310
> >
> > Please check out ,, where i am doing mistake
>
> I'm sorry, but I don't understand where you are having your problems.
> Specifically, what error are you getting when your kernel fails to
> compile?
>
> As for the kernel version, I do not recommend using linux 2.4 any
> more.  You should consider using a 2.6 kernel instead.  I've got some
> documentation on the 2.6 kernel for virtex devices here:
>
> http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
>
> Cheers,
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195
>



-- 
Narendra Sisodiya
MTech (Computer Technology), IIT Delhi
+91-9999232792
http://www.techfandu.org/index.html

[-- Attachment #2: Type: text/html, Size: 1931 bytes --]

^ permalink raw reply

* Re: CPM2 USB host driver
From: Mike Rapoport @ 2007-12-02  6:31 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200711301628.33526.laurentp@cse-semaphore.com>

> 
>> I tried to forward-port FHCI from Freescale 2.6.11 kernels. Twice.
>> But these efforts always stumbled over more important tasks.
> 
> Do you think I start from the FHCI driver provided by Freescale for 2.6.11, 
> from the cpm2usb driver or from scratch ?

The cmp2usb is old and crappy, and I had no time at all to update it. So if the
choice was to start from cpm2usb or from scratch, I'd choose to start from scratch.

> Both the cpm2usb and FHCI drivers seem to use the packet-level interface. Is 
> there any reason not to use the transaction-level interface ?


> Best regards,
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply

* Re: [PATCH 09/28] blk_end_request: changing ps3disk (take 3)
From: Geert Uytterhoeven @ 2007-12-02  9:34 UTC (permalink / raw)
  To: Kiyoshi Ueda
  Cc: linux-scsi, Linux/PPC Development, jens.axboe,
	Linux Kernel Development, linux-ide, dm-devel, bharrosh, j-nomura
In-Reply-To: <20071130.182810.98558485.k-ueda@ct.jp.nec.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1615 bytes --]

On Fri, 30 Nov 2007, Kiyoshi Ueda wrote:
> This patch converts ps3disk to use blk_end_request().
                                     ^^^^^^^^^^^^^^^
Patch subject and description are inconsistent with actual change.

> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> ---
>  drivers/block/ps3disk.c |    6 +-----
>  1 files changed, 1 insertion(+), 5 deletions(-)
> 
> Index: 2.6.24-rc3-mm2/drivers/block/ps3disk.c
> ===================================================================
> --- 2.6.24-rc3-mm2.orig/drivers/block/ps3disk.c
> +++ 2.6.24-rc3-mm2/drivers/block/ps3disk.c
> @@ -280,11 +280,7 @@ static irqreturn_t ps3disk_interrupt(int
>  	}
>  
>  	spin_lock(&priv->lock);
> -	if (!end_that_request_first(req, uptodate, num_sectors)) {
> -		add_disk_randomness(req->rq_disk);
> -		blkdev_dequeue_request(req);
> -		end_that_request_last(req, uptodate);
> -	}
> +	__blk_end_request(req, uptodate, num_sectors << 9);
        ^^^^^^^^^^^^^^^^^

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven@sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

^ permalink raw reply

* Re: [PATCH 0/3] OF-platform PATA driver
From: Anton Vorontsov @ 2007-12-02 11:46 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-ide, Paul Mundt, Jeff Garzik, Arnd Bergmann, linuxppc-dev
In-Reply-To: <20071202035755.GA3116@lixom.net>

On Sat, Dec 01, 2007 at 09:57:55PM -0600, Olof Johansson wrote:
> On Sun, Dec 02, 2007 at 02:58:10AM +0300, Anton Vorontsov wrote:
> > On Sat, Dec 01, 2007 at 05:54:49PM -0500, Jeff Garzik wrote:
> > while (1) {
> > 	send_patches();
> > 
> > 	if (ack_collected(PaulM) && ack_collected(PowerPC_people))
> > 		break;
> > 
> > 	sleep(wait_for_comments_timeout); <-- currently here.
> 
> I still haven't seen you address the compatible comments (that
> pata-platform is suboptimal). Or did I miss some respin of the patches?

I didn't resend these patches yet. You started the thread, but you hid
away from the discussion (you had been Cc'ed to every mail).

1. Arnd suggested {p,s}ata-pio-{1,2,3,..} or ata-{1,2,3,..} compatible
   scheme;
2. Sergei verbosely explained that that there is no reason to
   complicate compatible property. He suggested ata-generic, or
   ata-simple;

Mainly I was awaiting for your further comments. By now I tend to
follow Sergei's comments and rename compatible stuff to ata-generic.
Are you fine with it?

Thanks,

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* RE: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHYlayer functionality
From: Joakim Tjernlund @ 2007-12-02 11:54 UTC (permalink / raw)
  To: cbou, 'Jochen Friedrich'
  Cc: netdev, linux-kernel, 'Jeff Garzik', linuxppc-dev
In-Reply-To: <20071201213403.GA2350@zarina>

[SNIP]
> ^^ the correct solution is to implement arch_initcall function
> which will create fixed PHYs, and then leave only
> snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); part in the
> fs_enet's find_phy().
> 
> Try add something like this to the fsl_soc.c (compile untested):
> 
> - - - -
> static int __init of_add_fixed_phys(void)
> {
> 	struct device_node *np;
> 	const u32 *prop;
> 	struct fixed_phy_status status = {};
> 
> 	while ((np = of_find_node_by_name(NULL, "ethernet"))) {
> 		data  = of_get_property(np, "fixed-link", NULL);
> 		if (!data)
> 			continue;
> 
> 		status.link = 1;
> 		status.duplex = data[1];
> 		status.speed  = data[2];

What about Pause and Asym_Pause? Dunno why so few, if any, eth drivers
impl. it, but the PHY lib supports it.
Even if fixed PHYs doesn't support it directly I think the OF interface
should have it.

    - fixed-link : <a b c d e> where a is emulated phy id - choose any,
      but unique to the all specified fixed-links, b is duplex - 0 half,
      1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no pause,
      1 pause, d asym_pause - 0 no asym_pause, 1 asym_pause.

Jocke

> 
> 		ret = fixed_phy_add(PHY_POLL, data[0], &status);
> 		if (ret)
> 			return ret;
> 	}
> 
> 	return 0;
> }
> arch_initcall(of_add_fixed_phys);
> - - - -
> 
> And remove fixed_phy_add() from the fs_enet. This should work
> nicely and also should be ideologically correct. ;-)
> 
> > How is this supposed to work for modules or for the
> > PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned
> > during fs_soc initialization but during device initialization?
> 
> We should mark fixed.c as bool. Fake/virtual/fixed/platform PHYs
> creation is architecture code anyway, can't be =m.
> 
> -- 
> Anton Vorontsov
> email: cbou@mail.ru
> backup email: ya-cbou@yandex.ru
> irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHYlayer functionality
From: Anton Vorontsov @ 2007-12-02 12:13 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: linuxppc-dev, netdev, 'Jeff Garzik', linux-kernel
In-Reply-To: <051e01c834da$1cce82f0$5267a8c0@Jocke>

On Sun, Dec 02, 2007 at 12:54:36PM +0100, Joakim Tjernlund wrote:
> [SNIP]
> > ^^ the correct solution is to implement arch_initcall function
> > which will create fixed PHYs, and then leave only
> > snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); part in the
> > fs_enet's find_phy().
> > 
> > Try add something like this to the fsl_soc.c (compile untested):
> > 
> > - - - -
> > static int __init of_add_fixed_phys(void)
> > {
> > 	struct device_node *np;
> > 	const u32 *prop;
> > 	struct fixed_phy_status status = {};
> > 
> > 	while ((np = of_find_node_by_name(NULL, "ethernet"))) {
> > 		data  = of_get_property(np, "fixed-link", NULL);
> > 		if (!data)
> > 			continue;
> > 
> > 		status.link = 1;
> > 		status.duplex = data[1];
> > 		status.speed  = data[2];
> 
> What about Pause and Asym_Pause?

Will be addressed in the next respin of these patches. Let's
hope on Monday.

> Dunno why so few, if any, eth drivers
> impl. it, but the PHY lib supports it.
> Even if fixed PHYs doesn't support it directly I think the OF interface
> should have it.
> 
>     - fixed-link : <a b c d e> where a is emulated phy id - choose any,
>       but unique to the all specified fixed-links, b is duplex - 0 half,
>       1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no pause,
>       1 pause, d asym_pause - 0 no asym_pause, 1 asym_pause.

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ 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