From: Jens Axboe <axboe@suse.de>
To: Daniela Engert <dani@ngrt.de>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
meissner@suse.de, Jeff Garzik <jgarzik@pobox.com>
Subject: Re: sata_sil problem / oops
Date: Thu, 2 Jun 2005 21:30:38 +0200 [thread overview]
Message-ID: <20050602193037.GB13964@suse.de> (raw)
In-Reply-To: <20050602192327.GA13964@suse.de>
On Thu, Jun 02 2005, Jens Axboe wrote:
> On Thu, Jun 02 2005, Daniela Engert wrote:
> > On Thu, 2 Jun 2005 12:03:58 +0200, Marcus Meissner wrote:
> >
> > >We see a problem in the sata_sil driver. The code looks like this:
> > >
> > > cls=sil_get_device_cache_line(pdev);
> > > cls >>= 3;
> > > cls++; /* cls = (line_size/8)+1 */
> > > writeb(cls, mmio_base + SIL_FIFO_R0);
> > > writeb(cls, mmio_base + SIL_FIFO_W0);
> > > writeb(cls, mmio_base + SIL_FIFO_R1);
> > > writeb(cls, mmio_base + SIL_FIFO_W2);
> > >
> > >We have a device where mmio_base is only 0x200 byte long, so
> > >the access to SIL_FIFO_W2 (offset 0x241) causes an Oops.
> > >
> > >- Should it perhaps be W1 instead of W2?
> > >- If not, does it need a range check?
> >
> > My OS/2 driver and the Windows driver write to the following locations:
> >
> > SiI3112: BAR5+0x40, BAR5+0x41, BAR5+0x44, BAR5+0x45
> > SiI3114: BAR5+0x40, BAR5+0x41, BAR5+0x44, BAR5+0x45,
> > BAR5+0x240, BAR5+0x241, BAR5+0x244, BAR5+0x245
>
> Does the 3112 have two ports and the 3114 four?
Seems that is so, from looking at the driver. If I were to guess at a
fix for this, it would be as follows.
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -432,7 +432,13 @@ static int sil_init_one (struct pci_dev
writeb(cls, mmio_base + SIL_FIFO_R0);
writeb(cls, mmio_base + SIL_FIFO_W0);
writeb(cls, mmio_base + SIL_FIFO_R1);
- writeb(cls, mmio_base + SIL_FIFO_W2);
+ writeb(cls, mmio_base + SIL_FIFO_W1);
+ if (ent->driver_data == sil_3114) {
+ writeb(cls, mmio_base + SIL_FIFO_R2);
+ writeb(cls, mmio_base + SIL_FIFO_W2);
+ writeb(cls, mmio_base + SIL_FIFO_R3);
+ writeb(cls, mmio_base + SIL_FIFO_W3);
+ }
} else
printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n",
pci_name(pdev));
--
Jens Axboe
next prev parent reply other threads:[~2005-06-02 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-02 10:03 sata_sil problem / oops Marcus Meissner
2005-06-02 17:24 ` Daniela Engert
2005-06-02 19:23 ` Jens Axboe
2005-06-02 19:30 ` Jens Axboe [this message]
2005-06-02 21:45 ` Jeff Garzik
2005-06-02 19:50 ` Daniela Engert
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=20050602193037.GB13964@suse.de \
--to=axboe@suse.de \
--cc=dani@ngrt.de \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=meissner@suse.de \
/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