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 6E389C61DBE for ; Wed, 26 Aug 2026 23:44:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FB0810EE72; Wed, 26 Aug 2026 23:44:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="T0bpm99B"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6386C10EE72 for ; Wed, 26 Aug 2026 23:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1787787859; x=1819323859; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version:content-transfer-encoding; bh=ipgRKXDlU2vTw7buzziSpMuu2rY74UKrI6HsrCltBHM=; b=T0bpm99Bgl4ACqZdu9Re7oLCa7pPPO+EfbNkE1fI+IUfKxHCpUzjZjPZ dmZXpn6vcLizg/6Bqnkj6no4qBwaYvuaAqLc0dldaLPf/xqP7OPcvtP4w kn/8hX5cTNSILDEp1rZcQ+hvHGM6i5jUWysFoIhzWDvD4GIICJJnM+SI+ YAKOBsZ0z9DX3BGJP40kgQpNyIyRMrpQAqWTj2D5VNT0DD41SHBDXp0Dm PYqc/cXwJHF/8afgNaPbauihn5oRrxteQNsgS6/iaanqtU1+p8vdOrCRX 9bEAz9tctypZKZpfzwPV5wIIpurNBvJzkQRJ2Qt7i91e6AsyqbCnBHObu A==; X-CSE-ConnectionGUID: 1JjHkH3oQtq6pOgHDxxCWw== X-CSE-MsgGUID: HbYipqdqQtiCc8+tytawlg== X-IronPort-AV: E=McAfee;i="6800,10657,11887"; a="98952438" X-IronPort-AV: E=Sophos;i="6.25,245,1779174000"; d="scan'208";a="98952438" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2026 16:44:18 -0700 X-CSE-ConnectionGUID: 537FFxnYTMa3t/EOkmsgaQ== X-CSE-MsgGUID: Nj3O8YPwTeOEs9OeNROcuw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,245,1779174000"; d="scan'208";a="263948055" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.88.27.185]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2026 16:44:18 -0700 Date: Wed, 26 Aug 2026 16:44:17 -0700 Message-ID: <85fr00cur2.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH 2/3] drm/xe/xe_oa: Avoid checking and setting fields in the OA report In-Reply-To: References: <20260821222338.1053887-5-umesh.nerlige.ramappa@intel.com> <20260821222338.1053887-7-umesh.nerlige.ramappa@intel.com> <87ecfnh6jj.wl-ashutosh.dixit@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/30.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=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Wed, 26 Aug 2026 16:30:31 -0700, Umesh Nerlige Ramappa wrote: > > On Mon, Aug 24, 2026 at 08:39:12AM -0700, Dixit, Ashutosh wrote: > > On Fri, 21 Aug 2026 15:23:41 -0700, Umesh Nerlige Ramappa wrote: > >> > >> @@ -260,7 +224,7 @@ static bool mert_wa_14026633728(struct xe_oa_strea= m *s) > >> static bool xe_oa_buffer_check_unlocked(struct xe_oa_stream *stream) > >> { > >> u32 gtt_offset =3D xe_bo_ggtt_addr(stream->oa_buffer.bo); > >> - u32 tail, hw_tail, partial_report_size, available; > >> + u32 hw_tail, partial_report_size, available; > >> int report_size =3D stream->oa_buffer.format->size; > >> unsigned long flags; > >> > >> @@ -280,29 +244,7 @@ static bool xe_oa_buffer_check_unlocked(struct xe= _oa_stream *stream) > >> /* Subtract partial amount off the tail */ > >> hw_tail =3D xe_oa_circ_diff(stream, hw_tail, partial_report_size); > >> > >> - tail =3D hw_tail; > >> - > >> - /* > >> - * Walk the stream backward until we find a report with report id an= d timestamp > >> - * not 0. We can't tell whether a report has fully landed in memory = before the > >> - * report id and timestamp of the following report have landed. > >> - * > >> - * This is assuming that the writes of the OA unit land in memory in= the order > >> - * they were written. If not : (=E2=95=AF=C2=B0=E2=96=A1=C2=B0=EF= =BC=89=E2=95=AF=EF=B8=B5 =E2=94=BB=E2=94=81=E2=94=BB > >> - */ > >> - while (xe_oa_circ_diff(stream, tail, stream->oa_buffer.tail) >=3D re= port_size) { > >> - if (oa_report_id(stream, tail) || oa_timestamp(stream, tail)) > >> - break; > >> - > >> - tail =3D xe_oa_circ_diff(stream, tail, report_size); > >> - } > >> - > >> - if (xe_oa_circ_diff(stream, hw_tail, tail) > report_size) > >> - drm_dbg(&stream->oa->xe->drm, > >> - "unlanded report(s) head=3D0x%x tail=3D0x%x hw_tail=3D0x%x\n", > >> - stream->oa_buffer.head, tail, hw_tail); > >> - > >> - stream->oa_buffer.tail =3D tail; > >> + stream->oa_buffer.tail =3D hw_tail; > > > > This line is added here and then is modified in Patch 3. So maybe we sh= ould > > not add this line here, just add the line in Patch 3? And just delete l= ine > > in this patch? So this patch will only contain code deletion. > > I left it in here intentionally. This represents a state where we still > have functional OA but tail is just tracking hw_tail and we may run into > the unlanded OA report bug. The subsequent patch fixes that bug. > > If that's messy, then I would just squash this and the next patch into > one. Thoughts? No, in that case leave as is, since it's easier to review. > > > > > Also take care of the issue reported by sashiko: > > > > - [Low] The macro `oa_report_header_64bit` is left defined but is compl= etely unused after its only callers were removed. > > > > Apart from these nits, this is: > > > > Reviewed-by: Ashutosh Dixit