From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97805606A322 for ; Wed, 2 Dec 2026 17:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=PccRkGBm Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5411610E696; Wed, 2 Dec 2026 17:11:07 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25FC410E696 for ; Wed, 2 Dec 2026 17:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796231461; x=1827767461; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=DTTlJG8GyatR34gwwEnFLijcbug81SP92RYEI2iRXRg=; b=PccRkGBmEcLr8LpjyuQ6rWJ0QIXhw+/KfPSFLgEyisr7XnNSe8WP6Xbm 4ryruUenkkQO/zaO0C/FUX+wrytKXd+kS+3LrM7yzKwg4l8J4HC4kfWOe GrZ7sycU8VN/UUtQ8TH6GbAfvvnTksM5XV3Y+qEucBNaCY9fyb0fOEJ2+ nQM3EHsEiBi/vHrE2FGqz845JIGcWZJIF+wt3aKbmj7KK5uFxGv5fyY0D SOWxmvM3DuF49fc/xiKbIM275D2fLpCy0HiT4l00sX7iwhF1PzWTVJ8ub n+e9vxBFVjT4eBe26gEBL3Pd3fKb7JGZJC9AV8d67KY7JEint0js2IZ+d A==; X-CSE-ConnectionGUID: 1SUHktnzQ1CUOLWSu0wJNQ== X-CSE-MsgGUID: bYHDswnORom0Fxp+HDTX0w== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5050891" X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="5050891" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 09:11:01 -0800 X-CSE-ConnectionGUID: cDbECEwTQSyJL5QhP4kT0Q== X-CSE-MsgGUID: seRBh67bQB6jb02Gj0GqRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="13792144" Received: from soc-5cg43972f8.clients.intel.com (HELO [172.28.182.154]) ([172.28.182.154]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 09:11:00 -0800 Message-ID: Date: Wed, 2 Dec 2026 18:10:58 +0100 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 4/4] drm/xe/pf: Extract helper to reset VFs provisioning To: =?UTF-8?Q?Pi=C3=B3rkowski=2C_Piotr?= , intel-xe@lists.freedesktop.org References: <20261201162219.22723-1-piotr.piorkowski@intel.com> <20261201162219.22723-5-piotr.piorkowski@intel.com> Content-Language: en-US From: "Bernatowicz, Marcin" In-Reply-To: <20261201162219.22723-5-piotr.piorkowski@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/1/2026 5:22 PM, Piórkowski, Piotr wrote: > From: Piotr Piórkowski > > Move the code that releases the VFs provisioning and restores the PF > default configuration, done when changing to the auto mode, into a > separate helper, as we will need it also to start VFs provisioning > using the VGPU profile from the same clean state. > > Signed-off-by: Piotr Piórkowski > --- > drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 24 ++++++++++++++-------- > 1 file changed, 15 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c > index 598fd77c230f6..0ad1b51142f6b 100644 > --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c > +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c > @@ -154,6 +154,20 @@ int xe_sriov_pf_reprovision_default(struct xe_device *xe) > return pf_reprovision_default(xe); > } > > +static int pf_reset_provisioning(struct xe_device *xe) > +{ > + lockdep_assert_held(xe_sriov_pf_master_mutex(xe)); > + > + if (xe_sriov_pf_num_vfs(xe)) { > + xe_sriov_dbg(xe, "can't reset provisioning: VFs must be disabled!\n"); > + return -EBUSY; > + } > + pf_unprovision_all_vfs(xe); > + > + /* custom PF EQ/PT/sched_if_idle would block fair VF scheduling */ > + return pf_reprovision_default(xe); > +} > + > static int pf_change_mode(struct xe_device *xe, enum xe_sriov_provisioning_mode mode, void *who) > { > lockdep_assert_held(xe_sriov_pf_master_mutex(xe)); > @@ -164,15 +178,7 @@ static int pf_change_mode(struct xe_device *xe, enum xe_sriov_provisioning_mode > if (mode == XE_SRIOV_PROVISIONING_MODE_AUTO) { > int err; > > - if (xe_sriov_pf_num_vfs(xe)) { > - xe_sriov_dbg(xe, "can't restore %s: VFs must be disabled!\n", > - mode_to_string(mode)); > - return -EBUSY; > - } > - pf_unprovision_all_vfs(xe); > - > - /* custom PF EQ/PT/sched_if_idle would block fair VF scheduling */ > - err = pf_reprovision_default(xe); > + err = pf_reset_provisioning(xe); > if (err) > return err; LGTM, Reviewed-by: Marcin Bernatowicz > }