All of lore.kernel.org
 help / color / mirror / Atom feed
From: Myron Stowe <myron.stowe@hp.com>
To: minyard@acm.org
Cc: linux-acpi@vger.kernel.org,
	openipmi-developer@lists.sourceforge.net, lenb@kernel.org
Subject: [PATCH 2/4] ipmi: Remove SPMI table based device discovery method
Date: Wed, 03 Mar 2010 20:44:15 -0700	[thread overview]
Message-ID: <20100304034415.30205.59685.stgit@bob.kio> (raw)
In-Reply-To: <20100304033146.30205.68689.stgit@bob.kio>

Remove optional ACPI static Service Processor Management Interface
(SPMI) table based IPMI device discovery mechanism.

The SPMI table is available for use as an early boot process device
description mechanism (i.e. prior to the availability of the OS to
utilize ACPI, namespace based [IPI001], control methods) however,
‘Plug-and-Play’ enumeration mechanisms such as PCI and ACPI should
be used when possible [1].

Windows relies solely on ACPI/IPI0001 or PCI device based enumeration
for IPMI.  HP added the SPMI table for HP-UX to use before ACPI
namespace is available but Linux doesn't need such as its driver's
discovery processing takes place after both ACPI and PCI subsystems
have been set up.

[1] From Appendix C1 of the afore mentioned IPMI specification -
    "... this structure (referring to SPMI) should be used only
    when the interface cannot be discovered via 'Plug-and-Play'
    discovery mechanisms incorporated in interfaces such as PCI
    and ACPI."

Signed-off-by: Myron Stowe <myron.stowe@hp.com>
---

 drivers/char/ipmi/ipmi_bt_sm.c   |    2 
 drivers/char/ipmi/ipmi_si_intf.c |  165 --------------------------------------
 2 files changed, 2 insertions(+), 165 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index 7b98c06..d0e868e 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -204,7 +204,7 @@ static unsigned int bt_init_data(struct si_sm_data *bt, struct si_sm_io *io)
 	bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * 1000000;
 	bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT;
 	/* BT_CAP_outreqs == zero is a flag to read BT Capabilities */
-	return 3; /* We claim 3 bytes of space; ought to check SPMI table */
+	return 3; /* We claim 3 bytes of space */
 }
 
 /* Jam a completion code (probably an error) into a response */
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 86a7dd7..806ae83 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1118,7 +1118,7 @@ static struct ipmi_smi_handlers handlers = {
 
 /*
  * There can be 4 IO ports passed in (with or without IRQs), 4 addresses,
- * a default IO port, and 1 ACPI/SPMI address.  That sets SI_MAX_DRIVERS.
+ * a default IO port, and 1 ACPI address.  That sets SI_MAX_DRIVERS.
  */
 
 static LIST_HEAD(smi_infos);
@@ -1808,13 +1808,6 @@ static __devinit void hardcode_find_bmc(void)
 
 #include <linux/acpi.h>
 
-/*
- * Once we get an ACPI failure, we don't try any more, because we go
- * through the tables sequentially.  Once we don't find a table, there
- * are no more.
- */
-static int acpi_failure;
-
 /* For GPE-type interrupts. */
 static u32 ipmi_acpi_gpe(void *context)
 {
@@ -1873,158 +1866,6 @@ static int acpi_gpe_irq_setup(struct smi_info *info)
 	}
 }
 
-/*
- * Defined at
- * http://h21007.www2.hp.com/dspp/files/unprotected/devresource/
- * Docs/TechPapers/IA64/hpspmi.pdf
- */
-struct SPMITable {
-	s8	Signature[4];
-	u32	Length;
-	u8	Revision;
-	u8	Checksum;
-	s8	OEMID[6];
-	s8	OEMTableID[8];
-	s8	OEMRevision[4];
-	s8	CreatorID[4];
-	s8	CreatorRevision[4];
-	u8	InterfaceType;
-	u8	IPMIlegacy;
-	s16	SpecificationRevision;
-
-	/*
-	 * Bit 0 - SCI interrupt supported
-	 * Bit 1 - I/O APIC/SAPIC
-	 */
-	u8	InterruptType;
-
-	/*
-	 * If bit 0 of InterruptType is set, then this is the SCI
-	 * interrupt in the GPEx_STS register.
-	 */
-	u8	GPE;
-
-	s16	Reserved;
-
-	/*
-	 * If bit 1 of InterruptType is set, then this is the I/O
-	 * APIC/SAPIC interrupt.
-	 */
-	u32	GlobalSystemInterrupt;
-
-	/* The actual register address. */
-	struct acpi_generic_address addr;
-
-	u8	UID[4];
-
-	s8      spmi_id[1]; /* A '\0' terminated array starts here. */
-};
-
-static __devinit int try_init_spmi(struct SPMITable *spmi)
-{
-	struct smi_info  *info;
-	u8 		 addr_space;
-
-	if (spmi->IPMIlegacy != 1) {
-	    printk(KERN_INFO "IPMI: Bad SPMI legacy %d\n", spmi->IPMIlegacy);
-	    return -ENODEV;
-	}
-
-	if (spmi->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
-		addr_space = IPMI_MEM_ADDR_SPACE;
-	else
-		addr_space = IPMI_IO_ADDR_SPACE;
-
-	info = kzalloc(sizeof(*info), GFP_KERNEL);
-	if (!info) {
-		printk(KERN_ERR "ipmi_si: Could not allocate SI data (3)\n");
-		return -ENOMEM;
-	}
-
-	info->addr_source = "SPMI";
-
-	/* Figure out the interface type. */
-	switch (spmi->InterfaceType) {
-	case 1:	/* KCS */
-		info->si_type = SI_KCS;
-		break;
-	case 2:	/* SMIC */
-		info->si_type = SI_SMIC;
-		break;
-	case 3:	/* BT */
-		info->si_type = SI_BT;
-		break;
-	default:
-		printk(KERN_INFO "ipmi_si: Unknown ACPI/SPMI SI type %d\n",
-			spmi->InterfaceType);
-		kfree(info);
-		return -EIO;
-	}
-
-	if (spmi->InterruptType & 1) {
-		/* We've got a GPE interrupt. */
-		info->irq = spmi->GPE;
-		info->irq_setup = acpi_gpe_irq_setup;
-	} else if (spmi->InterruptType & 2) {
-		/* We've got an APIC/SAPIC interrupt. */
-		info->irq = spmi->GlobalSystemInterrupt;
-		info->irq_setup = std_irq_setup;
-	} else {
-		/* Use the default interrupt setting. */
-		info->irq = 0;
-		info->irq_setup = NULL;
-	}
-
-	if (spmi->addr.bit_width) {
-		/* A (hopefully) properly formed register bit width. */
-		info->io.regspacing = spmi->addr.bit_width / 8;
-	} else {
-		info->io.regspacing = DEFAULT_REGSPACING;
-	}
-	info->io.regsize = info->io.regspacing;
-	info->io.regshift = spmi->addr.bit_offset;
-
-	if (spmi->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
-		info->io_setup = mem_setup;
-		info->io.addr_type = IPMI_MEM_ADDR_SPACE;
-	} else if (spmi->addr.space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
-		info->io_setup = port_setup;
-		info->io.addr_type = IPMI_IO_ADDR_SPACE;
-	} else {
-		kfree(info);
-		printk(KERN_WARNING
-		       "ipmi_si: Unknown ACPI I/O Address type\n");
-		return -EIO;
-	}
-	info->io.addr_data = spmi->addr.address;
-
-	try_smi_init(info);
-
-	return 0;
-}
-
-static __devinit void spmi_find_bmc(void)
-{
-	acpi_status      status;
-	struct SPMITable *spmi;
-	int              i;
-
-	if (acpi_disabled)
-		return;
-
-	if (acpi_failure)
-		return;
-
-	for (i = 0; ; i++) {
-		status = acpi_get_table(ACPI_SIG_SPMI, i+1,
-					(struct acpi_table_header **)&spmi);
-		if (status != AE_OK)
-			return;
-
-		try_init_spmi(spmi);
-	}
-}
-
 static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
 				    const struct pnp_device_id *dev_id)
 {
@@ -3217,10 +3058,6 @@ static __devinit int init_ipmi_si(void)
 	dmi_find_bmc();
 #endif
 
-#ifdef CONFIG_ACPI
-	spmi_find_bmc();
-#endif
-
 	if (si_trydefaults) {
 		mutex_lock(&smi_infos_lock);
 		if (list_empty(&smi_infos)) {

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-03-04  3:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  3:44 [PATCH 0/4] ipmi: remove SPMI and update core driver with dev_printk Myron Stowe
2010-03-04  3:44 ` [PATCH 1/4] ipmi: Raise precedence of PNP based discovery mechanisms (ACPI, PCI) Myron Stowe
2010-03-04  3:44 ` Myron Stowe [this message]
2010-03-04  7:56   ` [Openipmi-developer] [PATCH 2/4] ipmi: Remove SPMI table based device discovery method Bela Lubkin
2010-03-04 18:47     ` Myron Stowe
2010-03-05 12:58       ` Bela Lubkin
2010-03-05 16:06         ` Bjorn Helgaas
2010-03-05 17:13         ` [Openipmi-developer] " Myron Stowe
2010-03-04  3:44 ` [PATCH 3/4] ipmi: Convert tracking of the ACPI device pointer to a PNP device Myron Stowe
2010-03-04  9:20   ` ykzhao
2010-03-04 20:48     ` Myron Stowe
2010-03-05  1:46       ` ykzhao
2010-03-05 16:41         ` Myron Stowe
2010-03-05 19:34           ` Bjorn Helgaas
2010-03-04  3:44 ` [PATCH 4/4] ipmi: Update driver to use 'dev_printk()' and its constructs Myron Stowe
2010-03-04 14:07 ` [PATCH 0/4] ipmi: remove SPMI and update core driver with dev_printk Corey Minyard
2010-03-05 16:31   ` Myron Stowe
2010-03-09 23:16   ` Myron Stowe
2010-03-10 14:55     ` [SPAM] - Re: [PATCH 0/4] ipmi: remove SPMI and update core driver with dev_printk - Email found in subject Andy Cress
2010-03-10 15:20       ` Corey Minyard
2010-03-10 17:55         ` [Openipmi-developer] " Myron Stowe
2010-03-11 17:10           ` Bela Lubkin

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=20100304034415.30205.59685.stgit@bob.kio \
    --to=myron.stowe@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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.