From patchwork Thu Sep 19 22:35:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13808029 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E05451B3746; Thu, 19 Sep 2024 22:38:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726785521; cv=fail; b=OnirS8F/VQYi2bcCTvuZaj7jI7SwxwCBOtyymeYoDFV9EKO/PQsH715oG6SNemegPYW6ZtLLuGWyn2Bg7jkjAwpFwGj1XNDKbAuYYqXgUdB2fsuGuIhZ5nA82FUfs/yZ4DIkKTQQnART88BqX7+oNByrfNHk3eAugalo4ObN0pg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726785521; c=relaxed/simple; bh=MSeyN4wI4jVrwrpXPBfwNiYCVHjQ+Ol9ePL96RONo8M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=DDz4STFM794HJSzWOT7vwHOZrHnHamCZETaBcSi3rpP5RWLaE90KCIznY7CcKe7/jwGgH/h/jqvpfOGgaardOemAEMRk4QpnD86Jea9HS1mKtRdLiE9/5hn8kCxJeAjvzyj55wBh5sw9s6W5fh94T6XUqtHJ9K4s2p38aCLrk94= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XoZV4y5E; arc=fail smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XoZV4y5E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726785520; x=1758321520; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=MSeyN4wI4jVrwrpXPBfwNiYCVHjQ+Ol9ePL96RONo8M=; b=XoZV4y5E4X4FmJYMer6hJKyjc/h3/+RqQ9aM3WR5Ey8iBBB0D+37RL8v lVvbYL56mq8GxzJi8s0l7AUGXmSjrTbZ3CoyUb0QlamOoY+I9r/RM0dvL oRdYFAGJ0NQXBpZUAybu7qe6D8awgKmkeaMBHzK+zLGydcs9nuqr6zLHx fO2cezOzMpfzHb0aSipkoM1SHDJ4AtsvGsz4LwsGaBAUnVojpjz4/4mUl 6K3dk0PfJ0GkVb7s/yH+Zr/uQrOttnL1qQMRVf9OL2Z5Z/dN7+hFHTCll lfXTL/CgCOPDp1AXc32MJ4RGVZHVWWZNWPiD7HcXjL7fCwrYE92ECHmJf A==; X-CSE-ConnectionGUID: hFSjcPLyQLSm6s9Z5X7ymQ== X-CSE-MsgGUID: yjrxhuuIQbW3KWaUEUgxug== X-IronPort-AV: E=McAfee;i="6700,10204,11200"; a="29514951" X-IronPort-AV: E=Sophos;i="6.10,243,1719903600"; d="scan'208";a="29514951" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2024 15:38:39 -0700 X-CSE-ConnectionGUID: Pn8z3yzwQTKH9IJ/iNg+wg== X-CSE-MsgGUID: byCZeJhwRsKEo/WHBH5olw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,243,1719903600"; d="scan'208";a="75061372" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Sep 2024 15:38:39 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 15:38:38 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 15:38:37 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 19 Sep 2024 15:38:37 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.47) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 19 Sep 2024 15:38:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lRDtmc3qxEDj/GP5TG9fMRsl31OcYAPGAbSBHgiVAH7wP3x26yByo9BA9JDuXPXo+K8MODehFEOH0mLsekdzzcIxDzGXZL271G2LbkgX/51+enOAqxhSL2vyzy00KYVRtTGJU1HrLGAxWceOl27pqmY2fBY3N9SCTvqrB0lF2LXsEQhxEuaJuZ/lgqcKwFWAXXd4+lf7h1ZswBIIDSKDWpE/9tTcMvoUCUZKE6EEcSBCCb+5VTeIylp8AQbqnp+9I2ips+2NunCM5S/302lOXuioGyOvGYfSdPU4teC3M5fuHyGHjzdfJdJJa7UfDOEfYB+i+5tZuDzajceArZAY2A== 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=jdvethQQmrLnacOS1BtlWoV6+5D4782RcFBDMX3Og/8=; b=kJClbz9HiqsBHGHhbxBmZ1xY49D8s1w7+QvpsrMXpTIusdoDR1vNwR3aB6G6vyp+idXLKMcqn387VOTFWxf+UuBWgTgGQ0tpoBLWHaawdQHkFkDNpPiEdhNiRhLccQrwgzh8ZB1xEj82sq8ocO4j79Om6N54oATz8kcbNsA9hCA91P0a0N48RfSzkXaZ3vJ674sKbZpXnT/3QBdTLImoTsZYLmr7h7Uaiy/8mLyLjpXPIve+TRkBecUMgXNELKD+2DVoOuBgWeTgcDNtgfh8ossWH4jls7tJKWQQ3nual6mcBxZrVinWB0Jx4tWduIortOl2tuxizgnJHjG731AXwg== 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 DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by MW4PR11MB5824.namprd11.prod.outlook.com (2603:10b6:303:187::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26; Thu, 19 Sep 2024 22:38:35 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39%5]) with mapi id 15.20.7982.018; Thu, 19 Sep 2024 22:38:35 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , , , "Bjorn Helgaas" , =?utf-8?q?Christian_K=C3=B6nig?= , =?utf-8?q?Krzy?= =?utf-8?q?sztof_Wilczy=C5=84ski?= CC: Rodrigo Vivi , Michal Wajdeczko , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matt Roper , =?utf-8?q?Micha=C5=82_Winiarski?= Subject: [PATCH v2 3/3] drm/xe/pf: Extend the VF LMEM BAR Date: Fri, 20 Sep 2024 00:35:57 +0200 Message-ID: <20240919223557.1897608-4-michal.winiarski@intel.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240919223557.1897608-1-michal.winiarski@intel.com> References: <20240919223557.1897608-1-michal.winiarski@intel.com> X-ClientProxiedBy: WA2P291CA0039.POLP291.PROD.OUTLOOK.COM (2603:10a6:1d0:1f::25) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|MW4PR11MB5824:EE_ X-MS-Office365-Filtering-Correlation-Id: fbc9c587-ab64-4b4a-0a05-08dcd8fbcc2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?13AhXtBIarNb6faSDOGIE6sasDzhSiX?= =?utf-8?q?ko/K9BNIpiIK0C+LuGLX/ogmpfS7HUOYthPnh/+Wu9I8YVl3gMAJ602ypaAgz41WD?= =?utf-8?q?uhisJ4P3r36uVz+lJHd3lT+OEk/9OhUCDYf6ART5cthlChipdCCyYglW4qquCWdsu?= =?utf-8?q?E9p/vWqfIH2lY5llBaIvj0nZGeU+EH2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rMhvc3hLkjvCrNSjvW3vwuX4dfGhA?= =?utf-8?q?SwK3hUOw8NLmcYKYnhikHmT+y1EQPEimMLjTZvw7tavH4uk5sauR84JWiM1vyvY5l?= =?utf-8?q?D3LG+0x01pLioBNqkEatE8/XF69NzNGGXPQs4RYy6ox1sjlTh8czkoHx3sXndQnep?= =?utf-8?q?qi2Rtiv9SSrxvfDIwlplPxjuJOKQq9V79G1gdJF3nwMl7jpNLDUUIzKiKWnVBwaR+?= =?utf-8?q?bzLfYusafM6pPWrLjPpmaqckXVtfEcgfF3Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5373.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rbKadKxXg3Amtv3hG4mefS3Kho5m?= =?utf-8?q?4zH5zgp8zqpbwoKZztV3Q+cHKuzfXwhdqDwn3ZwQIA4gIG9G19I757oXczRaMYka4?= =?utf-8?q?Dtb9FoFcS2Jj53jHnGIKcg7PeyTZDqMyuGz9TjySunQS8YWJwfNvseVjAoq2Roo25?= =?utf-8?q?Mh6HNssLI5Ms9gU42bYyeV9gGg1xevVdbk/NjOVCJwDS793nkNa/vlp/p8H/TU5j1?= =?utf-8?q?5sJKbtuO7tYUM0owkVHFkyh+MzAoW1u8KNLByXZVtD3bx2KxHNjuC4bL/w0Io5J7I?= =?utf-8?q?3Gp7suaLB+bT15OyAbsD1s1Xr98P2uzSNRWFaQLoPSxpzUSmWDDs1KSHObQ8w4XQ7?= =?utf-8?q?WewcYBf8rIVpJGVS6xknnK8I0Y0VTLCTIn0RsH+WGPWwIpjAJU5m4wqGmoYOjytKg?= =?utf-8?q?a1Eh3jDXXuc9nclHDGmUFsZ9gNJuaiWJO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wtePkoXL/lBvlAFjqsPH?= =?utf-8?q?VcqxtwJ+34J2ANrTYITKT3Qpln4WbCM6UC9PhR0hnTgptGthN1o00o6F//ppied9b?= =?utf-8?q?oklRwyXzodz1pFCmrDLXozYip0i3AAN/701oQyr+G7rLw+aTEqXh50iq77zJCZTGv?= =?utf-8?q?7D3bqz2GX6Vz69p69DRKqn81ZxxlpMgDQ9FNVTUuXHrGoWj8M+6+m60tDbRMvrlA6?= =?utf-8?q?vZfosWsRq0hbzc/JgzZueq3RAVT+4Kie3Q=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fbc9c587-ab64-4b4a-0a05-08dcd8fbcc2a X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 22:38:35.4541 (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: BhWq5Ou/S9pCrLSw6dk7TVZ/fARnnh93WZuppRqFE6dsLQxQ3EBE9jFZ/CNj7knqx6gFj/dp8iZvvdalqbRRZg7gP8n6imqbziPbczEg950= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB5824 X-OriginatorOrg: intel.com Opt into extending the VF BAR. LMEM is partitioned between multiple VFs, and we expect that the more VFs we have, the less LMEM is assigned to each VF. This means that we can achieve full LMEM BAR access without the need to attempt full VF LMEM BAR resize via pci_resize_resource(). Signed-off-by: MichaƂ Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe/regs/xe_bars.h +++ b/drivers/gpu/drm/xe/regs/xe_bars.h @@ -7,5 +7,6 @@ #define GTTMMADR_BAR 0 /* MMIO + GTT */ #define LMEM_BAR 2 /* VRAM */ +#define VF_LMEM_BAR 9 /* VF VRAM */ #endif diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c index 0f721ae17b266..a26719b87ac1e 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c @@ -4,7 +4,9 @@ */ #include +#include +#include "regs/xe_bars.h" #include "xe_assert.h" #include "xe_device.h" #include "xe_module.h" @@ -80,8 +82,14 @@ bool xe_sriov_pf_readiness(struct xe_device *xe) */ int xe_sriov_pf_init_early(struct xe_device *xe) { + int err; + xe_assert(xe, IS_SRIOV_PF(xe)); + err = pci_iov_resource_extend(to_pci_dev(xe->drm.dev), VF_LMEM_BAR, true); + if (err) + xe_sriov_info(xe, "Failed to extend VF LMEM BAR: %d", err); + return drmm_mutex_init(&xe->drm, &xe->sriov.pf.master_lock); }