linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: in_be32() etc
Date: Fri, 24 Feb 2012 07:18:59 +1100	[thread overview]
Message-ID: <1330028339.20389.28.camel@pasglop> (raw)
In-Reply-To: <20120223112915.GT22562@n2100.arm.linux.org.uk>

On Thu, 2012-02-23 at 11:29 +0000, Russell King - ARM Linux wrote:
> What's this stuff doing in generic drivers?

Well, I suppose that's because the xilinx stuff used to be ppc
only ? :-)
 
> See drivers/gpio/gpio-xilinx.c:
> static int xgpio_get(struct gpio_chip *gc, unsigned int gpio)
> {
>         struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
> 
>         return (in_be32(mm_gc->regs + XGPIO_DATA_OFFSET) >> gpio) & 1;
> }
> 
> include/linux/of_gpio.h:
> struct of_mm_gpio_chip {
>         struct gpio_chip gc;
>         void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
>         void __iomem *regs;
> };
> 
> Why am I being asked to add in_be32() etc to ARMs io.h ?  Why do we need
> yet another set of IO accessors?  Is there something wrong with
> ioread*()/ioread*be() etc?

Nope, nothing wrong with them, the driver should be fixed. in_be* is
historical ppc stuff.

> My guess is this stems from a lack of proper review

That or history. Our readX/writeX used to be more PCI specific (have
infrastructure to work around PCI bridge bugs) which some drivers
avoided using the in_/out_ variants, in some case it's just pure
history, etc... Some of these things are ancient.

Cheers,
Ben.

  reply	other threads:[~2012-02-23 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 11:29 in_be32() etc Russell King - ARM Linux
2012-02-23 20:18 ` Benjamin Herrenschmidt [this message]
2012-02-23 20:25   ` Russell King - ARM Linux
2012-02-23 20:27     ` Grant Likely

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=1330028339.20389.28.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    /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).