* Re: [PATCH] net_sched: prio: use qdisc_dequeue_peeked
From: Eric Dumazet @ 2011-08-09 12:56 UTC (permalink / raw)
To: Florian Westphal; +Cc: netdev
In-Reply-To: <1312891483-30034-1-git-send-email-fw@strlen.de>
Le mardi 09 août 2011 à 14:04 +0200, Florian Westphal a écrit :
> commit 07bd8df5df4369487812bf85a237322ff3569b77
> (sch_sfq: fix peek() implementation) changed sfq to use generic
> peek helper.
>
> This makes HFSC complain about a non-work-conserving child qdisc, if
> prio with sfq child is used within hfsc:
>
> hfsc peeks into prio qdisc, which will then peek into sfq.
> returned skb is stashed in sch->gso_skb.
>
> Next, hfsc tries to dequeue from prio, but prio will call sfq dequeue
> directly, which may return NULL instead of previously peeked-at skb.
>
> Have prio call qdisc_dequeue_peeked, so sfq->dequeue() is
> not called in this case.
>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> Eric, does this look correct to you?
> I am not sure if sfq needs fixing instead of this patch here.
>
> diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
> index 2a318f2..b5d56a2 100644
> --- a/net/sched/sch_prio.c
> +++ b/net/sched/sch_prio.c
> @@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)
>
> for (prio = 0; prio < q->bands; prio++) {
> struct Qdisc *qdisc = q->queues[prio];
> - struct sk_buff *skb = qdisc->dequeue(qdisc);
> + struct sk_buff *skb = qdisc_dequeue_peeked(qdisc);
> if (skb) {
> qdisc_bstats_update(sch, skb);
> sch->q.qlen--;
Hi Florian
Are you sure this patch is still needed, after commit
e1738bd9cecc5c867b0e2996470c1ff20f66ba79
(sch_sfq: fix sfq_enqueue())
I am asking before fully reviewing the code, I dont know who
should/shouldnt call qdisc_dequeue_peeked() instead of qdisc->dequeue()
Thanks !
^ permalink raw reply
* RE: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: U Bhaskar-B22300 @ 2011-08-09 12:54 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Wolfgang Grandegger
In-Reply-To: <4E412D26.9020608-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> -----Original Message-----
> From: Marc Kleine-Budde [mailto:mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org]
> Sent: Tuesday, August 09, 2011 6:21 PM
> To: U Bhaskar-B22300
> Cc: Wolfgang Grandegger; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
>
> Bhaskar,
>
> On 08/09/2011 02:41 PM, U Bhaskar-B22300 wrote:
> >> The frequency is fixed to CCB-frequency / 2. Will that ever change?
> >> What can we expect from future Flexcan hardware? Will it support
> >> further clock sources?
> > [Bhaskar] Yes the frequency will always be CCB-frequency/2.Even if the
> CCB gets changed that will be taken care by the u-boot fixup code for
> > clock-frequency. clock-frequency is not filled by somebody in the
> dts file. It will be done by u-boot.
> > For clock source,I can't say right now, that's why I have kept a
> property for this in the can node. So that in future, we need to fill it
> > appropriately
>
> are you actually following the discussion about Robin's patches? Robin
> has provided patch that work without the clock frequency in the DT at
> all..
[Bhaskar] Hi Marc,
Yes I am following the discussion on Robin's patch. Just going tru the patches. I will respond
>
> Marc
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Industrial Linux Solutions | Phone: +49-231-2826-924 |
> Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
^ permalink raw reply
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Marc Kleine-Budde @ 2011-08-09 12:50 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Wolfgang Grandegger
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1C3552-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1077 bytes --]
Bhaskar,
On 08/09/2011 02:41 PM, U Bhaskar-B22300 wrote:
>> The frequency is fixed to CCB-frequency / 2. Will that ever change? What
>> can we expect from future Flexcan hardware? Will it support further clock
>> sources?
> [Bhaskar] Yes the frequency will always be CCB-frequency/2.Even if the CCB gets changed that will be taken care by the u-boot fixup code for
> clock-frequency. clock-frequency is not filled by somebody in the dts file. It will be done by u-boot.
> For clock source,I can't say right now, that's why I have kept a property for this in the can node. So that in future, we need to fill it
> appropriately
are you actually following the discussion about Robin's patches? Robin
has provided patch that work without the clock frequency in the DT at all..
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Robin Holt @ 2011-08-09 12:49 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Marc Kleine-Budde, Wolfgang Grandegger
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1C3552-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
On Tue, Aug 09, 2011 at 12:41:39PM +0000, U Bhaskar-B22300 wrote:
>
>
> > -----Original Message-----
> > From: Wolfgang Grandegger [mailto:wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org]
> > Sent: Tuesday, August 09, 2011 4:19 PM
> > To: U Bhaskar-B22300
> > Cc: Marc Kleine-Budde; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
> > netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> > Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
> >
> > On 08/09/2011 11:27 AM, U Bhaskar-B22300 wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Wolfgang Grandegger [mailto:wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org]
> > >> Sent: Tuesday, August 09, 2011 2:03 PM
> > >> To: U Bhaskar-B22300
> > >> Cc: Marc Kleine-Budde; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
> > >> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> > >> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
> > >>
> > >> Hi Bhaskar,
> > >>
> > >> On 08/09/2011 09:57 AM, U Bhaskar-B22300 wrote:
> > >>>
> > >>>
> > >>>> -----Original Message-----
> > >>>> From: Marc Kleine-Budde [mailto:mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org]
> > >>>> Sent: Tuesday, August 09, 2011 12:23 AM
> > >>>> To: Wolfgang Grandegger
> > >>>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org; netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; U
> > >>>> Bhaskar- B22300
> > >>>> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
> > >>>>
> > >>>> On 08/08/2011 05:33 PM, Wolfgang Grandegger wrote:
> > >>>>>> ACK - The device tree bindings as in mainline's Documentation is
> > >>>>>> a
> > >>>> mess.
> > >>>>>> If the powerpc guys are happy with a clock interfaces based
> > >>>>>> approach somewhere in arch/ppc, I'm more than happy to remove:
> > >>>>>> - fsl,flexcan-clock-source (not implemented, even in the fsl
> > >>>>>> driver)
> > >>> [Bhaskar]I have pushed the FlexCAN series of patches, It contains
> > >>> the usage of all the fields posted in the FlexCAN bindings at
> > >>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-3.0.y.git;a=b
> > >>> lo
> > >>> b;f=Documentation/devicetree/bindings/net/can/fsl-flexcan.txt;h=1a72
> > >>> 9f
> > >>> 089866259ef82d0db5893ff7a8c54d5ccf;hb=94ed5b4788a7cdbe68bc7cb8516972
> > >>> cb
> > >>> ebdc8274
> > >>
> > >> As Marc already pointed out, Robin already has a much more advanced
> > >> patch stack in preparation. Especially your patches do not care about
> > >> the already existing Flexcan core on the Freescale's ARM socks.
> > > [Bhaskar] No, the patches are taking care of the existing ARM
> > functionality.
> > > I have not tested on the ARM based board, but the patches are made
> > in a
> > > Manner that it should not break the ARM based functionality.
> > >>
> > >>>>>>
> > >>>>>> - fsl,flexcan-clock-divider \__ replace with code in arch/ppc, or
> > >>>>>> - clock-frequency / a single clock-frequency attribute
> > >>>>>
> > >>>>> In the "net-next-2.6" tree there is also:
> > >>>>>
> > >>>>> $ grep flexcan arch/powerpc/boots/dts/*.dts
> > >>>>> p1010rdb.dts: fsl,flexcan-clock-source =
> > >> "platform";
> > >>>>> p1010rdb.dts: fsl,flexcan-clock-source =
> > >> "platform";
> > >>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
> > >>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
> > >>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
> > >>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
> > >>>>>
> > >>>>> Especially the fsl,flexcan-clock-divider = <2>; might make people
> > >>>>> think, that they could set something else.
> > >>>>
> > >>> [Bhaskar] As it is mentioned in the Flexcan bindings, the need of
> > >> fsl,flexcan-clock-divider = <2>;
> > >>> But I kept it as "2" because FlexCan clock source is the
> > >> platform clock and it is CCB/2
> > >>> If the "2" is misleading, the bindings can be changed or some
> > >> text can be written to make the meaning of "2"
> > >>> Understandable , Please suggest ..
> > >>
> > >> The clock source and frequency is fixed. Why do we need an extra
> > >> properties for that. We have panned to remove these bogus bindings
> > >> from the Linux kernel, which sneaked in *without* any review on the
> > >> relevant mailing lists (at least I have not realized any posting). We
> > >> do not think they are really needed. They just confuse the user. We
> > >> also prefer to use the compatibility string "fsl,flexcan" instead
> > >> "fsl,flexcan-v1.0". It's unusual to add a version number, which is
> > >> for the Flexcan on the PowerPC cores only, I assume, but there will
> > >> be device tree for ARM soon. A proper compatibility string would be
> > >> "fsl,p1010-flexcan" if we really need to distinguish.
> > >>
> > > [Bhaskar] About clock source.. There can be two sources of clock for
> > the CAN.
> > > Oscillator or the platform clock, but at present only platform
> > clock is supported
> > > in P1010.If we remove the fsl,flexcan-clock-source property, we
> > will lost the flexibility
> > > of changing the clock source ..
> > >
> > > About clock-frequency... it is also not fixed. It depends on
> > the platform clock which in turns
> > > Depends on the CCB clock. So it will be better to keep clock-
> > frequency property which is getting fixed via u-boot.
> >
> > The frequency is fixed to CCB-frequency / 2. Will that ever change? What
> > can we expect from future Flexcan hardware? Will it support further clock
> > sources?
> [Bhaskar] Yes the frequency will always be CCB-frequency/2.Even if the CCB gets changed that will be taken care by the u-boot fixup code for
> clock-frequency. clock-frequency is not filled by somebody in the dts file. It will be done by u-boot.
> For clock source,I can't say right now, that's why I have kept a property for this in the can node. So that in future, we need to fill it
> appropriately
Speaking of the dts file, I have left the p1010si.dtsi file with
the fsl,flexcan-v1.0 .compatible definition. The flexcan folks
(IIRC Wolfgang) objected to that as it does not follow the standard
which should be just fsl,flexcan.
How would you like to change that? Should I add it as part of this patch,
add another patch to the series, or let you take care of it?
Also, I assume the uboot project will need to be changed as well to
reflect the corrected name.
Thanks,
Robin
^ permalink raw reply
* Re: RSS mode performance in ixgbe (82599) driver
From: Eric Dumazet @ 2011-08-09 12:43 UTC (permalink / raw)
To: J.Hwan Kim; +Cc: linux-kernel, netdev
In-Reply-To: <4E41222B.8060003@gmail.com>
Le mardi 09 août 2011 à 21:03 +0900, J.Hwan Kim a écrit :
> Hi, everyone
>
> I'm testing the RSS mode throughput of Intel ixgbe 82599 driver.
> My server's specification is Xeon 3GHz (4cores) and PCIe speed is
> 2.5Gx8lanes,
> and DD2 memory is about 600~700MHz.
>
> When I enable the RSS(receive side scaling) mode with 4 Rx queues,
> the Rx performance is below than when I use a single queue.
>
> I don't know how the cores operate, whether the cores run in sequence
> or simultaneously at the same time.
>
> I want to know the mechanism in general how the multi-cores run
> and the reason why the performance of ixgbe driver in rss mode is below
> non-rss mode.
CC netdev, as these kind of stuff is better hosted on netdev
You should make sure your 4 rx queues are serviced by different cpus, or
else, one cpu could be the bottleneck.
cat /proc/interrupts
^ permalink raw reply
* RE: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: U Bhaskar-B22300 @ 2011-08-09 12:41 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Marc Kleine-Budde
In-Reply-To: <4E41108F.1090104-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> -----Original Message-----
> From: Wolfgang Grandegger [mailto:wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org]
> Sent: Tuesday, August 09, 2011 4:19 PM
> To: U Bhaskar-B22300
> Cc: Marc Kleine-Budde; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
>
> On 08/09/2011 11:27 AM, U Bhaskar-B22300 wrote:
> >
> >
> >> -----Original Message-----
> >> From: Wolfgang Grandegger [mailto:wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org]
> >> Sent: Tuesday, August 09, 2011 2:03 PM
> >> To: U Bhaskar-B22300
> >> Cc: Marc Kleine-Budde; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
> >> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> >> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
> >>
> >> Hi Bhaskar,
> >>
> >> On 08/09/2011 09:57 AM, U Bhaskar-B22300 wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Marc Kleine-Budde [mailto:mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org]
> >>>> Sent: Tuesday, August 09, 2011 12:23 AM
> >>>> To: Wolfgang Grandegger
> >>>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org; netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; U
> >>>> Bhaskar- B22300
> >>>> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
> >>>>
> >>>> On 08/08/2011 05:33 PM, Wolfgang Grandegger wrote:
> >>>>>> ACK - The device tree bindings as in mainline's Documentation is
> >>>>>> a
> >>>> mess.
> >>>>>> If the powerpc guys are happy with a clock interfaces based
> >>>>>> approach somewhere in arch/ppc, I'm more than happy to remove:
> >>>>>> - fsl,flexcan-clock-source (not implemented, even in the fsl
> >>>>>> driver)
> >>> [Bhaskar]I have pushed the FlexCAN series of patches, It contains
> >>> the usage of all the fields posted in the FlexCAN bindings at
> >>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-3.0.y.git;a=b
> >>> lo
> >>> b;f=Documentation/devicetree/bindings/net/can/fsl-flexcan.txt;h=1a72
> >>> 9f
> >>> 089866259ef82d0db5893ff7a8c54d5ccf;hb=94ed5b4788a7cdbe68bc7cb8516972
> >>> cb
> >>> ebdc8274
> >>
> >> As Marc already pointed out, Robin already has a much more advanced
> >> patch stack in preparation. Especially your patches do not care about
> >> the already existing Flexcan core on the Freescale's ARM socks.
> > [Bhaskar] No, the patches are taking care of the existing ARM
> functionality.
> > I have not tested on the ARM based board, but the patches are made
> in a
> > Manner that it should not break the ARM based functionality.
> >>
> >>>>>>
> >>>>>> - fsl,flexcan-clock-divider \__ replace with code in arch/ppc, or
> >>>>>> - clock-frequency / a single clock-frequency attribute
> >>>>>
> >>>>> In the "net-next-2.6" tree there is also:
> >>>>>
> >>>>> $ grep flexcan arch/powerpc/boots/dts/*.dts
> >>>>> p1010rdb.dts: fsl,flexcan-clock-source =
> >> "platform";
> >>>>> p1010rdb.dts: fsl,flexcan-clock-source =
> >> "platform";
> >>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
> >>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
> >>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
> >>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
> >>>>>
> >>>>> Especially the fsl,flexcan-clock-divider = <2>; might make people
> >>>>> think, that they could set something else.
> >>>>
> >>> [Bhaskar] As it is mentioned in the Flexcan bindings, the need of
> >> fsl,flexcan-clock-divider = <2>;
> >>> But I kept it as "2" because FlexCan clock source is the
> >> platform clock and it is CCB/2
> >>> If the "2" is misleading, the bindings can be changed or some
> >> text can be written to make the meaning of "2"
> >>> Understandable , Please suggest ..
> >>
> >> The clock source and frequency is fixed. Why do we need an extra
> >> properties for that. We have panned to remove these bogus bindings
> >> from the Linux kernel, which sneaked in *without* any review on the
> >> relevant mailing lists (at least I have not realized any posting). We
> >> do not think they are really needed. They just confuse the user. We
> >> also prefer to use the compatibility string "fsl,flexcan" instead
> >> "fsl,flexcan-v1.0". It's unusual to add a version number, which is
> >> for the Flexcan on the PowerPC cores only, I assume, but there will
> >> be device tree for ARM soon. A proper compatibility string would be
> >> "fsl,p1010-flexcan" if we really need to distinguish.
> >>
> > [Bhaskar] About clock source.. There can be two sources of clock for
> the CAN.
> > Oscillator or the platform clock, but at present only platform
> clock is supported
> > in P1010.If we remove the fsl,flexcan-clock-source property, we
> will lost the flexibility
> > of changing the clock source ..
> >
> > About clock-frequency... it is also not fixed. It depends on
> the platform clock which in turns
> > Depends on the CCB clock. So it will be better to keep clock-
> frequency property which is getting fixed via u-boot.
>
> The frequency is fixed to CCB-frequency / 2. Will that ever change? What
> can we expect from future Flexcan hardware? Will it support further clock
> sources?
[Bhaskar] Yes the frequency will always be CCB-frequency/2.Even if the CCB gets changed that will be taken care by the u-boot fixup code for
clock-frequency. clock-frequency is not filled by somebody in the dts file. It will be done by u-boot.
For clock source,I can't say right now, that's why I have kept a property for this in the can node. So that in future, we need to fill it
appropriately
>
> Wolfgang.
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Robin Holt @ 2011-08-09 12:40 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w, PPC list,
Wolfgang Grandegger
In-Reply-To: <4E41291B.3020001-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On Tue, Aug 09, 2011 at 02:33:31PM +0200, Marc Kleine-Budde wrote:
> On 08/09/2011 07:55 AM, Robin Holt wrote:
> > I added a clock source for the p1010rdb so the flexcan driver
> > could find its clock frequency.
> >
> > 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>
> > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> > Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
>
> After fixing Wolfgangs remarks add by Acked-by, for what it's worth in
> the ppc-world :)
Does that go for the other two patches in the series you have not
commented on in many revs as well?
Robin
^ permalink raw reply
* Re: [PATCH 12/12] headers, ppp: Add missing #include to <linux/if_ppp.h>
From: Ben Hutchings @ 2011-08-09 12:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, paulus, linux-ppp
In-Reply-To: <20110809.002738.679747111943821641.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]
On Tue, 2011-08-09 at 00:27 -0700, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Mon, 08 Aug 2011 14:25:19 +0100
>
> > <linux/if_ppp.h> uses various types defined in <linux/ppp_defs.h>.
> >
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>
> Unfortunately there is a "net/if_ppp.h" provided by glibc that
> includes "net/ppp_defs.h", and all of this is presumably in order
> to discourage direct use of the kernel headers.
>
> Even though net/ppp_defs.h ends up including linux/ppp_defs.h
> anyways.
>
> Whilst I think your efforts are to be commended, we can't start doing
> or else we'll start breaking the build in various unexpected ways.
>
> The SIOCDEVPRIVATE (defined by GLIBC in bits/ioctls.h) case is just
> one such example.
I did try to check for these cases, but obviously missed some. I'll
re-post the series without these ones.
In the longer term I would really like to solve this mess somehow.
glibc is obviously duplicating a lot of definitions in different headers
(but tends to lag behind a little) and other C libraries may also have
to duplicate that work for compatibility. Some kernel headers already
*do* include headers such as <linux/if.h> that can conflict with C
library headers, sometimes requiring userland to work around the
conflict somehow.
Ben.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Marc Kleine-Budde @ 2011-08-09 12:33 UTC (permalink / raw)
To: Robin Holt
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, PPC list,
Wolfgang Grandegger
In-Reply-To: <1312869313-22434-5-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 5934 bytes --]
On 08/09/2011 07:55 AM, Robin Holt wrote:
> I added a clock source for the p1010rdb so the flexcan driver
> could find its clock frequency.
>
> 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>
> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
After fixing Wolfgangs remarks add by Acked-by, for what it's worth in
the ppc-world :)
Some nitpicking from me :) - Darn you send another patch. This comments
still apply.
>
> ---
>
> Could I also get a ruling on the Kconfig language. I could do it either
> with the 85xx_HAVE_CAN_FLEXCAN in or out of the Kconfig file. It felt
> like the right thing to do was without, but the arm Kconfig files do
> it this way and a patch from freescale had something similar so I went
> this route.
>
> arch/powerpc/platforms/85xx/Kconfig | 6 +++
> arch/powerpc/platforms/85xx/Makefile | 1 +
> arch/powerpc/platforms/85xx/clock.c | 59 ++++++++++++++++++++++++++++++++
> arch/powerpc/platforms/85xx/p1010rdb.c | 8 ++++
> 4 files changed, 74 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..ed4cf92 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -26,6 +26,10 @@ config MPC8560_ADS
> help
> This option enables support for the MPC 8560 ADS board
>
> +config 85xx_HAVE_CAN_FLEXCAN
> + bool
> + select HAVE_CAN_FLEXCAN if NET && CAN
> +
> config MPC85xx_CDS
> bool "Freescale MPC85xx CDS"
> select DEFAULT_UIMAGE
> @@ -70,6 +74,8 @@ config MPC85xx_RDB
> config P1010_RDB
> bool "Freescale P1010RDB"
> select DEFAULT_UIMAGE
> + select 85xx_HAVE_CAN_FLEXCAN
> + 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..64ad7a4 100644
> --- a/arch/powerpc/platforms/85xx/Makefile
> +++ b/arch/powerpc/platforms/85xx/Makefile
> @@ -11,6 +11,7 @@ obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o
> obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
> obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
> obj-$(CONFIG_P1010_RDB) += p1010rdb.o
> +obj-$(CONFIG_PPC_CLOCK) += clock.o
> obj-$(CONFIG_P1022_DS) += p1022_ds.o
> obj-$(CONFIG_P1023_RDS) += p1023_rds.o
> obj-$(CONFIG_P2040_RDB) += p2040_rdb.o corenet_ds.o
> diff --git a/arch/powerpc/platforms/85xx/clock.c b/arch/powerpc/platforms/85xx/clock.c
> new file mode 100644
> index 0000000..a25cbf3
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/clock.c
> @@ -0,0 +1,59 @@
Please add your copyright notice and add a license, e.g. "This file is
released under GPLv2"
> +
> +#include <linux/device.h>
> +#include <linux/err.h>
> +
> +#include <asm/clk_interface.h>
> +
> +#include <sysdev/fsl_soc.h>
> +
> +/*
> + * p1010rdb needs to provide a clock source for the flexcan driver.
> + */
> +struct clk {
> + unsigned long rate;
> +} p1010_rdb_system_clock;
> +
> +static struct clk *p1010_rdb_clk_get(struct device *dev, const char *id)
> +{
> + const char *dev_init_name;
> +
> + if (!dev)
> + return ERR_PTR(-ENOENT);
> +
> + /*
> + * The can devices are named ffe1c000.can0 and ffe1d000.can1 on
> + * the p1010rdb. Check for the "can" portion of that name before
> + * returning a clock source.
> + */
> + dev_init_name = dev_name(dev);
> + if (strlen(dev_init_name) != 13)
> + return ERR_PTR(-ENOENT);
> + dev_init_name += 9;
> + if (strncmp(dev_init_name, "can", 3))
> + return ERR_PTR(-ENOENT);
> +
> + return &p1010_rdb_system_clock;
> +}
> +
> +static void p1010_rdb_clk_put(struct clk *clk)
> +{
> + return;
> +}
> +
> +static unsigned long p1010_rdb_clk_get_rate(struct clk *clk)
> +{
> + return clk->rate;
> +}
> +
> +static struct clk_interface p1010_rdb_clk_functions = {
> + .clk_get = p1010_rdb_clk_get,
> + .clk_get_rate = p1010_rdb_clk_get_rate,
> + .clk_put = p1010_rdb_clk_put,
no indention here please, just one space before the "=". YMMV
> +};
> +
> +void __init p1010_rdb_clk_init(void)
> +{
> + p1010_rdb_system_clock.rate = fsl_get_sys_freq();
> + clk_functions = p1010_rdb_clk_functions;
> +}
> +
> diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
> index d7387fa..29e04d6 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");
> }
>
> +static void __init p1010_rdb_init(void)
> +{
> +#ifdef PPC_CLOCK
> + p1010_rdb_clk_init();
> +#endif
> +}
> +
> 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,
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* [PATCH 2/4] [flexcan] Abstract off read/write for big/little endian.
From: Robin Holt @ 2011-08-09 12:28 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: Robin Holt, Marc Kleine-Budde, socketcan-core, netdev, PPC list
In-Reply-To: <1312892907-20419-1-git-send-email-holt@sgi.com>
Make flexcan driver handle register reads in the appropriate endianess.
This was a basic search and replace and then define some inlines.
Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
To: Wolfgang Grandegger <wg@grandegger.com>
To: U Bhaskar-B22300 <B22300@freescale.com>
Cc: socketcan-core@lists.berlios.de
Cc: netdev@vger.kernel.org
Cc: PPC list <linuxppc-dev@lists.ozlabs.org>
---
drivers/net/can/flexcan.c | 140 ++++++++++++++++++++++++++------------------
1 files changed, 83 insertions(+), 57 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 586b2cd..68cbe52 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -190,6 +190,31 @@ static struct can_bittiming_const flexcan_bittiming_const = {
};
/*
+ * Abstract off the read/write for arm versus ppc.
+ */
+#if defined(__BIG_ENDIAN)
+static inline u32 flexcan_read(void __iomem *addr)
+{
+ return in_be32(addr);
+}
+
+static inline void flexcan_write(u32 val, void __iomem *addr)
+{
+ out_be32(addr, val);
+}
+#else
+static inline u32 flexcan_read(void __iomem *addr)
+{
+ return readl(addr);
+}
+
+static inline void flexcan_write(u32 val, void __iomem *addr)
+{
+ writel(val, addr);
+}
+#endif
+
+/*
* Swtich transceiver on or off
*/
static void flexcan_transceiver_switch(const struct flexcan_priv *priv, int on)
@@ -210,9 +235,9 @@ static inline void flexcan_chip_enable(struct flexcan_priv *priv)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg &= ~FLEXCAN_MCR_MDIS;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
udelay(10);
}
@@ -222,9 +247,9 @@ static inline void flexcan_chip_disable(struct flexcan_priv *priv)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_MDIS;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
}
static int flexcan_get_berr_counter(const struct net_device *dev,
@@ -232,7 +257,7 @@ static int flexcan_get_berr_counter(const struct net_device *dev,
{
const struct flexcan_priv *priv = netdev_priv(dev);
struct flexcan_regs __iomem *regs = priv->base;
- u32 reg = readl(®s->ecr);
+ u32 reg = flexcan_read(®s->ecr);
bec->txerr = (reg >> 0) & 0xff;
bec->rxerr = (reg >> 8) & 0xff;
@@ -266,15 +291,15 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (cf->can_dlc > 0) {
u32 data = be32_to_cpup((__be32 *)&cf->data[0]);
- writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
+ flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
}
if (cf->can_dlc > 3) {
u32 data = be32_to_cpup((__be32 *)&cf->data[4]);
- writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
+ flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
}
- writel(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
- writel(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
+ flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
+ flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
kfree_skb(skb);
@@ -462,8 +487,8 @@ static void flexcan_read_fifo(const struct net_device *dev,
struct flexcan_mb __iomem *mb = ®s->cantxfg[0];
u32 reg_ctrl, reg_id;
- reg_ctrl = readl(&mb->can_ctrl);
- reg_id = readl(&mb->can_id);
+ reg_ctrl = flexcan_read(&mb->can_ctrl);
+ reg_id = flexcan_read(&mb->can_id);
if (reg_ctrl & FLEXCAN_MB_CNT_IDE)
cf->can_id = ((reg_id >> 0) & CAN_EFF_MASK) | CAN_EFF_FLAG;
else
@@ -473,12 +498,12 @@ static void flexcan_read_fifo(const struct net_device *dev,
cf->can_id |= CAN_RTR_FLAG;
cf->can_dlc = get_can_dlc((reg_ctrl >> 16) & 0xf);
- *(__be32 *)(cf->data + 0) = cpu_to_be32(readl(&mb->data[0]));
- *(__be32 *)(cf->data + 4) = cpu_to_be32(readl(&mb->data[1]));
+ *(__be32 *)(cf->data + 0) = cpu_to_be32(flexcan_read(&mb->data[0]));
+ *(__be32 *)(cf->data + 4) = cpu_to_be32(flexcan_read(&mb->data[1]));
/* mark as read */
- writel(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
- readl(®s->timer);
+ flexcan_write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
+ flexcan_read(®s->timer);
}
static int flexcan_read_frame(struct net_device *dev)
@@ -514,17 +539,17 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
* The error bits are cleared on read,
* use saved value from irq handler.
*/
- reg_esr = readl(®s->esr) | priv->reg_esr;
+ reg_esr = flexcan_read(®s->esr) | priv->reg_esr;
/* handle state changes */
work_done += flexcan_poll_state(dev, reg_esr);
/* handle RX-FIFO */
- reg_iflag1 = readl(®s->iflag1);
+ reg_iflag1 = flexcan_read(®s->iflag1);
while (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE &&
work_done < quota) {
work_done += flexcan_read_frame(dev);
- reg_iflag1 = readl(®s->iflag1);
+ reg_iflag1 = flexcan_read(®s->iflag1);
}
/* report bus errors */
@@ -534,8 +559,8 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
if (work_done < quota) {
napi_complete(napi);
/* enable IRQs */
- writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
- writel(priv->reg_ctrl_default, ®s->ctrl);
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
+ flexcan_write(priv->reg_ctrl_default, ®s->ctrl);
}
return work_done;
@@ -549,9 +574,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg_iflag1, reg_esr;
- reg_iflag1 = readl(®s->iflag1);
- reg_esr = readl(®s->esr);
- writel(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */
+ reg_iflag1 = flexcan_read(®s->iflag1);
+ reg_esr = flexcan_read(®s->esr);
+ flexcan_write(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */
/*
* schedule NAPI in case of:
@@ -567,16 +592,16 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
* save them for later use.
*/
priv->reg_esr = reg_esr & FLEXCAN_ESR_ERR_BUS;
- writel(FLEXCAN_IFLAG_DEFAULT & ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE,
- ®s->imask1);
- writel(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT &
+ ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->imask1);
+ flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
®s->ctrl);
napi_schedule(&priv->napi);
}
/* FIFO overflow */
if (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_OVERFLOW) {
- writel(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW, ®s->iflag1);
+ flexcan_write(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW, ®s->iflag1);
dev->stats.rx_over_errors++;
dev->stats.rx_errors++;
}
@@ -585,7 +610,7 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
if (reg_iflag1 & (1 << FLEXCAN_TX_BUF_ID)) {
/* tx_bytes is incremented in flexcan_start_xmit */
stats->tx_packets++;
- writel((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
+ flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
netif_wake_queue(dev);
}
@@ -599,7 +624,7 @@ static void flexcan_set_bittiming(struct net_device *dev)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->ctrl);
+ reg = flexcan_read(®s->ctrl);
reg &= ~(FLEXCAN_CTRL_PRESDIV(0xff) |
FLEXCAN_CTRL_RJW(0x3) |
FLEXCAN_CTRL_PSEG1(0x7) |
@@ -623,11 +648,11 @@ static void flexcan_set_bittiming(struct net_device *dev)
reg |= FLEXCAN_CTRL_SMP;
dev_info(dev->dev.parent, "writing ctrl=0x%08x\n", reg);
- writel(reg, ®s->ctrl);
+ flexcan_write(reg, ®s->ctrl);
/* print chip status */
dev_dbg(dev->dev.parent, "%s: mcr=0x%08x ctrl=0x%08x\n", __func__,
- readl(®s->mcr), readl(®s->ctrl));
+ flexcan_read(®s->mcr), flexcan_read(®s->ctrl));
}
/*
@@ -648,10 +673,10 @@ static int flexcan_chip_start(struct net_device *dev)
flexcan_chip_enable(priv);
/* soft reset */
- writel(FLEXCAN_MCR_SOFTRST, ®s->mcr);
+ flexcan_write(FLEXCAN_MCR_SOFTRST, ®s->mcr);
udelay(10);
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
if (reg_mcr & FLEXCAN_MCR_SOFTRST) {
dev_err(dev->dev.parent,
"Failed to softreset can module (mcr=0x%08x)\n",
@@ -673,12 +698,12 @@ static int flexcan_chip_start(struct net_device *dev)
* choose format C
*
*/
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
FLEXCAN_MCR_IDAM_C;
dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__, reg_mcr);
- writel(reg_mcr, ®s->mcr);
+ flexcan_write(reg_mcr, ®s->mcr);
/*
* CTRL
@@ -696,7 +721,7 @@ static int flexcan_chip_start(struct net_device *dev)
* (FLEXCAN_CTRL_ERR_MSK), too. Otherwise we don't get any
* warning or bus passive interrupts.
*/
- reg_ctrl = readl(®s->ctrl);
+ reg_ctrl = flexcan_read(®s->ctrl);
reg_ctrl &= ~FLEXCAN_CTRL_TSYN;
reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF |
FLEXCAN_CTRL_ERR_STATE | FLEXCAN_CTRL_ERR_MSK;
@@ -704,38 +729,39 @@ static int flexcan_chip_start(struct net_device *dev)
/* save for later use */
priv->reg_ctrl_default = reg_ctrl;
dev_dbg(dev->dev.parent, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
- writel(reg_ctrl, ®s->ctrl);
+ flexcan_write(reg_ctrl, ®s->ctrl);
for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) {
- writel(0, ®s->cantxfg[i].can_ctrl);
- writel(0, ®s->cantxfg[i].can_id);
- writel(0, ®s->cantxfg[i].data[0]);
- writel(0, ®s->cantxfg[i].data[1]);
+ flexcan_write(0, ®s->cantxfg[i].can_ctrl);
+ flexcan_write(0, ®s->cantxfg[i].can_id);
+ flexcan_write(0, ®s->cantxfg[i].data[0]);
+ flexcan_write(0, ®s->cantxfg[i].data[1]);
/* put MB into rx queue */
- writel(FLEXCAN_MB_CNT_CODE(0x4), ®s->cantxfg[i].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
+ ®s->cantxfg[i].can_ctrl);
}
/* acceptance mask/acceptance code (accept everything) */
- writel(0x0, ®s->rxgmask);
- writel(0x0, ®s->rx14mask);
- writel(0x0, ®s->rx15mask);
+ flexcan_write(0x0, ®s->rxgmask);
+ flexcan_write(0x0, ®s->rx14mask);
+ flexcan_write(0x0, ®s->rx15mask);
flexcan_transceiver_switch(priv, 1);
/* synchronize with the can bus */
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
reg_mcr &= ~FLEXCAN_MCR_HALT;
- writel(reg_mcr, ®s->mcr);
+ flexcan_write(reg_mcr, ®s->mcr);
priv->can.state = CAN_STATE_ERROR_ACTIVE;
/* enable FIFO interrupts */
- writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
/* print chip status */
dev_dbg(dev->dev.parent, "%s: reading mcr=0x%08x ctrl=0x%08x\n",
- __func__, readl(®s->mcr), readl(®s->ctrl));
+ __func__, flexcan_read(®s->mcr), flexcan_read(®s->ctrl));
return 0;
@@ -757,12 +783,12 @@ static void flexcan_chip_stop(struct net_device *dev)
u32 reg;
/* Disable all interrupts */
- writel(0, ®s->imask1);
+ flexcan_write(0, ®s->imask1);
/* Disable + halt module */
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
flexcan_transceiver_switch(priv, 0);
priv->can.state = CAN_STATE_STOPPED;
@@ -854,24 +880,24 @@ static int __devinit register_flexcandev(struct net_device *dev)
/* select "bus clock", chip must be disabled */
flexcan_chip_disable(priv);
- reg = readl(®s->ctrl);
+ reg = flexcan_read(®s->ctrl);
reg |= FLEXCAN_CTRL_CLK_SRC;
- writel(reg, ®s->ctrl);
+ flexcan_write(reg, ®s->ctrl);
flexcan_chip_enable(priv);
/* set freeze, halt and activate FIFO, restrict register access */
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT |
FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
/*
* Currently we only support newer versions of this core
* featuring a RX FIFO. Older cores found on some Coldfire
* derivates are not yet supported.
*/
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
if (!(reg & FLEXCAN_MCR_FEN)) {
dev_err(dev->dev.parent,
"Could not enable RX FIFO, unsupported core\n");
--
1.7.2.1
^ permalink raw reply related
* [PATCH 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Robin Holt @ 2011-08-09 12:28 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, , PPC list,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1312892907-20419-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 can device only has an
oscillator of system bus frequency divided by 2.
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>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
---
arch/powerpc/platforms/85xx/Kconfig | 2 +
arch/powerpc/platforms/85xx/Makefile | 2 +
arch/powerpc/platforms/85xx/clock.c | 42 ++++++++++++++++++++++++++++++++
arch/powerpc/platforms/85xx/p1010rdb.c | 8 ++++++
4 files changed, 54 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..a6fd2c8
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/clock.c
@@ -0,0 +1,42 @@
+
+#include <linux/device.h>
+#include <linux/err.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);
+
+ 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 3/4] [flexcan] Add of_match to platform_device definition.
From: Robin Holt @ 2011-08-09 12:28 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, PPC list
In-Reply-To: <1312892907-20419-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>
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>
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",
+ },
+ {},
+};
+
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 1/4] [flexcan] Remove #include <mach/clock.h>
From: Robin Holt @ 2011-08-09 12:28 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, PPC list
In-Reply-To: <1312892907-20419-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>
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>
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 0/4] [flexcan/powerpc] Add support for powerpc flexcan (freescale p1010) -V8
From: Robin Holt @ 2011-08-09 12:28 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, PPC list
Marc, Wolfgang or U Bhaskar,
This patch set should have all your comments included. It is based on
the David S. Miller net-next-2.6 tree commit 19fd617.
I have compiled each patch in the series individually for both arm and
powerpc (cheated on ppc and reordered them with the last patch first so
I could select CAN_FLEXCAN.
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 submission to David S. Miller for the netdev tree. This is the
first submission of patch 4 which, I believe, will end up going through
the linuxppc-dev list and can go at any time after the flexcan patches
are submitted. As long the first and last patches are both applied,
the tree will compile for either ppc or arm, but will not work without
all patches. If the ppc patch (4/4) gets applied before 1/4, we could
have a random config tester detect a compile failure on ppc if they
select NET, CAN, and CAN_FLEXCAN.
Thanks,
Robin Holt
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Robin Holt @ 2011-08-09 12:04 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
PPC list
In-Reply-To: <4E40DDA5.1050004-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
On Tue, Aug 09, 2011 at 09:11:33AM +0200, Wolfgang Grandegger wrote:
> On 08/09/2011 08:33 AM, Robin Holt wrote:
> > Argh. I sent an earlier (non-working) version of this patch. Here is
> > the correct one.
>
> Please always resend the complete series of patches with an incremented
> version number. Furthermore, this is not an RFC any more. A prefix
> similar to [PATCH nfsl_get_sys_freq() et-next-2.6 v2] would be perfect.
>
> > I added a clock source for the p1010rdb so the flexcan driver
> > could find its clock frequency.
> >
> > 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>
> > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
> > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> > Cc: PPC list <linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
> > ---
> > arch/powerpc/platforms/85xx/Kconfig | 6 +++
> > arch/powerpc/platforms/85xx/Makefile | 1 +
> > arch/powerpc/platforms/85xx/clock.c | 59 ++++++++++++++++++++++++++++++++
> > arch/powerpc/platforms/85xx/p1010rdb.c | 10 +++++
> > 4 files changed, 76 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..ed4cf92 100644
> > --- a/arch/powerpc/platforms/85xx/Kconfig
> > +++ b/arch/powerpc/platforms/85xx/Kconfig
> > @@ -26,6 +26,10 @@ config MPC8560_ADS
> > help
> > This option enables support for the MPC 8560 ADS board
> >
> > +config 85xx_HAVE_CAN_FLEXCAN
> > + bool
> > + select HAVE_CAN_FLEXCAN if NET && CAN
> > +
>
> Why do you need that? More below...
Happily removed.
> > config MPC85xx_CDS
> > bool "Freescale MPC85xx CDS"
> > select DEFAULT_UIMAGE
> > @@ -70,6 +74,8 @@ config MPC85xx_RDB
> > config P1010_RDB
> > bool "Freescale P1010RDB"
> > select DEFAULT_UIMAGE
> > + select 85xx_HAVE_CAN_FLEXCAN
> > + select PPC_CLOCK if CAN_FLEXCAN
>
> select HAVE_CAN_FLEXCAN
> select PPC_CLOCK
>
> Should just be fine, or have I missed something.
If I don't have the if NET && CAN, then 'make savedefconfig' will
complain. Otherwise, removed 85xx_HAVE_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..64ad7a4 100644
> > --- a/arch/powerpc/platforms/85xx/Makefile
> > +++ b/arch/powerpc/platforms/85xx/Makefile
> > @@ -11,6 +11,7 @@ obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o
> > obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
> > obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
> > obj-$(CONFIG_P1010_RDB) += p1010rdb.o
> > +obj-$(CONFIG_PPC_CLOCK) += clock.o
>
> I would put that to the beginning or before the board settings.
Done.
> > obj-$(CONFIG_P1022_DS) += p1022_ds.o
> > obj-$(CONFIG_P1023_RDS) += p1023_rds.o
> > obj-$(CONFIG_P2040_RDB) += p2040_rdb.o corenet_ds.o
> > diff --git a/arch/powerpc/platforms/85xx/clock.c b/arch/powerpc/platforms/85xx/clock.c
> > new file mode 100644
> > index 0000000..a25cbf3
> > --- /dev/null
> > +++ b/arch/powerpc/platforms/85xx/clock.c
> > @@ -0,0 +1,59 @@
> > +
> > +#include <linux/device.h>
> > +#include <linux/err.h>
> > +
> > +#include <asm/clk_interface.h>
> > +
> > +#include <sysdev/fsl_soc.h>
> > +
> > +/*
> > + * p1010rdb needs to provide a clock source for the flexcan driver.
> > + */
> > +struct clk {
> > + unsigned long rate;
> > +} p1010_rdb_system_clock;
> > +
> > +static struct clk *p1010_rdb_clk_get(struct device *dev, const char *id)
> > +{
> > + const char *dev_init_name;
> > +
> > + if (!dev)
> > + return ERR_PTR(-ENOENT);
> > +
> > + /*
> > + * The can devices are named ffe1c000.can0 and ffe1d000.can1 on
> > + * the p1010rdb. Check for the "can" portion of that name before
> > + * returning a clock source.
> > + */
> > + dev_init_name = dev_name(dev);
> > + if (strlen(dev_init_name) != 13)
> > + return ERR_PTR(-ENOENT);
> > + dev_init_name += 9;
> > + if (strncmp(dev_init_name, "can", 3))
> > + return ERR_PTR(-ENOENT);
>
> What's that good for? Also it's wrong to rely on the special name of the
> node. I think it can be removed.
Removed.
>
> > + return &p1010_rdb_system_clock;
>
> Just returning fsl_get_sys_freq() here would already be fine. I'm also
> missing the factor of two here:
>
> return fsl_get_sys_freq() / 2; ????
If we were going that route, I would return NULL here and do that
return on the clk_get_rate() call, correct? I just tested with that
and it worked.
> > +}
> > +
> > +static void p1010_rdb_clk_put(struct clk *clk)
> > +{
> > + return;
> > +}
> > +
> > +static unsigned long p1010_rdb_clk_get_rate(struct clk *clk)
> > +{
> > + return clk->rate;
> > +}
> > +
> > +static struct clk_interface p1010_rdb_clk_functions = {
> > + .clk_get = p1010_rdb_clk_get,
> > + .clk_get_rate = p1010_rdb_clk_get_rate,
> > + .clk_put = p1010_rdb_clk_put,
> > +};
> > +
> > +void __init p1010_rdb_clk_init(void)
> > +{
> > + p1010_rdb_system_clock.rate = fsl_get_sys_freq();
>
> > + clk_functions = p1010_rdb_clk_functions;
> > +}
>
> The name is too specific. The idea is that the interface could be used
> for other 85xx processors as well, not only the p1010. The prefix
> "mpc85xx_" instead of "p1010_rdb" seems more appropriate to me.
Done.
>
> > diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
> > index d7387fa..d0afbf9 100644
> > --- a/arch/powerpc/platforms/85xx/p1010rdb.c
> > +++ b/arch/powerpc/platforms/85xx/p1010rdb.c
> > @@ -81,6 +81,15 @@ static void __init p1010_rdb_setup_arch(void)
> > printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
> > }
> >
> > +extern void p1010_rdb_clk_init(void);
> > +
> > +static void __init p1010_rdb_init(void)
> > +{
> > +#ifdef CONFIG_PPC_CLOCK
> > + p1010_rdb_clk_init();
> > +#endif
> > +}
>
> The #ifdef's are not needed if CONFIG_PPC_CLOCK is selected in the Kconfig.
Done.
>
> > static struct of_device_id __initdata p1010rdb_ids[] = {
> > { .type = "soc", },
> > { .compatible = "soc", },
> > @@ -111,6 +120,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,
Thank you very much for your patience with me,
Robin
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Marc Kleine-Budde @ 2011-08-09 12:04 UTC (permalink / raw)
To: Robin Holt
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300, PPC list,
Wolfgang Grandegger
In-Reply-To: <20110809114043.GN4926-sJ/iWh9BUns@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1400 bytes --]
On 08/09/2011 01:40 PM, Robin Holt wrote:
> On Tue, Aug 09, 2011 at 09:11:33AM +0200, Wolfgang Grandegger wrote:
>>> + return &p1010_rdb_system_clock;
>>
>> Just returning fsl_get_sys_freq() here would already be fine. I'm also
>> missing the factor of two here:
>>
>> return fsl_get_sys_freq() / 2; ????
>
> I am working on the other comments right now as well, but this one
> brought up a good question. The old algorithm in the original freescale
> patches I started with actually did, essentially:
>
> ...clock.freq = DIV_ROUND_CLOSEST(fsl_get_sys_freq() / 2, 1000) * 1000
>
> The end result was before:
> ...clock.freq=0x0bebc200
That's exactly 200 MHz
> After:
> ...clock.freq=0x0bebc1fe
this is 199 999 998 Hz
> Is that rounding relavent?
_If_ 200 MHz is correct, this would be an error of 0.000001%. But the
fsl code rounds to closest KHz. Rounding introduces errors in most of
the cases. IMHO it's better not to round here.
For example the usual at91can is clocked with 99.532800 MHz, this is a
least the value the arm clock framework reports.
Cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* [PATCH] net_sched: prio: use qdisc_dequeue_peeked
From: Florian Westphal @ 2011-08-09 12:04 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal, Eric Dumazet
commit 07bd8df5df4369487812bf85a237322ff3569b77
(sch_sfq: fix peek() implementation) changed sfq to use generic
peek helper.
This makes HFSC complain about a non-work-conserving child qdisc, if
prio with sfq child is used within hfsc:
hfsc peeks into prio qdisc, which will then peek into sfq.
returned skb is stashed in sch->gso_skb.
Next, hfsc tries to dequeue from prio, but prio will call sfq dequeue
directly, which may return NULL instead of previously peeked-at skb.
Have prio call qdisc_dequeue_peeked, so sfq->dequeue() is
not called in this case.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
Eric, does this look correct to you?
I am not sure if sfq needs fixing instead of this patch here.
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 2a318f2..b5d56a2 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)
for (prio = 0; prio < q->bands; prio++) {
struct Qdisc *qdisc = q->queues[prio];
- struct sk_buff *skb = qdisc->dequeue(qdisc);
+ struct sk_buff *skb = qdisc_dequeue_peeked(qdisc);
if (skb) {
qdisc_bstats_update(sch, skb);
sch->q.qlen--;
--
1.7.3.4
^ permalink raw reply related
* Re: [RFC 4/4] [powerpc] Add flexcan device support for p1010rdb.
From: Robin Holt @ 2011-08-09 11:40 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, U Bhaskar-B22300,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
PPC list
In-Reply-To: <4E40DDA5.1050004-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
On Tue, Aug 09, 2011 at 09:11:33AM +0200, Wolfgang Grandegger wrote:
> > + return &p1010_rdb_system_clock;
>
> Just returning fsl_get_sys_freq() here would already be fine. I'm also
> missing the factor of two here:
>
> return fsl_get_sys_freq() / 2; ????
I am working on the other comments right now as well, but this one
brought up a good question. The old algorithm in the original freescale
patches I started with actually did, essentially:
...clock.freq = DIV_ROUND_CLOSEST(fsl_get_sys_freq() / 2, 1000) * 1000
The end result was before:
...clock.freq=0x0bebc200
After:
...clock.freq=0x0bebc1fe
Is that rounding relavent?
Thanks,
Robin
^ permalink raw reply
* Re: 802.3ad bonding brain damaged?
From: Benny Amorsen @ 2011-08-09 11:24 UTC (permalink / raw)
To: Phillip Susi; +Cc: Chris Friesen, David Lamparter, netdev
In-Reply-To: <4E4047CF.5030705@cfl.rr.com>
Phillip Susi <psusi@cfl.rr.com> writes:
> Try, sure, but if you can't without seriously affecting performance,
> then having a knob for damn the torpedoes, full speed ahead mode seems
> reasonable.
Packet reordering often affects performance. It can easily be more
costly than losing half the bandwidth of a bundled link.
These days you are even dependent on the NIC firmware for good
performance with TCP for reordered packets -- if the NIC is bad at
handling them, you don't get any performance boost from GRO.
For UDP, applications have to handle it on their own.
/Benny
^ permalink raw reply
* Re: [PATCH 3/4] powerpc/p1010: FlexCAN Controller for of_ type
From: Marc Kleine-Budde @ 2011-08-09 10:56 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: netdev@vger.kernel.org, holt@sgi.com, wg@grandegger.com,
davem@davemloft.net, linuxppc-release@linux.freescale.net,
socketcan-core@lists.berlios.de
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1BF197@039-SN1MPN1-004.039d.mgd.msft.net>
[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]
On 08/09/2011 12:29 PM, U Bhaskar-B22300 wrote:
>> NACK - your patch does more than the description states (debug code).
> [Bhaskar] Ok I will change description as below
> This patch introduces the following features
> 1. provides the support for FlexCAN on P1010 SoC.
> 2. Provides the common read/write interface for ARM and PowerPC based FlexCAN.
> 3. Provides the clock interface for PowerPC based FlexCAN.
> Will it be OK ?
>
>> Further you still add bugs to the driver. I've send you patches to fix
>> them.
> [Bhaskar] Please mention what sort of BUG you are seeing ..
I have, it's in that mail:
> @@ -957,24 +952,24 @@ static int __devinit register_flexcandev(struct net_device *dev)
> >
> > /* select "bus clock", chip must be disabled */
> > flexcan_chip_disable(priv);
> > - reg = readl(®s->ctrl);
> > + reg = flexcan_read(®s->ctrl);
> > reg |= FLEXCAN_CTRL_CLK_SRC;
> > - writel(reg, ®s->ctrl);
> > + flexcan_write(reg, ®s->ctrl);
> >
> > flexcan_chip_enable(priv);
> >
> > /* set freeze, halt and activate FIFO, restrict register access */
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT |
> > FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV;
> > - writel(reg, ®s->mcr);
> > + flexcan_write(reg, ®s->mcr);
> >
> > /*
> > * Currently we only support newer versions of this core
> > * featuring a RX FIFO. Older cores found on some Coldfire
> > * derivates are not yet supported.
> > */
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > if (!(reg & FLEXCAN_MCR_FEN)) {
> > dev_err(dev->dev.parent,
> > "Could not enable RX FIFO, unsupported core\n");
> > @@ -984,6 +979,7 @@ static int __devinit register_flexcandev(struct net_device *dev)
> >
> > err = register_candev(dev);
> >
> > + return err;
If you return here, the clock stays enabled....not good
> > out:
> > /* disable core and turn off clocks */
> > flexcan_chip_disable(priv);
> > @@ -992,7 +988,7 @@ static int __devinit register_flexcandev(struct net_device *dev)
> > return err;
> > }
For reference bugreport + fix:
https://lists.berlios.de/pipermail/socketcan-core/2011-July/005838.html
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Wolfgang Grandegger @ 2011-08-09 10:48 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: Marc Kleine-Budde, socketcan-core@lists.berlios.de,
netdev@vger.kernel.org, Devicetree-discuss@lists.ozlabs.org
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1BDF8C@039-SN1MPN1-004.039d.mgd.msft.net>
On 08/09/2011 11:27 AM, U Bhaskar-B22300 wrote:
>
>
>> -----Original Message-----
>> From: Wolfgang Grandegger [mailto:wg@grandegger.com]
>> Sent: Tuesday, August 09, 2011 2:03 PM
>> To: U Bhaskar-B22300
>> Cc: Marc Kleine-Budde; socketcan-core@lists.berlios.de;
>> netdev@vger.kernel.org; Devicetree-discuss@lists.ozlabs.org
>> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
>>
>> Hi Bhaskar,
>>
>> On 08/09/2011 09:57 AM, U Bhaskar-B22300 wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
>>>> Sent: Tuesday, August 09, 2011 12:23 AM
>>>> To: Wolfgang Grandegger
>>>> Cc: socketcan-core@lists.berlios.de; netdev@vger.kernel.org; U
>>>> Bhaskar- B22300
>>>> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
>>>>
>>>> On 08/08/2011 05:33 PM, Wolfgang Grandegger wrote:
>>>>>> ACK - The device tree bindings as in mainline's Documentation is a
>>>> mess.
>>>>>> If the powerpc guys are happy with a clock interfaces based
>>>>>> approach somewhere in arch/ppc, I'm more than happy to remove:
>>>>>> - fsl,flexcan-clock-source (not implemented, even in the fsl
>>>>>> driver)
>>> [Bhaskar]I have pushed the FlexCAN series of patches, It contains the
>>> usage of all the fields posted in the FlexCAN bindings at
>>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-3.0.y.git;a=blo
>>> b;f=Documentation/devicetree/bindings/net/can/fsl-flexcan.txt;h=1a729f
>>> 089866259ef82d0db5893ff7a8c54d5ccf;hb=94ed5b4788a7cdbe68bc7cb8516972cb
>>> ebdc8274
>>
>> As Marc already pointed out, Robin already has a much more advanced patch
>> stack in preparation. Especially your patches do not care about the
>> already existing Flexcan core on the Freescale's ARM socks.
> [Bhaskar] No, the patches are taking care of the existing ARM functionality.
> I have not tested on the ARM based board, but the patches are made in a
> Manner that it should not break the ARM based functionality.
>>
>>>>>>
>>>>>> - fsl,flexcan-clock-divider \__ replace with code in arch/ppc, or
>>>>>> - clock-frequency / a single clock-frequency attribute
>>>>>
>>>>> In the "net-next-2.6" tree there is also:
>>>>>
>>>>> $ grep flexcan arch/powerpc/boots/dts/*.dts
>>>>> p1010rdb.dts: fsl,flexcan-clock-source =
>> "platform";
>>>>> p1010rdb.dts: fsl,flexcan-clock-source =
>> "platform";
>>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
>>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
>>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
>>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
>>>>>
>>>>> Especially the fsl,flexcan-clock-divider = <2>; might make people
>>>>> think, that they could set something else.
>>>>
>>> [Bhaskar] As it is mentioned in the Flexcan bindings, the need of
>> fsl,flexcan-clock-divider = <2>;
>>> But I kept it as "2" because FlexCan clock source is the
>> platform clock and it is CCB/2
>>> If the "2" is misleading, the bindings can be changed or some
>> text can be written to make the meaning of "2"
>>> Understandable , Please suggest ..
>>
>> The clock source and frequency is fixed. Why do we need an extra
>> properties for that. We have panned to remove these bogus bindings from
>> the Linux kernel, which sneaked in *without* any review on the relevant
>> mailing lists (at least I have not realized any posting). We do not think
>> they are really needed. They just confuse the user. We also prefer to use
>> the compatibility string "fsl,flexcan" instead "fsl,flexcan-v1.0". It's
>> unusual to add a version number, which is for the Flexcan on the PowerPC
>> cores only, I assume, but there will be device tree for ARM soon. A
>> proper compatibility string would be "fsl,p1010-flexcan" if we really
>> need to distinguish.
>>
> [Bhaskar] About clock source.. There can be two sources of clock for the CAN.
> Oscillator or the platform clock, but at present only platform clock is supported
> in P1010.If we remove the fsl,flexcan-clock-source property, we will lost the flexibility
> of changing the clock source ..
>
> About clock-frequency... it is also not fixed. It depends on the platform clock which in turns
> Depends on the CCB clock. So it will be better to keep clock-frequency property which is getting fixed via u-boot.
The frequency is fixed to CCB-frequency / 2. Will that ever change? What
can we expect from future Flexcan hardware? Will it support further
clock sources?
Wolfgang.
^ permalink raw reply
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Wolfgang Grandegger @ 2011-08-09 10:41 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Marc Kleine-Budde
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1BEFCE-TcFNo7jSaXM0vywKSws3iq4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
On 08/09/2011 11:34 AM, U Bhaskar-B22300 wrote:
>
>
>> -----Original Message-----
>> From: Marc Kleine-Budde [mailto:mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org]
>> Sent: Tuesday, August 09, 2011 1:43 PM
>> To: U Bhaskar-B22300
>> Cc: Wolfgang Grandegger; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org;
>> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Subject: Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
>>
>> On 08/09/2011 09:57 AM, U Bhaskar-B22300 wrote:
>>>> On 08/08/2011 05:33 PM, Wolfgang Grandegger wrote:
>>>>>> ACK - The device tree bindings as in mainline's Documentation is a
>>>> mess.
>>>>>> If the powerpc guys are happy with a clock interfaces based
>>>>>> approach somewhere in arch/ppc, I'm more than happy to remove:
>>>>>> - fsl,flexcan-clock-source (not implemented, even in the fsl
>>>>>> driver)
>>
>>> [Bhaskar]I have pushed the FlexCAN series of patches, It contains the
>>> usage of all the fields posted in the FlexCAN bindings at
>>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-3.0.y.git;a=blo
>>> b;f=Documentation/devicetree/bindings/net/can/fsl-flexcan.txt;h=1a729f
>>> 089866259ef82d0db5893ff7a8c54d5ccf;hb=94ed5b4788a7cdbe68bc7cb8516972cb
>>> ebdc8274
>>
>> I've commented the patches. They are in a very bad shape. Please test
>> Robin's patches.
>>
>>>>>>
>>>>>> - fsl,flexcan-clock-divider \__ replace with code in arch/ppc, or
>>>>>> - clock-frequency / a single clock-frequency attribute
>>>>>
>>>>> In the "net-next-2.6" tree there is also:
>>>>>
>>>>> $ grep flexcan arch/powerpc/boots/dts/*.dts
>>>>> p1010rdb.dts: fsl,flexcan-clock-source =
>> "platform";
>>>>> p1010rdb.dts: fsl,flexcan-clock-source =
>> "platform";
>>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
>>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
>>>>> p1010si.dtsi: compatible = "fsl,flexcan-v1.0";
>>>>> p1010si.dtsi: fsl,flexcan-clock-divider = <2>;
>>>>>
>>>>> Especially the fsl,flexcan-clock-divider = <2>; might make people
>>>>> think, that they could set something else.
>>>>
>>> [Bhaskar] As it is mentioned in the Flexcan bindings, the need of
>>> fsl,flexcan-clock-divider = <2>; But I kept it as "2" because FlexCan
>>> clock source is the platform clock and it is CCB/2 If the "2" is
>>> misleading, the bindings can be changed or some text can be written to
>>> make the meaning of "2" Understandable , Please suggest ..
>>
>> The clock devider is crap. Why not specify the clockrate that goes into
>> the flexcan core?
> [Bhaskar] The reason why I placed the "fsl,flexcan-clock-divider" property is just because the earlier implementations
> Of CAN also follows the same approach. Please see below the approach of mscan.
> compatible = "fsl,mpc5121-mscan";
> interrupts = <13 0x8>;
> interrupt-parent = <&ipic>;
> reg = <0x1380 0x80>;
> fsl,mscan-clock-source = "ref";
> fsl,mscan-clock-divider = <3>;
> };
> If you want we can remove the fsl,flexcan-clock-divider property. Please comment ..
For that platform the user can *change* these properties so select
another clock-source or clock-divider. This is not the case for the
P1010. Therefore these properties are not needed.
Wolfgang.
^ permalink raw reply
* Re: [PATCH 3/4] powerpc/p1010: FlexCAN Controller for of_ type
From: Wolfgang Grandegger @ 2011-08-09 10:37 UTC (permalink / raw)
To: U Bhaskar-B22300
Cc: linuxppc-release-50dRxjG7WBCY5r8RbUyfqNHuzzzSOjJt@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
Marc Kleine-Budde, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org
In-Reply-To: <9C64B7751C3BCA41B64A68E23005A7BE1BF197-TcFNo7jSaXM0vywKSws3iq4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
On 08/09/2011 12:29 PM, U Bhaskar-B22300 wrote:
>
>
>> -----Original Message-----
>> From: Marc Kleine-Budde [mailto:mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org]
>> Sent: Monday, August 08, 2011 8:51 PM
>> To: U Bhaskar-B22300
>> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; holt-sJ/iWh9BUns@public.gmane.org; wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org;
>> davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org; linuxppc-release-50dRxjG7WBCY5r8RbUyfqNHuzzzSOjJt@public.gmane.org; U Bhaskar-
>> B22300; socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
>> Subject: Re: [PATCH 3/4] powerpc/p1010: FlexCAN Controller for of_ type
>>
>> On 08/08/2011 05:00 PM, Bhaskar Upadhaya wrote:
>>> Provide FlexCAN support for Freescale P1010 SoC.
>>> Modify the existing FlexCAN, so as to support the of_type approach on
>>> P1010(power architecture based)SoC.
>>>
>>> FlexCAN is a communication controller implementing the CAN protocol
>>> according to the CAN 2.0B protocol specification.
>>> This controller is available on Freescale P1010 platform.
>>> Signed-off-by: Bhaskar Upadhaya <bhaskar.upadhaya-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>
>> NACK - your patch does more than the description states (debug code).
> [Bhaskar] Ok I will change description as below
> This patch introduces the following features
> 1. provides the support for FlexCAN on P1010 SoC.
> 2. Provides the common read/write interface for ARM and PowerPC based FlexCAN.
> 3. Provides the clock interface for PowerPC based FlexCAN.
> Will it be OK ?
Sorry, too late. Please try the patches posted by Robin recently. We are
currently reviewing those for mainline inclusion and would be happy, if
you would help.
Thanks,
Wolfgang.
^ permalink raw reply
* RE: [PATCH 3/4] powerpc/p1010: FlexCAN Controller for of_ type
From: U Bhaskar-B22300 @ 2011-08-09 10:29 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: netdev@vger.kernel.org, holt@sgi.com, wg@grandegger.com,
davem@davemloft.net, linuxppc-release@linux.freescale.net,
socketcan-core@lists.berlios.de
In-Reply-To: <4E3FFEEB.8070400@pengutronix.de>
> -----Original Message-----
> From: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
> Sent: Monday, August 08, 2011 8:51 PM
> To: U Bhaskar-B22300
> Cc: netdev@vger.kernel.org; holt@sgi.com; wg@grandegger.com;
> davem@davemloft.net; linuxppc-release@linux.freescale.net; U Bhaskar-
> B22300; socketcan-core@lists.berlios.de
> Subject: Re: [PATCH 3/4] powerpc/p1010: FlexCAN Controller for of_ type
>
> On 08/08/2011 05:00 PM, Bhaskar Upadhaya wrote:
> > Provide FlexCAN support for Freescale P1010 SoC.
> > Modify the existing FlexCAN, so as to support the of_type approach on
> > P1010(power architecture based)SoC.
> >
> > FlexCAN is a communication controller implementing the CAN protocol
> > according to the CAN 2.0B protocol specification.
> > This controller is available on Freescale P1010 platform.
> > Signed-off-by: Bhaskar Upadhaya <bhaskar.upadhaya@freescale.com>
>
> NACK - your patch does more than the description states (debug code).
[Bhaskar] Ok I will change description as below
This patch introduces the following features
1. provides the support for FlexCAN on P1010 SoC.
2. Provides the common read/write interface for ARM and PowerPC based FlexCAN.
3. Provides the clock interface for PowerPC based FlexCAN.
Will it be OK ?
> Further you still add bugs to the driver. I've send you patches to fix
> them.
[Bhaskar] Please mention what sort of BUG you are seeing ..
>
> Marc
>
> > ---
> > Based on
> > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git
> > Branch master
> >
> > drivers/net/can/Kconfig | 8 +-
> > drivers/net/can/Makefile | 4 +-
> > drivers/net/can/flexcan.c | 162 ++++++++++++------------
> > drivers/net/can/flexcan_iface.c | 261
> > +++++++++++++++++++++++++++++++++++++++
> > 4 files changed, 349 insertions(+), 86 deletions(-) create mode
> > 100644 drivers/net/can/flexcan_iface.c
> >
> > diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index
> > f6c98fb..882da54 100644
> > --- a/drivers/net/can/Kconfig
> > +++ b/drivers/net/can/Kconfig
> > @@ -98,9 +98,12 @@ config HAVE_CAN_FLEXCAN
> >
> > config CAN_FLEXCAN
> > tristate "Support for Freescale FLEXCAN based chips"
> > - depends on CAN_DEV && HAVE_CAN_FLEXCAN
> > + depends on CAN_DEV && (!ARM || HAVE_CAN_FLEXCAN)
> > + select PPC_CLOCK
> > ---help---
> > - Say Y here if you want to support for Freescale FlexCAN.
> > + Say Y here if you want support for Freescale FlexCAN.
> > + Flexcan Module is implementing the CAN Protocol
> > + version 2.0
> >
> > config PCH_CAN
> > tristate "PCH CAN"
> > @@ -123,6 +126,7 @@ source "drivers/net/can/softing/Kconfig"
> > config CAN_DEBUG_DEVICES
> > bool "CAN devices debugging messages"
> > depends on CAN
> > + default N
> > ---help---
> > Say Y here if you want the CAN device drivers to produce a bunch
> of
> > debug messages to the system log. Select this if you are having
> > diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile index
> > 24ebfe8..4965e6f 100644
> > --- a/drivers/net/can/Makefile
> > +++ b/drivers/net/can/Makefile
> > @@ -19,7 +19,9 @@ obj-$(CONFIG_CAN_TI_HECC) += ti_hecc.o
> > obj-$(CONFIG_CAN_MCP251X) += mcp251x.o
> > obj-$(CONFIG_CAN_BFIN) += bfin_can.o
> > obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o
> > -obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
> > +obj-$(CONFIG_CAN_FLEXCAN) += flexcan_driver.o
> > +flexcan_driver-objs := flexcan.o \
> > + flexcan_iface.o
> > obj-$(CONFIG_PCH_CAN) += pch_can.o
> >
> > ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG diff --git
> > a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index
> > a24aa12..1c1af24 100644
> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c
> > @@ -22,10 +22,8 @@
> >
> > #include <linux/netdevice.h>
> > #include <linux/can.h>
> > -#include <linux/can/dev.h>
> > #include <linux/can/error.h>
> > #include <linux/can/platform/flexcan.h> -#include <linux/clk.h>
> > #include <linux/delay.h> #include <linux/if_arp.h> #include
> > <linux/if_ether.h> @@ -34,11 +32,6 @@ #include <linux/kernel.h>
> > #include <linux/list.h> #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 */
> > #define FLEXCAN_NAPI_WEIGHT (8 + 2)
> > @@ -167,19 +160,6 @@ struct flexcan_regs {
> > struct flexcan_mb cantxfg[64];
> > };
> >
> > -struct flexcan_priv {
> > - struct can_priv can;
> > - struct net_device *dev;
> > - struct napi_struct napi;
> > -
> > - void __iomem *base;
> > - u32 reg_esr;
> > - u32 reg_ctrl_default;
> > -
> > - struct clk *clk;
> > - struct flexcan_platform_data *pdata;
> > -};
> > -
> > static struct can_bittiming_const flexcan_bittiming_const = {
> > .name = DRV_NAME,
> > .tseg1_min = 4,
> > @@ -229,9 +209,10 @@ static inline void flexcan_chip_enable(struct
> flexcan_priv *priv)
> > struct flexcan_regs __iomem *regs = priv->base;
> > u32 reg;
> >
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > +
> > reg &= ~FLEXCAN_MCR_MDIS;
> > - writel(reg, ®s->mcr);
> > + flexcan_write(reg, ®s->mcr);
> >
> > udelay(10);
> > }
> > @@ -248,9 +229,10 @@ static inline void flexcan_chip_disable(struct
> flexcan_priv *priv)
> > struct flexcan_regs __iomem *regs = priv->base;
> > u32 reg;
> >
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > +
> > reg |= FLEXCAN_MCR_MDIS;
> > - writel(reg, ®s->mcr);
> > + flexcan_write(reg, ®s->mcr);
> > }
> >
> > /**
> > @@ -266,9 +248,9 @@ static int flexcan_get_berr_counter(const struct
> > net_device *dev, {
> > const struct flexcan_priv *priv = netdev_priv(dev);
> > struct flexcan_regs __iomem *regs = priv->base;
> > - u32 reg = readl(®s->ecr);
> >
> > - bec->txerr = (reg >> 0) & 0xff;
> > + u32 reg = flexcan_read(®s->ecr);
> > + bec->txerr = reg & 0xff;
> > bec->rxerr = (reg >> 8) & 0xff;
> >
> > return 0;
> > @@ -294,6 +276,7 @@ static int flexcan_start_xmit(struct sk_buff *skb,
> struct net_device *dev)
> > u32 can_id;
> > u32 ctrl = FLEXCAN_MB_CNT_CODE(0xc) | (cf->can_dlc << 16);
> >
> > + flexcan_reg_dump(dev);
> > if (can_dropped_invalid_skb(dev, skb))
> > return NETDEV_TX_OK;
> >
> > @@ -311,21 +294,24 @@ static int flexcan_start_xmit(struct sk_buff
> > *skb, struct net_device *dev)
> >
> > if (cf->can_dlc > 0) {
> > u32 data = be32_to_cpup((__be32 *)&cf->data[0]);
> > - writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
> > + flexcan_write(data,
> > + ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
> > }
> > if (cf->can_dlc > 3) {
> > u32 data = be32_to_cpup((__be32 *)&cf->data[4]);
> > - writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
> > + flexcan_write(data,
> > + ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
> > }
> >
> > - writel(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
> > - writel(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
> > + flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
> > + flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
> >
> > kfree_skb(skb);
> >
> > /* tx_packets is incremented in flexcan_irq */
> > stats->tx_bytes += cf->can_dlc;
> >
> > + flexcan_reg_dump(dev);
> > return NETDEV_TX_OK;
> > }
> >
> > @@ -440,7 +426,8 @@ static void do_state(struct net_device *dev,
> > CAN_ERR_CRTL_TX_WARNING :
> > CAN_ERR_CRTL_RX_WARNING;
> > }
> > - case CAN_STATE_ERROR_WARNING: /* fallthrough */
> > + /* fallthrough */
> > + case CAN_STATE_ERROR_WARNING:
> > /*
> > * from: ERROR_ACTIVE, ERROR_WARNING
> > * to : ERROR_PASSIVE, BUS_OFF
> > @@ -536,8 +523,8 @@ static void flexcan_read_fifo(const struct
> net_device *dev,
> > struct flexcan_mb __iomem *mb = ®s->cantxfg[0];
> > u32 reg_ctrl, reg_id;
> >
> > - reg_ctrl = readl(&mb->can_ctrl);
> > - reg_id = readl(&mb->can_id);
> > + reg_ctrl = flexcan_read(&mb->can_ctrl);
> > + reg_id = flexcan_read(&mb->can_id);
> > if (reg_ctrl & FLEXCAN_MB_CNT_IDE)
> > cf->can_id = ((reg_id >> 0) & CAN_EFF_MASK) | CAN_EFF_FLAG;
> > else
> > @@ -547,12 +534,13 @@ static void flexcan_read_fifo(const struct
> net_device *dev,
> > cf->can_id |= CAN_RTR_FLAG;
> > cf->can_dlc = get_can_dlc((reg_ctrl >> 16) & 0xf);
> >
> > - *(__be32 *)(cf->data + 0) = cpu_to_be32(readl(&mb->data[0]));
> > - *(__be32 *)(cf->data + 4) = cpu_to_be32(readl(&mb->data[1]));
> > + *(__be32 *) (&cf->data[0]) =
> > + cpu_to_be32(flexcan_read(&mb->data[0]));
> > + *(__be32 *) (&cf->data[4]) =
> > + cpu_to_be32(flexcan_read(&mb->data[1]));
> >
> > /* mark as read */
> > - writel(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
> > - readl(®s->timer);
> > + flexcan_write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
> > }
> >
> > static int flexcan_read_frame(struct net_device *dev) @@ -596,17
> > +584,17 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
> > * The error bits are cleared on read,
> > * use saved value from irq handler.
> > */
> > - reg_esr = readl(®s->esr) | priv->reg_esr;
> > + reg_esr = flexcan_read(®s->esr) | priv->reg_esr;
> >
> > /* handle state changes */
> > work_done += flexcan_poll_state(dev, reg_esr);
> >
> > /* handle RX-FIFO */
> > - reg_iflag1 = readl(®s->iflag1);
> > - while (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE &&
> > - work_done < quota) {
> > + reg_iflag1 = flexcan_read(®s->iflag1);
> > + while ((reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE) &&
> > + (work_done < quota)) {
> > work_done += flexcan_read_frame(dev);
> > - reg_iflag1 = readl(®s->iflag1);
> > + reg_iflag1 = flexcan_read(®s->iflag1);
> > }
> >
> > /* report bus errors */
> > @@ -616,8 +604,8 @@ static int flexcan_poll(struct napi_struct *napi,
> int quota)
> > if (work_done < quota) {
> > napi_complete(napi);
> > /* enable IRQs */
> > - writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
> > - writel(priv->reg_ctrl_default, ®s->ctrl);
> > + flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
> > + flexcan_write(priv->reg_ctrl_default, ®s->ctrl);
> > }
> >
> > return work_done;
> > @@ -641,9 +629,10 @@ static irqreturn_t flexcan_irq(int irq, void
> *dev_id)
> > struct flexcan_regs __iomem *regs = priv->base;
> > u32 reg_iflag1, reg_esr;
> >
> > - reg_iflag1 = readl(®s->iflag1);
> > - reg_esr = readl(®s->esr);
> > - writel(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */
> > + flexcan_reg_dump(dev);
> > + reg_iflag1 = flexcan_read(®s->iflag1);
> > + reg_esr = flexcan_read(®s->esr);
> > + flexcan_write(FLEXCAN_ESR_ERR_INT, ®s->esr);/* ACK err IRQ */
> >
> > /*
> > * schedule NAPI in case of:
> > @@ -659,16 +648,17 @@ static irqreturn_t flexcan_irq(int irq, void
> *dev_id)
> > * save them for later use.
> > */
> > priv->reg_esr = reg_esr & FLEXCAN_ESR_ERR_BUS;
> > - writel(FLEXCAN_IFLAG_DEFAULT &
> ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE,
> > - ®s->imask1);
> > - writel(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
> > - ®s->ctrl);
> > + flexcan_write(FLEXCAN_IFLAG_DEFAULT &
> > + ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->imask1);
> > + flexcan_write(priv->reg_ctrl_default &
> > + ~FLEXCAN_CTRL_ERR_ALL, ®s->ctrl);
> > napi_schedule(&priv->napi);
> > }
> >
> > /* FIFO overflow */
> > if (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_OVERFLOW) {
> > - writel(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW, ®s->iflag1);
> > + flexcan_write(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW,
> > + ®s->iflag1);
> > dev->stats.rx_over_errors++;
> > dev->stats.rx_errors++;
> > }
> > @@ -677,10 +667,11 @@ static irqreturn_t flexcan_irq(int irq, void
> *dev_id)
> > if (reg_iflag1 & (1 << FLEXCAN_TX_BUF_ID)) {
> > /* tx_bytes is incremented in flexcan_start_xmit */
> > stats->tx_packets++;
> > - writel((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
> > + flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
> > netif_wake_queue(dev);
> > }
> >
> > + flexcan_reg_dump(dev);
> > return IRQ_HANDLED;
> > }
> >
> > @@ -698,7 +689,7 @@ static void flexcan_set_bittiming(struct net_device
> *dev)
> > struct flexcan_regs __iomem *regs = priv->base;
> > u32 reg;
> >
> > - reg = readl(®s->ctrl);
> > + reg = flexcan_read(®s->ctrl);
> > reg &= ~(FLEXCAN_CTRL_PRESDIV(0xff) |
> > FLEXCAN_CTRL_RJW(0x3) |
> > FLEXCAN_CTRL_PSEG1(0x7) |
> > @@ -722,11 +713,11 @@ static void flexcan_set_bittiming(struct
> net_device *dev)
> > reg |= FLEXCAN_CTRL_SMP;
> >
> > dev_info(dev->dev.parent, "writing ctrl=0x%08x\n", reg);
> > - writel(reg, ®s->ctrl);
> > + flexcan_write(reg, ®s->ctrl);
> >
> > /* print chip status */
> > dev_dbg(dev->dev.parent, "%s: mcr=0x%08x ctrl=0x%08x\n", __func__,
> > - readl(®s->mcr), readl(®s->ctrl));
> > + flexcan_read(®s->mcr), flexcan_read(®s->ctrl));
> > }
> >
> > /**
> > @@ -751,10 +742,10 @@ static int flexcan_chip_start(struct net_device
> *dev)
> > flexcan_chip_enable(priv);
> >
> > /* soft reset */
> > - writel(FLEXCAN_MCR_SOFTRST, ®s->mcr);
> > + flexcan_write(FLEXCAN_MCR_SOFTRST, ®s->mcr);
> > udelay(10);
> >
> > - reg_mcr = readl(®s->mcr);
> > + reg_mcr = flexcan_read(®s->mcr);
> > if (reg_mcr & FLEXCAN_MCR_SOFTRST) {
> > dev_err(dev->dev.parent,
> > "Failed to softreset can module (mcr=0x%08x)\n", @@ -
> 776,12
> > +767,12 @@ static int flexcan_chip_start(struct net_device *dev)
> > * choose format C
> > *
> > */
> > - reg_mcr = readl(®s->mcr);
> > + reg_mcr = flexcan_read(®s->mcr);
> > reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
> > FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
> > FLEXCAN_MCR_IDAM_C;
> > dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__,
> reg_mcr);
> > - writel(reg_mcr, ®s->mcr);
> > + flexcan_write(reg_mcr, ®s->mcr);
> >
> > /*
> > * CTRL
> > @@ -799,7 +790,7 @@ static int flexcan_chip_start(struct net_device
> *dev)
> > * (FLEXCAN_CTRL_ERR_MSK), too. Otherwise we don't get any
> > * warning or bus passive interrupts.
> > */
> > - reg_ctrl = readl(®s->ctrl);
> > + reg_ctrl = flexcan_read(®s->ctrl);
> > reg_ctrl &= ~FLEXCAN_CTRL_TSYN;
> > reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF |
> > FLEXCAN_CTRL_ERR_STATE | FLEXCAN_CTRL_ERR_MSK; @@ -807,38
> +798,40
> > @@ static int flexcan_chip_start(struct net_device *dev)
> > /* save for later use */
> > priv->reg_ctrl_default = reg_ctrl;
> > dev_dbg(dev->dev.parent, "%s: writing ctrl=0x%08x", __func__,
> reg_ctrl);
> > - writel(reg_ctrl, ®s->ctrl);
> > + flexcan_write(reg_ctrl, ®s->ctrl);
> >
> > for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) {
> > - writel(0, ®s->cantxfg[i].can_ctrl);
> > - writel(0, ®s->cantxfg[i].can_id);
> > - writel(0, ®s->cantxfg[i].data[0]);
> > - writel(0, ®s->cantxfg[i].data[1]);
> > + flexcan_write(0, ®s->cantxfg[i].can_ctrl);
> > + flexcan_write(0, ®s->cantxfg[i].can_id);
> > + flexcan_write(0, ®s->cantxfg[i].data[0]);
> > + flexcan_write(0, ®s->cantxfg[i].data[1]);
> >
> > /* put MB into rx queue */
> > - writel(FLEXCAN_MB_CNT_CODE(0x4), ®s->cantxfg[i].can_ctrl);
> > + flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
> > + ®s->cantxfg[i].can_ctrl);
> > }
> >
> > /* acceptance mask/acceptance code (accept everything) */
> > - writel(0x0, ®s->rxgmask);
> > - writel(0x0, ®s->rx14mask);
> > - writel(0x0, ®s->rx15mask);
> > + flexcan_write(0x0, ®s->rxgmask);
> > + flexcan_write(0x0, ®s->rx14mask);
> > + flexcan_write(0x0, ®s->rx15mask);
> >
> > flexcan_transceiver_switch(priv, 1);
> >
> > /* synchronize with the can bus */
> > - reg_mcr = readl(®s->mcr);
> > + reg_mcr = flexcan_read(®s->mcr);
> > reg_mcr &= ~FLEXCAN_MCR_HALT;
> > - writel(reg_mcr, ®s->mcr);
> > + flexcan_write(reg_mcr, ®s->mcr);
> >
> > priv->can.state = CAN_STATE_ERROR_ACTIVE;
> >
> > /* enable FIFO interrupts */
> > - writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
> > + flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
> >
> > /* print chip status */
> > dev_dbg(dev->dev.parent, "%s: reading mcr=0x%08x ctrl=0x%08x\n",
> > - __func__, readl(®s->mcr), readl(®s->ctrl));
> > + __func__, flexcan_read(®s->mcr),
> > + flexcan_read(®s->ctrl));
> >
> > return 0;
> >
> > @@ -860,12 +853,12 @@ static void flexcan_chip_stop(struct net_device
> *dev)
> > u32 reg;
> >
> > /* Disable all interrupts */
> > - writel(0, ®s->imask1);
> > + flexcan_write(0, ®s->imask1);
> >
> > /* Disable + halt module */
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
> > - writel(reg, ®s->mcr);
> > + flexcan_write(reg, ®s->mcr);
> >
> > flexcan_transceiver_switch(priv, 0);
> > priv->can.state = CAN_STATE_STOPPED; @@ -935,6 +928,8 @@ static int
> > flexcan_set_mode(struct net_device *dev, enum can_mode mode)
> > break;
> >
> > default:
> > + dev_dbg(dev->dev.parent, "Setting flexcan mode(%d) in func %s
> in line"
> > + "%d \r\n", mode, __func__, __LINE__);
> > return -EOPNOTSUPP;
> > }
> >
> > @@ -957,24 +952,24 @@ static int __devinit register_flexcandev(struct
> > net_device *dev)
> >
> > /* select "bus clock", chip must be disabled */
> > flexcan_chip_disable(priv);
> > - reg = readl(®s->ctrl);
> > + reg = flexcan_read(®s->ctrl);
> > reg |= FLEXCAN_CTRL_CLK_SRC;
> > - writel(reg, ®s->ctrl);
> > + flexcan_write(reg, ®s->ctrl);
> >
> > flexcan_chip_enable(priv);
> >
> > /* set freeze, halt and activate FIFO, restrict register access */
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT |
> > FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV;
> > - writel(reg, ®s->mcr);
> > + flexcan_write(reg, ®s->mcr);
> >
> > /*
> > * Currently we only support newer versions of this core
> > * featuring a RX FIFO. Older cores found on some Coldfire
> > * derivates are not yet supported.
> > */
> > - reg = readl(®s->mcr);
> > + reg = flexcan_read(®s->mcr);
> > if (!(reg & FLEXCAN_MCR_FEN)) {
> > dev_err(dev->dev.parent,
> > "Could not enable RX FIFO, unsupported core\n"); @@ -
> 984,6 +979,7
> > @@ static int __devinit register_flexcandev(struct net_device *dev)
> >
> > err = register_candev(dev);
> >
> > + return err;
>
> If you return here, the clock stays enabled....not good
>
> > out:
> > /* disable core and turn off clocks */
> > flexcan_chip_disable(priv);
> > @@ -992,7 +988,7 @@ static int __devinit register_flexcandev(struct
> net_device *dev)
> > return err;
> > }
> >
> > -static void __devexit unregister_flexcandev(struct net_device *dev)
> > +void __devexit unregister_flexcandev(struct net_device *dev)
> > {
> > unregister_candev(dev);
> > }
> > diff --git a/drivers/net/can/flexcan_iface.c
> > b/drivers/net/can/flexcan_iface.c new file mode 100644 index
> > 0000000..0c5f6dd
> > --- /dev/null
> > +++ b/drivers/net/can/flexcan_iface.c
> > @@ -0,0 +1,261 @@
> > +/*
> > + * flexcan_iface.c
> > + *
> > + * Copyright 2011 Freescale Semiconductor, Inc.
> > + *
> > + * Based on code originally by Andrey Volkov <avolkov@varma-el.com>
> > + *
> > + * LICENCE:
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation version 2.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + */
> > +
> > +#include <linux/netdevice.h>
> > +#include <linux/can/platform/flexcan.h>
> > +
> > +struct flexcan_interface flexcan_ops;
> > +
> > +/**
> > + * flexcan_of_get_clk_rate - returns the rate, used for bit-timing
> > + * calculations of FlexCAN
> > + */
> > +static unsigned long flexcan_of_get_clk_rate(struct clk *clock) {
> > + return clock->rate;
> > +}
> > +
> > +static void flexcan_of_clk_put(struct clk *clk) {
> > + kfree(clk);
> > +}
> > +
> > +/**
> > + * flexcan_of_clk_get - calculates the rate, used for bit-timing
> > + * calculations of FlexCAN
> > + * @dev: the FlexCAN device to be used
> > + * @id: id used to differentiate among different clock nodes
> > + *
> > + * calculate the rate based on the clock-frequency
> > + * and clock-divider values from device tree.
> > + * It calculate the rate being "platform" as the clock source
> > + * Framework for "oscillator" as clock source is also provided.
> > + *
> > + * Return value
> > + * - On Success
> > + * the rate as part of clk struct, used to calculate the bit-
> timing
> > + * for FlexCAN
> > + * - On Failure
> > + * error value
> > + */
> > +static struct clk *flexcan_of_clk_get(struct device *dev, const char
> > +*id) {
> > + struct clk *clock;
> > + u32 *clock_freq = NULL;
> > + u32 *clock_divider = NULL;
> > + const char *clk_source;
> > + int err;
> > + unsigned long rate;
> > +
> > + clk_source = (char *)of_get_property(dev->of_node,
> > + "fsl,flexcan-clock-source", NULL);
> > + if (clk_source == NULL) {
> > + dev_err(dev, "Cannot find fsl,flexcan-clock-source"
> > + "property\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + }
> > + if (!memcmp(clk_source, "platform", strlen(clk_source))) {
> > + clock_divider = (u32 *)of_get_property(dev->of_node,
> > + "fsl,flexcan-clock-divider", NULL);
> > + if (*clock_divider) {
> > + clock_freq = (u32 *) of_get_property(dev->of_node,
> > + "clock-frequency", NULL);
> > + if (clock_freq == NULL) {
> > + dev_err(dev, "Cannot find clock-frequency"
> > + "property\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + }
> > + rate = DIV_ROUND_CLOSEST(*clock_freq / *clock_divider,
> > + 1000) * 1000;
> > + } else {
> > + dev_err(dev, "Cannot find valid fsl,"
> > + "flexcan-clock-divider\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + }
> > + } else if (!memcmp(clk_source, "oscillator", strlen(clk_source))) {
> > + clock_divider = (u32 *)of_get_property(dev->of_node,
> > + "fsl,flexcan-clock-divider", NULL);
> > + clock_freq = (u32 *)of_get_property(dev->of_node,
> > + "clock-frequency", NULL);
> > + if (!(*clock_divider && *clock_freq)) {
> > + dev_err(dev, "Cannot find valid"
> > + "fsl,flexcan-clock-divider or"
> > + "clock-frequency\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + } else { /*FIXME for keeping oscillator as clock-source*/
> > + dev_err(dev, "oscillator as clock support is"
> > + "not available\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + }
> > + } else {
> > + dev_err(dev, "Invalid flexcan-clock-source\n");
> > + err = -EINVAL;
> > + goto failed_clock;
> > + }
> > +
> > + clock = kmalloc(sizeof(struct clk), GFP_KERNEL);
> > + if (!clock) {
> > + dev_err(dev, "Cannot allocate memory\n");
> > + err = -ENOMEM;
> > + goto failed_clock;
> > + }
> > +
> > + clock->rate = rate;
> > + dev_info(dev, "clock-frequency is %lu in line %d in function
> %s\r\n",
> > + clock->rate, __LINE__, __func__);
> > + return clock;
> > +
> > + failed_clock:
> > + return ERR_PTR(err);
> > +}
> > +
> > +/**
> > + * flexcan_of_resource_init - initialize the resources for
> > + * "of" type platform like powerpc
> > + * @flexcan_res: input buffer filled with address for accessing h/w
> registers
> > + * of FlexCAN
> > + * @pdev: the FlexCAN device to be used
> > + * @flexcan_ops: input buffer containing different utility functions
> > + *
> > + * fills the flexcan_res with the address detail
> > + * for accessing the h/w registers of FlexCAN block.
> > + * flexcan_ops is filled with different clock functions and normal
> > +read/write
> > + *
> > + * Return value
> > + * - On Success
> > + * 0
> > + * - On Failure
> > + * error value
> > + */
> > +static int flexcan_of_resource_init(struct flexcan_resource
> *flexcan_res,
> > + struct device *pdev,
> > + struct flexcan_interface *flexcan_ops) {
> > + u64 addr, size;
> > + int err, irq;
> > +
> > + addr = of_translate_address(pdev->of_node,
> > + of_get_address(pdev->of_node, 0, &size, NULL));
> > + flexcan_res->addr = addr;
> > + flexcan_res->size = size;
> > + flexcan_res->drv_name = pdev->driver->name;
> > + irq = irq_of_parse_and_map(pdev->of_node, 0);
> > + if (irq == NO_IRQ) {
> > + dev_err(pdev, "cannot map to irq\n");
> > + err = -EINVAL;
> > + goto failed_req;
> > + }
> > +
> > + flexcan_res->irq = irq;
> > +
> > + flexcan_ops->clk_enable = NULL;
> > + flexcan_ops->clk_disable = NULL;
> > + flexcan_ops->clk_get_rate = flexcan_of_get_clk_rate;
> > + flexcan_ops->clk_get = flexcan_of_clk_get;
> > + flexcan_ops->clk_put = flexcan_of_clk_put;
> > + return 0;
> > +
> > +failed_req:
> > + return err;
> > +}
> > +
> > +
> > +
> > +/**
> > + * flexcan_probe - performs the resource initialization
> > + * after detecting the architecture type like "of" or
> > + * "platform" type
> > + * @pdev: pointer to platform device
> > + *
> > + * initialises the resources based on "platform" or "of"
> > + * type architecture.It also registers the FlexCAN with netdev layer.
> > + *
> > + * Return value
> > + * - On Success
> > + * 0
> > + * - On Failure
> > + * error value
> > + */
> > +static int flexcan_probe(struct platform_device *pdev) {
> > + int err;
> > + struct flexcan_resource flexcan_res;
> > + struct device_node *np = pdev->dev.of_node;
> > +
> > + if (np) {
> > + err = flexcan_of_resource_init(&flexcan_res,
> > + &pdev->dev, &flexcan_ops);
> > + if (err) {
> > + dev_err(&pdev->dev, "Flexcan Initialization"
> > + "failed with err (%d)\n", err);
> > + err = -EINVAL;
> > + goto failed_req;
> > + }
> > + }
> > +
> > + err = flexcan_dev_init(&pdev->dev, flexcan_res, &flexcan_ops);
> > + if (err) {
> > + dev_err(&pdev->dev, "Flexcan Initialization failed with err"
> > + "(%d)\n", err);
> > + err = -EINVAL;
> > + goto failed_req;
> > + }
> > +
> > + return 0;
> > + failed_req:
> > + return err;
> > +}
> > +
> > +/**
> > + * flexcan_remove - performs the resource de-initialization
> > + * after detecting the architecture type like "of" or
> > + * "platform" type
> > + * @pdev: pointer to platform device
> > + *
> > + * de-initializez the resources based on "platform" or "of"
> > + * type architecture.It also unregister the FlexCAN with netdev layer.
> > + */
> > +static int flexcan_remove(struct platform_device *pdev) {
> > + struct net_device *dev = platform_get_drvdata(pdev);
> > + struct flexcan_priv *priv = netdev_priv(dev);
> > + struct device_node *np = pdev->dev.of_node;
> > + struct resource *mem;
> > + u64 addr = 0, size;
> > +
> > + unregister_flexcandev(dev);
> > + iounmap(priv->base);
> > +
> > + if (np) {
> > + addr = of_translate_address(pdev->dev.of_node,
> > + of_get_address(pdev->dev.of_node, 0, &size, NULL));
> > + release_mem_region(addr, size);
> > + } clk_put(priv->clk);
> > +
> > + platform_set_drvdata(pdev, NULL);
> > + free_candev(dev);
> > +
> > + return 0;
> > +}
> > +
>
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Industrial Linux Solutions | Phone: +49-231-2826-924 |
> Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
^ permalink raw reply
* Re: BUG: null pointer deref in rt2800usb_get_txwi
From: Marc Kleine-Budde @ 2011-08-09 10:21 UTC (permalink / raw)
To: Gertjan van Wingerde
Cc: Netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, Stanislaw Gruszka
In-Reply-To: <CAL1gcdMTmSZGRzdek1zSS58ha9c7nUXxXBo5P41r22_wgiaMEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 11042 bytes --]
Hello Gertjan,
On 08/09/2011 11:01 AM, Gertjan van Wingerde wrote:
> Hi Marc,
>
> On Tue, Aug 9, 2011 at 10:23 AM, Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
>> Hello,
>>
>> I'm a running a sheeva plug (ARM/kirkwood) with a rt2800 USB stick in AP mode.
>> Bus 001 Device 002: ID 1737:0071 Linksys WUSB600N v1 Dual-Band Wireless-N Network Adapter [Ralink RT2870]
>>
>> kernel is v3.0.1 +
>> 00898a47269ae5e6dda04defad00234b96692d95 rt2x00: fix usage of NULL queue
>> b52398b6e4522176dd125722c72c301015d24520 rt2x00: rt2800: fix zeroing skb structure
>>
>> Which is here for reference:
>> (http://git.pengutronix.de/?p=mkl/linux-2.6.git;a=shortlog;h=refs/heads/wireless/rt2x00/v3.0.1)
>>
>> The Kernel crashes after ~1d with this oopses:
>> (Same oops with stock v3.0.0 and v3.0.1)
>>
>> [69638.429744] Unable to handle kernel NULL pointer dereference at virtual address 000000ac
>> [69638.438515] pgd = c0004000
>> [69638.441322] [000000ac] *pgd=00000000
>> [69638.444974] Internal error: Oops: 17 [#1]
>> [69638.449001] Modules linked in: nfsd nfs lockd fscache auth_rpcgss nfs_acl sunrpc bridge ipv6 stp ext2 arc4 rt2800usb rt2800lib crc_ccitt rt2x00usb rt2x00
>> lib mac80211 cfg80211 rfkill hmac sha1_generic mv_cesa aes_generic ext4 mbcache jbd2 mmc_block ehci_hcd mvsdio usbcore mmc_core mv643xx_eth libphy inet_lro
>> [69638.476620] CPU: 0 Not tainted (3.0.1-100-bs-kirkwood+ #3)
>> [69638.482489] PC is at rt2800usb_get_txwi+0x10/0x1c [rt2800usb]
>> [69638.488273] LR is at rt2800_txdone_entry+0x34/0xe0 [rt2800lib]
>> [69638.494131] pc : [<bf1bb194>] lr : [<bf1affa4>] psr: 80000013
>> [69638.494136] sp : de44df08 ip : 00000001 fp : 00000022
>> [69638.505672] r10: 0000000e r9 : 00000001 r8 : 0000003c
>> [69638.510914] r7 : 00000000 r6 : de6aafc0 r5 : 818c22fd r4 : de6d99c8
>> [69638.517472] r3 : 00000000 r2 : 00000000 r1 : 818c22fd r0 : de6d99c8
>> [69638.524030] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
>> [69638.531371] Control: 0005397f Table: 0105c000 DAC: 00000017
>> [69638.537144] Process kworker/u:0 (pid: 2089, stack limit = 0xde44c270)
>> [69638.543614] Stack: (0xde44df08 to 0xde44e000)
>> [69638.547997] df00: 00000000 818c22fd 00000000 de6aafc0 de6d99c8 818c22fd
>> [69638.556221] df20: df958eb4 bf1b0128 c041a384 de6aafc0 df959600 de6ab3c4 de6ab3c4 c043defc
>> [69638.564443] df40: 00000089 00000012 00000000 bf1bba00 de6ab3c4 c043defc 00000000 df8b86a0
>> [69638.572666] df60: df959600 bf1bb9e8 de6ab3c4 c043defc 00000089 00000012 00000000 c005beac
>> [69638.580881] df80: df8b86a0 df959605 00000081 df8b86a0 de44c000 c043defc c043def4 df8b86b0
>> [69638.589103] dfa0: 00000089 c043defc 00000000 c005ca38 de4c7f30 df8b86a0 c005c878 00000013
>> [69638.597325] dfc0: 00000000 00000000 00000000 c005fdcc 00000000 00000000 df8b86a0 00000000
>> [69638.605542] dfe0: de44dfe0 de44dfe0 de4c7f30 c005fd50 c0030a94 c0030a94 ebfffffe e3500000
>> [69638.613787] [<bf1bb194>] (rt2800usb_get_txwi+0x10/0x1c [rt2800usb]) from [<bf1affa4>] (rt2800_txdone_entry+0x34/0xe0 [rt2800lib])
>> [69638.625518] [<bf1affa4>] (rt2800_txdone_entry+0x34/0xe0 [rt2800lib]) from [<bf1b0128>] (rt2800_txdone+0xd8/0x124 [rt2800lib])
>> [69638.636894] [<bf1b0128>] (rt2800_txdone+0xd8/0x124 [rt2800lib]) from [<bf1bba00>] (rt2800usb_work_txdone+0x18/0x110 [rt2800usb])
>> [69638.648522] [<bf1bba00>] (rt2800usb_work_txdone+0x18/0x110 [rt2800usb]) from [<c005beac>] (process_one_work+0x240/0x404)
>> [69638.659451] [<c005beac>] (process_one_work+0x240/0x404) from [<c005ca38>] (worker_thread+0x1c0/0x2e0)
>> [69638.668722] [<c005ca38>] (worker_thread+0x1c0/0x2e0) from [<c005fdcc>] (kthread+0x7c/0x84)
>> [69638.677036] [<c005fdcc>] (kthread+0x7c/0x84) from [<c0030a94>] (kernel_thread_exit+0x0/0x8)
>> [69638.685433] Code: e5903008 e5933008 e3530010 e590300c (e59300ac)
>> [69638.691726] ---[ end trace 99d4053be7f17aef ]---
>>
>> [69638.699949] Unable to handle kernel paging request at virtual address fffffffc
>> [69638.707210] pgd = c0004000
>> [69638.709930] [fffffffc] *pgd=1fffe831, *pte=00000000, *ppte=00000000
>> [69638.716244] Internal error: Oops: 17 [#2]
>> [69638.720270] Modules linked in: nfsd nfs lockd fscache auth_rpcgss nfs_acl sunrpc bridge ipv6 stp ext2 arc4 rt2800usb rt2800lib crc_ccitt rt2x00usb rt2x00lib mac80211 cfg80211 rfkill hmac sha1_generic mv_cesa aes_generic ext4 mbcache jbd2 mmc_block ehci_hcd mvsdio usbcore mmc_core mv643xx_eth libphy inet_lro
>> [69638.747890] CPU: 0 Tainted: G D (3.0.1-100-bs-kirkwood+ #3)
>> [69638.754628] PC is at kthread_data+0x4/0xc
>> [69638.758650] LR is at wq_worker_sleeping+0xc/0xc0
>> [69638.763292] pc : [<c005ffbc>] lr : [<c005cbb8>] psr: 20000093
>> [69638.763297] sp : de44dc68 ip : c03f1958 fp : de44dcf4
>> [69638.774833] r10: de44c000 r9 : de755d2c r8 : 00000001
>> [69638.780084] r7 : df819ac0 r6 : de755da8 r5 : c03f1910 r4 : 00000000
>> [69638.786641] r3 : 00000000 r2 : 93c085a9 r1 : 00000000 r0 : de755c20
>> [69638.793199] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
>> [69638.800454] Control: 0005397f Table: 1fa78000 DAC: 00000015
>> [69638.806226] Process kworker/u:0 (pid: 2089, stack limit = 0xde44c270)
>> [69638.812696] Stack: (0xde44dc68 to 0xde44e000)
>> [69638.817079] dc60: de755c20 c02d84c8 de7583e0 c01228b4 00000000 00000000
>> [69638.825293] dc80: 00000003 c0048920 00393830 de755c50 0ecbd14a 00000000 0ecbd14a 00000000
>> [69638.833507] dca0: c03f1dcc c0061c4c 0ecbd14a 00000000 de755c20 debe0840 00000001 c041c348
>> [69638.841722] dcc0: de755c20 c0046ffc de755c20 00000001 00000000 de755c20 ffffffff de44dcfc
>> [69638.849945] dce0: df819ac0 00000001 de755d2c de755d2c de755c18 c0048920 bf1bb194 de44dcfc
>> [69638.858168] dd00: de44dcfc de755d74 de44dd1c de44dec0 de44c000 00000001 bf1bb196 de44dd72
>> [69638.866390] dd20: bf1bb194 00000000 00000017 c0033024 de44c270 0000000b 00000001 de44c000
>> [69638.874606] dd40: 65000001 33303935 20383030 33393565 38303033 35336520 31303033 35652030
>> [69638.882827] dd60: 30333039 28206330 33393565 63613030 00002029 00000017 00000022 000000ac
>> [69638.891041] dd80: 00000017 00000000 de44dec0 00000000 00000013 00000017 00000022 c02d5af8
>> [69638.899257] dda0: de755c20 c0036430 40000013 c0038fc0 c0038f74 def76020 00000f40 c0035840
>> [69638.907479] ddc0: dee26460 df900574 df900400 bf010dac ffdf5000 ffdf56e0 00000010 df900524
>> [69638.915702] dde0: 40000013 df9004e4 00000003 00000010 60000093 c0254124 df9004e4 00000006
>> [69638.923916] de00: 00000017 c03ec210 000000ac de44dec0 0000003c 00000013 0000000e c002a1cc
>> [69638.932130] de20: 00000080 00000000 df900598 00000000 de6b4418 df9004e4 c04196a0 de44c000
>> [69638.940344] de40: 00000000 00000001 00000080 00000003 0000012c c02541c0 c043ccf0 0069ca19
>> [69638.948558] de60: 00000000 00000001 0000000c de44c000 c043cce4 0000003c 00000001 00000003
>> [69638.956773] de80: 00000001 c004af7c de8960a0 de755c50 c03f1958 c03f5fb8 0000000a 00000014
>> [69638.964987] dea0: df958eb4 0000000b 00000000 ffffffff de44def4 de6aafc0 00000000 c002f7ac
>> [69638.973201] dec0: de6d99c8 818c22fd 00000000 00000000 de6d99c8 818c22fd de6aafc0 00000000
>> [69638.981415] dee0: 0000003c 00000001 0000000e 00000022 00000001 de44df08 bf1affa4 bf1bb194
>> [69638.989631] df00: 80000013 ffffffff 00000000 818c22fd 00000000 de6aafc0 de6d99c8 818c22fd
>> [69638.997854] df20: df958eb4 bf1b0128 c041a384 de6aafc0 df959600 de6ab3c4 de6ab3c4 c043defc
>> [69639.006076] df40: 00000089 00000012 00000000 bf1bba00 de6ab3c4 c043defc 00000000 df8b86a0
>> [69639.014291] df60: df959600 bf1bb9e8 de6ab3c4 c043defc 00000089 00000012 00000000 c005beac
>> [69639.022514] df80: df8b86a0 df959605 00000081 df8b86a0 de44c000 c043defc c043def4 df8b86b0
>> [69639.030737] dfa0: 00000089 c043defc 00000000 c005ca38 de4c7f30 df8b86a0 c005c878 00000013
>> [69639.038958] dfc0: 00000000 00000000 00000000 c005fdcc 00000000 00000000 df8b86a0 00000001
>> [69639.047175] dfe0: de44dfe0 de44dfe0 de4c7f30 c005fd50 c0030a94 c0030a94 ebfffffe e3500000
>> [69639.055402] [<c005ffbc>] (kthread_data+0x4/0xc) from [<c005cbb8>] (wq_worker_sleeping+0xc/0xc0)
>> [69639.064148] [<c005cbb8>] (wq_worker_sleeping+0xc/0xc0) from [<c02d84c8>] (schedule+0xe8/0x4e8)
>> [69639.072806] [<c02d84c8>] (schedule+0xe8/0x4e8) from [<c0048920>] (do_exit+0x6b8/0x6f8)
>> [69639.080764] [<c0048920>] (do_exit+0x6b8/0x6f8) from [<c0033024>] (die+0x2e4/0x324)
>> [69639.088378] [<c0033024>] (die+0x2e4/0x324) from [<c02d5af8>] (__do_kernel_fault.part.5+0x54/0x74)
>> [69639.097301] [<c02d5af8>] (__do_kernel_fault.part.5+0x54/0x74) from [<c0036430>] (do_page_fault+0x260/0x27c)
>> [69639.107091] [<c0036430>] (do_page_fault+0x260/0x27c) from [<c002a1cc>] (do_DataAbort+0x34/0x98)
>> [69639.115839] [<c002a1cc>] (do_DataAbort+0x34/0x98) from [<c002f7ac>] (__dabt_svc+0x4c/0x60)
>> [69639.124139] Exception stack(0xde44dec0 to 0xde44df08)
>> [69639.129219] dec0: de6d99c8 818c22fd 00000000 00000000 de6d99c8 818c22fd de6aafc0 00000000
>> [69639.137433] dee0: 0000003c 00000001 0000000e 00000022 00000001 de44df08 bf1affa4 bf1bb194
>> [69639.145643] df00: 80000013 ffffffff
>> [69639.149165] [<c002f7ac>] (__dabt_svc+0x4c/0x60) from [<bf1bb194>] (rt2800usb_get_txwi+0x10/0x1c [rt2800usb])
>> [69639.159060] [<bf1bb194>] (rt2800usb_get_txwi+0x10/0x1c [rt2800usb]) from [<bf1affa4>] (rt2800_txdone_entry+0x34/0xe0 [rt2800lib])
>> [69639.170786] [<bf1affa4>] (rt2800_txdone_entry+0x34/0xe0 [rt2800lib]) from [<bf1b0128>] (rt2800_txdone+0xd8/0x124 [rt2800lib])
>> [69639.182164] [<bf1b0128>] (rt2800_txdone+0xd8/0x124 [rt2800lib]) from [<bf1bba00>] (rt2800usb_work_txdone+0x18/0x110 [rt2800usb])
>> [69639.193789] [<bf1bba00>] (rt2800usb_work_txdone+0x18/0x110 [rt2800usb]) from [<c005beac>] (process_one_work+0x240/0x404)
>> [69639.204711] [<c005beac>] (process_one_work+0x240/0x404) from [<c005ca38>] (worker_thread+0x1c0/0x2e0)
>> [69639.213980] [<c005ca38>] (worker_thread+0x1c0/0x2e0) from [<c005fdcc>] (kthread+0x7c/0x84)
>> [69639.222293] [<c005fdcc>] (kthread+0x7c/0x84) from [<c0030a94>] (kernel_thread_exit+0x0/0x8)
>> [69639.230685] Code: c03f42e8 c02dea14 c02dbd08 e590315c (e5130004)
>> [69639.237041] ---[ end trace 99d4053be7f17af0 ]---
>
> There is a patch from Stanislaw floating around that ought to fix this crash.
> You can find the crash at:
patch? :)
> http://marc.info/?l=linux-wireless&m=131279612304597&w=2
>
> However, there is still some discussion on the patch and some more
> tweaking of the patch may be required.
Thanks for the patch.
It's currently compiling - I'll complain it crashes again :)
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox