Received: by 10.213.65.16 with SMTP id m16csp145513imf; Sun, 11 Mar 2018 20:41:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELuiBYa/Kj7L0TKsK7g3W/fg1U7fKStgiVnrC6ERPFzLfYrLtoSy4wzCgZ9YAyG6bkL0OhOe X-Received: by 10.101.66.76 with SMTP id d12mr5410042pgq.234.1520826101413; Sun, 11 Mar 2018 20:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520826101; cv=none; d=google.com; s=arc-20160816; b=nFQCvJcTUhxkBI6nxNcOEuq0sEVoMYEmnexMGDT1ZfIph/9ktp0Xq46/yD+2Lpw8p8 lHJ53vAEijAmAfq4nNYH02n45aNyULrKHrcYNjiGh7bLVO2ZEipLIKajryySTLo8mf0q M8rAH0WIZQ43cNJymckx7vDAE4A+7s44wA962L4nYcvxjC3CdNqFroLRR4Cu1+R+mnpP MqOROaZ5CSscr/yMWNJPIABfaH+ahfI8mrgsVBQCEYGL3UpS7hn30kf+o8b/jZbdcfDO d0adJ8apdkVkzvREzSyhGIiaxJWJu3rdPJpp2+opgInNUN/G0VEtgvtuLng3vV84teG+ FeDw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=18a8ZxrxS6DE7QXrhMbJxDuPpUfLFlJSDRWnJXMP5WA=; b=vcBjqX4/US31tn398QO6a8cE8KfzsluGfr9HDWCotS94rGR304hABztfC9yXYBP6wZ b1TTOEU8zljoNiDFLd1NHeF+z08zDiqZ7UuQl3YuCDoWV2tWXnACNTiFYYJ6JKZkAOV+ IHsezjwOscs/8IaUpDhdFLVJdPxImcFyQ58lsGoRDEAP1Ie0CVVivPqzlissfgTaE2GF Aq95p8gpKKQDwPIz/TArYKVYyP+WGiohfa2tR6f5nZO7QdszZE5hqlt41IZRa5y3nD0J eYRnrlphcYFN0Y1hPyipcwVmQDsl+FgQ6equFEBaw1ZRDIYoNhsMDlgNUhapkxPP91Vp 2pXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IrwTtKky; dkim=pass header.i=@codeaurora.org header.s=default header.b=EvIJ12p4; 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 z74si5149845pfd.257.2018.03.11.20.41.27; Sun, 11 Mar 2018 20:41:41 -0700 (PDT) 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=pass header.i=@codeaurora.org header.s=default header.b=IrwTtKky; dkim=pass header.i=@codeaurora.org header.s=default header.b=EvIJ12p4; 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 S933245AbeCLDkj (ORCPT + 99 others); Sun, 11 Mar 2018 23:40:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52222 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932770AbeCLDk1 (ORCPT ); Sun, 11 Mar 2018 23:40:27 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3CCA76016D; Mon, 12 Mar 2018 03:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520826027; bh=OV+WqMq3VsGU4YY0Ohj5g4amcs7r0Gq3K9gz7LG+0Io=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IrwTtKkyf8bpCed61xHnfosD0nByyWsZZSwkgTjWMxC6FisgynqxEyVYulduuTLHo 2WC/nHI/pGiQvtT6Wl/qzoYmFrlaB33bhh+ECkjewja0TyWnJ9DYzJuNnYws8C4RH8 Y4uuANHlCHLXC2jHnd2Vh4QdwVMUNvhP5WY7LCA4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.222.143.176] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: anjiandi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 63BD86016D; Mon, 12 Mar 2018 03:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520826025; bh=OV+WqMq3VsGU4YY0Ohj5g4amcs7r0Gq3K9gz7LG+0Io=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EvIJ12p4qznXQtqZueSnpaeZ20LIYi2vufi6xeN8IhHg+2m/L9gr+MX4BjG6d0rqO g6VqRKoTdJZfRrae4S0/hlPO2JfLSiGmMi0b+LPkc35nGbs3CovJQuBJ6yq26vRwvj 92GhGndXC/mn/844vPgd4nmINGDCcGnN6AAwwfpM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 63BD86016D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=anjiandi@codeaurora.org Subject: Re: [PATCH] ipmi: Remove ACPI SPMI probing from the SSIF (I2C) driver To: Corey Minyard , minyard@acm.org Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1520543298-18163-1-git-send-email-minyard@acm.org> From: Jiandi An Message-ID: Date: Sun, 11 Mar 2018 22:40:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 08:42 PM, Corey Minyard wrote: > On 03/09/2018 04:28 PM, Jiandi An wrote: >> >> >> On 03/08/2018 03:08 PM, minyard@acm.org wrote: >>> 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. >> >> Thanks Corey.  I tested this patch.  It works for us through the ACPI >> control method. > > Thanks.  May I add a "Tested-by" for you? Tested-by: Jiandi An > >> By the way, FYI the ipmi_si driver is also having the >> SPMI probe code. >> >> [   17.370835] ipmi_si: probing via SPMI >> > > Yes, I've removed that in a separate patch. > > -corey > >> Thanks >> - Jiandi >> >>> >>>   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) >>> >> > -- Jiandi An Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.