From patchwork Thu Mar 4 03:44:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Myron Stowe X-Patchwork-Id: 83507 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o243iE2I015794 for ; Thu, 4 Mar 2010 03:44:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754737Ab0CDDoS (ORCPT ); Wed, 3 Mar 2010 22:44:18 -0500 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:26525 "EHLO g5t0009.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754666Ab0CDDoQ (ORCPT ); Wed, 3 Mar 2010 22:44:16 -0500 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g5t0009.atlanta.hp.com (Postfix) with ESMTP id B6C9530506; Thu, 4 Mar 2010 03:44:15 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id 885BC14123; Thu, 4 Mar 2010 03:44:15 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 588F3CF0036; Wed, 3 Mar 2010 20:44:15 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z6M2eBtxVmqu; Wed, 3 Mar 2010 20:44:15 -0700 (MST) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 437E2CF0032; Wed, 3 Mar 2010 20:44:15 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 4244D2617B; Wed, 3 Mar 2010 20:44:15 -0700 (MST) Subject: [PATCH 2/4] ipmi: Remove SPMI table based device discovery method To: minyard@acm.org From: Myron Stowe Cc: linux-acpi@vger.kernel.org, openipmi-developer@lists.sourceforge.net, lenb@kernel.org Date: Wed, 03 Mar 2010 20:44:15 -0700 Message-ID: <20100304034415.30205.59685.stgit@bob.kio> In-Reply-To: <20100304033146.30205.68689.stgit@bob.kio> References: <20100304033146.30205.68689.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Mar 2010 03:44:19 +0000 (UTC) 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 -/* - * 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)) {