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 9BBCDC83F15 for ; Wed, 30 Aug 2023 05:33:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5947F10E4B5; Wed, 30 Aug 2023 05:33:08 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A013810E4B5 for ; Wed, 30 Aug 2023 05:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693373586; x=1724909586; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=AhIzuyzQEkS/Uh3MdqgcESFFVrp5Dc5ReokUBDXvGqQ=; b=oHHYgKfg/stpMihZalm1vEUJ+ibLhOjIJ+W20rp651akoKdTHnrWsBrQ +f+41/glYp7uR/W1UuklXhPVEH+tD8KwJkpsAsvIGOk5V0H6+He+43SAd ejBp8aHUnJjd6YzArsu/C4cqBXwHLQxb2+ID51wGAatrMJv5cKD2vZ3wQ p/BFmihWHpfilbLyeoup2CKzGkSdZSauIhlhiSoCzfri9WXfBTf4UBKa1 eSJQHeiWvxzYMCKecgAdZ6DJWBSXzb5DmCwP3t0CLiAD83xh75AkfmWn6 vq7rgZ9Py3boLUbAG57vaYMHuNIeqmpjZyMy3ksh6Nje8SsduD5T+LvVD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="461929385" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="461929385" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 22:33:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="853589090" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="853589090" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.209.82]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 22:33:05 -0700 Date: Tue, 29 Aug 2023 22:33:02 -0700 Message-ID: <87cyz514dt.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Aravind Iddamsetty In-Reply-To: <20230830051544.369643-3-aravind.iddamsetty@linux.intel.com> References: <20230830051544.369643-1-aravind.iddamsetty@linux.intel.com> <20230830051544.369643-3-aravind.iddamsetty@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-xe] [PATCH 2/3] drm/xe: Use spinlock in forcewake instead of mutex 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: , Cc: intel-xe@lists.freedesktop.org, Rodrigo Vivi Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, 29 Aug 2023 22:15:43 -0700, Aravind Iddamsetty wrote: > Hi Aravind, > @@ -162,7 +162,7 @@ int xe_force_wake_get(struct xe_force_wake *fw, > domain->id, ret); > } > fw->awake_domains |= woken; > - mutex_unlock(&fw->lock); > + spin_unlock(&fw->lock); No need to change anything yet, but let's get some more opinion on this: is it ok to (a) just replace the mutex with a spinlock in these force_wake functions, or, (b) should we have a second set of functions to be called in atomic context, say: xe_force_wake_get/put_atomic? So we should use (b) in atomic contexts and everywhere else we just continue to use the previous set of non-atomic functions? Or just converting the default set of functions to use spin lock (as is done in this patch) is ok? Thanks. -- Ashutosh