Received: by 10.223.185.116 with SMTP id b49csp76560wrg; Thu, 8 Mar 2018 13:09:43 -0800 (PST) X-Google-Smtp-Source: AG47ELu8DIFhIpqFrzYtONuZ4pGDk5+jGDgg9znrhX+PCYFo1IeVDP1Af81+n9ouMl1n5DZplMf+ X-Received: by 2002:a17:902:7142:: with SMTP id u2-v6mr25298698plm.257.1520543383500; Thu, 08 Mar 2018 13:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520543383; cv=none; d=google.com; s=arc-20160816; b=ueirb6P77mSZ80bRQ+yO7KwjWNfXXJwtCpdAyW4U0pUJ1lNBevnWMiudu6GiY/s+2P L33t9gDgx+CDzWkaduXgHhXyEJQCrkuAWtPoFXyihxvVNLAkDMaykczD2jmIDhW0rSvK F5maVz6Zqf8SCly4Q40o43ds+/CGSzk56JyZ00AKVWZGlinK+LXbc6btz2ICOzzrUyq9 Weghc4kVafhqgXTflKbbu2O7/er5GlmPzisvAvj6G1RLSW02Yb5ZvNKRnvAk0/CP2I+q eGutn9pSfm8IW0L1/JhsND5jaygdcq6dhHjOIyoiFIOdTt5sO117rlC5jo3Vldtcjb6D 9mag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=R+jzqNAr46iD09LOj4Gt33C59l9Ap4Bg6ytO/psNEE8=; b=LczzP34/KHWwhNwIqyXW+yWnvCGpo7XhVuqj49/PS4ehextIbVAYqtdYjqyOK0RjYO 3vQXhFHHhUYZ/dMrALNaJRzs3pbjYjRtc/mff2aHpBodUdx1LvPo9EKIcb3Z0kNIPV+6 u9uQafNFjBLf1jS427k+BkSBvTi1TVpR7b/f7eD8ZSm2o5z5kqFLUumoGRJzzDdiulBM kCoeepwAAGQg7gmWOnBumKyC+7j2trTIt/zoG1wUml5DByeDsgZadtA3yTQe62lE0gX3 fbhnv86pOq4L2KhQql2xrlVg831PigVhCl/kPuSefvXcfXaUmfF2h1LYmqyHosh0gTJm g16g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EyN0gvm2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si392002pgb.212.2018.03.08.13.09.28; Thu, 08 Mar 2018 13:09:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EyN0gvm2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751298AbeCHVI0 (ORCPT + 99 others); Thu, 8 Mar 2018 16:08:26 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:42547 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbeCHVIZ (ORCPT ); Thu, 8 Mar 2018 16:08:25 -0500 Received: by mail-pf0-f195.google.com with SMTP id a16so408144pfn.9 for ; Thu, 08 Mar 2018 13:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R+jzqNAr46iD09LOj4Gt33C59l9Ap4Bg6ytO/psNEE8=; b=EyN0gvm2k5qekbEo31f0Ok9vWvR7FyjP2bc9ROzXUfcQtjdEyVxCXwwZV5k1+caxTA CLVG0XcdBS60T/DASiY8QbUYSKpOCqJZlesGBWwUagMGBhj5JhfS7k8JXUejGUrmTaLi mxvparty9DieFeYQfVo44islG8hMKx/tftW+C/HnNa+dqOsJVrGkRDFKdikbO0lW3K8D k7bs4QDFKxvYT4Ii3l6KxVuIMprVm05mUGG9TOf/038LgWaRzPptoYi4o6trCboLo5jf GG6cr3AkBCefn6e64rpLFimKsGySSnSWfvflngkjSWqmr0GsBaJlBvDqCfG6qyJ0Rr97 RIkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=R+jzqNAr46iD09LOj4Gt33C59l9Ap4Bg6ytO/psNEE8=; b=Aq6iCvOfsv4jbDHwnFHHE/Z6U/r6oWU6vjdp/VDzA2wZ6JaL3A4cefIb0PP27SKGNm r6sBAHjN+er8Zlocyvjpz27BQKIg2KcOxm3+s3A8Jz62M+woKogpe6hhXsNw7hknru/X jGg0l56TzTe0SYsAIB5sawZRsC/bna5rtEct/Ce0jLp8gKFO6ramUvxB6Q9Bc7pCmuP4 BnM+/QavHTAP315nINAP7irbdfnM5BcdIwWPlFL4CtA1sP3vhfKv5FnB1/hXEPiypm0+ tflPHKx+oTcOnR/GqCCpn/4kTsEEeYIGCNU6BeNNhUAV1LZd35j8DUX1DGf8GaOwscgK u3fg== X-Gm-Message-State: APf1xPCP63ILW7Mwbg2fabm4HOU6JIeylMvHTD55wXAHKJDSqqV+uCIe dxCz/6EPnafGFOld84Fjtw== X-Received: by 10.101.67.198 with SMTP id n6mr22205024pgp.150.1520543304220; Thu, 08 Mar 2018 13:08:24 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id r9sm38060470pfg.11.2018.03.08.13.08.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 13:08:22 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id C7583159; Thu, 8 Mar 2018 15:08:20 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id DCFF330009D; Thu, 8 Mar 2018 15:08:19 -0600 (CST) From: minyard@acm.org To: Jiandi An Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Corey Minyard Subject: [PATCH] ipmi: Remove ACPI SPMI probing from the SSIF (I2C) driver Date: Thu, 8 Mar 2018 15:08:18 -0600 Message-Id: <1520543298-18163-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Corey Minyard The IPMI spec states: The purpose of the SPMI Table is to provide a mechanism that can be used by the OSPM (an ACPI term for “OS Operating System-directed configuration and Power Management” essentially meaning an ACPI-aware OS or OS loader) very early in the boot process, e.g., before the ability to execute ACPI control methods in the OS is available. When we are probing IPMI in Linux, ACPI control methods are available, so we shouldn't be probing using SPMI. It could cause some confusion during the probing process. Signed-off-by: Corey Minyard Cc: Jiandi An --- Jiandi, this just yanks out the SPMI code. Your platform should have an ACPI control method in it's namespace specifying the IPMI interface. If it doesn't, that's a bug in your platform and really needs to be fixed. Finding IPMI devices with SMBIOS tables is kind of risky since there is no real way to know which I2C bus has the IPMI device if your system has more than one I2C bus. With an ACPI control method, the IPMI control method will be inside the I2C bus control method, so it will be unambiguous. drivers/char/ipmi/ipmi_ssif.c | 105 ------------------------------------------ 1 file changed, 105 deletions(-) diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 4cff4cd..206257b 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1994,108 +1994,6 @@ static const struct acpi_device_id ssif_acpi_match[] = { { }, }; MODULE_DEVICE_TABLE(acpi, ssif_acpi_match); - -/* - * 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; - -/* - * Defined in the IPMI 2.0 spec. - */ -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 int try_init_spmi(struct SPMITable *spmi) -{ - unsigned short myaddr; - - if (num_addrs >= MAX_SSIF_BMCS) - return -1; - - if (spmi->IPMIlegacy != 1) { - pr_warn("IPMI: Bad SPMI legacy: %d\n", spmi->IPMIlegacy); - return -ENODEV; - } - - if (spmi->InterfaceType != 4) - return -ENODEV; - - if (spmi->addr.space_id != ACPI_ADR_SPACE_SMBUS) { - pr_warn(PFX "Invalid ACPI SSIF I/O Address type: %d\n", - spmi->addr.space_id); - return -EIO; - } - - myaddr = spmi->addr.address & 0x7f; - - return new_ssif_client(myaddr, NULL, 0, 0, SI_SPMI, NULL); -} - -static 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); - } -} -#else -static void spmi_find_bmc(void) { } #endif #ifdef CONFIG_DMI @@ -2200,9 +2098,6 @@ static int init_ipmi_ssif(void) ssif_i2c_driver.driver.acpi_match_table = ACPI_PTR(ssif_acpi_match); - if (ssif_tryacpi) - spmi_find_bmc(); - if (ssif_trydmi) { rv = platform_driver_register(&ipmi_driver); if (rv) -- 2.7.4