From patchwork Thu Nov 9 19:48:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 118478 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp7014384qgn; Thu, 9 Nov 2017 11:49:05 -0800 (PST) X-Google-Smtp-Source: ABhQp+Scl776Zsi9UpE2irNbCbzqW41TYWVYvkIY8II3VkaChl13a6UZMMGE6a8JSbVtaBuYj4BU X-Received: by 10.98.159.210 with SMTP id v79mr1568952pfk.162.1510256945835; Thu, 09 Nov 2017 11:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510256945; cv=none; d=google.com; s=arc-20160816; b=c8qbtOoAAs2SV4OOz38gj4q8WNso3jce5sKBKiSHgmfIk0kxb6lRn0QB/20NZ9kWtD kz/lkgO/bLC1X5B+2rf1kCsNt7TJP7c1/ZqwsELBG79IjNXQMzBG4mIK+DwAHdDtL/x0 6qgaZ2RrcWEySPdl+UYTAn4X5awU6+TqsdAjmWoDOuF8R3M1fzTSk30oQnr6+an0C/H9 NXw1eugt4VareD2LyhL26ertp4t3RQKmvSZqS7w0wU7ErqYHgJWIvMS34/BxqsSCCYnm WAwyI12uIvWc0eRNz46Epuw6SjJKXuneXuCfavyhOX6wFoCa2Ef7xJuEog5bM5bKJ8Qm QunA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=LXiucpEkx0i7EqSJsSfUGfNNycQx2jQIAtIJp2PX6GA=; b=kwTlAifkLtmLealF4uU7CNR4k/cESQEMJdTZ3WYGt5DRGAOOo7HhABySfG/PPqUhL1 IlJd/8GGgcYsd0nZx9Cz/T2o+Df8sKGsnnpbbt1uiOU31p5tUSv2Y2lOKdcBseEDIzo1 MEgW+A1kSmTABphriiE2aia7FjtgXTC1YdcLgLF2n9wX/8sEJPtNR1c64Tdw4nBoBC6K h6NKRpp/oXhk7PFvMXySGn5iEeuifUwYZoVW15c6GfMaoKdhI2RSIEPXaXa1EuwaA4mP eqYfvFuib2tMWZiOEE7JKdLaXFWi9+1tUjZ/Ot5w+MMzdhW+40CRinuU6wJAbmLrANvQ WbXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=W9rzuKT5; 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 7si6949992ple.62.2017.11.09.11.49.05; Thu, 09 Nov 2017 11:49:05 -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=W9rzuKT5; 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 S1754211AbdKITtE (ORCPT + 25 others); Thu, 9 Nov 2017 14:49:04 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:54593 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361AbdKITtC (ORCPT ); Thu, 9 Nov 2017 14:49:02 -0500 Received: by mail-pf0-f196.google.com with SMTP id n89so4992718pfk.11 for ; Thu, 09 Nov 2017 11:49:01 -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:in-reply-to:references; bh=LXiucpEkx0i7EqSJsSfUGfNNycQx2jQIAtIJp2PX6GA=; b=W9rzuKT58MlZy2MJgamjvF6QjYzhHvPOaw83FB8Cmklu6Cf5Cw9DjdZcBGpva8KfpD R48yo2OG+U6xABAbbUBS6T4A9qdyzbiC87gWHUvjN2simQaBBnkUaleAUQHtsFjpqhUO T+30lGZw1E4ocAzmRtxELcQnELnDTfqmMRI4iWvocMcXaPemJH90od3qf6zlTjPP1BjP 7T/D7YF3gSQiAtQurmiWckNpPI4uX26Gc/QGk+K2kcfU9wxu8QiEmMRTGesGKywOOyTe l+IgDo5u6RDGh304iJLgkV6dwB7irhO1a0cS4Cbut0+tyJDiWbhNuO8ZgL0DWykCQC5P Y8xw== 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 :in-reply-to:references; bh=LXiucpEkx0i7EqSJsSfUGfNNycQx2jQIAtIJp2PX6GA=; b=eSliCutWFPiBRMHO4bk3U/1gYzMp8zWLf5HskoO3YQjhDwzpv/w7fqaUjAip3aAuLl ukssFBYeSRu4J80y1+NSY4Lbs1MF9PgSalkWAjkDJclci3Svwx+v/bt+ioYlOVDj9uO6 Oifm9Lo9LiAr+AZj4lmkASzQD6SBlT/6LIyrnfXlWkfS3jg1xyhG/PI3IW9M9EhfKA7q xPB8jJw6GVGMrvVihPrlPziiJGyDkLjsiJTjuZHnfFBY8x+vhoEliUUGjiUsRlHtynrt 1Rn14SysPwD+r2C84vZa5hNeF4isDQxSr+JNtYOQRHQvnVF7WixKE9b8FPWmMX7VJDT7 Drfw== X-Gm-Message-State: AJaThX6wJ00taqhd+FkjJdLnIq0nx93IKZGQDkvFJjKijr9Y9Fj6nPKX zDTe8rOBs2bxT/UplC04LA== X-Received: by 10.84.150.131 with SMTP id h3mr1513132plh.126.1510256940606; Thu, 09 Nov 2017 11:49:00 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id y127sm12826768pgb.52.2017.11.09.11.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 11:48:59 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 1CABE198; Thu, 9 Nov 2017 13:48:57 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 9543A300E5F; Thu, 9 Nov 2017 13:48:56 -0600 (CST) From: minyard@acm.org To: Andrew Banman Cc: Dimitri Sivanich , Russ Anderson , Mike Travis , openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Corey Minyard Subject: [PATCH] ipmi: Prefer ACPI system interfaces over SMBIOS ones Date: Thu, 9 Nov 2017 13:48:47 -0600 Message-Id: <1510256927-8033-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Corey Minyard The recent changes to add SMBIOS (DMI) IPMI interfaces as platform devices caused DMI to be selected before ACPI, causing ACPI type of operations to not work. Signed-off-by: Corey Minyard --- Andrew, I looked a bit more and found that I already had this queued for the next kernel release, it fixes your issue and another issue, too. If this works for you, I'll request this for stable. -corey drivers/char/ipmi/ipmi_si_intf.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) -- 2.7.4 Tested-by: Andrew Banman diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 39c55f4..f8e28ba 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -3425,7 +3425,7 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info) del_timer_sync(&smi_info->si_timer); } -static int is_new_interface(struct smi_info *info) +static struct smi_info *find_dup_si(struct smi_info *info) { struct smi_info *e; @@ -3440,24 +3440,36 @@ static int is_new_interface(struct smi_info *info) */ if (info->slave_addr && !e->slave_addr) e->slave_addr = info->slave_addr; - return 0; + return e; } } - return 1; + return NULL; } static int add_smi(struct smi_info *new_smi) { int rv = 0; + struct smi_info *dup; mutex_lock(&smi_infos_lock); - if (!is_new_interface(new_smi)) { - pr_info(PFX "%s-specified %s state machine: duplicate\n", - ipmi_addr_src_to_str(new_smi->addr_source), - si_to_str[new_smi->si_type]); - rv = -EBUSY; - goto out_err; + dup = find_dup_si(new_smi); + if (dup) { + if (new_smi->addr_source == SI_ACPI && + dup->addr_source == SI_SMBIOS) { + /* We prefer ACPI over SMBIOS. */ + dev_info(dup->dev, + "Removing SMBIOS-specified %s state machine in favor of ACPI\n", + si_to_str[new_smi->si_type]); + cleanup_one_si(dup); + } else { + dev_info(new_smi->dev, + "%s-specified %s state machine: duplicate\n", + ipmi_addr_src_to_str(new_smi->addr_source), + si_to_str[new_smi->si_type]); + rv = -EBUSY; + goto out_err; + } } pr_info(PFX "Adding %s-specified %s state machine\n", @@ -3866,7 +3878,8 @@ static void cleanup_one_si(struct smi_info *to_clean) poll(to_clean); schedule_timeout_uninterruptible(1); } - disable_si_irq(to_clean, false); + if (to_clean->handlers) + disable_si_irq(to_clean, false); while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) { poll(to_clean); schedule_timeout_uninterruptible(1);