public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Rudolf Marek <r.marek@sh.cvut.cz>, Jordan Crouse <jordan.crouse@amd.com>
Cc: info-linux@ldcmail.amd.com, BGardner@Wabtec.com,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: Re: scx200_acb: Use PCI I/O resource when appropriate
Date: Tue, 11 Apr 2006 22:42:50 +0200	[thread overview]
Message-ID: <20060411224250.9f2b2ead.khali@linux-fr.org> (raw)
In-Reply-To: <443BD961.3050807@sh.cvut.cz>

Hi Rudolf, Jordan,

> Well we had the problem with i2c-viapro and vi686a. Best solution was
> to fail from the probe function - like this:
> 
>          /* Always return failure here.  This is to allow other drivers to bind
>           * to this pci device.  We don't really want to have control over the
>           * pci device, we only wanted to read as few register values from it.
>           */
>          return -ENODEV;
> 
> release_region:
>          release_region(vt596_smba, 8);
>          return error;
> }

True, but we were lucky. You can only do that if you don't need to
access the PCI configuration space during run-time (after the
initialization step) in either driver "sharing" the PCI device. The
i2c-viapro driver qualified, but for example we couldn't do that for
the i2c-i801 driver (block transactions in I2C mode require PCI
configuration register access.)

So depending on the exact hardware context, Jordan may or may not be
able to use the same trick. The other (cleaner) solution is to have an
additional module which registers the PCI device and exports some kind
of interface for the other modules to access the parts they need - but
this requires extra code and makes things much more complex too.

-- 
Jean Delvare

  reply	other threads:[~2006-04-11 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-31 23:03 [PATCH 2.6] scx200_acb: Use PCI I/O resource when appropriate Jordan Crouse
2006-04-11 12:07 ` Jean Delvare
     [not found] ` <LYRIS-4270-45297-2006.04.11-06.08.18--jordan.crouse#amd.com@whitestar.amd.com>
2006-04-11 16:19   ` Jordan Crouse
2006-04-11 16:29     ` [lm-sensors] " Rudolf Marek
2006-04-11 20:42       ` Jean Delvare [this message]
2006-04-11 21:02     ` Jean Delvare

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=20060411224250.9f2b2ead.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=BGardner@Wabtec.com \
    --cc=info-linux@ldcmail.amd.com \
    --cc=jordan.crouse@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=r.marek@sh.cvut.cz \
    /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