Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3758095pxb; Mon, 1 Nov 2021 20:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXnssrqoVwyt86csRaE9PdaumAIWjDrCmw3cG/mJQrAFrN2rgy0W+v9koDIjTSZV/xb+BF X-Received: by 2002:a05:6602:2a42:: with SMTP id k2mr23998282iov.97.1635823767853; Mon, 01 Nov 2021 20:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635823767; cv=none; d=google.com; s=arc-20160816; b=HLDJfOWNXXpkHvzhX8iM6nrBzoWRu3BMPfA1HmqWeyhBckIdovUrZ+wPMt1rkMPbkD G1UeL0YK78Oo5YIpMdLUCxfG4MXDs0M6ysCE320kkiFn/AT0j7HqdAsUNMQDoY52j8q3 JjT+JtRdCJx/EV2Xm1kLAa8WV4ZZOYQZtExWs0qCmoDG42FQy9MgDMHKpLqytjLHmk8M zNMXZAH0/PKp6MgdQmLbEBokrcGJ5bt5o6tC0qG/CV1L/P5zBPxVCepMbO9cvToTO0Bb +5w3RC90u3oQ5+rnAN2aLlYnQTHQ9W0/YoTf4BhIJdHoeQ3W2yBONIODtRb8FQYX94mg lmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=svkrf9ThmGXqx3loLNGudDhbzyCRrGw2gRzWF5i8jOE=; b=LYErrDk0mRHsXI7Rvu7t4XVYzCLhlPc6RZJZEB5wri4UMUwAMfWwQFLJDRV8eBPorO jQbUC+r8hKzetnXprQ7xB1kB3XuM1JzqxKSukGDn7cC9EbgAR4JADXd1Yd3us+o6uU+V bq+d3HxZAj410YHXhIBc6Rp0GhNTAh3p6DRiF+Hl66o7WuTsoUo2Zg4s3vTSh003f1jz aWdnsR8k50jPGY/61sC80nOF6QJbljEFcdrbTxeJriAGdsRJ3clg6FqRQz4OCCaO66aS B/X5kZ+1dfEkhVyblDvp+RQ2m+chcPzV6XCvTZhd9rkEUgs3KvmQmChdDKx2mQaZ7F75 53rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=SjBVwlup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si18495692ilg.110.2021.11.01.20.29.14; Mon, 01 Nov 2021 20:29:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=SjBVwlup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231836AbhKBDax (ORCPT + 99 others); Mon, 1 Nov 2021 23:30:53 -0400 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]:50428 "EHLO smtp-relay-internal-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhKBDau (ORCPT ); Mon, 1 Nov 2021 23:30:50 -0400 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A0EA43F1AE for ; Tue, 2 Nov 2021 03:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1635823694; bh=svkrf9ThmGXqx3loLNGudDhbzyCRrGw2gRzWF5i8jOE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SjBVwlupuL4Z3Dd9BkNHzmoLkzv6dsftm0vATlA1KHHrAAkZ9SD7g8w7iLUP2He4l PkxQb8TcpoeQoRJCq7wLChn1ZC6EOhhgl4+7Ji5vuNB/JRDUeguCM/KkU2uyABm8pb NJAuNEOGOBsyWKUDf7Zit2sTzQy0YKeCNHaJOWQPfDcGvhBpF/YoQVFXlV1BA/u4PR 6Ni6mOdshlmbfd1NpmoaNlL6At0YzKqv8CuITbQwp9dX+23Ae6qXsbYJUpzLTPOXEQ gJJ7JtTOVkB7nUPCttq7ZKAusu18354OgsSvQPglDSB/Xsj5rnmhrKjIIHlmB0wlOo SBJP4dXoBqlqg== Received: by mail-oo1-f69.google.com with SMTP id u11-20020a4a85cb000000b002b725ac13d8so9358084ooh.0 for ; Mon, 01 Nov 2021 20:28:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=svkrf9ThmGXqx3loLNGudDhbzyCRrGw2gRzWF5i8jOE=; b=Lhr+QzjhHQ+hphJMu7WuI1gsuRDlmHtYZ8DwpHKVqFDddJDg+Rkjh30UIyhwMQpxl2 6GSuqBju/mvUfKPOOfUjmcwwDSuv5S7Lw7+Fz6FciQBhMt95dnV2AWUyRG00aazSa8P/ XNxE4m3TK2926t1CR7DIy7c9mbmKs7uGEZHCHZfQnqSpZR8TyvQqNeEUTuZHB3xl2xO4 nRjDpziJE6w9BPWGXAnjeH1+jg8ZbeKKbUACmgw/H3+VH5KKrg2t9gam9IOFWGXLdo7X 4LigeQ2lEeuHviQvaMCp4RTUiY1+uGzkEK0pkfGqUqsHrZG/fHX/FzBqUwz7+N6/TV6x MXSg== X-Gm-Message-State: AOAM532GHmn92wuTcDYNGfraBqVDISUnQHSJoBmOA3SDnhLElEuHU5Cx GjO5spfsRxJ88pHHCs64KdqVi/i2onvjUkjELv6OZemCab+nLzCpXh8vryflNajDYxmnYjsKucA GxX5doYJv/xAcJMnuOwbmO0mEocKWg8XPIM66MG82/onxYKUH+2lyfYRtxQ== X-Received: by 2002:aca:41d5:: with SMTP id o204mr2729104oia.41.1635823693333; Mon, 01 Nov 2021 20:28:13 -0700 (PDT) X-Received: by 2002:aca:41d5:: with SMTP id o204mr2729083oia.41.1635823693070; Mon, 01 Nov 2021 20:28:13 -0700 (PDT) MIME-Version: 1.0 References: <20211026065112.1366205-1-kai.heng.feng@canonical.com> <04ed8307-ab1f-59d6-4454-c759ce4a453b@intel.com> In-Reply-To: From: Kai-Heng Feng Date: Tue, 2 Nov 2021 11:27:59 +0800 Message-ID: Subject: Re: [PATCH v2] e1000e: Add a delay to let ME unconfigure s0ix when DPG_EXIT_DONE is already flagged To: Sasha Neftin Cc: Jesse Brandeburg , "Nguyen, Anthony L" , AceLan Kao , "David S. Miller" , Jakub Kicinski , Dima Ruinskiy , "moderated list:INTEL ETHERNET DRIVERS" , Linux Netdev List , LKML , "Kraus, NechamaX" , "Fuxbrumer, Devora" , "Avivi, Amir" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 29, 2021 at 5:14 PM Sasha Neftin wrote: > > On 10/27/2021 01:50, Kai-Heng Feng wrote: > > On Tue, Oct 26, 2021 at 4:48 PM Sasha Neftin wrote: > >> > >> On 10/26/2021 09:51, Kai-Heng Feng wrote: > >>> On some ADL platforms, DPG_EXIT_DONE is always flagged so e1000e resume > >>> polling logic doesn't wait until ME really unconfigures s0ix. > >>> > >>> So check DPG_EXIT_DONE before issuing EXIT_DPG, and if it's already > >>> flagged, wait for 1 second to let ME unconfigure s0ix. > >>> > >>> Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix") > >>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821 > >>> Signed-off-by: Kai-Heng Feng > >>> --- > >>> v2: > >>> Add missing "Fixes:" tag > >>> > >>> drivers/net/ethernet/intel/e1000e/netdev.c | 7 +++++++ > >>> 1 file changed, 7 insertions(+) > >>> > >>> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c > >>> index 44e2dc8328a22..cd81ba00a6bc9 100644 > >>> --- a/drivers/net/ethernet/intel/e1000e/netdev.c > >>> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c > >>> @@ -6493,14 +6493,21 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) > >>> u32 mac_data; > >>> u16 phy_data; > >>> u32 i = 0; > >>> + bool dpg_exit_done; > >>> > >>> if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) { > >>> + dpg_exit_done = er32(EXFWSM) & E1000_EXFWSM_DPG_EXIT_DONE; > >>> /* Request ME unconfigure the device from S0ix */ > >>> mac_data = er32(H2ME); > >>> mac_data &= ~E1000_H2ME_START_DPG; > >>> mac_data |= E1000_H2ME_EXIT_DPG; > >>> ew32(H2ME, mac_data); > >>> > >>> + if (dpg_exit_done) { > >>> + e_warn("DPG_EXIT_DONE is already flagged. This is a firmware bug\n"); > >>> + msleep(1000); > >>> + } > >> Thanks for working on the enablement. > >> The delay approach is fragile. We need to work with CSME folks to > >> understand why _DPG_EXIT_DONE indication is wrong on some ADL platforms. > >> Could you provide CSME/BIOS version? dmidecode -t 0 and cat > >> /sys/class/mei/mei0/fw_ver > > > > $ sudo dmidecode -t 0 > > # dmidecode 3.2 > > Getting SMBIOS data from sysfs. > > SMBIOS 3.4 present. > > # SMBIOS implementations newer than version 3.2.0 are not > > # fully supported by this version of dmidecode. > > > > Handle 0x0001, DMI type 0, 26 bytes > > BIOS Information > > Vendor: Dell Inc. > > Version: 0.12.68 > > Release Date: 10/01/2021 > > ROM Size: 48 MB > > Characteristics: > > PCI is supported > > PNP is supported > > BIOS is upgradeable > > BIOS shadowing is allowed > > Boot from CD is supported > > Selectable boot is supported > > EDD is supported > > Print screen service is supported (int 5h) > > 8042 keyboard services are supported (int 9h) > > Serial services are supported (int 14h) > > Printer services are supported (int 17h) > > ACPI is supported > > USB legacy is supported > > BIOS boot specification is supported > > Function key-initiated network boot is supported > > Targeted content distribution is supported > > UEFI is supported > > BIOS Revision: 0.12 > > > > $ cat /sys/class/mei/mei0/fw_ver > > 0:16.0.15.1518 > > 0:16.0.15.1518 > > 0:16.0.15.1518 > > > Thank you Kai-Heng. The _DPG_EXIT_DONE bit indication comes from the > EXFWSM register controlled by the CSME. We have only read access. I > realized that this indication was set to 1 even before our request to > unconfigure the s0ix settings from the CSME. I am wondering. Does after > a ~ 1s delay (or less, or more) _DPG_EXIT_DONE indication eventually > change by CSME to 0? (is it consistently) Never. It's consistently being 1. Right now we are seeing the same issue on TGL, so I wonder if it's better to just revert the CSME series? Kai-Heng > >>> /* Poll up to 2.5 seconds for ME to unconfigure DPG. > >>> * If this takes more than 1 second, show a warning indicating a > >>> * firmware bug > >>> >