All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristen Accardi <kristen.c.accardi@intel.com>
To: Greg KH <greg@kroah.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	acpi-devel@lists.sourceforge.net,
	pcihpd-discuss@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, "Shah,
	Rajesh" <rajesh.shah@intel.com>,
	"Brown, Len" <len.brown@intel.com>
Subject: Re: [ACPI] Re: [Pcihpd-discuss] RE: [patch 2/2] acpi: add ability to derive irq when doing a surpriseremoval of an adapter
Date: Fri, 21 Oct 2005 14:28:34 -0700	[thread overview]
Message-ID: <1129930114.5932.6.camel@whizzy> (raw)
In-Reply-To: <20051019165940.GA2177@kroah.com>

This patch will allow the acpi code to correctly disable the irq when an
adapter has been "surprise" removed.  The INTERRUPT_PIN value is stored
in the pci_dev structure at probe time, and if the acpi code attempts to
read the INTERRUPT_PIN from config space and detects that the adapter is
not present, it will use the stored value instead.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>

---
I've re-worked this patch as you suggested.  the INTERRUPT_PIN was read
in many different places in the code, so I hope that this is the right
place to save off the value.  Thanks for taking a look.

 drivers/acpi/pci_irq.c |   10 ++++++++++
 drivers/pci/probe.c    |    1 +
 include/linux/pci.h    |    1 +
 3 files changed, 12 insertions(+)

Index: linux-2.6.13/drivers/acpi/pci_irq.c
===================================================================
--- linux-2.6.13.orig/drivers/acpi/pci_irq.c
+++ linux-2.6.13/drivers/acpi/pci_irq.c
@@ -504,6 +504,16 @@ void acpi_pci_irq_disable(struct pci_dev
 		return_VOID;
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
+
+	/*
+	 * If a device has been "surprise" removed via
+	 * hotplug, the pin value will be invalid
+	 * In this case, we should use the stored
+	 * pin value from the pci_dev structure
+	 */
+	if (pin == 0xff)
+		pin = dev->pin;
+
 	if (!pin)
 		return_VOID;
 	pin--;
Index: linux-2.6.13/drivers/pci/probe.c
===================================================================
--- linux-2.6.13.orig/drivers/pci/probe.c
+++ linux-2.6.13/drivers/pci/probe.c
@@ -571,6 +571,7 @@ static void pci_read_irq(struct pci_dev 
 	unsigned char irq;
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq);
+	dev->pin = irq;
 	if (irq)
 		pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
 	dev->irq = irq;
Index: linux-2.6.13/include/linux/pci.h
===================================================================
--- linux-2.6.13.orig/include/linux/pci.h
+++ linux-2.6.13/include/linux/pci.h
@@ -98,6 +98,7 @@ struct pci_dev {
 	unsigned int	class;		/* 3 bytes: (base,sub,prog-if) */
 	u8		hdr_type;	/* PCI header type (`multi' flag masked out) */
 	u8		rom_base_reg;	/* which config register controls the ROM */
+	u8		pin;  		/* which interrupt pin this device uses */
 
 	struct pci_driver *driver;	/* which driver has allocated this device */
 	u64		dma_mask;	/* Mask of the bits of bus address this

  reply	other threads:[~2005-10-21 21:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-08  0:56 [patch 2/2] acpi: add ability to derive irq when doing a surpriseremoval of an adapter Li, Shaohua
2005-10-08  0:56 ` Li, Shaohua
2005-10-10 17:48 ` Kristen Accardi
2005-10-10 17:48   ` Kristen Accardi
2005-10-11 17:54 ` Kristen Accardi
2005-10-18 23:57   ` [Pcihpd-discuss] " Kristen Accardi
2005-10-19 15:29     ` [ACPI] " Bjorn Helgaas
2005-10-19 16:51       ` Kristen Accardi
2005-10-19 16:59         ` Greg KH
2005-10-21 21:28           ` Kristen Accardi [this message]
2005-10-22  3:14             ` Bjorn Helgaas
2005-10-22  3:14               ` Bjorn Helgaas
2005-10-19 17:06         ` Matthew Wilcox
2005-10-19 17:06           ` [ACPI] " Matthew Wilcox

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=1129930114.5932.6.camel@whizzy \
    --to=kristen.c.accardi@intel.com \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=bjorn.helgaas@hp.com \
    --cc=greg@kroah.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pcihpd-discuss@lists.sourceforge.net \
    --cc=rajesh.shah@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.