All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Graeme Russ <graeme.russ@gmail.com>, linux-ide@vger.kernel.org
Subject: Re: [PATCH] Add hook for custom xfer function in PATA Platform driver
Date: Mon, 10 May 2010 14:03:30 +0400	[thread overview]
Message-ID: <4BE7D9F2.4070006@ru.mvista.com> (raw)
In-Reply-To: <4BE7D714.9010006@ru.mvista.com>

Hello.

Sergei Shtylyov wrote:

>>>> other devices on the bus). By overriding the data transfer function 
>>>> I can
>>>> arbitrate access to the bus and switch the bus timings based on the
>>>> peripheral being accessed. This cannot be done be a generic data 
>>>> transfer
>>>> function.
>>>>         
>>>   I disagree with your approach of overriding the libata methods at the
>>> board level, so I suggest to write a new driver. This is too 
>>> complicated
>>> stuff for poor old pata_platform. :-)
>>>     
>>
>> My custom function to date looks like:
>>
>> unsigned int ata_enet_data_xfer(struct ata_device *dev, unsigned char 
>> *buf,
>>                    unsigned int buflen, int rw)
>> {
>>     struct ata_port *ap = dev->link->ap;
>>     void __iomem *data_addr = ap->ioaddr.data_addr;
>>
>>     set_gp_bus_slow();
>>     /* Transfer bytes */
>>     if (rw == READ)
>>         ioread8_rep(data_addr, buf, buflen);
>>     else
>>         iowrite8_rep(data_addr, buf, buflen);
>>
>>     set_gp_bus_fast();
>>     return buflen;
>> }
>>
>> set_gp_bus_slow() and set_gp_bus_fast() (at the moment) simply set a few
>> config registers to set the GP bus timing (no arbitration yet, but these

   BTW, do you know that there are different ATA PIO transfer modes with 
different timings?

>> functions will also handle that using a mutex). I don't see the point in
>> re-writing the entire PATA Platform driver when the existing driver 
>> appears
>> to be perfectly capable with a very minor extension hook.
>>   
>
>   As I said, we *can't* implement the driver methods at the board 
> level. Especially if they involve messing with timings -- that's the 
> point where the ATA driver stops being generic, like pata_platform, 
> and there arises a need for the dedicated driver. Also, your patch 
> would bring in disparity with the ide-platfrom driver (which should be 
> interchangeable with pata_platfrom). For me, the need of a separate 
> driver is clear now, so I'll remain opposed to your patch. Of course, 
> the maintainer (Jeff Garzik) will decide but if I could veto this 
> patch I would.

   At the very least, you should remove 'struct ata_device *' parameter 
from your hook, so that it could be called from the IDE driver also. 
Without this change, the patch will remain totally unacceptable.

>> Graeme
> Regards,

WBR, Sergei


  reply	other threads:[~2010-05-10 10:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09  5:21 [PATCH] Add hook for custom xfer function in PATA Platform driver Graeme Russ
     [not found] ` <4BE6910D.9070504@ru.mvista.com>
2010-05-09 11:29   ` Graeme Russ
2010-05-09 13:36     ` Sergei Shtylyov
2010-05-10  0:10       ` Graeme Russ
2010-05-10  9:51         ` Sergei Shtylyov
2010-05-10 10:03           ` Sergei Shtylyov [this message]
2010-05-11  0:25           ` Robert Hancock
2010-05-12 20:58             ` Sergei Shtylyov
2010-05-13  4:00               ` Graeme Russ
2010-05-13 21:02                 ` Sergei Shtylyov
2010-05-14  4:04                   ` Graeme Russ
2010-05-26 14:05                     ` Sergei Shtylyov
2010-06-09 12:36                       ` Graeme Russ
2010-05-11  9:55           ` Alan Cox
2010-05-12 20:30             ` Sergei Shtylyov
2010-05-12 23:13               ` Alan Cox
2010-05-13  4:09                 ` Graeme Russ
2010-05-13 21:22                   ` Sergei Shtylyov
2010-05-13 22:30                     ` Alan Cox
2010-05-14  4:37                     ` Graeme Russ
2010-05-26 14:26                       ` Sergei Shtylyov

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=4BE7D9F2.4070006@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=graeme.russ@gmail.com \
    --cc=linux-ide@vger.kernel.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 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.