From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6769C606BE99 for ; Thu, 3 Dec 2026 12:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DF6LUHnf Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03E0C112859; Thu, 3 Dec 2026 12:14:00 +0000 (UTC) X-Greylist: delayed 430 seconds by postgrey-1.36 at gabe; Thu, 03 Dec 2026 12:13:53 UTC Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 750BC112858; Thu, 3 Dec 2026 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796300033; x=1827836033; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=9Nc9VSnL9tMwV0QhmH5Yv/jK77eBGAa6C9vPnknEZvY=; b=DF6LUHnfjsTg1Xpz8+nhv0d/GgqG7ZIJgBbezCSDGK7E07Bysy6yszML hrTMD0glh7knj1bEe7Wtlu1D5FSS3gXQbp0PVPTfziNDbKPpnS+smE6Me a0Qtgmm7LvM5Yk1Q7nzkN1tRJVi00b0MdnksgJlxWh0YtItvmNtJmvEmY 2S39uh7KZ+Z5NNd3MXaEFJ8Xc1msm25HZZ2la7oGtoousqEz7Vx0fpGGb rH8ZPawZ9f2mkJqX7IayaLi8d56rrNE0yZanjCupXaNL9FKvI15295QxH 6k5Z5GFIURGcsmdmdm3Bt6xtIS59KbcqiIgWunWHxnW3nNexEERIZmYdC A==; X-CSE-ConnectionGUID: 9AwseTXLSQ6/bSmH//Wn3Q== X-CSE-MsgGUID: LeK9TY4cQyGdbG9eC8FfLA== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="10883" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="10883" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa114.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 04:06:40 -0800 X-CSE-ConnectionGUID: ItwIv950TlOUpmBijrz9tQ== X-CSE-MsgGUID: fjPbG1WnSbutwx45cyivSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="14065187" Received: from abityuts-desk1.ger.corp.intel.com (HELO localhost) ([10.245.244.117]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 04:06:39 -0800 Date: Thu, 3 Dec 2026 14:06:34 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: sashiko-reviews@lists.linux.dev Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Subject: Re: [PATCH v2 4/7] drm/i915/de: Use raw readl()/writel()/etc for register access in display Message-ID: References: <20261201192737.13451-1-ville.syrjala@linux.intel.com> <20261201192737.13451-5-ville.syrjala@linux.intel.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-gfx" X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, Dec 01, 2026 at 07:43:25PM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 2 potential > issues to consider: > - [Medium] drm/i915/de: missing Wa_15015404425 flush in ptl_mmio_funcs > on PTL A-step That's pre-production hw. Don't care. > - [Low] drm/i915/de: missing assert_display_rpm_held() in 8-bit and > 16-bit MMIO helpers Could throw those in as a followup I suppose. > -- > > commit e8135e4c35609a69906e1d35188298d3836a144f > Author: Ville Syrjälä > > drm/i915/de: Use raw readl()/writel()/etc for register access in display > > This commit replaces the remaining intel_uncore_{read,write}*() calls in > the display MMIO helpers with direct readb()/writeb()/readw()/readl()/ > writel() accesses and implements Wa_15015404425 in intel_de.c for Lunar > Lake. > > > diff --git a/drivers/gpu/drm/i915/display/intel_de.c b/drivers/gpu/drm/i915/display/intel_de.c > > index 658380cb8973b..d65f68b649d1d 100644 > > --- a/drivers/gpu/drm/i915/display/intel_de.c > > +++ b/drivers/gpu/drm/i915/display/intel_de.c > [ ... ] > > @@ -149,6 +144,12 @@ int intel_de_wait_for_clear_ms(struct intel_display *display, intel_reg_t reg, > > return intel_de_wait_ms(display, reg, mask, 0, timeout_ms, NULL); > > } > > > > +static __always_inline void __iomem * > > +__intel_de_mmio_for_reg(struct intel_display *display, intel_reg_t reg) > > +{ > > + return display->mmio.regs + intel_reg_offset(reg); > > +} > > + > > u8 intel_de_read8(struct intel_display *display, intel_reg_t reg) > > { > > u8 val; > > @@ -156,7 +157,7 @@ u8 intel_de_read8(struct intel_display *display, intel_reg_t reg) > > /* this is only used on VGA registers (possible on pre-g4x) */ > > drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 5 || display->platform.g4x); > > > > - val = intel_uncore_read8(__to_uncore(display), reg); > > + val = readb(__intel_de_mmio_for_reg(display, reg)); > > trace_intel_reg_rw(false, reg, val, sizeof(val)); > > > > return val; > > @@ -167,7 +168,7 @@ void intel_de_write8(struct intel_display *display, intel_reg_t reg, u8 val) > > drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 5 || display->platform.g4x); > > > > trace_intel_reg_rw(true, reg, val, sizeof(val)); > > - intel_uncore_write8(__to_uncore(display), reg, val); > > + writeb(val, __intel_de_mmio_for_reg(display, reg)); > > } > > > > u16 intel_de_read16(struct intel_display *display, intel_reg_t reg) > > @@ -177,7 +178,7 @@ u16 intel_de_read16(struct intel_display *display, intel_reg_t reg) > > /* this is only used on MCHBAR registers on pre-SNB */ > > drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 6); > > > > - val = intel_uncore_read16(__to_uncore(display), reg); > > + val = readw(__intel_de_mmio_for_reg(display, reg)); > > trace_intel_reg_rw(false, reg, val, sizeof(val)); > > > > return val; > > [Severity: Low] > Should intel_de_read8(), intel_de_write8(), and intel_de_read16() call > assert_display_rpm_held(display) like __intel_de_read() and > __intel_de_write() do? > > Previously, intel_uncore_read8(), intel_uncore_write8(), and > intel_uncore_read16() checked assert_rpm_wakelock_held() via > GEN2_READ_HEADER and GEN2_WRITE_HEADER, so replacing them directly with > readb(), writeb(), and readw() drops the runtime PM wakelock assertion for > 8-bit VGA and 16-bit MCHBAR accesses. > > [ ... ] > > > @@ -533,11 +568,31 @@ static void lnl_mmio_write(struct intel_display *display, intel_reg_t reg, u32 v > > #undef LNL_MMIO_FLAGS > > > > static const struct intel_mmio_funcs lnl_mmio_funcs = { > > - .read_fw = i9xx_mmio_read_fw, > > + .read_fw = lnl_mmio_read_fw, > > .read = lnl_mmio_read, > > .write = lnl_mmio_write, > > }; > > > > +#define PTL_MMIO_FLAGS __MMIO_WAKELOCK > > + > > +static u32 ptl_mmio_read(struct intel_display *display, intel_reg_t reg) > > +{ > > + return __intel_de_read(display, reg, PTL_MMIO_FLAGS); > > +} > > + > > +static void ptl_mmio_write(struct intel_display *display, intel_reg_t reg, u32 val) > > +{ > > + __intel_de_write(display, reg, val, PTL_MMIO_FLAGS); > > +} > > + > > +#undef PTL_MMIO_FLAGS > > + > > +static const struct intel_mmio_funcs ptl_mmio_funcs = { > > + .read_fw = i9xx_mmio_read_fw, > > + .read = ptl_mmio_read, > > + .write = ptl_mmio_write, > > +}; > > + > [ ... ] > > @@ -571,7 +630,9 @@ void intel_de_init(struct intel_display *display) > > else > > display->mmio.funcs = &i9xx_mmio_funcs; > > } else { > > - if (DISPLAY_VER(display) >= 20) > > + if (DISPLAY_VER(display) >= 30) > > + display->mmio.funcs = &ptl_mmio_funcs; > > + else if (DISPLAY_VER(display) >= 20) > > display->mmio.funcs = &lnl_mmio_funcs; > > else > > display->mmio.funcs = &i9xx_mmio_funcs; > > [Severity: Medium] > Does selecting ptl_mmio_funcs unconditionally for DISPLAY_VER(display) >= 30 > drop Wa_15015404425 on Panther Lake systems where XE_DEVICE_WA(xe, > 15015404425) is active? > > In xe_device_wa_oob.rules and xe_wa_oob.rules, 15015404425 is enabled for > PLATFORM(PANTHERLAKE) and only disabled once media_gt is at least stepping > B0 (and after xe_display_init_early() runs during probe): > > drivers/gpu/drm/xe/xe_device.c:xe_device_probe() { > ... > err = xe_display_init_early(xe); > if (err) > return err; > ... > if (xe->tiles->media_gt && > XE_GT_WA(xe->tiles->media_gt, 15015404425_disable)) > XE_DEVICE_WA_DISABLE(xe, 15015404425); > } > > Before this change, display reads went through xe_mmio_read32() -> > mmio_flush_pending_writes(), which checked XE_DEVICE_WA(mmio->tile->xe, > 15015404425). With ptl_mmio_funcs omitting __MMIO_READ_AFTER_WRITE_WA, > non-posted display reads on Panther Lake with an A-step media/compute die > (or during early display init) can overtake pending posted writes and > return stale register values. > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20261201192737.13451-1-ville.syrjala@linux.intel.com?part=4 -- Ville Syrjälä Intel