Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5623842pxb; Mon, 14 Feb 2022 03:47:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWdLir+6O1qa1sgpXgPcN6H7TSoIhOhOHyLiio96tee6tszOpU7cLm+oV2y8IkGNHEueiY X-Received: by 2002:a05:6402:1806:: with SMTP id g6mr2048895edy.259.1644839235007; Mon, 14 Feb 2022 03:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644839235; cv=none; d=google.com; s=arc-20160816; b=iM2i+AnWPYw8u0U02MGp9QLy1/dgTue0cAqXqIuESVAqkqw9dK3q2IAkkOkfkru7X1 D3NVpjXVRjue4OT90jKTncVCpTYEjV8T8yPwVdjIW1trBuvqB9uVRS8tgetvMwmD6TLy fUb4dVZY7mVd+dtjEoyjD9sl9Y869JfSDLOtBUrhI29EegyhWYW2DPPL4qHPxoI1d7xD kpYuntbhqQkSXUbc9bcfLoiiGVWRCP8WqnXUGzVCnxJ8uDoTK0kwt4EYL2LZjKGcUkkU Ll1oTE1cc3ZdXD4jATSr84z7OSLirHHUxjdxBLgs/jo5raxOtqZeapfqDnNambVWrs3B Z/8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O+8eZAd6pnRqfWIokgHAMKP1veswRfVCs3yjzAGhm2w=; b=v0/3psRRH+PfzmHInLBitwi7QrIZfHsuWcRQRfYwhuvUWwtS+cb8KTKl+iyALvxVP9 fJa21NN6RKw62TK66mRi6/ffPVsEh8dzmPpvAleMzATqyVo9sWLvno99yl/rM8/oS8ig tNFuv3O06o4Vq3OebA3/sHdL1m6XYKCJAbGom+PdG3TtKs6YqMXJT7YfkjtBfzkVPgre k1Wlj4+rFZkinM0X51sYUqfs8UwtI3QUZfvavZw9jJ7ZD+WQiK+pDxxBF4ufTdJbO7JV 9yXMZT1zszHuUYv9TLmz9L4scyvsbFcAGyc8Fossfo3kNs9WuLX2DkmlPWvs6n+/pENX oidA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dmbsco6Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id el12si19283868edb.382.2022.02.14.03.46.52; Mon, 14 Feb 2022 03:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dmbsco6Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235039AbiBMKdA (ORCPT + 99 others); Sun, 13 Feb 2022 05:33:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235040AbiBMKc6 (ORCPT ); Sun, 13 Feb 2022 05:32:58 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 474C45D669 for ; Sun, 13 Feb 2022 02:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644748373; x=1676284373; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dWtFQyJtLhloaNLECP6ny+40Hn5wg+HkV2E42wNJyQY=; b=dmbsco6YobOzzgsPcPPovrNuMTWNCoa4zg/ohv/ENAWNsHTGD/uHhwK4 2PM7xZA8TdRpmXBhJ6+Xs1J9uQVmICukxKZTod0MmLt9g8vAoLzYwzxuY hiVmLQoB734iQoLJL8MuXrYOhv/AK47YbOl4VgA6ndrK5SG514VZRsOpR 1ZFH2skENwSMNlkvg1FgD2ckcbEl4I8WIjqJ7HeEpGhK+jDBr/Nm/5pAe Os+OtKjYSVxfZlsIDBpSpcxbTrKGDiu7BvZJ+o5aQN8++aNLr2icaytDx 26SW98GdRYx7IZ0mfnBCbCVBSfm3GXXRjhYfmU3PvUr6+LdEUgkmxugkV Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10256"; a="247532550" X-IronPort-AV: E=Sophos;i="5.88,365,1635231600"; d="scan'208";a="247532550" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 02:32:53 -0800 X-IronPort-AV: E=Sophos;i="5.88,365,1635231600"; d="scan'208";a="527474404" Received: from sannilnx.jer.intel.com ([10.12.231.79]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 02:32:50 -0800 From: Alexander Usyskin To: Greg Kroah-Hartman , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter Cc: Tomas Winkler , Alexander Usyskin , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ashutosh Dixit Subject: [PATCH v7 5/5] mei: gsc: retrieve the firmware version Date: Sun, 13 Feb 2022 12:32:15 +0200 Message-Id: <20220213103215.2440248-6-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213103215.2440248-1-alexander.usyskin@intel.com> References: <20220213103215.2440248-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a hook to retrieve the firmware version of the GSC devices to bus-fixup. GSC has a different MKHI clients GUIDs but the same message structure to retrieve the firmware version as MEI so mei_fwver() can be reused. CC: Ashutosh Dixit Reviewed-by: Greg Kroah-Hartman Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- V5: Rebase V6: Rebase V7: add Greg KH Reviewed-by --- drivers/misc/mei/bus-fixup.c | 25 +++++++++++++++++++++++++ drivers/misc/mei/hw-me.c | 2 ++ 2 files changed, 27 insertions(+) diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 67844089db21..59506ba6fc48 100644 --- a/drivers/misc/mei/bus-fixup.c +++ b/drivers/misc/mei/bus-fixup.c @@ -30,6 +30,12 @@ static const uuid_le mei_nfc_info_guid = MEI_UUID_NFC_INFO; #define MEI_UUID_MKHIF_FIX UUID_LE(0x55213584, 0x9a29, 0x4916, \ 0xba, 0xdf, 0xf, 0xb7, 0xed, 0x68, 0x2a, 0xeb) +#define MEI_UUID_IGSC_MKHI UUID_LE(0xE2C2AFA2, 0x3817, 0x4D19, \ + 0x9D, 0x95, 0x06, 0xB1, 0x6B, 0x58, 0x8A, 0x5D) + +#define MEI_UUID_IGSC_MKHI_FIX UUID_LE(0x46E0C1FB, 0xA546, 0x414F, \ + 0x91, 0x70, 0xB7, 0xF4, 0x6D, 0x57, 0xB4, 0xAD) + #define MEI_UUID_HDCP UUID_LE(0xB638AB7E, 0x94E2, 0x4EA2, \ 0xA5, 0x52, 0xD1, 0xC5, 0x4B, 0x62, 0x7F, 0x04) @@ -241,6 +247,23 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev) mei_cldev_disable(cldev); } +static void mei_gsc_mkhi_ver(struct mei_cl_device *cldev) +{ + int ret; + + /* No need to enable the client if nothing is needed from it */ + if (!cldev->bus->fw_f_fw_ver_supported) + return; + + ret = mei_cldev_enable(cldev); + if (ret) + return; + + ret = mei_fwver(cldev); + if (ret < 0) + dev_err(&cldev->dev, "FW version command failed %d\n", ret); + mei_cldev_disable(cldev); +} /** * mei_wd - wd client on the bus, change protocol version * as the API has changed. @@ -492,6 +515,8 @@ static struct mei_fixup { MEI_FIXUP(MEI_UUID_NFC_HCI, mei_nfc), MEI_FIXUP(MEI_UUID_WD, mei_wd), MEI_FIXUP(MEI_UUID_MKHIF_FIX, mei_mkhi_fix), + MEI_FIXUP(MEI_UUID_IGSC_MKHI, mei_gsc_mkhi_ver), + MEI_FIXUP(MEI_UUID_IGSC_MKHI_FIX, mei_gsc_mkhi_ver), MEI_FIXUP(MEI_UUID_HDCP, whitelist), MEI_FIXUP(MEI_UUID_ANY, vt_support), MEI_FIXUP(MEI_UUID_PAVP, whitelist), diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 9748d14849a1..7e77328142ff 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -1577,12 +1577,14 @@ static const struct mei_cfg mei_me_pch15_sps_cfg = { static const struct mei_cfg mei_me_gsc_cfg = { MEI_CFG_TYPE_GSC, MEI_CFG_PCH8_HFS, + MEI_CFG_FW_VER_SUPP, }; /* Graphics System Controller Firmware Interface */ static const struct mei_cfg mei_me_gscfi_cfg = { MEI_CFG_TYPE_GSCFI, MEI_CFG_PCH8_HFS, + MEI_CFG_FW_VER_SUPP, }; /* -- 2.32.0