linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Paris <jim@jtan.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux IDE <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] Re: PCI IRQ problems -- update
Date: Thu, 16 Dec 2004 06:16:56 -0500	[thread overview]
Message-ID: <20041216111656.GA12740@jim.sh> (raw)
In-Reply-To: <1102851831.1371.23.camel@localhost.localdomain>

Alan Cox wrote:
> > I added a quirk for this case.  This is against 2.6.10-rc3, and it
> > makes all of my problems go away cleanly.  Is this reasonable?
> 
> I think so. You might want to send a copy to linux-ide@vger.kernel.org
> so that Bartlomiej doesn't miss it.

Alan, thanks for the help.

Bartlomiej: I have an ICH3-M controller on my laptop.  The BIOS is
leaving the prog-if as 0x8E (primary = legacy, secondary = native).
When the PCI interrupt is routed (either in the IDE driver's
pci_enable_device, or earlier if pci=routeirq is used), unhandled
interrupts cause IRQ 9 to be disabled, breaking most of my other
hardware.  This seems to be caused by having the nonexistant secondary
interface set to native mode.  According to the datasheet I checked,
having different modes for primary/secondary is not an allowed
combination anyway, so the following PCI quirk checks for this case
and forces both interfaces to legacy if true.

It may make sense to make this more generic (this problem may affect
other PCI IDs as well), or it may be better solved in the IDE driver,
at least when pci=routeirq is not used.  But the following patch does
work well for me.

-jim

--- a/drivers/pci/quirks.c	2004-12-10 19:18:50.000000000 -0500
+++ b/drivers/pci/quirks.c	2004-12-11 16:32:41.000000000 -0500
@@ -717,6 +717,26 @@
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, quirk_svwks_csb5ide );
 
+/*
+ *	Intel 82801CAM ICH3-M datasheet says IDE modes must be the same
+ */
+static void __init quirk_ide_samemode(struct pci_dev *pdev)
+{
+	u8 prog;
+	pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
+	if ( ((prog & 1) && !(prog & 4)) || ((prog & 4) && !(prog & 1)) )
+	{
+		printk(KERN_INFO
+		       "PCI: IDE mode mismatch; forcing legacy mode\n");
+		prog &= ~5;
+		pdev->class &= ~5;
+		pci_write_config_byte(pdev, PCI_CLASS_PROG, prog);
+		/* need to re-assign BARs for compat mode */
+		quirk_ide_bases(pdev);
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, quirk_ide_samemode);
+
 /* This was originally an Alpha specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
  */


       reply	other threads:[~2004-12-16 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041211173538.GA21216@jim.sh>
     [not found] ` <1102783555.7267.37.camel@localhost.localdomain>
     [not found]   ` <20041211202314.GA22731@jim.sh>
     [not found]     ` <20041211220307.GA23848@jim.sh>
     [not found]       ` <1102851831.1371.23.camel@localhost.localdomain>
2004-12-16 11:16         ` Jim Paris [this message]
2005-01-07  2:22           ` [PATCH] Re: PCI IRQ problems -- update Bartlomiej Zolnierkiewicz

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=20041216111656.GA12740@jim.sh \
    --to=jim@jtan.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).