public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-scsi@vger.kernel.org
Subject: Re: Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released
Date: Fri, 13 Dec 2002 18:20:13 -0500	[thread overview]
Message-ID: <20021213232013.GF10883@redhat.com> (raw)
In-Reply-To: <59730000.1039820896@aslan.btc.adaptec.com>

On Fri, Dec 13, 2002 at 04:08:17PM -0700, Justin T. Gibbs wrote:
> > On Fri, Dec 13, 2002 at 09:51:13PM +0000, Christoph Hellwig wrote:
> >> On Fri, Dec 13, 2002 at 04:23:52PM -0500, Doug Ledford wrote:
> >> > Hmmm...what's the failure mode here?
> >> 
> >> It complains that it can't reserve the mem regions but still continues to
> >> setup, download sequencer code, and even register scsi3ff.
> > 
> > Hmmm...are you loading mine or Justin's driver first?  Mine should bail, 
> > not continue, when it can't reserve the requested region.
> 
> If the new driver is loaded second, you'll wind up with a config
> space COMMAND register with both IO space and MEM space disabled.
> The reason for this was to ensure that the aic7xxx controller was
> not responding to a memory or I/O port already requested for a
> *different device*.

Two PCI devices sharing the same I/O or Mem space either one is invalid.  
If the space is allocated to the card, then it *belongs* to that card and
there should never be a conflict.  So, in my driver now, I switched to
using pci_request_regions() (pretty nice helper function actually, it
grabs *all* the pci resources that are assigned to that card and fails if
it can't get all of them).  That's the only thing that really made sense
to me.  Now, I think the *only* thing I might do differently is to move
the pci_enable_device() call to after the pci_request_regions() since
right now the pci_enable_device() is the first thing my driver does (I
wasn't sure, but I thought you might have to call pci_enable_device() to
trigger some resource allocations so that pci_request_regions() would have
all the regions it needs to reserve properly allocated).  But, that should
be fairly safe from a 2 driver standpoint (I'm making the assumption that
calling pci_enabled_device() on an already enabled and live card isn't a
problem, which I think is right but probably warrants a deeper look into
the pci subsys to be sure).  It's also pretty close to identical to what I
do in the eisa/vlb case.

>  I wasn't thinking about a *different driver*
> accessing the same device.  There are other PCI api functions
> that are called prior to the region check too (set powerstate, enable
> device, set dma mask, etc.).  I just don't know how safe you can
> really make it unless the old driver uses the PCI registration API.
> The new driver will fail though if *both* its memory and port addresses
> cannot be mapped.

I had a few things in there before the region check as well.  I just moved 
the region check up to the top, right after pci_enable_device().

> In the other load order, the driver only reserves the region type it is
> using.

Which I think is technically wrong IMHO.  Whether you use the I/O space or
not, it's been allocated to you by the BIOS/PCI subsystem.  If you can't
have control over an area allocated to you then there is a bogon hiding
somewhere in the woodpile.

> The other region is simply disabled in the COMMAND register.  This is
> probably why things are failing.  One driver is using mem I/O.  The other
> is using PIO.
> 
> --
> Justin

-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc. 
         1801 Varsity Dr.
         Raleigh, NC 27606
  

  reply	other threads:[~2002-12-13 23:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-09 23:53 Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released Justin T. Gibbs
2002-12-10  0:12 ` Christoph Hellwig
2002-12-10  0:33   ` Justin T. Gibbs
2002-12-10 13:14     ` Christoph Hellwig
2002-12-10 16:02       ` James Bottomley
2002-12-10 20:03         ` Justin T. Gibbs
2002-12-10 20:58           ` James Bottomley
     [not found]         ` <20021211135855.A19325@infradead.org>
2002-12-11 15:18           ` Justin T. Gibbs
2002-12-11 15:39             ` Christoph Hellwig
2002-12-11 16:08               ` Justin T. Gibbs
2002-12-11 16:23                 ` Christoph Hellwig
2002-12-12  7:16                   ` Jens Axboe
2002-12-12 17:20                     ` Justin T. Gibbs
2002-12-12 17:38                       ` Jens Axboe
2002-12-13 21:06                         ` Christoph Hellwig
2002-12-14 10:42                           ` Jens Axboe
2002-12-11 17:06                 ` Alan Cox
2002-12-11 17:31               ` Justin T. Gibbs
2002-12-11 18:17                 ` Christoph Hellwig
2002-12-11 20:23                   ` Justin T. Gibbs
2002-12-12 20:20                   ` Doug Ledford
2002-12-12 20:39                     ` Christoph Hellwig
2002-12-12 21:06                     ` Justin T. Gibbs
2002-12-13 21:02                     ` Christoph Hellwig
2002-12-13 21:23                       ` Doug Ledford
2002-12-13 21:37                         ` Justin T. Gibbs
2002-12-13 21:51                         ` Christoph Hellwig
2002-12-13 22:52                           ` Doug Ledford
2002-12-13 23:08                             ` Justin T. Gibbs
2002-12-13 23:20                               ` Doug Ledford [this message]
2002-12-13 23:32                                 ` Justin T. Gibbs
2002-12-14 21:55               ` Gérard Roudier
2002-12-14 23:29                 ` Justin T. Gibbs
2002-12-19 18:56                   ` scsi_scan.c complaints Doug Ledford
2002-12-21  1:29                     ` Doug Ledford
2002-12-12  5:51         ` Aic7xxx v6.2.22 and Aic79xx v1.3.0Alpha2 Released Andrew Morton
2002-12-12 14:51           ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2002-12-14  5:57 Milton D. Miller II

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=20021213232013.GF10883@redhat.com \
    --to=dledford@redhat.com \
    --cc=gibbs@scsiguy.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox