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 98CFACE8E97 for ; Thu, 24 Oct 2024 17:23:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6289610E971; Thu, 24 Oct 2024 17:23:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="YZrDECuX"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32ABA10E971 for ; Thu, 24 Oct 2024 17:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729790583; x=1761326583; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=p17slaHwnZ/3sZVHe5lk/6fJzXpNerLaSoTtVnUxH8c=; b=YZrDECuX8L5m/s8TxPpYidcRQY/WVN5ttkycSYhcNDIsWhfcRtnwgu/w 6eow60s00NvqlblygHeRsskZ6be+m2i0F+Mv+Sxl6Y3FHIxc5F6HYTXQq rsKSBm7owdgltkOoyZshcuoMNtNkD+8pSQB4as+GS7Us/mJvaxCvjquGC o1z/AIGnCf6ByhWmlZ947K0Xsd3IjVvhRCx79dAPM02Gh7laiuv4Qo0Ki T55jRPjVzKnuQusgxJbZ9WoOyaPNokze5guF8V/NjJk3kl0IYlEHdzsvB 4cxOKegCYhlYHiYrwHnMS0bLupU+3UCb6M+ZIsmGf33Hq1geJNfJ0Ro3Q Q==; X-CSE-ConnectionGUID: AO5z7e3lR8m1IMAHU9p/Tw== X-CSE-MsgGUID: szmeFB5KTkCJwCArrIfMVg== X-IronPort-AV: E=McAfee;i="6700,10204,11235"; a="46922007" X-IronPort-AV: E=Sophos;i="6.11,229,1725346800"; d="scan'208";a="46922007" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2024 10:23:03 -0700 X-CSE-ConnectionGUID: f7/l92LLSeqLUctIn31RKA== X-CSE-MsgGUID: 4LmTUUk4T/mJFTB0uo7ycg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,229,1725346800"; d="scan'208";a="80564884" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 24 Oct 2024 10:23:03 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 24 Oct 2024 10:23:01 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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, 24 Oct 2024 10:23:01 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 24 Oct 2024 10:23:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V8ohyEIFGi9wyxL5LoTd/RUqTr5uz82ZW+0EtcpdO22eXLdXpbQZBvF2Wn8rkbpSw/juUDtCljvTjMaoeHFBkZAfaoX/2gC/9Pg+8y4kUcJefQD/HQYPRAsTPazHcB4/UnFEt7Aqh7xmAJ49ztQCWI+vQXXMsKsy38hOphx/uF28xsBpVnbfTkLyGhBojGX97HLYTB5V3kuM8nRcA9d4rdVpsqW+dkXEs3WsUtYaTwpSSMbPX94sUZl23S6I/8lBeIZX4VSVVJZBBtAljGpK4FLpVR0tUDze1WUAxBE+A138O8zc+xG96X9kadO0OOBgWGDM7+q9UGbfbTWhQWIJ6Q== 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=tHaluV/PnalyG2R3friZGrk9YyINHK2VxDGttCUkRso=; b=hQihk9LUNrC/GaKokQ9eXyc9eg1G8zUe09oyPlGIobERccjbH6UfwJn/RK9VLhpABxYxNike/Am6Q5aQq89IiACmHL+BeEq7zzTTPaK7V8/asulbL6BBPF1GqA0yzWdtGKCn5C7P6xFGF+b5SMSI/1pngPM24ja4UL1ZycDhQCCHFtZkuuW7OtSfXDuA4TrjdWbxHMipbHtsUwgjjsCRQiw+0dJ1JrFkeOnAj39B19D1efPTAMhrYCLlzfhzywFD8NRrqtRViJNV2w2Eu5jXAqqHyzRQhLp0QPxfW3BEJcQmUm0wCAw2acm+uBtzOubHS8zCZofB4q7/m2khOZA4rg== 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 PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) by IA0PR11MB7750.namprd11.prod.outlook.com (2603:10b6:208:442::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Thu, 24 Oct 2024 17:22:58 +0000 Received: from PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332]) by PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332%6]) with mapi id 15.20.8093.018; Thu, 24 Oct 2024 17:22:58 +0000 Date: Thu, 24 Oct 2024 17:22:37 +0000 From: Matthew Brost To: John Harrison CC: Nirmoy Das , , "Badal Nilawar" , Jani Nikula , Matthew Auld , Himal Prasad Ghimiray , Lucas De Marchi , Subject: Re: [PATCH v2] drm/xe/ufence: Flush xe ordered_wq in case of ufence timeout Message-ID: References: <20241024151815.929142-1-nirmoy.das@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BYAPR11CA0077.namprd11.prod.outlook.com (2603:10b6:a03:f4::18) To PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR11MB6522:EE_|IA0PR11MB7750:EE_ X-MS-Office365-Filtering-Correlation-Id: 15de79d4-f427-4f3f-d971-08dcf4508164 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FqktwIDuPfYmWlIBg1mliP0l1rejuOCBJbRZJWLb1E+aohM8DqL+czRoBKOg?= =?us-ascii?Q?eHGEQSf2Auq4OAJ1jSq/cmkWrftWHtENX7QzJSIDmIGLQhikziQyLTZFuIOZ?= =?us-ascii?Q?pO8N9qZwJaE9VwZYMLkYt8GvxzCEF+Z9bfzTY13CPdSX3sS0laWHZlZNJ3aR?= =?us-ascii?Q?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e/bsgJC4an9sG0qFk7K?= =?us-ascii?Q?xti06L9r8W18nuGc5j2wA8kquntohO+aCnUIGJ7u7QqcCb7UfYXk2zHkjWgq?= =?us-ascii?Q?momZmeadpTf9m2d+fdmltL491fe1zmoJLRAIPofpWuHgBm8+Q4rMseXRZmde?= =?us-ascii?Q?yC+FyxTXbDCQfKHqP4uQ2fDlvkxbwnp1y+cR6rOUDotJFf8x6qgYj4ERGgfk?= =?us-ascii?Q?k6l/+6iNTREyF/CsAW8j?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB6522.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YzovV+6Ru/A0P+ae4LnegFT0UuDupVnC50ICoSDqQH9UFWkfTeoDgze9+khF?= =?us-ascii?Q?/2TRWQH78QGFAhfoo0LpbS9eZwcqC+m/Uermdsu9/HqWqwc3jgn5kNVRvBt6?= =?us-ascii?Q?/c1yiIoEY+WFMQ0mq+Rdm8nMOZNleZ7UBVwJ4z15iviHINZjY6J31sAfaAsg?= =?us-ascii?Q?0bAE2T7+nP3oDZZpIiwpqk9mZFjXvnLtMKR4GCqOQv8Xbr+3d3O4ft7YMl+e?= =?us-ascii?Q?eT2HVjI6od2AVDcc6VYiQDzEWQDCrNuPux5CbGjTTeTj6ZmgrHs+uyUeZtv3?= =?us-ascii?Q?Xyid+kbtPGFoPkuqyHlCxGWVM7ck3VXc+S2fbwxP3ebIqDI5FI9vYSNxJT5h?= =?us-ascii?Q?NSgzpiOJnm8E+mkESx5I1o4SLUxDv7sjYZrOI+4SDpJer7pZ8wy9tgPS6Esh?= =?us-ascii?Q?iHLN/LdVTOb0HXGKc8FFixWeiRsSdD712DpQ1viBMY1XaTDut5SKsMWu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etLU5CIJrm+mQyIosJD/2FHYJUlEcN?= =?us-ascii?Q?rdglNSRdlBG57xd1OUBVFd9H6dbI40QkVwGn1eSNH35MzV5vlJ3YlohJ+yRz?= =?us-ascii?Q?HtRKvUPJBwpKJmxNEwasyYdwdkOfpwITRbi5UA7prT1dn2U91GNGWcK20Dq+?= =?us-ascii?Q?fpYDBe8t6UAgqAbUBuNCiXxsOF+OyHuPAuNGrE/X2bmyJpG2/DS/rgzw4Nor?= =?us-ascii?Q?nEPAWUQTlAI8U79OoKk38WX8NejlH2/ri7bvBf0989CNeCEFVrm+c2lBHAwF?= =?us-ascii?Q?ew=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 15de79d4-f427-4f3f-d971-08dcf4508164 X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6522.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 17:22:58.6687 (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: hUHGZy+bhjLbC6+ZPqSFgzCg1T/wEkuA8ij3BqUbtpJ0OP8uw9qq6qkBI4RCnpFbh/9pJeXgzpeolhBGhx31/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7750 X-OriginatorOrg: intel.com X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Thu, Oct 24, 2024 at 10:14:21AM -0700, John Harrison wrote: > On 10/24/2024 08:18, Nirmoy Das wrote: > > Flush xe ordered_wq in case of ufence timeout which is observed > > on LNL and that points to the recent scheduling issue with E-cores. > > > > This is similar to the recent fix: > > commit e51527233804 ("drm/xe/guc/ct: Flush g2h worker in case of g2h > > response timeout") and should be removed once there is E core > > scheduling fix. > > > > v2: Add platform check(Himal) > > s/__flush_workqueue/flush_workqueue(Jani) > > > > Cc: Badal Nilawar > > Cc: Jani Nikula > > Cc: Matthew Auld > > Cc: John Harrison > > Cc: Himal Prasad Ghimiray > > Cc: Lucas De Marchi > > Cc: # v6.11+ > > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2754 > > Suggested-by: Matthew Brost > > Signed-off-by: Nirmoy Das > > Reviewed-by: Matthew Brost > > --- > > drivers/gpu/drm/xe/xe_wait_user_fence.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/gpu/drm/xe/xe_wait_user_fence.c b/drivers/gpu/drm/xe/xe_wait_user_fence.c > > index f5deb81eba01..78a0ad3c78fe 100644 > > --- a/drivers/gpu/drm/xe/xe_wait_user_fence.c > > +++ b/drivers/gpu/drm/xe/xe_wait_user_fence.c > > @@ -13,6 +13,7 @@ > > #include "xe_device.h" > > #include "xe_gt.h" > > #include "xe_macros.h" > > +#include "compat-i915-headers/i915_drv.h" > > #include "xe_exec_queue.h" > > static int do_compare(u64 addr, u64 value, u64 mask, u16 op) > > @@ -155,6 +156,19 @@ int xe_wait_user_fence_ioctl(struct drm_device *dev, void *data, > > } > > if (!timeout) { > > + if (IS_LUNARLAKE(xe)) { > > + /* > > + * This is analogous to e51527233804 ("drm/xe/guc/ct: Flush g2h > > + * worker in case of g2h response timeout") > > + * > > + * TODO: Drop this change once workqueue scheduling delay issue is > > + * fixed on LNL Hybrid CPU. > > + */ > > + flush_workqueue(xe->ordered_wq); > If we are having multiple instances of this workaround, can we wrap them up > in as 'LNL_FLUSH_WORKQUEUE(q)' or some such? Put the IS_LNL check inside the > macro and make it pretty obvious exactly where all the instances are by > having a single macro name to search for. > +1, I think Lucas is suggesting something similar to this on the chat to make sure we don't lose track of removing these W/A when this gets fixed. Matt > John. > > > + err = do_compare(addr, args->value, args->mask, args->op); > > + if (err <= 0) > > + break; > > + } > > err = -ETIME; > > break; > > } >