From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67BC2C3DA4A for ; Tue, 20 Aug 2024 05:38:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 130D210E4B1; Tue, 20 Aug 2024 05:38:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MN5jvJEb"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id B720610E4B0 for ; Tue, 20 Aug 2024 05:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724132294; x=1755668294; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=CI2SyL9ClJrz9HeipYo1fnNZgJySKDBKXV9qdMau4gk=; b=MN5jvJEbf+NM7z/9PIfET807Km3btSzXhPUY1dhG9cxT/PvsSQkQuB/v fUtJjxiSJjKmwZpZPlVE2id2si8yBAIBobu5R5CploBHIsIfMaCJKG94p FQmPQlX35HXt8ntfmbxfF2m9QMaZnwWp5AYdi11B6yVagHe1pKZiVYbAH 1hA5yc7RBZnwF9b8kut7/1iqLIP8Wv5g1xd2LxjAEAGOTQPb6ypeQm2LC PkNBtYbA7Di+HvSzeMye3SBUGNgZJlNCjrVJy6LuMTGykd+Ts/8gpOfCv EZMW89j1lk6cJ4eN85ophuX3RJqFAfhHbjNgOGZaJQ/NH/oOz6Z/8mQkf g==; X-CSE-ConnectionGUID: c18sigM3Sg2l3bOfd4xXJg== X-CSE-MsgGUID: j2yVBnf2T5K43OxcF9c6TQ== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26205974" X-IronPort-AV: E=Sophos;i="6.10,161,1719903600"; d="scan'208,217";a="26205974" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 22:38:13 -0700 X-CSE-ConnectionGUID: o6MxAC+FQMWRavSn5Yxylg== X-CSE-MsgGUID: 00v3/ZnmRRCCIIp0mp0m/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,161,1719903600"; d="scan'208,217";a="64982796" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Aug 2024 22:38:12 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 19 Aug 2024 22:38:12 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 19 Aug 2024 22:38:12 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 19 Aug 2024 22:38:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hXN5TenVfn0/t098QL4FN3WBz4tcS9gAGiqGQ9FcPUCDpABZR6o4XrDtb+kIWXZP+2kCwozcRgKckqLKQvJuG7M5JKztgsLsjkfp2kHHQAh8lXK6j5wIuOtXJSiRQHC/ekUUazCqKXMMqgnyliGaUhWGsRpU8InXfZVld4FL0Wk3bC9ZcKmT6JwJwQho0hidb2oGvrHiFkuKri1V3svxRODbu5HGI0GWR+B9P/GF4uelofNLkq9lZMdUFmeuIiq78i20zM65iiZDT789RYYWDVPpBgNaGiMhhsC0LtTDlisbqDOni/JbairbLO5ewZcKX1MScxNkgYEvJxRXYu2LDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w3lqZ6peNhj1r9mhFFfI0xufN0d10DESSRWLQI7VqxE=; b=bFboHkP9w1mJYFfG043D+LPOjvChk7Fc0pkR6TwA8Bq+OuL2I3d++2h4f+SvK+UeBGtbSjP5Sml8D+/vKe1irBete8JsvjfvV886PQ94Gsyk8AhFQdOqi6pK7AZhCLOKdeFj/hT6gt1J6TXLzw1f1ZMl0psFCXfPpkYYUO9jlThHsUFi7Wer949WFcQeb0jZ8fezHVSmZD/VI4HgsEaDLyYEm7zcJpCA4peF0vju7tZ221Yh170R/pIpJnFzPE9ZQcBGcNUiAytCkiSUHom3zH8j2IjAr7egCbb7l8vys0YAP0ikbrqcmg9PdXPCZomNrkRce6oUKTI03G3fLbrjjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5293.namprd11.prod.outlook.com (2603:10b6:5:390::20) by SA1PR11MB6847.namprd11.prod.outlook.com (2603:10b6:806:29e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 05:38:04 +0000 Received: from DM4PR11MB5293.namprd11.prod.outlook.com ([fe80::e1f5:3b23:9560:2dc2]) by DM4PR11MB5293.namprd11.prod.outlook.com ([fe80::e1f5:3b23:9560:2dc2%4]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024 05:38:04 +0000 Content-Type: multipart/alternative; boundary="------------0rGvBusQ5aX8nQVWqiv0Fexf" Message-ID: <28cfb915-3871-44da-bc85-decf316a8a12@intel.com> Date: Tue, 20 Aug 2024 11:07:57 +0530 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH i-g-t] lib/igt_kmod: Unload/Reload the mei Modules Before Unloading/Reloading the i915/xe Driver To: Lucas De Marchi , Daniele Ceraolo Spurio CC: , Kamil Konieczny References: <20240815130423.7686-1-krishnaiah.bommu@intel.com> Content-Language: en-US From: "Bommu, Krishnaiah" In-Reply-To: X-ClientProxiedBy: MA0PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:af::19) To DM4PR11MB5293.namprd11.prod.outlook.com (2603:10b6:5:390::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5293:EE_|SA1PR11MB6847:EE_ X-MS-Office365-Filtering-Correlation-Id: a1c03702-9001-49b1-744b-08dcc0da431d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEJ2dGdITDJYNTZzempxZHBJTmRKN1NRQ2RGc1pKUVJKdzYyNVBLK0JFNktk?= =?utf-8?B?OENPZng5ZUg3ekN6bzdGbEMwcTBCamNtU09tREJCZTE1Y3VpWmpIV21BUEE4?= =?utf-8?B?TTQ0YXFxWTMydHloY3JnQml0Y25ISTVxR1N2MlVhalRG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tGazBRdnZqNEF5Nmt4WjlMZjNsVGt4RkNsK1Ja?= =?utf-8?B?Y0R0OXNKdlo3MGM3akQ0ZnVPaUMwcTRyZ2dwbERkVE0yYWdJb2twYURsK1VJ?= =?utf-8?B?RFFKWTF4UlZUS3luMHRZdUxiakt3Q2xiTDE4dWNkRFlEeE5XOFMzQkR4YmlB?= =?utf-8?B?eExkbGdnbW8rdGVTMlMrejRDOHJuOGpWUEdKVU4zYXNqL3p0R0ZkTzJWbmJ5?= =?utf-8?B?ZVFVUWhBM0hrNzZkSktIMzFuenpuN1NSSGhDSWRHMjNqb2kxd0ZDT2hVYlpn?= =?utf-8?B?VUlJVG83R0FFYlJxaG9kQ0pYZlRaTGpSWlplSzExanRKUjZzcUFTd0xLVzBt?= =?utf-8?B?MHBIb2pZVnZBMjA3bVhWZ05MRFI3Z2FZOUgvZTJkQUY0TnZVZXE1TkpQb3Rr?= =?utf-8?B?Qm43N0FpV0d5bDIvR2J0bjRsQnYyM3ZkZkVvdFJzZHhQUXZtaksrNUJiNkht?= =?utf-8?B?RTdaQUFvSWV5M1pnMklFUVVKRUZlMmN2bXJjbTdpYjRJWjY1blNvMHBSZ2d4?= =?utf-8?B?YVp2eTQzRk1GVWNVNlBNa0R4VG44d3g2ekVWQ1BXNmF4NEt0cmJ0R1JaNlVG?= =?utf-8?B?ak5pcDk2cVVIckdwdkZFWlRxSCtBTEFzRnp1OWFWd0lNVmxtVHFZcGVUSDRo?= =?utf-8?B?dC81ak5DU1ZPbXpMYTYweW5tWldUTUc0UElXTnhQRlk5S0JGZXdxY0dYTldZ?= =?utf-8?Q?li4U59f/DsZJ6nCbsQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5293.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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8?B?NXViZm82STNXbjZWclNXaHpkbU1sZDhSVHVScDFlTU45Y25VajdMNXp0UUFh?= =?utf-8?B?Q2x5bzNSMTk2eEFackFaTFhOZDlZaXB0ZVRTOE1oek5lR3VyTDFGSkp6ODhL?= =?utf-8?B?TnljM2VHSmNCR2dvL09XYmE5OU9vMWhabm8wYWJadnpsSmkxaFQ1ZTdYK1Rs?= =?utf-8?B?MXNNelJYa0NMdVUxQ2FuMFJGbGIxYnlmM3c2N1NYRU00dlVFQ2NZTnFoTjhC?= =?utf-8?B?V01lZzh0aUdTak9ydE1vdndEVnlsSnZ5ei9lMmkxVk8rZ255eVVPUTh0QnVK?= =?utf-8?B?WDcwTngyK0YveDlveXZ6dG5KQUpmclJlU3d5UGJpcS9GOWdEdGVtRVR2WGNm?= =?utf-8?B?UWc3aGdJNmdvTXpWeGVHQldRbUtwZHNzVzFvN1VHOS81M1Y2ZGFuTEQ1ZFFz?= =?utf-8?B?MGc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: a1c03702-9001-49b1-744b-08dcc0da431d X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5293.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 05:38:04.5852 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /NQVdvw1TajgsdJXOv80G++udCSO9Y7NYaaX1KXhw2WvQNiu9NH8xt9soIXwtdNduvvucWot+aHUPl0qZdR4EmgoSq5biRWvbhHO/KjzkUI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6847 X-OriginatorOrg: intel.com X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" --------------0rGvBusQ5aX8nQVWqiv0Fexf Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit On 15-08-2024 22:55, Lucas De Marchi wrote: > On Thu, Aug 15, 2024 at 09:57:08AM GMT, Daniele Ceraolo Spurio wrote: >> >> >> On 8/15/2024 8:20 AM, Lucas De Marchi wrote: >>> On Thu, Aug 15, 2024 at 06:34:23PM GMT, Bommu Krishnaiah wrote: >>>> To ensure stability and proper module management, this update >>>> introduces >>>> changes to the handling of MEI modules when loading or unloading >>>> the Intel i915 or Xe drivers. >>>> >>>> Key Changes: >>>> - Unload Order: The `mei_gsc_proxy` module is now unloaded before >>>> `mei_gsc`, >>>> preventing potential failures during the unloading process. >>>> - Platform-Specific Handling: On platforms where the MEI hardware >>>> is integrated >>>> with the graphics device (e.g., DG2/BMG), the MEI modules depend on >>>> the i915/Xe driver. >>>> Conversely, on newer platforms like CLS, where MEI hardware is >>>> separate, >>>> this dependency does not exist. This update ensures that MEI >>>> modules are >>>> unloaded/reloaded in the correct order based on platform-specific >>>> dependencies. >>>> >>>> These changes address the need for a more robust handling of MEI >>>> modules across >>>> different hardware platforms, ensuring that the i915/Xe driver can be >>>> cleanly unloaded and reloaded without issues. >>>> >>>> Signed-off-by: Bommu Krishnaiah >>>> Cc: Kamil Konieczny >>>> Cc: Daniele Ceraolo Spurio >>>> --- >>>> lib/igt_kmod.c | 38 ++++++++++++++++++++++++++++++++++++++ >>>> 1 file changed, 38 insertions(+) >>>> >>>> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c >>>> index 464c0dcf4..6ee2b7afe 100644 >>>> --- a/lib/igt_kmod.c >>>> +++ b/lib/igt_kmod.c >>>> @@ -480,9 +480,29 @@ igt_intel_driver_load(const char *opts, const >>>> char *driver) >>>> { >>>>     int ret; >>>> >>>> +    const char *mei[] = { >>>> +        /* mei_gsc uses an i915 aux dev and the other mei mods >>>> depend on it */ >>>> +        "mei_pxp", >>>> +        "mei_hdcp", >>>> +        "mei_gsc_proxy", >>>> +        "mei_gsc", >>>> +        NULL, >>> >>> all this manual approach we have for module unloading should be gone >>> IMO. Replace that with 1) unbind the driver; 2) unload the module. >>> There's no need afaict to keep tracking what the module uses. >>> >>> as for loading, why exactly do we have to do the kernels/depmod >>> manually?  If we have to do anything manually like that, it means >>> real users won't have that and we are actually missing the proper >>> integration. I typed something on the different types of >>> dependencies (harddep, softdep, weakdep): >>> https://politreco.com/2024/08/linux-module-dependencies/ >> >> The mei modules are a bit of an issue because they change behavior >> between integrated and discrete. In integrated, they're loaded on the >> CPU MEI device (the CSME) and so they're completely independent from >> i915/xe and we don't need to unload/load them them to unload/load >> i915/xe. On discrete however the MEI device is a child device on the >> graphics card, so the mei modules depend on i915/xe and need to be >> removed before the graphics driver can be unloaded, but are then >> auto-reloaded when the i915/xe is re-loaded. So for IGT we have 2 >> possible solutions: >> >> 1) only unload mei modules if we're on discrete, in which case they >> will correctly auto-reload when we re-export the child device. >> 2) always unload mei modules before unloading i915/xe, but then we >> need to manually re-load them because they're not going to be >> auto-reloaded on integrated. >> >> I'm guessing that if we unplug i915/xe that's going to automatically >> unplug the mei driver on the child device so maybe that does help in >> avoiding the unload/reload flow? > > yes. Just unbinding the driver should make it stop using it and if > that doesn't work we have something to fix outside of the CI infra. > > for the loading part, *if we have no other means*, adding a > MODULE_SOFTDEP("pre: ...") would do it, although a weakdep + > request_module() if/when needed would be better (except that > weakdep is only available on 6.11 and kmod 33) > > Lucas De Marchi > >> >> Daniele >> >>> >>> Lucas De Marchi thank you for your inputs I tried with module unbind and unload with this mei modules was not removed, I will add mei_gsc_proxy removal for discrete platforms with MODULE_SOFTDEP root@DUT6099BMGFRD:/home/gta# root@DUT6099BMGFRD:/home/gta# lsmod | grep mei mei_gsc_proxy163840 mei_gsc122881 mei_pxp163840 mei_hdcp286720 mei_me491523 mei_gsc mei1679368 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me root@DUT6099BMGFRD:/home/gta# echo -n auto > /sys/bus/pci/devices/0000\:03\:00.0/power/control root@DUT6099BMGFRD:/home/gta# echo -n "0000:03:00.0" > /sys/bus/pci/drivers/xe/unbind root@DUT6099BMGFRD:/home/gta# lsmod | grep mei mei_gsc_proxy163840 mei_gsc122880 mei_pxp163840 mei_hdcp286720 mei_me491523 mei_gsc mei1679367 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me root@DUT6099BMGFRD:/home/gta# root@DUT6099BMGFRD:/home/gta# modprobe -r xe root@DUT6099BMGFRD:/home/gta# root@DUT6099BMGFRD:/home/gta# root@DUT6099BMGFRD:/home/gta# lsmod | grep mei mei_gsc_proxy163840 mei_gsc122880 mei_pxp163840 mei_hdcp286720 mei_me491523 mei_gsc mei1679367 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me root@DUT6099BMGFRD:/home/gta# Regards, Krishna. >>> >>>> +    }; >>>> + >>>>     if (opts) >>>>         igt_info("Reloading %s with %s\n\n", driver, opts); >>>> >>>> +    for (const char **m = mei; *m; m++) { >>>> +        if (igt_kmod_is_loaded(*m)) >>>> +            continue; >>>> + >>>> +        ret = igt_kmod_load(*m, NULL); >>>> +        if (ret) { >>>> +            igt_debug("Could not load %s\n", *m); >>>> +            return ret; >>>> +        } >>>> +    } >>>> + >>>>     ret = igt_kmod_load(driver, opts); >>>>     if (ret) { >>>>         igt_debug("Could not load %s\n", driver); >>>> @@ -620,9 +640,14 @@ int __igt_intel_driver_unload(char **who, >>>> const char *driver) >>>>     const char *aux[] = { >>>>         /* gen5: ips uses symbol_get() so only a soft module >>>> dependency */ >>>>         "intel_ips", >>>> +        NULL, >>>> +    }; >>>> + >>>> +    const char *mei[] = { >>>>         /* mei_gsc uses an i915 aux dev and the other mei mods >>>> depend on it */ >>>>         "mei_pxp", >>>>         "mei_hdcp", >>>> +        "mei_gsc_proxy", >>>>         "mei_gsc", >>>>         NULL, >>>>     }; >>>> @@ -647,6 +672,19 @@ int __igt_intel_driver_unload(char **who, >>>> const char *driver) >>>>         } >>>>     } >>>> >>>> +    for (const char **m = mei; *m; m++) { >>>> +        if (!igt_kmod_is_loaded(*m)) >>>> +            continue; >>>> + >>>> +        ret = igt_kmod_unload(*m); >>>> +        if (ret) { >>>> +            if (who) >>>> +                *who = strdup_realloc(*who, *m); >>>> + >>>> +            return ret; >>>> +        } >>>> +    } >>>> + >>>>     if (igt_kmod_is_loaded(driver)) { >>>>         ret = igt_kmod_unload(driver); >>>>         if (ret) { >>>> -- >>>> 2.25.1 >>>> >> --------------0rGvBusQ5aX8nQVWqiv0Fexf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit


On 15-08-2024 22:55, Lucas De Marchi wrote:
On Thu, Aug 15, 2024 at 09:57:08AM GMT, Daniele Ceraolo Spurio wrote:


On 8/15/2024 8:20 AM, Lucas De Marchi wrote:
On Thu, Aug 15, 2024 at 06:34:23PM GMT, Bommu Krishnaiah wrote:
To ensure stability and proper module management, this update introduces
changes to the handling of MEI modules when loading or unloading
the Intel i915 or Xe drivers.

Key Changes:
- Unload Order: The `mei_gsc_proxy` module is now unloaded before `mei_gsc`,
preventing potential failures during the unloading process.
- Platform-Specific Handling: On platforms where the MEI hardware is integrated
with the graphics device (e.g., DG2/BMG), the MEI modules depend on the i915/Xe driver.
Conversely, on newer platforms like CLS, where MEI hardware is separate,
this dependency does not exist. This update ensures that MEI modules are
unloaded/reloaded in the correct order based on platform-specific dependencies.

These changes address the need for a more robust handling of MEI modules across
different hardware platforms, ensuring that the i915/Xe driver can be
cleanly unloaded and reloaded without issues.

Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
lib/igt_kmod.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 464c0dcf4..6ee2b7afe 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -480,9 +480,29 @@ igt_intel_driver_load(const char *opts, const char *driver)
{
    int ret;

+    const char *mei[] = {
+        /* mei_gsc uses an i915 aux dev and the other mei mods depend on it */
+        "mei_pxp",
+        "mei_hdcp",
+        "mei_gsc_proxy",
+        "mei_gsc",
+        NULL,

all this manual approach we have for module unloading should be gone
IMO. Replace that with 1) unbind the driver; 2) unload the module.
There's no need afaict to keep tracking what the module uses.

as for loading, why exactly do we have to do the kernels/depmod
manually?  If we have to do anything manually like that, it means
real users won't have that and we are actually missing the proper
integration. I typed something on the different types of
dependencies (harddep, softdep, weakdep):
https://politreco.com/2024/08/linux-module-dependencies/

The mei modules are a bit of an issue because they change behavior between integrated and discrete. In integrated, they're loaded on the CPU MEI device (the CSME) and so they're completely independent from i915/xe and we don't need to unload/load them them to unload/load i915/xe. On discrete however the MEI device is a child device on the graphics card, so the mei modules depend on i915/xe and need to be removed before the graphics driver can be unloaded, but are then auto-reloaded when the i915/xe is re-loaded. So for IGT we have 2 possible solutions:

1) only unload mei modules if we're on discrete, in which case they will correctly auto-reload when we re-export the child device.
2) always unload mei modules before unloading i915/xe, but then we need to manually re-load them because they're not going to be auto-reloaded on integrated.

I'm guessing that if we unplug i915/xe that's going to automatically unplug the mei driver on the child device so maybe that does help in avoiding the unload/reload flow?

yes. Just unbinding the driver should make it stop using it and if
that doesn't work we have something to fix outside of the CI infra.

for the loading part, *if we have no other means*, adding a
MODULE_SOFTDEP("pre: ...") would do it, although a weakdep +
request_module() if/when needed would be better (except that
weakdep is only available on 6.11 and kmod 33)

Lucas De Marchi


Daniele


Lucas De Marchi


thank you for your inputs

I tried with module unbind and unload with this mei modules was not removed, I will add mei_gsc_proxy removal for discrete platforms with MODULE_SOFTDEP

root@DUT6099BMGFRD:/home/gta#

root@DUT6099BMGFRD:/home/gta# lsmod | grep mei

mei_gsc_proxy          16384  0

mei_gsc                12288  1

mei_pxp                16384  0

mei_hdcp               28672  0

mei_me                 49152  3 mei_gsc

mei                   167936  8 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me

root@DUT6099BMGFRD:/home/gta# echo -n auto > /sys/bus/pci/devices/0000\:03\:00.0/power/control

root@DUT6099BMGFRD:/home/gta# echo -n "0000:03:00.0" > /sys/bus/pci/drivers/xe/unbind

root@DUT6099BMGFRD:/home/gta# lsmod | grep mei

mei_gsc_proxy          16384  0

mei_gsc                12288  0

mei_pxp                16384  0

mei_hdcp               28672  0

mei_me                 49152  3 mei_gsc

mei                   167936  7 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me

root@DUT6099BMGFRD:/home/gta#

root@DUT6099BMGFRD:/home/gta# modprobe -r xe

root@DUT6099BMGFRD:/home/gta#

root@DUT6099BMGFRD:/home/gta#

root@DUT6099BMGFRD:/home/gta# lsmod | grep mei

mei_gsc_proxy          16384  0

mei_gsc                12288  0

mei_pxp                16384  0

mei_hdcp               28672  0

mei_me                 49152  3 mei_gsc

mei                   167936  7 mei_gsc_proxy,mei_gsc,mei_hdcp,mei_pxp,mei_me

root@DUT6099BMGFRD:/home/gta#


Regards,

Krishna.


+    };
+
    if (opts)
        igt_info("Reloading %s with %s\n\n", driver, opts);

+    for (const char **m = mei; *m; m++) {
+        if (igt_kmod_is_loaded(*m))
+            continue;
+
+        ret = igt_kmod_load(*m, NULL);
+        if (ret) {
+            igt_debug("Could not load %s\n", *m);
+            return ret;
+        }
+    }
+
    ret = igt_kmod_load(driver, opts);
    if (ret) {
        igt_debug("Could not load %s\n", driver);
@@ -620,9 +640,14 @@ int __igt_intel_driver_unload(char **who, const char *driver)
    const char *aux[] = {
        /* gen5: ips uses symbol_get() so only a soft module dependency */
        "intel_ips",
+        NULL,
+    };
+
+    const char *mei[] = {
        /* mei_gsc uses an i915 aux dev and the other mei mods depend on it */
        "mei_pxp",
        "mei_hdcp",
+        "mei_gsc_proxy",
        "mei_gsc",
        NULL,
    };
@@ -647,6 +672,19 @@ int __igt_intel_driver_unload(char **who, const char *driver)
        }
    }

+    for (const char **m = mei; *m; m++) {
+        if (!igt_kmod_is_loaded(*m))
+            continue;
+
+        ret = igt_kmod_unload(*m);
+        if (ret) {
+            if (who)
+                *who = strdup_realloc(*who, *m);
+
+            return ret;
+        }
+    }
+
    if (igt_kmod_is_loaded(driver)) {
        ret = igt_kmod_unload(driver);
        if (ret) {
-- 
2.25.1


--------------0rGvBusQ5aX8nQVWqiv0Fexf--