public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga•com>
To: Olof Johansson <olof@lixom•net>
Cc: ppcdev <linuxppc-dev@ozlabs•org>, Christoph Hellwig <hch@lst•de>
Subject: Re: [PATCH v2] pcmcia: CompactFlash driver for PA Semi Electra boards
Date: Wed, 27 Jun 2007 06:20:38 -0500	[thread overview]
Message-ID: <3d37f1da59dc2a063a06bbd6092ed96a@bga.com> (raw)
In-Reply-To: <20070625171221.GA6684@lixom.net>

> On Mon, Jun 25, 2007 at 08:39:09PM +0100, Christoph Hellwig wrote:
>> On Mon, Jun 25, 2007 at 12:12:21PM -0500, Olof Johansson wrote:
>>> Driver for the CompactFlash slot on the PA Semi Electra eval board. 
>>> It's
>>> a simple device sitting on localbus, with interrupts and 
>>> detect/voltage
>>> control over GPIO.
>>>
>>> The driver is implemented as an of_platform driver, and adds localbus
>>> as a bus being probed by the of_platform framework.
>>
>> Looks good to me. The only odd thing is the inconsistant use of
>> #ifdef CONFIG_PCMCIA in setup.c.
>
> The ifdef is needed since for CONFIG_PCMCIA=n builds, the bus notifier
> isn't available. I wanted to do the bus notifier registration 
> explicitly
> before the of_platform bus probe to avoid later surprises due to 
> reordered
> initcalls in case it was split up in it's own initcall.

If CONFIG_PCMCIA=m then your notifier is not registered.  The modprobe 
of your of_driver loads ds.ko, registers the bus, then registers your 
driver.  When the socket driver tries to dma, the BUG in dma_64 for no 
archdata.dma_ops triggers.

It seems like we need

(1) a notifier that a bus is registered, run before allowing any 
devices, so that platforms can register bus notifiers by bus name 
before the devices and drivers are registered.

(2) a powerpc64 generic pcmcia bus notifier that copys the dma ops from 
the parent socket.

(3) something to set the dma_ops to direct_dma_ops on the of device.

If we don't want (3) to be in the driver (as Christoph previosly 
mentioned), then it needs to be a seperate bus that reuses the of 
matching.  This would be similar to how ibmebus is setup.   If I 
remember the discussion, ibmebus is to provide the alternate dma ops 
and steals match etc code from the of_platform bus type.


Oh, is this why you have depends on PCMCIA=y ?


> I could add the code under ifdef as well, but it didn't seem too
> critical. Once the second major board comes along I'll probably move it
> out to a per-board file, there's no real need for it just yet.

milton

  parent reply	other threads:[~2007-06-27 11:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  1:03 [PATCH] pcmcia: CompactFlash driver for PA Semi Electra boards Olof Johansson
2007-06-25  5:56 ` Christoph Hellwig
2007-06-25 15:50   ` Olof Johansson
2007-06-25 17:12 ` [PATCH v2] " Olof Johansson
2007-06-25 19:39   ` Christoph Hellwig
2007-06-25 20:43     ` Olof Johansson
2007-07-05 14:49       ` [PATCH v3] " Olof Johansson
2007-07-20 23:48         ` Andrew Morton
2007-07-21 20:18           ` Olof Johansson
2007-08-31  2:43         ` [PATCH -mm] pcmcia: Updates to electra_cf driver Olof Johansson
2007-06-27 11:20   ` Milton Miller [this message]
2007-07-05 14:37     ` [PATCH v2] pcmcia: CompactFlash driver for PA Semi Electra boards Olof Johansson
2007-06-27 11:20 ` [PATCH] " Milton Miller
2007-07-05 14:36   ` Olof Johansson

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=3d37f1da59dc2a063a06bbd6092ed96a@bga.com \
    --to=miltonm@bga$(echo .)com \
    --cc=hch@lst$(echo .)de \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=olof@lixom$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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