From: Richard Cochran <richardcochran@gmail.com> To: Krzysztof Halasa <khc@pm.waw.pl> Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, netdev@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>, Arnd Bergmann <arnd@arndb.de>, Christoph Lameter <cl@linux.com>, David Miller <davem@davemloft.net>, John Stultz <johnstul@us.ibm.com>, Peter Zijlstra <peterz@infradead.org>, Rodolfo Giometti <giometti@linux.it>, Thomas Gleixner <tglx@linutronix.de> Subject: Re: [PATCH V8 12/13] ptp: Added a clock driver for the IXP46x. Date: Fri, 7 Jan 2011 18:07:52 +0100 [thread overview] Message-ID: <20110107170752.GB8666@riccoc20.at.omicron.at> (raw) In-Reply-To: <m3ei8plpa0.fsf@intrepid.localdomain> Krzysztof, Thanks for your review. I have some responses, below. But before that, I have a big favor to ask you. Can you please look at the TODO in my patch and give me a hint? I don't know how to relate the port instance (NPE A,B,C) to the two time stamping channels. On Thu, Jan 06, 2011 at 10:01:59PM +0100, Krzysztof Halasa wrote: > Richard Cochran <richardcochran@gmail.com> writes: > > + u32 SrcUUIDHi; /* 0x5C Sequence Identifier/Source UUID0 High */ > > I don't like these XxxYyyZzz either :-( Okay, I'll change that. > > +static void do_tx_timestamp(struct port *port, struct sk_buff *skb) > > +{ > > +#ifdef __ARMEB__ ... > > +#endif > > +} > > And what if we're little-endian? It is a NOOP in that case. > Why does it depend on BE? The time stamp code clones the skb, but the LE version frees the skb too early. Perhaps we can move that dev_kfree_skb(skb) in the LE case to be the last statement in eth_xmit(). What do you think? > > > @@ -1171,6 +1357,11 @@ static int __devinit eth_init_one(struct platform_device *pdev) > > char phy_id[MII_BUS_ID_SIZE + 3]; > > int err; > > > > + if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) { > > + pr_err("ixp4xx_eth: bad ptp filter\n"); > > + return -EINVAL; > > + } > > + > > if (!(dev = alloc_etherdev(sizeof(struct port)))) > > return -ENOMEM; > > Shouldn't it depend on CPU type? It won't hurt to init the BPF unconditionally. The important bits are checked with cpu_is_ixp46x(). > BTW which CPU is required? IXP46x (455/460/465)? Does it work on 43x? IIRC, it does not work on 43x. I don't know about 455 and 460, but I can find out... > > + if (NO_IRQ == irq) > > + return NO_IRQ; > > Don't like these either :-( Do you mean, you don't like the constant on the left hand side? Is that prohibited by CodingStyle or similar? I got into the habit of writing it that way to prevent a typo like: if (irq = NO_IRQ) > Not showstoppers but... > > Also I don't like the ixp_read/ixp_write() trivial macros. Why not > simply call __raw_readl() and __raw_writel()? Well, I have had the experience back in 2.4 days of having my drivers ruined by the changing IO macros in the kernel. The wrappers are supposed to help if that ever happens again. Seeing *two* leading underscores in the macro names certainly makes me nervous. Thanks again, Richard
WARNING: multiple messages have this Message-ID (diff)
From: Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Krzysztof Halasa <khc-9GfyWEdoJtJmR6Xm/wNWPw@public.gmane.org> Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Alan Cox <alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>, Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>, John Stultz <johnstul-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>, Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>, Rodolfo Giometti <giometti-k2GhghHVRtY@public.gmane.org>, Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> Subject: Re: [PATCH V8 12/13] ptp: Added a clock driver for the IXP46x. Date: Fri, 7 Jan 2011 18:07:52 +0100 [thread overview] Message-ID: <20110107170752.GB8666@riccoc20.at.omicron.at> (raw) In-Reply-To: <m3ei8plpa0.fsf-gTjgKJgtlHj77SC2UrCW1FMQynFLKtET@public.gmane.org> Krzysztof, Thanks for your review. I have some responses, below. But before that, I have a big favor to ask you. Can you please look at the TODO in my patch and give me a hint? I don't know how to relate the port instance (NPE A,B,C) to the two time stamping channels. On Thu, Jan 06, 2011 at 10:01:59PM +0100, Krzysztof Halasa wrote: > Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > > + u32 SrcUUIDHi; /* 0x5C Sequence Identifier/Source UUID0 High */ > > I don't like these XxxYyyZzz either :-( Okay, I'll change that. > > +static void do_tx_timestamp(struct port *port, struct sk_buff *skb) > > +{ > > +#ifdef __ARMEB__ ... > > +#endif > > +} > > And what if we're little-endian? It is a NOOP in that case. > Why does it depend on BE? The time stamp code clones the skb, but the LE version frees the skb too early. Perhaps we can move that dev_kfree_skb(skb) in the LE case to be the last statement in eth_xmit(). What do you think? > > > @@ -1171,6 +1357,11 @@ static int __devinit eth_init_one(struct platform_device *pdev) > > char phy_id[MII_BUS_ID_SIZE + 3]; > > int err; > > > > + if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) { > > + pr_err("ixp4xx_eth: bad ptp filter\n"); > > + return -EINVAL; > > + } > > + > > if (!(dev = alloc_etherdev(sizeof(struct port)))) > > return -ENOMEM; > > Shouldn't it depend on CPU type? It won't hurt to init the BPF unconditionally. The important bits are checked with cpu_is_ixp46x(). > BTW which CPU is required? IXP46x (455/460/465)? Does it work on 43x? IIRC, it does not work on 43x. I don't know about 455 and 460, but I can find out... > > + if (NO_IRQ == irq) > > + return NO_IRQ; > > Don't like these either :-( Do you mean, you don't like the constant on the left hand side? Is that prohibited by CodingStyle or similar? I got into the habit of writing it that way to prevent a typo like: if (irq = NO_IRQ) > Not showstoppers but... > > Also I don't like the ixp_read/ixp_write() trivial macros. Why not > simply call __raw_readl() and __raw_writel()? Well, I have had the experience back in 2.4 days of having my drivers ruined by the changing IO macros in the kernel. The wrappers are supposed to help if that ever happens again. Seeing *two* leading underscores in the macro names certainly makes me nervous. Thanks again, Richard
next prev parent reply other threads:[~2011-01-07 17:08 UTC|newest] Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-12-31 19:11 [PATCH V8 00/13] ptp: IEEE 1588 hardware clock support Richard Cochran 2010-12-31 19:11 ` Richard Cochran 2010-12-31 19:12 ` [PATCH V8 01/13] time: Introduce timekeeping_inject_offset John Stultz 2010-12-31 19:12 ` John Stultz 2011-01-06 22:00 ` Arnd Bergmann 2011-01-06 22:00 ` Arnd Bergmann 2011-01-06 22:00 ` Arnd Bergmann 2010-12-31 19:12 ` [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit Richard Cochran 2010-12-31 19:12 ` Richard Cochran 2011-01-01 20:38 ` Kuwahara,T. 2011-01-01 20:38 ` Kuwahara,T. 2011-01-08 17:50 ` Richard Cochran 2011-01-08 17:50 ` Richard Cochran 2011-01-09 21:07 ` Kuwahara,T. 2011-01-09 21:07 ` Kuwahara,T. 2011-01-10 7:17 ` Richard Cochran 2011-01-10 7:17 ` Richard Cochran 2011-01-10 20:47 ` Kuwahara,T. 2011-01-10 20:47 ` Kuwahara,T. 2011-01-10 21:11 ` john stultz 2011-01-11 11:09 ` Richard Cochran 2011-01-10 7:22 ` Richard Cochran 2011-01-10 16:49 ` john stultz 2011-01-10 16:49 ` john stultz 2011-01-10 20:45 ` Kuwahara,T. 2011-01-10 20:45 ` Kuwahara,T. 2011-01-10 21:06 ` john stultz 2011-01-10 21:06 ` john stultz 2011-01-11 20:32 ` Kuwahara,T. 2011-01-11 20:32 ` Kuwahara,T. 2011-01-11 20:55 ` john stultz 2011-01-11 20:55 ` john stultz 2011-01-12 20:39 ` Kuwahara,T. 2011-01-12 20:55 ` john stultz 2011-01-12 20:55 ` john stultz 2010-12-31 19:13 ` [PATCH V8 03/13] posix clocks: introduce a syscall for clock tuning Richard Cochran 2010-12-31 19:13 ` [PATCH V8 04/13] posix_clocks: add clock_adjtime for arm Richard Cochran 2010-12-31 19:13 ` Richard Cochran 2010-12-31 19:14 ` [PATCH V8 05/13] posix_clocks: add clock_adjtime for blackfin Richard Cochran 2010-12-31 19:14 ` [PATCH V8 06/13] posix_clocks: add clock_adjtime for powerpc Richard Cochran 2010-12-31 19:14 ` [PATCH V8 07/13] posix_clocks: add clock_adjtime for x86 Richard Cochran 2010-12-31 19:15 ` [PATCH V8 08/13] posix clocks: cleanup the CLOCK_DISPTACH macro Richard Cochran 2010-12-31 19:15 ` Richard Cochran 2011-01-03 9:29 ` Peter Zijlstra 2011-01-03 11:51 ` Richard Cochran 2011-01-03 11:51 ` Richard Cochran 2011-01-11 12:57 ` Thomas Gleixner 2011-01-11 12:57 ` Thomas Gleixner 2011-01-12 7:37 ` Richard Cochran 2011-01-12 7:37 ` Richard Cochran 2011-01-12 11:16 ` Thomas Gleixner 2011-01-12 11:16 ` Thomas Gleixner 2011-01-12 12:17 ` Richard Cochran 2011-01-13 4:30 ` Richard Cochran 2011-01-13 4:30 ` Richard Cochran 2011-01-13 11:25 ` Thomas Gleixner 2011-01-13 11:25 ` Thomas Gleixner 2010-12-31 19:15 ` [PATCH V8 09/13] posix clocks: introduce dynamic clocks Richard Cochran 2010-12-31 19:15 ` Richard Cochran 2011-01-06 19:56 ` Arnd Bergmann 2011-01-06 19:56 ` Arnd Bergmann 2011-01-07 16:41 ` Richard Cochran 2010-12-31 19:16 ` [PATCH V8 10/13] ptp: Added a brand new class driver for ptp clocks Richard Cochran 2010-12-31 19:16 ` [PATCH V8 11/13] ptp: Added a clock that uses the eTSEC found on the MPC85xx Richard Cochran 2010-12-31 19:16 ` Richard Cochran 2010-12-31 19:17 ` [PATCH V8 12/13] ptp: Added a clock driver for the IXP46x Richard Cochran 2010-12-31 19:17 ` Richard Cochran 2011-01-06 21:01 ` Krzysztof Halasa 2011-01-07 17:07 ` Richard Cochran [this message] 2011-01-07 17:07 ` Richard Cochran 2011-01-08 16:25 ` Krzysztof Halasa 2011-01-08 16:25 ` Krzysztof Halasa 2011-01-10 20:24 ` Krzysztof Halasa 2011-01-10 20:24 ` Krzysztof Halasa 2010-12-31 19:17 ` [PATCH V8 13/13] ptp: Added a clock driver for the National Semiconductor PHYTER Richard Cochran 2010-12-31 19:17 ` Richard Cochran
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20110107170752.GB8666@riccoc20.at.omicron.at \ --to=richardcochran@gmail.com \ --cc=alan@lxorguk.ukuu.org.uk \ --cc=arnd@arndb.de \ --cc=cl@linux.com \ --cc=davem@davemloft.net \ --cc=giometti@linux.it \ --cc=johnstul@us.ibm.com \ --cc=khc@pm.waw.pl \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=netdev@vger.kernel.org \ --cc=peterz@infradead.org \ --cc=tglx@linutronix.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.