From: Tejun Heo <htejun@gmail.com>
To: "Nelson A. de Oliveira" <naoliv@gmail.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Jeff Garzik <jgarzik@pobox.com>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
alan@lxorguk.ukuu.org.uk
Subject: Re: PROBLEM: (libata) cdrom drive not detected in -mm series
Date: Wed, 13 Sep 2006 22:37:43 +0900 [thread overview]
Message-ID: <20060913133743.GF21866@htj.dyndns.org> (raw)
In-Reply-To: <9bfa9ae0609120430g7d557c8ds3fe802e1ddfffb27@mail.gmail.com>
[adding Alan to this thread]
The whole thread can be read from
http://thread.gmane.org/gmane.linux.kernel/445543/focus=445669
On Tue, Sep 12, 2006 at 08:30:50AM -0300, Nelson A. de Oliveira wrote:
> Hi!
>
> On 9/12/06, Tejun Heo <htejun@gmail.com> wrote:
> >Nelson A. de Oliveira wrote:
> >> My USB CD-ROM drive (that is detected as a SCSI drive) is not being
> >> detected on the -mm series of the Kernel.
> >
> >s/USB/SATA/, I presume.
>
> Yes, sorry!
>
> >[--snip--]
> >-ata2.00: ATAPI, max UDMA/33
> >-ata2.00: configured for UDMA/33
> >- Vendor: HL-DT-ST Model: CDRW/DVD GCC4244 Rev: B101
> >- Type: CD-ROM ANSI SCSI revision: 05
> >
> >Argh... yet another PCS problem. With whole -mm applied, does adding
> >kernel parameter 'ata_piix.force_pcs=1' make any difference?
>
> No. Tried with latest 2.6.18-rc6-mm2 and still not detected.
>
> >Please provide the following info.
> >
> >* the result of 'lspci -nvvv'
> >
> >* dmesg output with the attached patch applied (on top of -mm).
>
> Applied the patch and sending the output of lspci and dmesg.
It seems that we screwed up while making two combined ports handled by
single host. irq2 for the second port is added but other than that
the second port shared everything w/ the first port including port
flags, port ops and transfer masks. In your case, this resulted in
the PATA ports handled as SATA ports resulting in misdetection. I
missed this because combined on my mobo puts IDE port first, so SATA
ports doesn't get PCS check which works in most cases.
Can you verify whether the following patch fixes your problem?
Jeff, this doesn't affect upstream-fixes, so this isn't a showstopper
for 2.6.18. The only left one is Keith's case but he's on road and
won't be able to test proposed fix till 18th. I'll try to reproduce
it here.
Thanks.
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1c93154..bb66a12 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5269,11 +5269,19 @@ void ata_port_init(struct ata_port *ap,
ap->host = host;
ap->dev = ent->dev;
ap->port_no = port_no;
- ap->pio_mask = ent->pio_mask;
- ap->mwdma_mask = ent->mwdma_mask;
- ap->udma_mask = ent->udma_mask;
- ap->flags |= ent->port_flags;
- ap->ops = ent->port_ops;
+ if (port_no == 1 && ent->pinfo2) {
+ ap->pio_mask = ent->pinfo2->pio_mask;
+ ap->mwdma_mask = ent->pinfo2->mwdma_mask;
+ ap->udma_mask = ent->pinfo2->udma_mask;
+ ap->flags |= ent->pinfo2->flags;
+ ap->ops = ent->pinfo2->port_ops;
+ } else {
+ ap->pio_mask = ent->pio_mask;
+ ap->mwdma_mask = ent->mwdma_mask;
+ ap->udma_mask = ent->udma_mask;
+ ap->flags |= ent->port_flags;
+ ap->ops = ent->port_ops;
+ }
ap->hw_sata_spd_limit = UINT_MAX;
ap->active_tag = ATA_TAG_POISON;
ap->last_ctl = 0xFF;
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 7605028..e72ed8d 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -858,6 +858,7 @@ ata_pci_init_native_mode(struct pci_dev
probe_ent->port[p].bmdma_addr = bmdma;
}
ata_std_ports(&probe_ent->port[p]);
+ probe_ent->pinfo2 = port[1];
p++;
}
@@ -907,6 +908,7 @@ static struct ata_probe_ent *ata_pci_ini
probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
}
ata_std_ports(&probe_ent->port[1]);
+ probe_ent->pinfo2 = port[1];
} else
probe_ent->dummy_port_mask |= ATA_PORT_SECONDARY;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 8715305..ff67e75 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -361,6 +361,14 @@ struct ata_probe_ent {
unsigned long _host_flags;
void __iomem *mmio_base;
void *private_data;
+
+ /* port_info for the secondary port. Together with irq2, it's
+ * used to implement non-uniform secondary port. Currently,
+ * the only user is ata_piix combined mode. This workaround
+ * will be removed together with ata_probe_ent when init model
+ * is updated.
+ */
+ const struct ata_port_info *pinfo2;
};
struct ata_host {
next prev parent reply other threads:[~2006-09-13 13:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 1:02 Nelson A. de Oliveira
2006-09-12 7:41 ` Tejun Heo
2006-09-12 11:30 ` Nelson A. de Oliveira
2006-09-13 13:37 ` Tejun Heo [this message]
2006-09-13 14:45 ` Alan Cox
2006-09-14 0:41 ` Nelson A. de Oliveira
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=20060913133743.GF21866@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naoliv@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
all inboxes | Powered by JetHome®