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 19123C021A0 for ; Wed, 12 Feb 2025 02:27:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5F6B10E081; Wed, 12 Feb 2025 02:27:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="iw+U5bLQ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id A194810E081 for ; Wed, 12 Feb 2025 02:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1739327223; x=1770863223; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=zQ779D/x1fZne3eUT7Ju4HNZpdLBFVIU9hA6mek7BN4=; b=iw+U5bLQxOxy15GOZCVBHz470fMtLEO98ruORloaMVa0pvxuxBSRJZp3 eEZ0DQkxz0mrY9Ua5eLrNuT+0bbLe5Qk/QX4oDDnZFRfrooFPdknBGXUi 4eVwYXC7ysSaeSnOyXVdRrERAzCdEbcNaVGNetrEW16oFAprlYBn7BGsE zqp578DKfFBlZK5AQ1y07uc7a43JQehIow16M8/GGeLUbFPBrnjNn1nZt 2rcw5gszbcfcJGAXbJHgCPOYZ9QrUkrq9rO8RRKQgs4Gkzbo3d+G3zHal CIdiKagD1EoDf/ENvUh+cvujCRkb8KCGJC82kbbfBB1GNvwaKAwVjjW+C g==; X-CSE-ConnectionGUID: +BVb0ft6QhK8Zd6ANdZN+Q== X-CSE-MsgGUID: IP/09m8TR9yeVyzs4U2S5w== X-IronPort-AV: E=McAfee;i="6700,10204,11342"; a="65324779" X-IronPort-AV: E=Sophos;i="6.13,279,1732608000"; d="scan'208";a="65324779" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2025 18:27:02 -0800 X-CSE-ConnectionGUID: 3XmJR/jvR/ehMLZrYdHSlg== X-CSE-MsgGUID: mD6d5YyjR7CQ3OuLRiL7Iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,279,1732608000"; d="scan'208";a="117768293" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2025 18:27:02 -0800 Date: Tue, 11 Feb 2025 18:27:01 -0800 Message-ID: <85a5ar3nka.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH] drm/xe/oa: Ensure that polled read returns latest data In-Reply-To: <20250212010255.1423343-1-umesh.nerlige.ramappa@intel.com> References: <20250212010255.1423343-1-umesh.nerlige.ramappa@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/28.2 (x86_64-redhat-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 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 Tue, 11 Feb 2025 17:02:55 -0800, Umesh Nerlige Ramappa wrote: > > In polled mode, user calls poll() for read data to be available before > performing a read(). In the duration between these 2 calls, there may be > new data available in the OA buffer. To ensure user reads all available > data, check for latest data in the OA buffer in polled read. > > Signed-off-by: Umesh Nerlige Ramappa > --- > drivers/gpu/drm/xe/xe_oa.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > index fa873f3d0a9d..a692dffcb638 100644 > --- a/drivers/gpu/drm/xe/xe_oa.c > +++ b/drivers/gpu/drm/xe/xe_oa.c > @@ -548,6 +548,7 @@ static ssize_t xe_oa_read(struct file *file, char __user *buf, > mutex_unlock(&stream->stream_lock); > } while (!offset && !ret); > } else { > + xe_oa_buffer_check_unlocked(stream); > mutex_lock(&stream->stream_lock); > ret = __xe_oa_read(stream, buf, count, &offset); > mutex_unlock(&stream->stream_lock); OK, this is what blocking read does when it gets unblocked, so this is equivalent to blocking read. No need to add 'Fixes:' correct? Reviewed-by: Ashutosh Dixit