netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Michael-Luke Jones <mlj28@cam.ac.uk>,
	Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	Russell King <rmk@arm.linux.org.uk>,
	ARM Linux Mailing List <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS
Date: Tue, 08 May 2007 16:31:12 +0200	[thread overview]
Message-ID: <m3fy6775fz.fsf@maximus.localdomain> (raw)
In-Reply-To: <20070508113735.GB32055@xi.wantstofly.org> (Lennert Buytenhek's message of "Tue, 8 May 2007 13:37:35 +0200")

Lennert Buytenhek <buytenh@wantstofly.org> writes:

>> +/* Built-in 10/100 Ethernet MAC interfaces */
>> +static struct mac_plat_info ixdp425_plat_mac[] = {
>> +	{
>> +		.phy		= 0,
>> +		.rxq		= 3,
>> +	}, {
>> +		.phy		= 1,
>> +		.rxq		= 4,
>> +	}
>> +};
>
> As with Christian's driver (I'm feeling like a bit of a broken record
> here :-), putting knowledge of which queue to use (which is firmware-
> specific) in the _board_ support file is almost certainly wrong.
>
> I would just put the port number in there, and let the ethernet
> driver map the port number to the hardware queue number.  After all,
> the ethernet driver knows which queues the firmware uses, while the
> board support code doesn't.

No, quite the opposite. The board code knows its set of hardware
interfaces etc. and can let Ethernet driver use, say, HSS queues.
The driver can't know that.

It would make sense if we had many queues, but it doesn't seem
the case (perhaps the upper queues could be used for some
purposes, but Intel's code doesn't use them either and they
probably know better).

>> +static inline void set_regbits(u32 bits, u32 __iomem *reg)
>> +{
>> +	__raw_writel(__raw_readl(reg) | bits, reg);
>> +}
>> +static inline void clr_regbits(u32 bits, u32 __iomem *reg)
>> +{
>> +	__raw_writel(__raw_readl(reg) & ~bits, reg);
>> +}
>
> I generally discourage the use of such wrappers, as it often makes
> people forget that the set and clear operations are not atomic, and
> it ignores the fact that some of the other bits in the register you
> are modifying might have side-effects.

Without them the code in question is hardly readable, I pick the need
to remember about non-atomicity and possible side effects instead :-)

I've outlined the current versions in a separate mail, generally
2 patches are marked "v.2" and one "v.3".
-- 
Krzysztof Halasa

  reply	other threads:[~2007-05-08 14:31 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-06 23:46 [PATCH 0/3] Intel IXP4xx network drivers Krzysztof Halasa
2007-05-07  0:06 ` [PATCH 1/3] WAN Kconfig: change "depends on HDLC" to "select" Krzysztof Halasa
2007-05-07  1:44   ` Roman Zippel
2007-05-07  9:35     ` Krzysztof Halasa
2007-05-07 11:22       ` Roman Zippel
2007-05-07 11:56         ` Krzysztof Halasa
2007-05-07 13:17           ` Roman Zippel
2007-05-07 13:21             ` Jeff Garzik
2007-05-07 13:46               ` Roman Zippel
2007-05-07 16:50                 ` Krzysztof Halasa
2007-05-07 17:07                   ` Roman Zippel
2007-05-07 18:15                     ` Satyam Sharma
2007-05-07 20:31                       ` Jeff Garzik
2007-05-07 20:49                         ` Satyam Sharma
2007-05-07 20:50                         ` Randy Dunlap
2007-05-07 22:39                           ` Satyam Sharma
2007-05-07 22:52                             ` Randy Dunlap
2007-05-07 20:57                         ` Roman Zippel
2007-05-07 20:54                     ` Krzysztof Halasa
2007-05-07 21:02                     ` [PATCH] Use menuconfig objects II - netdev/wan Krzysztof Halasa
2007-05-07 21:08                     ` [PATCH 1a/3] WAN Kconfig: change "depends on HDLC" to "select" Krzysztof Halasa
2007-05-07  0:07 ` [PATCH 2/3] ARM: include IXP4xx "fuses" support Krzysztof Halasa
2007-05-07  5:24   ` Alexey Zaytsev
2007-05-07 10:24     ` Krzysztof Halasa
2007-05-07  0:07 ` [PATCH 3/3] Intel IXP4xx network drivers Krzysztof Halasa
2007-05-07 12:59   ` Michael-Luke Jones
2007-05-07 17:12     ` Krzysztof Halasa
2007-05-07 17:52       ` Christian Hohnstaedt
2007-05-07 20:00         ` Krzysztof Halasa
2007-05-08 11:48           ` Lennert Buytenhek
2007-05-08 13:47             ` Krzysztof Halasa
2007-05-07 18:14       ` Michael-Luke Jones
2007-05-07 19:57         ` Krzysztof Halasa
2007-05-07 20:18           ` Michael-Luke Jones
2007-05-08 11:46             ` Lennert Buytenhek
2007-05-08  0:11           ` [PATCH] Intel IXP4xx network drivers v.2 Krzysztof Halasa
2007-05-08  0:36           ` [PATCH] Intel IXP4xx network drivers v.2 - NPE Krzysztof Halasa
2007-05-08  7:02             ` Michael-Luke Jones
2007-05-08 13:56               ` Krzysztof Halasa
2007-05-08  0:46           ` [PATCH] Intel IXP4xx network drivers v.3 - QMGR Krzysztof Halasa
2007-05-08  7:05             ` Michael-Luke Jones
2007-05-08 13:57               ` Krzysztof Halasa
2007-05-08 11:32             ` Lennert Buytenhek
2007-05-08 12:47               ` Alexey Zaytsev
2007-05-08 12:59                 ` Lennert Buytenhek
2007-05-08 14:12               ` Krzysztof Halasa
2007-05-08 14:40                 ` Lennert Buytenhek
2007-05-08 16:59                   ` Krzysztof Halasa
2007-05-09 10:21                     ` Lennert Buytenhek
2007-05-10 14:08                       ` Krzysztof Halasa
2007-05-08  1:19           ` [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS Krzysztof Halasa
2007-05-08  5:28             ` Jeff Garzik
2007-05-08  7:22             ` Michael-Luke Jones
2007-05-08 11:37             ` Lennert Buytenhek
2007-05-08 14:31               ` Krzysztof Halasa [this message]
2007-05-08 14:53                 ` Lennert Buytenhek
2007-05-08 17:17                   ` Krzysztof Halasa
2007-05-08 11:40   ` [PATCH 3/3] Intel IXP4xx network drivers Lennert Buytenhek
2007-05-07 10:27 ` [PATCH 2a/3] " Krzysztof Halasa
2007-05-08  1:40 ` [PATCH 0/3] " Krzysztof Halasa
  -- strict thread matches above, loose matches on Subject: below --
2007-05-08  8:26 [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS Mikael Pettersson
2007-05-08  8:35 ` Michael-Luke Jones
2007-05-08  8:29 Tomasz Chmielewski
2007-05-08  8:48 ` Alexey Zaytsev
2007-05-08  8:54   ` Michael-Luke Jones
2007-05-08  8:55   ` Tomasz Chmielewski
2007-05-08 13:44   ` Gordon Farquharson
2007-05-08 15:28   ` Krzysztof Halasa
2007-05-08 15:52     ` Lennert Buytenhek
2007-05-08 17:20       ` Krzysztof Halasa
2007-05-08 17:31         ` Tomasz Chmielewski
2007-05-08 17:51           ` Krzysztof Halasa
2007-05-09  8:58         ` Marcus Better
2007-05-09  9:12           ` Koen Kooi
2007-05-09  9:21           ` Lennert Buytenhek
2007-05-09  9:35             ` Marcus Better
2007-05-09 11:04               ` Lennert Buytenhek
2007-05-09 14:22                 ` David Acker
2007-05-09 14:45                   ` Michael-Luke Jones
2007-05-15 21:20                     ` Lennert Buytenhek
2007-05-08 16:34 ` Krzysztof Halasa
2007-05-16  7:13 ` Christoph Hellwig
2007-05-16  7:35   ` Michael-Luke Jones
2007-05-16  9:41   ` Lennert Buytenhek
2007-05-16 10:20     ` Michael-Luke Jones
2007-05-16 10:46     ` Rod Whitby
2007-05-16 10:56       ` Lennert Buytenhek
2007-05-16 11:35         ` Rod Whitby
2007-05-16 12:00           ` Lennert Buytenhek
2007-05-16 14:58           ` Krzysztof Halasa
2007-05-16 14:44   ` Krzysztof Halasa
2007-05-09 10:35 Mikael Pettersson
2007-05-09 11:07 ` Lennert Buytenhek
2007-05-09 10:58 Tomasz Chmielewski

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=m3fy6775fz.fsf@maximus.localdomain \
    --to=khc@pm.waw.pl \
    --cc=buytenh@wantstofly.org \
    --cc=jeff@garzik.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlj28@cam.ac.uk \
    --cc=netdev@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).