All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michal Simek <monstr@monstr.eu>, Arnd Bergmann <arnd@arndb.de>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	<dahinds@users.sourceforge.net>
Subject: Re: [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be)
Date: Thu, 7 Feb 2013 19:28:24 +0400	[thread overview]
Message-ID: <5113C818.9050307@synopsys.com> (raw)
In-Reply-To: <CACxGe6uHx4KdZRgAyL-wQ2GurojAH0eTa6YRCoSuCg89BAvBTA@mail.gmail.com>

On 02/07/2013 07:23 PM, Grant Likely wrote:
> On Thu, Feb 7, 2013 at 3:12 PM, Alexey Brodkin
> <Alexey.Brodkin@synopsys.com> wrote:
>> On 02/07/2013 06:51 PM, Grant Likely wrote:
>>>
>>> On Thu, Feb 7, 2013 at 2:39 PM, Grant Likely <grant.likely@secretlab.ca>
>>> wrote:
>>>>
>>>> On Wed, Feb 6, 2013 at 9:35 PM, Benjamin Herrenschmidt
>>>> <benh@kernel.crashing.org> wrote:
>>>>>>
>>>>>>    In fact, the driver already knows about this and figures
>>>>>> out at runtime how the device is wired up to the bus. This is not the
>>>>>> problem.
>>>>>
>>>>>
>>>>> Except that this is very gross, especially when you observe that in the
>>>>> busted "big endian" case, it has to byteswap the bloody data port.
>>>>>
>>>>> So you end up having to do that gross hack with separate accessors for
>>>>> registers vs. data and not able to use the _rep variants, which also
>>>>> means that on platforms like ppc, you end up with a memory barrier on
>>>>> every access (or more), which is going to slow things down enormously.
>>>>
>>>>
>>>> I don't see why the _rep variants aren't usable here. The only reason
>>>> I didn't use them when I wrote the driver in the first place was I was
>>>> a n00b kernel hacker and I didn't know they were there.
>>>
>>>
>>> The 8-bit variant is different though because the hardware requires
>>> pingponging between odd and even byte addresses to flush the fifo.
>>> Reading a data port even address (0x40) gives the least significant
>>> byte. Reading from an odd address (0x41) give the MSB and pops the
>>> data off the FIFO. So, yes, the _rep variant can't be used in 8-bit
>>> mode. It should still be fine in 16-bit.
>>>
>>> page 45: http://www.xilinx.com/support/documentation/data_sheets/ds080.pdf
>>>
>>
>> Ok, so may I do a re-spin with these changes:
>
> There are two things here. 1) changing the accessors used. 2)
> switching the endianess as a bug fix. Any changes to the endian access
> should be a separate patch which a description of what is needed.
>
>> 1. In "ace_in_be16" use "ioread16be"
>> 2. In "ace_out_be16" use "iowrite16be"
>> 3. In "ace_in_le16" use "ioread16"
>> 4. In "ace_out_le16" use "iowrite16"
>
> Yes
>
>> 5. In "ace_datain_le16" use "ioread16_rep"
>> 6. In "ace_dataout_le16" use "iowrite16_rep"
>
> Maybe. In a separate patch. Hmmm... I guess there isn't an
> ioread16be_rep variant. Oh well. Check first with Michal on LE
> microblaze before making the change. If it doesn't work for him the
> more understanding is needed. I was pretty sure the LE variant already
> worked.
>
>> not sure about items for "ace_datain/out_be16" - what about _rep options
>> here?
>
> ioread16_rep should be fine. The ace_data{in,out}_be16 routines need
> to use the LE accessor. The existing code is definitely correct in
> this respect.

Well, if "ioread16_rep" is used in both "ace_data{in,out}_be16" and 
"ace_data{in,out}_le16" then what is a difference between them?
Whether there's a subtle difference still exists and I cannot see it or 
unified accessor could be used from now on at least for data access.

What do you think?

-Alexey

  reply	other threads:[~2013-02-07 15:28 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 16:02 [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be) Alexey Brodkin
2013-01-29 16:27 ` Arnd Bergmann
2013-01-30 11:03   ` Alexey Brodkin
2013-01-30 11:13     ` Michal Simek
2013-01-30 12:10       ` Vineet Gupta
2013-01-30 12:31         ` Michal Simek
2013-01-30 14:36           ` Arnd Bergmann
2013-02-04  9:26             ` Michal Simek
2013-02-04 17:24               ` Arnd Bergmann
2013-02-05  2:29                 ` Benjamin Herrenschmidt
2013-02-05 10:54                   ` Michal Simek
2013-02-05 12:09                     ` Vineet Gupta
2013-02-05 12:29                       ` Benjamin Herrenschmidt
2013-02-05 12:19                     ` Benjamin Herrenschmidt
2013-02-05 12:38                       ` Michal Simek
2013-02-05 14:03                         ` Alexey Brodkin
2013-02-05 15:12                           ` Arnd Bergmann
2013-02-05 21:01                             ` Benjamin Herrenschmidt
2013-02-06 10:03                             ` Grant Likely
2013-02-06 16:20                               ` Arnd Bergmann
2013-02-06 16:21                               ` Michal Simek
2013-02-07  0:34                                 ` Arnd Bergmann
2013-02-06 17:40                                   ` Michal Simek
2013-02-06 19:51                                     ` Geert Uytterhoeven
2013-02-07  7:23                                       ` Michal Simek
2013-02-07  7:38                                         ` Geert Uytterhoeven
2013-02-07  8:01                                           ` Michal Simek
2013-02-07  8:20                                             ` Geert Uytterhoeven
2013-02-07  8:33                                               ` Arnd Bergmann
2013-02-07 14:19                                                 ` Michal Simek
2013-02-07 23:12                                                   ` Arnd Bergmann
2013-02-11 10:38                                                     ` Michal Simek
2013-02-11 15:26                                                       ` Arnd Bergmann
2013-02-11 15:36                                                         ` Michal Simek
2013-02-11 15:43                                                           ` Arnd Bergmann
2013-02-11 15:57                                                             ` Michal Simek
2013-02-11 16:08                                                               ` Arnd Bergmann
2013-02-12  0:29                                                                 ` Benjamin Herrenschmidt
2013-02-12 11:29                                                                   ` Arnd Bergmann
2013-02-12 10:11                                                                 ` Michal Simek
2013-02-12 11:26                                                                   ` Arnd Bergmann
2013-02-12 12:14                                                                     ` Michal Simek
2013-02-12 13:55                                                                       ` Arnd Bergmann
2013-02-12 12:30                                                                   ` Benjamin Herrenschmidt
2013-02-12  0:25                                                               ` Benjamin Herrenschmidt
2013-02-12 10:03                                                                 ` Michal Simek
2013-02-05 21:00                           ` Benjamin Herrenschmidt
2013-02-05 21:25                             ` Alexey Brodkin
2013-02-05 23:07                               ` Benjamin Herrenschmidt
2013-02-06 10:14                                 ` Grant Likely
2013-02-06 16:27                                   ` Arnd Bergmann
2013-02-06 21:35                                   ` Benjamin Herrenschmidt
2013-02-07 12:09                                     ` Alexey Brodkin
2013-02-07 12:20                                       ` Benjamin Herrenschmidt
2013-02-07 12:23                                         ` Benjamin Herrenschmidt
2013-02-07 14:31                                       ` Michal Simek
2013-02-07 14:35                                         ` Alexey Brodkin
2013-02-07 14:39                                     ` Grant Likely
2013-02-07 14:51                                       ` Grant Likely
2013-02-07 15:12                                         ` Alexey Brodkin
2013-02-07 15:23                                           ` Grant Likely
2013-02-07 15:28                                             ` Alexey Brodkin [this message]
2013-02-07 16:44                                               ` Grant Likely
2013-02-07 16:56                                                 ` Alexey Brodkin
2013-02-07 17:16                                                   ` Grant Likely
2013-02-07 17:22                                                     ` Alexey Brodkin
2013-02-08  7:45                                                       ` Grant Likely
2013-02-07 21:18                                                   ` Benjamin Herrenschmidt
2013-02-07 21:15                                                 ` Benjamin Herrenschmidt
2013-02-07 23:05                                                 ` Arnd Bergmann
2013-02-08  6:19                                                   ` Geert Uytterhoeven
2013-02-08  7:14                                                   ` Grant Likely
2013-02-07 21:09                                             ` Benjamin Herrenschmidt
2013-02-12 17:02                                             ` Michal Simek
2013-02-12 17:25                                               ` Arnd Bergmann
2013-03-21 17:01                                                 ` Alexey Brodkin
2013-06-19  8:56                                                 ` xsysace driver support on arches other than PPC/Microblaze Alexey Brodkin
2013-06-19  9:09                                                   ` Alexey Brodkin
2013-06-19 12:13                                                   ` Andy Shevchenko
2013-06-19 12:56                                                     ` Alexey Brodkin
2013-06-19 14:51                                                       ` Arnd Bergmann
2013-02-07 21:06                                           ` [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be) Benjamin Herrenschmidt
2013-02-05 23:03                         ` Arnd Bergmann
2013-02-06  8:59                           ` Geert Uytterhoeven
2013-02-06 16:18                             ` Arnd Bergmann
2013-02-05 10:45                 ` Michal Simek
  -- strict thread matches above, loose matches on Subject: below --
2013-06-21 14:02 Alexey Brodkin
2013-06-21 14:23 ` Arnd Bergmann
2013-06-21 18:35   ` Alexey Brodkin
2013-06-21 18:40     ` Arnd Bergmann

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=5113C818.9050307@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=dahinds@users.sourceforge.net \
    --cc=geert@linux-m68k.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monstr@monstr.eu \
    /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 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.