linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Sagar Borikar <sagar.borikar@gmail.com>
Cc: Linux IDE mailing list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] Removing PCI dependency of ahci and making it amba bus compatible
Date: Sun, 29 Mar 2009 22:26:49 -0400	[thread overview]
Message-ID: <49D02DE9.4080106@garzik.org> (raw)
In-Reply-To: <3fb94e50903291900x2caac3c7nc30c842015570089@mail.gmail.com>

Sagar Borikar wrote:
> Thanks Jeff! Much appreciated all your comments.
> Shall send the modified patch soon.
> 
> On Mon, Mar 30, 2009 at 4:16 AM, Jeff Garzik <jgarzik@pobox.com> wrote:
>> Comments:
>>
>> * I am concerned at the unmodified duplication of so much code.  Given that
>> so little core AHCI modification was done, I would be interested in
>> exploring alternatives to wholesale code duplication.
> 
> So do you want to have a new file for ahci amba changes?

Well, two alternatives come to mind:

* add amba changes to ahci.c.  Plenty of drivers are multi-bus, and AHCI 
need not be any different.  sata_mv works on PCI and SoC embedded, for 
example.

* create libahci.c containing most of the code, and let ahci.c and 
ahci-amba.c contain only bus-specific code.

I would lean towards the first solution.


>> * ahci_configure_dma_masks() is wrong.  You must call generic DMA mapping
>> API or amba bus DMA mapping API (if exists), since you cannot call PCI DMA
>> mapping API.
> 
> amba doesn't have dma mapping. So that's why I explicitly set the dma
> mapping stuff for platform specific although I haven't done that port
> specific.

All Linux architectures must support the generic DMA mapping interface, 
even if it is a no-op implementation like i386.

If you peek "under the hood", the PCI DMA mapping interface is really 
just a wrapper for the generic DMA interface.

The right thing to do is convert AHCI's DMA mask setup code from PCI DMA 
mapping to generic DMA mapping API, and then make sure that amba fully 
implements the generic DMA mapping API.

Regards,

	Jeff




      parent reply	other threads:[~2009-03-30  2:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 14:00 [PATCH] Removing PCI dependency of ahci and making it amba bus compatible Sagar Borikar
2009-03-27  1:08 ` Tejun Heo
2009-03-27  1:10   ` Tejun Heo
2009-03-29 22:46 ` Jeff Garzik
     [not found]   ` <3fb94e50903291900x2caac3c7nc30c842015570089@mail.gmail.com>
2009-03-30  2:26     ` Jeff Garzik [this message]

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=49D02DE9.4080106@garzik.org \
    --to=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=sagar.borikar@gmail.com \
    /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).