Netdev List
 help / color / mirror / Atom feed
* [PATCH v11 4/5] powerpc: Add flexcan device support for p1010rdb.
From: Robin Holt @ 2011-08-10 16:27 UTC (permalink / raw)
  To: Robin Holt, Kumar Gala, Wolfgang Grandegger, U Bhaskar-B22300
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, Kumar Gala,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	PPC list, Wolfgang Grandegger
In-Reply-To: <1312993670-23999-1-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>

I added a simple clock source for the p1010rdb so the flexcan driver
could determine a clock frequency.  The p1010 flexcan device only has
an oscillator of system bus frequency divided by 2.

Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
Cc: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
---
 arch/powerpc/platforms/85xx/Kconfig    |    2 +
 arch/powerpc/platforms/85xx/Makefile   |    2 +
 arch/powerpc/platforms/85xx/clock.c    |   52 ++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/p1010rdb.c |    8 +++++
 4 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/clock.c

diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 498534c..c4304ae 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -70,6 +70,8 @@ config MPC85xx_RDB
 config P1010_RDB
 	bool "Freescale P1010RDB"
 	select DEFAULT_UIMAGE
+	select HAVE_CAN_FLEXCAN if NET && CAN
+	select PPC_CLOCK if CAN_FLEXCAN
 	help
 	  This option enables support for the MPC85xx RDB (P1010 RDB) board
 
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index a971b32..cc7f381 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,6 +3,8 @@
 #
 obj-$(CONFIG_SMP) += smp.o
 
+obj-$(CONFIG_PPC_CLOCK)   += clock.o
+
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/clock.c b/arch/powerpc/platforms/85xx/clock.c
new file mode 100644
index 0000000..0b6db1d
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/clock.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2011 SGI, inc.
+ *
+ * This code is licensed for use under the GPL V2 as published by
+ * the Free Software Foundation.
+ */
+
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/of.h>
+
+#include <asm/clk_interface.h>
+
+#include <sysdev/fsl_soc.h>
+
+/*
+ * p1010 needs to provide a clock source for the flexcan driver. The
+ * oscillator for the p1010 processor is only ever the system clock / 2.
+ */
+
+static struct clk *mpc85xx_clk_get(struct device *dev, const char *id)
+{
+	if (!dev)
+		return ERR_PTR(-ENOENT);
+
+	if (!dev->of_node ||
+	    !of_device_is_compatible(dev->of_node, "fsl,flexcan"))
+		return ERR_PTR(-ENOENT);
+
+	return NULL;
+}
+
+static void mpc85xx_clk_put(struct clk *clk)
+{
+	return;
+}
+
+static unsigned long mpc85xx_clk_get_rate(struct clk *clk)
+{
+	return fsl_get_sys_freq() / 2;
+}
+
+static struct clk_interface mpc85xx_clk_functions = {
+	.clk_get = mpc85xx_clk_get,
+	.clk_get_rate = mpc85xx_clk_get_rate,
+	.clk_put = mpc85xx_clk_put,
+};
+
+void __init mpc85xx_clk_init(void)
+{
+	clk_functions = mpc85xx_clk_functions;
+}
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d7387fa..5e52122 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -81,6 +81,13 @@ static void __init p1010_rdb_setup_arch(void)
 	printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
 }
 
+extern void mpc85xx_clk_init(void);
+
+static void __init p1010_rdb_init(void)
+{
+	mpc85xx_clk_init();
+}
+
 static struct of_device_id __initdata p1010rdb_ids[] = {
 	{ .type = "soc", },
 	{ .compatible = "soc", },
@@ -111,6 +118,7 @@ define_machine(p1010_rdb) {
 	.name			= "P1010 RDB",
 	.probe			= p1010_rdb_probe,
 	.setup_arch		= p1010_rdb_setup_arch,
+	.init			= p1010_rdb_init,
 	.init_IRQ		= p1010_rdb_pic_init,
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
-- 
1.7.2.1

^ permalink raw reply related

* [PATCH v11 3/5] flexcan: Add of_match to platform_device definition.
From: Robin Holt @ 2011-08-10 16:27 UTC (permalink / raw)
  To: Robin Holt, Kumar Gala, Wolfgang Grandegger, U Bhaskar-B22300
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, U Bhaskar-B22300,
	Grant Likely, Marc Kleine-Budde, PPC list, Wolfgang Grandegger
In-Reply-To: <1312993670-23999-1-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>

On powerpc, the OpenFirmware devices are not matched without specifying
an of_match array.  Introduce that array as that is used for matching
on the Freescale P1010 processor.

Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Cc: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
---
 drivers/net/can/flexcan.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 68cbe52..662f832 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1027,8 +1027,19 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct of_device_id flexcan_of_match[] = {
+	{
+		.compatible = "fsl,flexcan",
+	},
+	{},
+};
+
 static struct platform_driver flexcan_driver = {
-	.driver.name = DRV_NAME,
+	.driver = {
+		.name = DRV_NAME,
+		.owner = THIS_MODULE,
+		.of_match_table = flexcan_of_match,
+	},
 	.probe = flexcan_probe,
 	.remove = __devexit_p(flexcan_remove),
 };
-- 
1.7.2.1

^ permalink raw reply related

* [PATCH v11 1/5] flexcan: Remove #include <mach/clock.h>
From: Robin Holt @ 2011-08-10 16:27 UTC (permalink / raw)
  To: Robin Holt, Kumar Gala, Wolfgang Grandegger, U Bhaskar-B22300
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	PPC list, Wolfgang Grandegger
In-Reply-To: <1312993670-23999-1-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>

powerpc does not have a mach-####/clock.h.  When testing, I found neither
arm nor powerpc needed the mach/clock.h at all so I removed it.

Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Cc: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
---
 drivers/net/can/flexcan.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 1767811..586b2cd 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -35,8 +35,6 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 
-#include <mach/clock.h>
-
 #define DRV_NAME			"flexcan"
 
 /* 8 for RX fifo and 2 error handling */
-- 
1.7.2.1

^ permalink raw reply related

* [PATCH v11 0/5] flexcan/powerpc: Add support for powerpc flexcan (freescale p1010)
From: Robin Holt @ 2011-08-10 16:27 UTC (permalink / raw)
  To: Robin Holt, Kumar Gala, Wolfgang Grandegger, U Bhaskar-B22300
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, PPC list, Marc Kleine-Budde

With all the patches applied, my p1010rdb works for communicating between
its two can ports and also can communicate with an external PSOC.  I have
done no testing beyond compile testing on an arm system as I have no
access to an arm based system.

For the first three patches in the series, I believe they are all ready
for forwarding to David S. Miller for the netdev tree.  I think patch
4 is ready for submission to the PPC85xx maintainer.  Patch 5 changed
from the previous post by adding a second compatible string for the
fsl,flexcan-p1010 and bringing back the Documentation file in a more
correct form.

Thanks,
Robin Holt

^ permalink raw reply

* Re: [PATCH 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Robin Holt @ 2011-08-10 16:16 UTC (permalink / raw)
  To: Kumar Gala
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	U Bhaskar-B22300, socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	Marc Kleine-Budde, Scott Wood, PPC list, Wolfgang Grandegger
In-Reply-To: <97251371-2772-42A5-A959-D9F7A8D0A65B-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>

On Wed, Aug 10, 2011 at 09:52:07AM -0500, Kumar Gala wrote:
> 
> On Aug 9, 2011, at 3:59 PM, Robin Holt wrote:
> 
> > I guess my poor wording may have gotten me in trouble.  I am getting
> > ready to repost this patch, but I want to ensure I am getting it as
> > right as possible.
> > 
> > I think I should reword the commit message to indicate we are removing
> > the Documentation/.../fsl-flexcan.txt file which has essentially become
> > empty and change the p1010si.dtsi file's can nodes to "fsl,p1010-flexcan",
> > "fsl,flexcan".  Is that correct?
> > 
> > Thanks,
> > Robin
> 
> This is wrong.  Again, what binding covers "fsl,flexcan" if you remove fsl-flexcan.txt:
> 
> [galak@right powerpc]$ git grep flexcan Documentation/devicetree/bindings
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:fsl,flexcan-v1.0 nodes
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:- fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:- fsl,flexcan-clock-divider : for the reference and system clock, an additional
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:      - v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC.
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              compatible = "fsl,flexcan-v1.0";
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              fsl,flexcan-clock-source = "platform";
> Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              fsl,flexcan-clock-divider = <2>;
> 
> Not seeing anything that covers it.
> 
> I think the issue should be resolved by patching fsl-flexcan.txt to remove wording or update it.

Done.

Robin

^ permalink raw reply

* [patch net-next-2.6 2/2] rtnetlink: remove initialization of dev->real_num_tx_queues
From: Jiri Pirko @ 2011-08-10 16:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, fubar, andy, tgraf, ebiederm
In-Reply-To: <1312992585-1201-1-git-send-email-jpirko@redhat.com>

dev->real_num_tx_queues is correctly set already in alloc_netdev_mqs.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 net/core/rtnetlink.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 99d9e95..39f8dd6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1604,7 +1604,6 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
 	dev_net_set(dev, net);
 	dev->rtnl_link_ops = ops;
 	dev->rtnl_link_state = RTNL_LINK_INITIALIZING;
-	dev->real_num_tx_queues = real_num_queues;
 
 	if (tb[IFLA_MTU])
 		dev->mtu = nla_get_u32(tb[IFLA_MTU]);
-- 
1.7.6


^ permalink raw reply related

* [patch net-next-2.6 0/2] bonding: create same number of queues on all creations
From: Jiri Pirko @ 2011-08-10 16:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, fubar, andy, tgraf, ebiederm

When bonding device is created via /sys/class/net/bonding_masters,
correct number of queues is created. But if bonding device is created via rtnl,
default single queue is created. This little patchset makes it behaves the same.

Jiri Pirko (2):
  bonding: implement get_tx_queues rtnk_link_op
  rtnetlink: remove initialization of dev->real_num_tx_queues

 drivers/net/bonding/bond_main.c |    9 +++++++++
 net/core/rtnetlink.c            |    1 -
 2 files changed, 9 insertions(+), 1 deletions(-)

-- 
1.7.6


^ permalink raw reply

* [patch net-next-2.6 1/2] bonding: implement get_tx_queues rtnk_link_op
From: Jiri Pirko @ 2011-08-10 16:09 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, fubar, andy, tgraf, ebiederm
In-Reply-To: <1312992585-1201-1-git-send-email-jpirko@redhat.com>

If vonding device is created via rtnl, it is created with default number
of rx/tx queues. This patch implements callback in bonding so the
correct value (previously specified by bonding module param) is used.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/bonding/bond_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 38a83ac..854aa8d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4828,11 +4828,20 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
 	return 0;
 }
 
+static int bond_get_tx_queues(struct net *net, struct nlattr *tb[],
+			      unsigned int *num_queues,
+			      unsigned int *real_num_queues)
+{
+	*num_queues = tx_queues;
+	return 0;
+}
+
 static struct rtnl_link_ops bond_link_ops __read_mostly = {
 	.kind		= "bond",
 	.priv_size	= sizeof(struct bonding),
 	.setup		= bond_setup,
 	.validate	= bond_validate,
+	.get_tx_queues	= bond_get_tx_queues,
 };
 
 /* Create a new bond based on the specified name and bonding parameters.
-- 
1.7.6


^ permalink raw reply related

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Robin Holt @ 2011-08-10 16:00 UTC (permalink / raw)
  To: U Bhaskar-B22300
  Cc: Wood Scott-B07421, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Kumar Gala,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
	Marc Kleine-Budde, PPC list, Wolfgang Grandegger
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1C6A21-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>

On Wed, Aug 10, 2011 at 02:36:20PM +0000, U Bhaskar-B22300 wrote:
> 
> 
> > -----Original Message-----
> > From: Robin Holt [mailto:holt-sJ/iWh9BUns@public.gmane.org]
> > Sent: Wednesday, August 10, 2011 7:46 PM
> > To: Wolfgang Grandegger
> > Cc: Robin Holt; Marc Kleine-Budde; U Bhaskar-B22300; Wood Scott-B07421;
> > netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Kumar Gala; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org; PPC
> > list
> > Subject: Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree
> > binding.
> > 
> > On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
> > > Hi Robin,
> > >
> > > On 08/10/2011 05:06 AM, Robin Holt wrote:
> > > > In working with the socketcan developers, we have come to the
> > > > conclusion the Documentation...fsl-flexcan.txt device tree
> > > > documentation needs to be cleaned up.  The driver does not depend
> > > > upon any properties other
> > >
> > > Your first sentence could be misleading. Please just describe what the
> > > patch does and why, something like:
> > >
> > > "This patch cleans up the documentation of the device-tree binding for
> > > the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
> > > properties are not needed as the frequency of the source clock is
> > > fixed..." and so on.
> > 
> > I borrowed heavily from your message. ;)
> > 
> > > > than the required properties so we are removing the file.
> > > > Additionally, the p1010*dts* files are not following the standard
> > > > for node naming in that they have a trailing -v1.0.
> > >
> > > > Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> > > > To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
> > > > To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
> > > > To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > > > To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > > > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> > > > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> > > > Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> > > > Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
> > > > ---
> > > >  .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 ----------
> > ----------
> > > >  arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
> > > >  arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
> > > >  3 files changed, 4 insertions(+), 73 deletions(-)  delete mode
> > > > 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > > b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > > deleted file mode 100644
> > > > index 1a729f0..0000000
> > > > --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > > +++ /dev/null
> > > > @@ -1,61 +0,0 @@
> > > > -CAN Device Tree Bindings
> > > > -------------------------
> > > > -2011 Freescale Semiconductor, Inc.
> > > > -
> > > > -fsl,flexcan-v1.0 nodes
> > > > ------------------------
> > > > -In addition to the required compatible-, reg- and
> > > > interrupt-properties, you can -also specify which clock source shall
> > be used for the controller.
> > > > -
> > > > -CPI Clock- Can Protocol Interface Clock
> > > > -	This CLK_SRC bit of CTRL(control register) selects the clock source
> > to
> > > > -	the CAN Protocol Interface(CPI) to be either the peripheral clock
> > > > -	(driven by the PLL) or the crystal oscillator clock. The selected
> > clock
> > > > -	is the one fed to the prescaler to generate the Serial Clock
> > (Sclock).
> > > > -	The PRESDIV field of CTRL(control register) controls a prescaler
> > that
> > > > -	generates the Serial Clock (Sclock), whose period defines the
> > > > -	time quantum used to compose the CAN waveform.
> > > > -
> > > > -Can Engine Clock Source
> > > > -	There are two sources for CAN clock
> > > > -	- Platform Clock  It represents the bus clock
> > > > -	- Oscillator Clock
> > > > -
> > > > -	Peripheral Clock (PLL)
> > > > -	--------------
> > > > -		     |
> > > > -		    ---------		      -------------
> > > > -		    |       |CPI Clock	      | Prescaler |       Sclock
> > > > -		    |       |---------------->| (1.. 256) |------------>
> > > > -		    ---------		      -------------
> > > > -                     |  |
> > > > -	--------------  ---------------------CLK_SRC
> > > > -	Oscillator Clock
> > > > -
> > > > -- fsl,flexcan-clock-source : CAN Engine Clock Source.This property
> > selects
> > > > -			     the peripheral clock. PLL clock is fed to the
> > > > -			     prescaler to generate the Serial Clock (Sclock).
> > > > -			     Valid values are "oscillator" and "platform"
> > > > -			     "oscillator": CAN engine clock source is
> > oscillator clock.
> > > > -			     "platform" The CAN engine clock source is the bus
> > clock
> > > > -		             (platform clock).
> > > > -
> > > > -- fsl,flexcan-clock-divider : for the reference and system clock, an
> > additional
> > > > -			      clock divider can be specified.
> > > > -- clock-frequency: frequency required to calculate the bitrate for
> > FlexCAN.
> > > > -
> > > > -Note:
> > > > -	- v1.0 of flexcan-v1.0 represent the IP block version for P1010
> > SOC.
> > > > -	- P1010 does not have oscillator as the Clock Source.So the default
> > > > -	  Clock Source is platform clock.
> > > > -Examples:
> > > > -
> > > > -	can0@1c000 {
> > > > -		compatible = "fsl,flexcan-v1.0";
> > > > -		reg = <0x1c000 0x1000>;
> > > > -		interrupts = <48 0x2>;
> > > > -		interrupt-parent = <&mpic>;
> > > > -		fsl,flexcan-clock-source = "platform";
> > > > -		fsl,flexcan-clock-divqider = <2>;
> > > > -		clock-frequency = <fixed by u-boot>;
> > > > -	};
> > >
> > > Do we really want to drop the documentation for that binding. I think
> > > something like the following text would be still useful:
> > >
> > > ------------------------
> > > Flexcan CAN contoller on Freescale's ARM and PowerPC processors
> > >
> > > Required properties:
> > >
> > > - compatible : Should be "fsl,flexcan" and optionally
> > >                "fsl,flexcan-<processor>"
> > > - reg : Offset and length of the register set for this device
> > > - interrupts : Interrupt tuple for this device
> > >
> > > Example:
> > >
> > >   can@1c000 {
> > >           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
> > >           reg = <0x1c000 0x1000>;
> > >           interrupts = <48 0x2>;
> > >           interrupt-parent = <&mpic>;
> > >   };
> > > -------------------------
> > 
> > Done, except the
> > >           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
> > 
> > line is
> > 	compatible = "fsl,flexcan", "fsl,flexcan-p1010";
> > 
> > >
> > > What do you think?
> > >
> > > > diff --git a/arch/powerpc/boot/dts/p1010rdb.dts
> > > > b/arch/powerpc/boot/dts/p1010rdb.dts
> > > > index 6b33b73..d6a0bb2 100644
> > > > --- a/arch/powerpc/boot/dts/p1010rdb.dts
> > > > +++ b/arch/powerpc/boot/dts/p1010rdb.dts
> > > > @@ -169,14 +169,6 @@
> > > >  			};
> > > >  		};
> > > >
> > > > -		can0@1c000 {
> > > > -			fsl,flexcan-clock-source = "platform";
> > > > -		};
> > > > -
> > > > -		can1@1d000 {
> > > > -			fsl,flexcan-clock-source = "platform";
> > > > -		};
> > > > -
> > > >  		usb@22000 {
> > > >  			phy_type = "utmi";
> > > >  		};
> > > > diff --git a/arch/powerpc/boot/dts/p1010si.dtsi
> > > > b/arch/powerpc/boot/dts/p1010si.dtsi
> > > > index 7f51104..20c396d 100644
> > > > --- a/arch/powerpc/boot/dts/p1010si.dtsi
> > > > +++ b/arch/powerpc/boot/dts/p1010si.dtsi
> > > > @@ -141,19 +141,19 @@
> > > >  		};
> > > >
> > > >  		can0@1c000 {
> > > > -			compatible = "fsl,flexcan-v1.0";
> > > > +			compatible = "fsl,p1010-flexcan",
> > > > +					"fsl,flexcan";
> > >
> > > Does fit on one line.
> > >
> > > >  			reg = <0x1c000 0x1000>;
> > > >  			interrupts = <48 0x2>;
> > > >  			interrupt-parent = <&mpic>;
> > > > -			fsl,flexcan-clock-divider = <2>;
> > > >  		};
> > > >
> > > >  		can1@1d000 {
> > > > -			compatible = "fsl,flexcan-v1.0";
> > > > +			compatible = "fsl,p1010-flexcan",
> > > > +					"fsl,flexcan";
> > >
> > > Ditto
> > >
> > > >  			reg = <0x1d000 0x1000>;
> > > >  			interrupts = <61 0x2>;
> > > >  			interrupt-parent = <&mpic>;
> > > > -			fsl,flexcan-clock-divider = <2>;
> > > >  		};
> > > >
> > > >  		L2: l2-cache-controller@20000 {
> > >
> > > Please also correct the node names (not using the number suffix).
> > 
> > So the node names should be
> > 		can@1c000 {
> > 		can@1d000 {
> > correct?
> > 
> [Bhaskar] As there are two CAN controllers on P1010,So won't it be better
> 	    to distinguish it by can0 and can1 instead by simple "can" ?

It looks like the way to do that is to assign a label to those devices
and then associate the label with an alias.  I have no idea how that
works under the hood, but it is the way other files are set up.  Take a
look at arch/powerpc/boot/dts/bamboo.dts for how they define the serial
interfaces.

Grant or Wolfgang, is that the right way to handle the concern about
names or does it have no practical effect with the Linux kernel?

Thanks,
Robin

^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Robin Holt @ 2011-08-10 15:35 UTC (permalink / raw)
  To: Kumar Gala
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Scott Wood, PPC list
In-Reply-To: <8ED8063F-7227-402A-89D5-7CE69241AF9C-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>

On Wed, Aug 10, 2011 at 09:45:17AM -0500, Kumar Gala wrote:
> 
> On Aug 10, 2011, at 9:15 AM, Robin Holt wrote:
> 
> > On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
> >> Hi Robin,
> >> 
> >> On 08/10/2011 05:06 AM, Robin Holt wrote:
> >>> In working with the socketcan developers, we have come to the conclusion
> >>> the Documentation...fsl-flexcan.txt device tree documentation needs to
> >>> be cleaned up.  The driver does not depend upon any properties other
> >> 
> >> Your first sentence could be misleading. Please just describe what the
> >> patch does and why, something like:
> >> 
> >> "This patch cleans up the documentation of the device-tree binding for
> >> the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
> >> properties are not needed as the frequency of the source clock is
> >> fixed..." and so on.
> > 
> > I borrowed heavily from your message. ;)
> > 
> >>> than the required properties so we are removing the file.  Additionally,
> >>> the p1010*dts* files are not following the standard for node naming in
> >>> that they have a trailing -v1.0.
> >> 
> >>> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> >>> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
> >>> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
> >>> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> >>> To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> >>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> >>> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> >>> Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> >>> Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
> >>> ---
> >>> .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 --------------------
> >>> arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
> >>> arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
> >>> 3 files changed, 4 insertions(+), 73 deletions(-)
> >>> delete mode 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> 
> I don't understand how we can do this?  What binding spec covers the P1010 CAN support if you remove this?

We have added it back in based upon an earlier comment from Wolfgang.
I will post a new version shortly.

Robin

^ permalink raw reply

* [PATCH] PCnet: Fix section mismatch
From: Ralf Baechle @ 2011-08-10 15:23 UTC (permalink / raw)
  To: David S. Miller, Don Fry, netdev; +Cc: Thomas Bogendoerfer, linux-mips

Building MIPS mtx1_defconfig results in:

  MODPOST 735 modules
WARNING: drivers/net/pcnet32.o(.devinit.text+0x11ec): Section mismatch in reference from the function pcnet32_probe_vlbus.constprop.22() to the variable .init.data:pcnet32_portlist
The function __devinit pcnet32_probe_vlbus.constprop.22() references
a variable __initdata pcnet32_portlist.
If pcnet32_portlist is only used by pcnet32_probe_vlbus.constprop.22 then
annotate pcnet32_portlist with a matching annotation.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
As recently discussed in the discussion of submission of a fix for a
similar bug in another driver remove __initdata rather than replace it
with __devinitdata.

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

diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 8b3090d..80b6f36 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -82,7 +82,7 @@ static int cards_found;
 /*
  * VLB I/O addresses
  */
-static unsigned int pcnet32_portlist[] __initdata =
+static unsigned int pcnet32_portlist[] =
     { 0x300, 0x320, 0x340, 0x360, 0 };
 
 static int pcnet32_debug;

^ permalink raw reply related

* [PATCH] slcan: ldisc generated skbs are received in softirq context
From: Oliver Hartkopp @ 2011-08-10 15:18 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, Matvejchikov Ilya, Alan Cox

As this discussion pointed out

http://marc.info/?l=linux-netdev&m=131257225602375

netdevices that are based on serial line disciplines should use netif_rx_ni()
when pushing received socketbuffers into the netdev rx queue.

Following commit 614851601c121b1320a35757ab88292d6272f906 ("slip: fix NOHZ
local_softirq_pending 08 warning") this patch updates the slcan driver
accordingly.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
CC: Matvejchikov Ilya <matvejchikov@gmail.com>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>

---

diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index f523f1c..4b70b7e 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -197,7 +197,7 @@ static void slc_bump(struct slcan *sl)
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 	memcpy(skb_put(skb, sizeof(struct can_frame)),
 	       &cf, sizeof(struct can_frame));
-	netif_rx(skb);
+	netif_rx_ni(skb);

 	sl->dev->stats.rx_packets++;
 	sl->dev->stats.rx_bytes += cf.can_dlc;


^ permalink raw reply related

* Re: GRO support in the bridge
From: Stephen Hemminger @ 2011-08-10 15:08 UTC (permalink / raw)
  To: Sedat Cakir; +Cc: netdev@vger.kernel.org
In-Reply-To: <1312979355.53304.YahooMailNeo@web110404.mail.gq1.yahoo.com>

On Wed, 10 Aug 2011 05:29:15 -0700 (PDT)
Sedat Cakir <cakir_sedat@yahoo.com> wrote:

> Hi, 
> 
> 
> 
> I am trying to understand why GRO is NOT enabled on the bridge. Is there a special reason for it? Reading the code in net/core/dev.c:2817 (__netif_receieve_skb) which is what I think the bridge is calling because that is what is passed in at br_input.c:br_pass_frame_up():24. I am wondering if this can be modified to use one of the _gro_ receive functions and if so if that will positively impact performance? Do you have any idea? 
> 
> Appreciate your help.Thanks,
> Sedat

The reason is that GRO is related to NAPI.
GRO works by coalescing frames received in one NAPI interval
of work.  The bridge itself has no receive irq or NAPI and is upcalled
from the device receive handler. There is no expectation or
requirement that devices in a bridge use NAPI. Therefore it
is not possible or safe for bridge pseudo-device to use GRO.

^ permalink raw reply

* Re: [PATCH v2] net: add Documentation/networking/scaling.txt
From: David Miller @ 2011-08-10 14:57 UTC (permalink / raw)
  To: willemb; +Cc: rdunlap, linux-doc, netdev, therbert
In-Reply-To: <1312899648.5889.14.camel@gopher.nyc.corp.google.com>

From: Willem de Bruijn <willemb@google.com>
Date: Tue, 09 Aug 2011 10:20:48 -0400

> Describes RSS, RPS, RFS, accelerated RFS, and XPS.
> 
> This version incorporates comments by Randy Dunlap and Rick Jones.
> Besides text cleanup, it adds an explicit "Suggested Configuration" 
> heading to each section.
> 
> Signed-off-by: Willem de Bruijn <willemb@google.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Kumar Gala @ 2011-08-10 14:52 UTC (permalink / raw)
  To: Robin Holt
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	U Bhaskar-B22300, socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	Marc Kleine-Budde, Scott Wood, PPC list, Wolfgang Grandegger
In-Reply-To: <20110809205900.GC4926-sJ/iWh9BUns@public.gmane.org>


On Aug 9, 2011, at 3:59 PM, Robin Holt wrote:

> I guess my poor wording may have gotten me in trouble.  I am getting
> ready to repost this patch, but I want to ensure I am getting it as
> right as possible.
> 
> I think I should reword the commit message to indicate we are removing
> the Documentation/.../fsl-flexcan.txt file which has essentially become
> empty and change the p1010si.dtsi file's can nodes to "fsl,p1010-flexcan",
> "fsl,flexcan".  Is that correct?
> 
> Thanks,
> Robin

This is wrong.  Again, what binding covers "fsl,flexcan" if you remove fsl-flexcan.txt:

[galak@right powerpc]$ git grep flexcan Documentation/devicetree/bindings
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:fsl,flexcan-v1.0 nodes
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:- fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:- fsl,flexcan-clock-divider : for the reference and system clock, an additional
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:      - v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC.
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              compatible = "fsl,flexcan-v1.0";
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              fsl,flexcan-clock-source = "platform";
Documentation/devicetree/bindings/net/can/fsl-flexcan.txt:              fsl,flexcan-clock-divider = <2>;

Not seeing anything that covers it.

I think the issue should be resolved by patching fsl-flexcan.txt to remove wording or update it.

- k

^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Kumar Gala @ 2011-08-10 14:46 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	Scott Wood, PPC list
In-Reply-To: <4E42987F.9040304-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>


On Aug 10, 2011, at 9:41 AM, Wolfgang Grandegger wrote:

> On 08/10/2011 04:15 PM, Robin Holt wrote:
>> On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
> ...
>> Done, except the
>>>          compatible = "fsl,p1010-flexcan", "fsl,flexcan";
>> 
>> line is
>> 	compatible = "fsl,flexcan", "fsl,flexcan-p1010";
> 
> IIRC, there order is more to less specific, e.g. for I2C:
> 
>  compatible = "fsl,mpc5200-i2c", "fsl-i2c"
> 
> ...
> 
>>> Please also correct the node names (not using the number suffix).
>> 
>> So the node names should be
>> 		can@1c000 {
>> 		can@1d000 {
>> correct?
> 
> Yes, just have a look how other node names are constructed, e.g. for
> sata, serial, rtc, etc.:
> 
>  $ grep serial@ *.dts
>  ...
>  pdm360ng.dts:		serial@11000 {
>  pdm360ng.dts:		serial@11100 {
>  pdm360ng.dts:		serial@11200 {
>  pdm360ng.dts:		serial@11300 {
>  pdm360ng.dts:		serial@11400 {
>  pdm360ng.dts:		serial@11600 {
>  pdm360ng.dts:		serial@11800 {
>  pdm360ng.dts:		serial@11B00 {
>  ...
> 
> Wolfgang.

Agree w/Wolfgang here, can@1c000, can@1d000 is what we should use.

- k

^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Kumar Gala @ 2011-08-10 14:45 UTC (permalink / raw)
  To: Robin Holt
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	Scott Wood, PPC list, Wolfgang Grandegger
In-Reply-To: <20110810141550.GQ4926-sJ/iWh9BUns@public.gmane.org>


On Aug 10, 2011, at 9:15 AM, Robin Holt wrote:

> On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
>> Hi Robin,
>> 
>> On 08/10/2011 05:06 AM, Robin Holt wrote:
>>> In working with the socketcan developers, we have come to the conclusion
>>> the Documentation...fsl-flexcan.txt device tree documentation needs to
>>> be cleaned up.  The driver does not depend upon any properties other
>> 
>> Your first sentence could be misleading. Please just describe what the
>> patch does and why, something like:
>> 
>> "This patch cleans up the documentation of the device-tree binding for
>> the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
>> properties are not needed as the frequency of the source clock is
>> fixed..." and so on.
> 
> I borrowed heavily from your message. ;)
> 
>>> than the required properties so we are removing the file.  Additionally,
>>> the p1010*dts* files are not following the standard for node naming in
>>> that they have a trailing -v1.0.
>> 
>>> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
>>> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
>>> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
>>> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>> To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
>>> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
>>> Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
>>> Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
>>> ---
>>> .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 --------------------
>>> arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
>>> arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
>>> 3 files changed, 4 insertions(+), 73 deletions(-)
>>> delete mode 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt

I don't understand how we can do this?  What binding spec covers the P1010 CAN support if you remove this?

- k

^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Wolfgang Grandegger @ 2011-08-10 14:41 UTC (permalink / raw)
  To: Robin Holt
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, Kumar Gala,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	Scott Wood, PPC list
In-Reply-To: <20110810141550.GQ4926-sJ/iWh9BUns@public.gmane.org>

On 08/10/2011 04:15 PM, Robin Holt wrote:
> On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
...
> Done, except the
>>           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
> 
> line is
> 	compatible = "fsl,flexcan", "fsl,flexcan-p1010";

IIRC, there order is more to less specific, e.g. for I2C:

  compatible = "fsl,mpc5200-i2c", "fsl-i2c"

...

>> Please also correct the node names (not using the number suffix).
> 
> So the node names should be
> 		can@1c000 {
> 		can@1d000 {
> correct?

Yes, just have a look how other node names are constructed, e.g. for
sata, serial, rtc, etc.:

  $ grep serial@ *.dts
  ...
  pdm360ng.dts:		serial@11000 {
  pdm360ng.dts:		serial@11100 {
  pdm360ng.dts:		serial@11200 {
  pdm360ng.dts:		serial@11300 {
  pdm360ng.dts:		serial@11400 {
  pdm360ng.dts:		serial@11600 {
  pdm360ng.dts:		serial@11800 {
  pdm360ng.dts:		serial@11B00 {
  ...

Wolfgang.

^ permalink raw reply

* RE: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: U Bhaskar-B22300 @ 2011-08-10 14:36 UTC (permalink / raw)
  To: Robin Holt, Wolfgang Grandegger
  Cc: Marc Kleine-Budde, Wood Scott-B07421, netdev@vger.kernel.org,
	Kumar Gala, socketcan-core@lists.berlios.de, PPC list
In-Reply-To: <20110810141550.GQ4926@sgi.com>



> -----Original Message-----
> From: Robin Holt [mailto:holt@sgi.com]
> Sent: Wednesday, August 10, 2011 7:46 PM
> To: Wolfgang Grandegger
> Cc: Robin Holt; Marc Kleine-Budde; U Bhaskar-B22300; Wood Scott-B07421;
> netdev@vger.kernel.org; Kumar Gala; socketcan-core@lists.berlios.de; PPC
> list
> Subject: Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree
> binding.
> 
> On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
> > Hi Robin,
> >
> > On 08/10/2011 05:06 AM, Robin Holt wrote:
> > > In working with the socketcan developers, we have come to the
> > > conclusion the Documentation...fsl-flexcan.txt device tree
> > > documentation needs to be cleaned up.  The driver does not depend
> > > upon any properties other
> >
> > Your first sentence could be misleading. Please just describe what the
> > patch does and why, something like:
> >
> > "This patch cleans up the documentation of the device-tree binding for
> > the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
> > properties are not needed as the frequency of the source clock is
> > fixed..." and so on.
> 
> I borrowed heavily from your message. ;)
> 
> > > than the required properties so we are removing the file.
> > > Additionally, the p1010*dts* files are not following the standard
> > > for node naming in that they have a trailing -v1.0.
> >
> > > Signed-off-by: Robin Holt <holt@sgi.com>
> > > To: Marc Kleine-Budde <mkl@pengutronix.de>,
> > > To: Wolfgang Grandegger <wg@grandegger.com>,
> > > To: U Bhaskar-B22300 <B22300@freescale.com>
> > > To: Scott Wood <scottwood@freescale.com>
> > > Cc: socketcan-core@lists.berlios.de,
> > > Cc: netdev@vger.kernel.org,
> > > Cc: PPC list <linuxppc-dev@lists.ozlabs.org>
> > > Cc: Kumar Gala <galak@kernel.crashing.org>
> > > ---
> > >  .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 ----------
> ----------
> > >  arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
> > >  arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
> > >  3 files changed, 4 insertions(+), 73 deletions(-)  delete mode
> > > 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > deleted file mode 100644
> > > index 1a729f0..0000000
> > > --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > > +++ /dev/null
> > > @@ -1,61 +0,0 @@
> > > -CAN Device Tree Bindings
> > > -------------------------
> > > -2011 Freescale Semiconductor, Inc.
> > > -
> > > -fsl,flexcan-v1.0 nodes
> > > ------------------------
> > > -In addition to the required compatible-, reg- and
> > > interrupt-properties, you can -also specify which clock source shall
> be used for the controller.
> > > -
> > > -CPI Clock- Can Protocol Interface Clock
> > > -	This CLK_SRC bit of CTRL(control register) selects the clock source
> to
> > > -	the CAN Protocol Interface(CPI) to be either the peripheral clock
> > > -	(driven by the PLL) or the crystal oscillator clock. The selected
> clock
> > > -	is the one fed to the prescaler to generate the Serial Clock
> (Sclock).
> > > -	The PRESDIV field of CTRL(control register) controls a prescaler
> that
> > > -	generates the Serial Clock (Sclock), whose period defines the
> > > -	time quantum used to compose the CAN waveform.
> > > -
> > > -Can Engine Clock Source
> > > -	There are two sources for CAN clock
> > > -	- Platform Clock  It represents the bus clock
> > > -	- Oscillator Clock
> > > -
> > > -	Peripheral Clock (PLL)
> > > -	--------------
> > > -		     |
> > > -		    ---------		      -------------
> > > -		    |       |CPI Clock	      | Prescaler |       Sclock
> > > -		    |       |---------------->| (1.. 256) |------------>
> > > -		    ---------		      -------------
> > > -                     |  |
> > > -	--------------  ---------------------CLK_SRC
> > > -	Oscillator Clock
> > > -
> > > -- fsl,flexcan-clock-source : CAN Engine Clock Source.This property
> selects
> > > -			     the peripheral clock. PLL clock is fed to the
> > > -			     prescaler to generate the Serial Clock (Sclock).
> > > -			     Valid values are "oscillator" and "platform"
> > > -			     "oscillator": CAN engine clock source is
> oscillator clock.
> > > -			     "platform" The CAN engine clock source is the bus
> clock
> > > -		             (platform clock).
> > > -
> > > -- fsl,flexcan-clock-divider : for the reference and system clock, an
> additional
> > > -			      clock divider can be specified.
> > > -- clock-frequency: frequency required to calculate the bitrate for
> FlexCAN.
> > > -
> > > -Note:
> > > -	- v1.0 of flexcan-v1.0 represent the IP block version for P1010
> SOC.
> > > -	- P1010 does not have oscillator as the Clock Source.So the default
> > > -	  Clock Source is platform clock.
> > > -Examples:
> > > -
> > > -	can0@1c000 {
> > > -		compatible = "fsl,flexcan-v1.0";
> > > -		reg = <0x1c000 0x1000>;
> > > -		interrupts = <48 0x2>;
> > > -		interrupt-parent = <&mpic>;
> > > -		fsl,flexcan-clock-source = "platform";
> > > -		fsl,flexcan-clock-divqider = <2>;
> > > -		clock-frequency = <fixed by u-boot>;
> > > -	};
> >
> > Do we really want to drop the documentation for that binding. I think
> > something like the following text would be still useful:
> >
> > ------------------------
> > Flexcan CAN contoller on Freescale's ARM and PowerPC processors
> >
> > Required properties:
> >
> > - compatible : Should be "fsl,flexcan" and optionally
> >                "fsl,flexcan-<processor>"
> > - reg : Offset and length of the register set for this device
> > - interrupts : Interrupt tuple for this device
> >
> > Example:
> >
> >   can@1c000 {
> >           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
> >           reg = <0x1c000 0x1000>;
> >           interrupts = <48 0x2>;
> >           interrupt-parent = <&mpic>;
> >   };
> > -------------------------
> 
> Done, except the
> >           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
> 
> line is
> 	compatible = "fsl,flexcan", "fsl,flexcan-p1010";
> 
> >
> > What do you think?
> >
> > > diff --git a/arch/powerpc/boot/dts/p1010rdb.dts
> > > b/arch/powerpc/boot/dts/p1010rdb.dts
> > > index 6b33b73..d6a0bb2 100644
> > > --- a/arch/powerpc/boot/dts/p1010rdb.dts
> > > +++ b/arch/powerpc/boot/dts/p1010rdb.dts
> > > @@ -169,14 +169,6 @@
> > >  			};
> > >  		};
> > >
> > > -		can0@1c000 {
> > > -			fsl,flexcan-clock-source = "platform";
> > > -		};
> > > -
> > > -		can1@1d000 {
> > > -			fsl,flexcan-clock-source = "platform";
> > > -		};
> > > -
> > >  		usb@22000 {
> > >  			phy_type = "utmi";
> > >  		};
> > > diff --git a/arch/powerpc/boot/dts/p1010si.dtsi
> > > b/arch/powerpc/boot/dts/p1010si.dtsi
> > > index 7f51104..20c396d 100644
> > > --- a/arch/powerpc/boot/dts/p1010si.dtsi
> > > +++ b/arch/powerpc/boot/dts/p1010si.dtsi
> > > @@ -141,19 +141,19 @@
> > >  		};
> > >
> > >  		can0@1c000 {
> > > -			compatible = "fsl,flexcan-v1.0";
> > > +			compatible = "fsl,p1010-flexcan",
> > > +					"fsl,flexcan";
> >
> > Does fit on one line.
> >
> > >  			reg = <0x1c000 0x1000>;
> > >  			interrupts = <48 0x2>;
> > >  			interrupt-parent = <&mpic>;
> > > -			fsl,flexcan-clock-divider = <2>;
> > >  		};
> > >
> > >  		can1@1d000 {
> > > -			compatible = "fsl,flexcan-v1.0";
> > > +			compatible = "fsl,p1010-flexcan",
> > > +					"fsl,flexcan";
> >
> > Ditto
> >
> > >  			reg = <0x1d000 0x1000>;
> > >  			interrupts = <61 0x2>;
> > >  			interrupt-parent = <&mpic>;
> > > -			fsl,flexcan-clock-divider = <2>;
> > >  		};
> > >
> > >  		L2: l2-cache-controller@20000 {
> >
> > Please also correct the node names (not using the number suffix).
> 
> So the node names should be
> 		can@1c000 {
> 		can@1d000 {
> correct?
> 
[Bhaskar] As there are two CAN controllers on P1010,So won't it be better
	    to distinguish it by can0 and can1 instead by simple "can" ?
> Robin



^ permalink raw reply

* Re: [PATCH] slip: fix NOHZ local_softirq_pending 08 warning
From: Oliver Hartkopp @ 2011-08-10 14:33 UTC (permalink / raw)
  To: Alan Cox, matvejchikov; +Cc: netdev
In-Reply-To: <20110810102824.4c4eaefe@lxorguk.ukuu.org.uk>

On 10.08.2011 11:28, Alan Cox wrote:
>>   2) From tty_flip_buffer_push() which schedules the flush_to_ldisc to
>> work or calls it directly if the tty->low_latency set.
>>
>> So the only thing we must take into account that with tty->low_latency
>> set we can be in IRQ context when doing with netif_rx_ni(). But if we
> 
> A driver is not permitted to directly call into flush_to_ldisc from an
> interrupt so that case doesn't happen.
> 

Thanks to both of you for the explanation!

I'll send a patch for slcan.c then.

Best regards,
Oliver

^ permalink raw reply

* Re: [PATCH v10 3/5] [flexcan] Add of_match to platform_device definition.
From: Robin Holt @ 2011-08-10 14:33 UTC (permalink / raw)
  To: Robin Holt, Wolfgang Grandegger
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, Marc Kleine-Budde, PPC list,
	U Bhaskar-B22300
In-Reply-To: <1312945564-6626-4-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>

On Tue, Aug 09, 2011 at 10:06:02PM -0500, Robin Holt wrote:
> On powerpc, the OpenFirmware devices are not matched without specifying
> an of_match array.  Introduce that array as that is used for matching
> on the Freescale P1010 processor.
> 
> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> ---
>  drivers/net/can/flexcan.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 68cbe52..662f832 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -1027,8 +1027,19 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static struct of_device_id flexcan_of_match[] = {
> +	{
> +		.compatible = "fsl,flexcan",

Let me make sure I have this correct.  At this point, we would want it
to be fsl,flexcan here.  If, at some point, we find the i.MX-wonderful
has diverged from the -p1010, we would, at that point in the code, use
of_device_is_compatible to differentiate the two, correct?  That would
mean we should make no change to this patch for the fsl,flexcan-p1010,
right?

Robin

^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Robin Holt @ 2011-08-10 14:15 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, Kumar Gala,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	Scott Wood, PPC list
In-Reply-To: <4E428BFF.7060402-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

On Wed, Aug 10, 2011 at 03:47:43PM +0200, Wolfgang Grandegger wrote:
> Hi Robin,
> 
> On 08/10/2011 05:06 AM, Robin Holt wrote:
> > In working with the socketcan developers, we have come to the conclusion
> > the Documentation...fsl-flexcan.txt device tree documentation needs to
> > be cleaned up.  The driver does not depend upon any properties other
> 
> Your first sentence could be misleading. Please just describe what the
> patch does and why, something like:
> 
> "This patch cleans up the documentation of the device-tree binding for
>  the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
>  properties are not needed as the frequency of the source clock is
>  fixed..." and so on.

I borrowed heavily from your message. ;)

> > than the required properties so we are removing the file.  Additionally,
> > the p1010*dts* files are not following the standard for node naming in
> > that they have a trailing -v1.0.
> 
> > Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> > To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
> > To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
> > To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> > Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> > Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
> > ---
> >  .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 --------------------
> >  arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
> >  arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
> >  3 files changed, 4 insertions(+), 73 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > deleted file mode 100644
> > index 1a729f0..0000000
> > --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > +++ /dev/null
> > @@ -1,61 +0,0 @@
> > -CAN Device Tree Bindings
> > -------------------------
> > -2011 Freescale Semiconductor, Inc.
> > -
> > -fsl,flexcan-v1.0 nodes
> > ------------------------
> > -In addition to the required compatible-, reg- and interrupt-properties, you can
> > -also specify which clock source shall be used for the controller.
> > -
> > -CPI Clock- Can Protocol Interface Clock
> > -	This CLK_SRC bit of CTRL(control register) selects the clock source to
> > -	the CAN Protocol Interface(CPI) to be either the peripheral clock
> > -	(driven by the PLL) or the crystal oscillator clock. The selected clock
> > -	is the one fed to the prescaler to generate the Serial Clock (Sclock).
> > -	The PRESDIV field of CTRL(control register) controls a prescaler that
> > -	generates the Serial Clock (Sclock), whose period defines the
> > -	time quantum used to compose the CAN waveform.
> > -
> > -Can Engine Clock Source
> > -	There are two sources for CAN clock
> > -	- Platform Clock  It represents the bus clock
> > -	- Oscillator Clock
> > -
> > -	Peripheral Clock (PLL)
> > -	--------------
> > -		     |
> > -		    ---------		      -------------
> > -		    |       |CPI Clock	      | Prescaler |       Sclock
> > -		    |       |---------------->| (1.. 256) |------------>
> > -		    ---------		      -------------
> > -                     |  |
> > -	--------------  ---------------------CLK_SRC
> > -	Oscillator Clock
> > -
> > -- fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects
> > -			     the peripheral clock. PLL clock is fed to the
> > -			     prescaler to generate the Serial Clock (Sclock).
> > -			     Valid values are "oscillator" and "platform"
> > -			     "oscillator": CAN engine clock source is oscillator clock.
> > -			     "platform" The CAN engine clock source is the bus clock
> > -		             (platform clock).
> > -
> > -- fsl,flexcan-clock-divider : for the reference and system clock, an additional
> > -			      clock divider can be specified.
> > -- clock-frequency: frequency required to calculate the bitrate for FlexCAN.
> > -
> > -Note:
> > -	- v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC.
> > -	- P1010 does not have oscillator as the Clock Source.So the default
> > -	  Clock Source is platform clock.
> > -Examples:
> > -
> > -	can0@1c000 {
> > -		compatible = "fsl,flexcan-v1.0";
> > -		reg = <0x1c000 0x1000>;
> > -		interrupts = <48 0x2>;
> > -		interrupt-parent = <&mpic>;
> > -		fsl,flexcan-clock-source = "platform";
> > -		fsl,flexcan-clock-divqider = <2>;
> > -		clock-frequency = <fixed by u-boot>;
> > -	};
> 
> Do we really want to drop the documentation for that binding. I think
> something like the following text would be still useful:
> 
> ------------------------
> Flexcan CAN contoller on Freescale's ARM and PowerPC processors
> 
> Required properties:
> 
> - compatible : Should be "fsl,flexcan" and optionally
>                "fsl,flexcan-<processor>"
> - reg : Offset and length of the register set for this device
> - interrupts : Interrupt tuple for this device
> 
> Example:
> 
>   can@1c000 {
>           compatible = "fsl,p1010-flexcan", "fsl,flexcan";
>           reg = <0x1c000 0x1000>;
>           interrupts = <48 0x2>;
>           interrupt-parent = <&mpic>;
>   };
> -------------------------

Done, except the
>           compatible = "fsl,p1010-flexcan", "fsl,flexcan";

line is
	compatible = "fsl,flexcan", "fsl,flexcan-p1010";

> 
> What do you think?
> 
> > diff --git a/arch/powerpc/boot/dts/p1010rdb.dts b/arch/powerpc/boot/dts/p1010rdb.dts
> > index 6b33b73..d6a0bb2 100644
> > --- a/arch/powerpc/boot/dts/p1010rdb.dts
> > +++ b/arch/powerpc/boot/dts/p1010rdb.dts
> > @@ -169,14 +169,6 @@
> >  			};
> >  		};
> >  
> > -		can0@1c000 {
> > -			fsl,flexcan-clock-source = "platform";
> > -		};
> > -
> > -		can1@1d000 {
> > -			fsl,flexcan-clock-source = "platform";
> > -		};
> > -
> >  		usb@22000 {
> >  			phy_type = "utmi";
> >  		};
> > diff --git a/arch/powerpc/boot/dts/p1010si.dtsi b/arch/powerpc/boot/dts/p1010si.dtsi
> > index 7f51104..20c396d 100644
> > --- a/arch/powerpc/boot/dts/p1010si.dtsi
> > +++ b/arch/powerpc/boot/dts/p1010si.dtsi
> > @@ -141,19 +141,19 @@
> >  		};
> >  
> >  		can0@1c000 {
> > -			compatible = "fsl,flexcan-v1.0";
> > +			compatible = "fsl,p1010-flexcan",
> > +					"fsl,flexcan";
> 
> Does fit on one line.
> 
> >  			reg = <0x1c000 0x1000>;
> >  			interrupts = <48 0x2>;
> >  			interrupt-parent = <&mpic>;
> > -			fsl,flexcan-clock-divider = <2>;
> >  		};
> >  
> >  		can1@1d000 {
> > -			compatible = "fsl,flexcan-v1.0";
> > +			compatible = "fsl,p1010-flexcan",
> > +					"fsl,flexcan";
> 
> Ditto
> 
> >  			reg = <0x1d000 0x1000>;
> >  			interrupts = <61 0x2>;
> >  			interrupt-parent = <&mpic>;
> > -			fsl,flexcan-clock-divider = <2>;
> >  		};
> >  
> >  		L2: l2-cache-controller@20000 {
> 
> Please also correct the node names (not using the number suffix).

So the node names should be
		can@1c000 {
		can@1d000 {
correct?

Robin

^ permalink raw reply

* Re: Use of 802.3ad bonding for increasing link throughput
From: Simon Farnsworth @ 2011-08-10 13:50 UTC (permalink / raw)
  To: netdev
In-Reply-To: <4E427499.8060108@cyconix.com>

Tom Brown wrote:

> [couldn't thread with '802.3ad bonding brain damaged', as I've just
> signed up]
> 
> So, under what circumstances would a user actually use 802.3ad mode to
> "increase" link throughput, rather than just for redundancy? Are there
> any circumstances in which a single file, for example, could be
> transferred at multiple-NIC speed? The 3 hashing options are:
> 
As an example, from my server room here; I have an install server (TFTP, FTP 
and HTTP) connected by a 2x1G LACP bond to the switch. When I have multiple 
clients installing simultaneously, the layer2 hash distributes the load 
nicely across both NICs - I can reach saturation on both NICs together.

If I had routers between my clients and the install server, I'd need 
layer2+3 hashing to spread the clients over the links, but I'd still be able 
to push over a gigabit per second to the clients, despite being limited to 
1GBit/s to each individual client by the packet distribution.

I'm sure that you can think of lots of other situations in which you have 
multiple conversations sharing a link - those are the situations that gain 
speed from 802.3ad.
-- 
Simon Farnsworth


^ permalink raw reply

* Re: [PATCH v10 5/5] [powerpc] Fix up fsl-flexcan device tree binding.
From: Wolfgang Grandegger @ 2011-08-10 13:47 UTC (permalink / raw)
  To: Robin Holt
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, Kumar Gala,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	Scott Wood, PPC list
In-Reply-To: <1312945564-6626-6-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>

Hi Robin,

On 08/10/2011 05:06 AM, Robin Holt wrote:
> In working with the socketcan developers, we have come to the conclusion
> the Documentation...fsl-flexcan.txt device tree documentation needs to
> be cleaned up.  The driver does not depend upon any properties other

Your first sentence could be misleading. Please just describe what the
patch does and why, something like:

"This patch cleans up the documentation of the device-tree binding for
 the Flexcan devices on Freescale's PowerPC and ARM cores. Extra
 properties are not needed as the frequency of the source clock is
 fixed..." and so on.

> than the required properties so we are removing the file.  Additionally,
> the p1010*dts* files are not following the standard for node naming in
> that they have a trailing -v1.0.

> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>,
> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> Cc: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
> ---
>  .../devicetree/bindings/net/can/fsl-flexcan.txt    |   61 --------------------
>  arch/powerpc/boot/dts/p1010rdb.dts                 |    8 ---
>  arch/powerpc/boot/dts/p1010si.dtsi                 |    8 +-
>  3 files changed, 4 insertions(+), 73 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> deleted file mode 100644
> index 1a729f0..0000000
> --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> +++ /dev/null
> @@ -1,61 +0,0 @@
> -CAN Device Tree Bindings
> -------------------------
> -2011 Freescale Semiconductor, Inc.
> -
> -fsl,flexcan-v1.0 nodes
> ------------------------
> -In addition to the required compatible-, reg- and interrupt-properties, you can
> -also specify which clock source shall be used for the controller.
> -
> -CPI Clock- Can Protocol Interface Clock
> -	This CLK_SRC bit of CTRL(control register) selects the clock source to
> -	the CAN Protocol Interface(CPI) to be either the peripheral clock
> -	(driven by the PLL) or the crystal oscillator clock. The selected clock
> -	is the one fed to the prescaler to generate the Serial Clock (Sclock).
> -	The PRESDIV field of CTRL(control register) controls a prescaler that
> -	generates the Serial Clock (Sclock), whose period defines the
> -	time quantum used to compose the CAN waveform.
> -
> -Can Engine Clock Source
> -	There are two sources for CAN clock
> -	- Platform Clock  It represents the bus clock
> -	- Oscillator Clock
> -
> -	Peripheral Clock (PLL)
> -	--------------
> -		     |
> -		    ---------		      -------------
> -		    |       |CPI Clock	      | Prescaler |       Sclock
> -		    |       |---------------->| (1.. 256) |------------>
> -		    ---------		      -------------
> -                     |  |
> -	--------------  ---------------------CLK_SRC
> -	Oscillator Clock
> -
> -- fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects
> -			     the peripheral clock. PLL clock is fed to the
> -			     prescaler to generate the Serial Clock (Sclock).
> -			     Valid values are "oscillator" and "platform"
> -			     "oscillator": CAN engine clock source is oscillator clock.
> -			     "platform" The CAN engine clock source is the bus clock
> -		             (platform clock).
> -
> -- fsl,flexcan-clock-divider : for the reference and system clock, an additional
> -			      clock divider can be specified.
> -- clock-frequency: frequency required to calculate the bitrate for FlexCAN.
> -
> -Note:
> -	- v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC.
> -	- P1010 does not have oscillator as the Clock Source.So the default
> -	  Clock Source is platform clock.
> -Examples:
> -
> -	can0@1c000 {
> -		compatible = "fsl,flexcan-v1.0";
> -		reg = <0x1c000 0x1000>;
> -		interrupts = <48 0x2>;
> -		interrupt-parent = <&mpic>;
> -		fsl,flexcan-clock-source = "platform";
> -		fsl,flexcan-clock-divqider = <2>;
> -		clock-frequency = <fixed by u-boot>;
> -	};

Do we really want to drop the documentation for that binding. I think
something like the following text would be still useful:

------------------------
Flexcan CAN contoller on Freescale's ARM and PowerPC processors

Required properties:

- compatible : Should be "fsl,flexcan" and optionally
               "fsl,flexcan-<processor>"
- reg : Offset and length of the register set for this device
- interrupts : Interrupt tuple for this device

Example:

  can@1c000 {
          compatible = "fsl,p1010-flexcan", "fsl,flexcan";
          reg = <0x1c000 0x1000>;
          interrupts = <48 0x2>;
          interrupt-parent = <&mpic>;
  };
-------------------------

What do you think?

> diff --git a/arch/powerpc/boot/dts/p1010rdb.dts b/arch/powerpc/boot/dts/p1010rdb.dts
> index 6b33b73..d6a0bb2 100644
> --- a/arch/powerpc/boot/dts/p1010rdb.dts
> +++ b/arch/powerpc/boot/dts/p1010rdb.dts
> @@ -169,14 +169,6 @@
>  			};
>  		};
>  
> -		can0@1c000 {
> -			fsl,flexcan-clock-source = "platform";
> -		};
> -
> -		can1@1d000 {
> -			fsl,flexcan-clock-source = "platform";
> -		};
> -
>  		usb@22000 {
>  			phy_type = "utmi";
>  		};
> diff --git a/arch/powerpc/boot/dts/p1010si.dtsi b/arch/powerpc/boot/dts/p1010si.dtsi
> index 7f51104..20c396d 100644
> --- a/arch/powerpc/boot/dts/p1010si.dtsi
> +++ b/arch/powerpc/boot/dts/p1010si.dtsi
> @@ -141,19 +141,19 @@
>  		};
>  
>  		can0@1c000 {
> -			compatible = "fsl,flexcan-v1.0";
> +			compatible = "fsl,p1010-flexcan",
> +					"fsl,flexcan";

Does fit on one line.

>  			reg = <0x1c000 0x1000>;
>  			interrupts = <48 0x2>;
>  			interrupt-parent = <&mpic>;
> -			fsl,flexcan-clock-divider = <2>;
>  		};
>  
>  		can1@1d000 {
> -			compatible = "fsl,flexcan-v1.0";
> +			compatible = "fsl,p1010-flexcan",
> +					"fsl,flexcan";

Ditto

>  			reg = <0x1d000 0x1000>;
>  			interrupts = <61 0x2>;
>  			interrupt-parent = <&mpic>;
> -			fsl,flexcan-clock-divider = <2>;
>  		};
>  
>  		L2: l2-cache-controller@20000 {

Please also correct the node names (not using the number suffix).

Wolfgang.

^ permalink raw reply

* Re: [PATCH v2] pch ieee1588 driver for Intel EG20T PCH
From: Joe Perches @ 2011-08-10 13:40 UTC (permalink / raw)
  To: Toshiharu Okada
  Cc: richard.cochran, netdev, linux-kernel, qi.wang, yong.y.wang,
	joel.clark, kok.howg.ewe, tomoya-linux
In-Reply-To: <1312956783-11460-1-git-send-email-toshiharu-linux@dsn.okisemi.com>

On Wed, 2011-08-10 at 15:13 +0900, Toshiharu Okada wrote:
> This patch is for IEEE1588 driver of Intel EG20T PCH.
> EG20T PCH is the platform controller hub that is used in Intel's
> general embedded platform.
> This driver adds support for using the EG20T PCH as a PTP clock.

> Would you review this patch, although this driver has not been tested yet?

Just trivia...

> diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
[]
> +/**
> + * struct ch_1588_params_ - 1588 module paramter

parameter

> + */
> +struct pch_params_ {
> +	u8 station[STATION_ADDR_LEN];
> +};
 
names for struct types ending in _ are pretty unusual.

[]

> +/**
> + * get_decimal() - Returns the decimal value of the passed hexadecimal value
> + * @ch:	The hexadecimal value that has to be converted.
> + */
> +static s32 get_decimal(u8 ch)
> +{
> +	s32 ret;
> +
> +	if ((ch >= '0') && (ch <= '9'))
> +		ret = ch - '0';
> +	else if ((ch >= 'A') && (ch <= 'F'))
> +		ret = 10 + ch - 'A';
> +	else if ((ch >= 'a') && (ch <= 'f'))
> +		ret = 10 + ch - 'a';
> +	else
> +		return -1;
> +
> +	return ret;
> +}

hex_to_bin

> +pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
[]
> +	if (ret != 0) {
> +		dev_err(&pdev->dev,
> +			"%s:could not enable the pci device\n", __func__);
> +		goto err_pci_en;
> +	}

It seems all of the dev_<level> logging messages include __func__.
I think these __func__ uses are not particularly valuable and could
be removed.

> +	/* retreive the available length of the IO memory space */

retrieve

> +	if (!request_mem_region(chip->mem_base, chip->mem_size, "1588_regs")) {
> +		dev_err(&pdev->dev, "%s: could not allocate register memory "
> +			"space\n", __func__);

Please don't split format strings.

		dev_err(&pdev->dev, "could not allocate register memory space\n");
or if you must
		dev_err(&pdev->dev, "%s: could not allocate register memory space\n",
			__func__);
[]
> +	if (strcmp(pch_param.station, "00:00:00:00:00:00") != 0) {
> +		if (pch_set_station_address(pch_param.station, pdev) != 0) {
> +			dev_err(&pdev->dev,
> +				"%s: Invalid station address parameter\n"
> +				"Module loaded; But, station address not set "
> +				"correctly\n", __func__);

			dev_err(&pdev->dev,
				"%s: Invalid station address parameter\n"
				"Module loaded but station address not set correctly\n",
				__func__);

^ 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