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 5D9B0C433FE for ; Fri, 29 Apr 2022 15:00:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0D2110E078; Fri, 29 Apr 2022 15:00:56 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04B3B10E078 for ; Fri, 29 Apr 2022 15:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651244455; x=1682780455; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=TrEM7VbtLLiLU+X0JxysyeyIrLZh00Zhs/2m/DIgVo4=; b=FDvRc935ZamSYz6HRiR3auEGQDeFaKQY9ev+CoAYNVV4KixPuwcnhLku Ni87sqZeEw3lCgIAiOm+eh6eb2ske/Kygb/WYrTCbiYCJ6BgGw6NCRxzC agA/056nJUIqLpDI0Xlmn9AWP54TCH+hCqoo1st3anoUwbC525skws9V9 V5DTUXePWND4QjatxVT0DSA1B50elFWCQMLA7AN7mRQLGhwGQ9LA6P+ID RxjF6KKOv5QZLY/A9bmIy4dglNiB/1aPvcHuDqmmsCFqmYXywtrzJETKk ge6RP9AxAWqozQmVEeKctVNG5TTTY4OYyFKoNlZHLyv5Z3oEFZU70B+By Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="254051178" X-IronPort-AV: E=Sophos;i="5.91,185,1647327600"; d="scan'208";a="254051178" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 08:00:54 -0700 X-IronPort-AV: E=Sophos;i="5.91,185,1647327600"; d="scan'208";a="706571885" Received: from adixit-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.139.30]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 08:00:53 -0700 Date: Fri, 29 Apr 2022 07:46:05 -0700 Message-ID: <87zgk43q36.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Rodrigo Vivi In-Reply-To: References: <05d98604a81d231d39bd5f4634faae9e6489131f.1651192357.git.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/27.2 (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-gfx] [PATCH 3/9] drm/i915/pcode: Extend pcode functions for multiple gt's X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 29 Apr 2022 05:58:21 -0700, Rodrigo Vivi wrote: > > > @@ -1251,7 +1251,7 @@ static int i915_drm_resume(struct drm_device *dev) > > > > disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); > > > > - ret = intel_pcode_init(dev_priv); > > + ret = intel_gt_pcode_init(dev_priv); > > I didn't like we have this indirection i915 -> gt -> i915... > At the same time I understand you don't want to duplicate the for_each with > the error msg and all in here. > > So, what about having in this file a > static int __init_pcode(dev_priv) > ?! Sure, will fix. > > diff --git a/drivers/gpu/drm/i915/intel_pcode.c b/drivers/gpu/drm/i915/intel_pcode.c > > index ac727546868e..66020b2e461f 100644 > > --- a/drivers/gpu/drm/i915/intel_pcode.c > > +++ b/drivers/gpu/drm/i915/intel_pcode.c > > @@ -52,14 +52,12 @@ static int gen7_check_mailbox_status(u32 mbox) > > } > > } > > > > -static int __snb_pcode_rw(struct drm_i915_private *i915, u32 mbox, > > +static int intel_pcode_rw(struct intel_uncore *uncore, u32 mbox, > > I'm not sure if I like the idea of the renaming here... > I mean, it looks nicer indeed, but at the same time the "intel_" > make it looks it is exported one. Sure, will fix. > > --- a/drivers/gpu/drm/i915/intel_pcode.h > > +++ b/drivers/gpu/drm/i915/intel_pcode.h > > @@ -8,17 +8,32 @@ > > > > #include > > > > +struct intel_uncore; > > struct drm_i915_private; > > > > -int snb_pcode_read(struct drm_i915_private *i915, u32 mbox, u32 *val, u32 *val1); > > -int snb_pcode_write_timeout(struct drm_i915_private *i915, u32 mbox, u32 val, > > - int fast_timeout_us, int slow_timeout_ms); > > -#define snb_pcode_write(i915, mbox, val) \ > > +int intel_pcode_read(struct intel_uncore *uncore, u32 mbox, u32 *val, u32 *val1); > > + > > +int intel_pcode_write_timeout(struct intel_uncore *uncore, u32 mbox, u32 val, > > + int fast_timeout_us, int slow_timeout_ms); > > + > > +#define intel_pcode_write(uncore, mbox, val) \ > > + intel_pcode_write_timeout(uncore, mbox, val, 500, 0) > > + > > +int intel_pcode_request(struct intel_uncore *uncore, u32 mbox, u32 request, > > + u32 reply_mask, u32 reply, int timeout_base_ms); > > + > > +#define snb_pcode_read(i915, mbox, val, val1) \ > > + intel_pcode_read(&(i915)->uncore, mbox, val, val1) > > + > > +#define snb_pcode_write_timeout(i915, mbox, val, fast_timeout_us, slow_timeout_ms) \ > > + intel_pcode_write_timeout(&(i915)->uncore, mbox, val, fast_timeout_us, slow_timeout_ms) > > + > > +#define snb_pcode_write(i915, mbox, val) \ > > snb_pcode_write_timeout(i915, mbox, val, 500, 0) > > > > -int skl_pcode_request(struct drm_i915_private *i915, u32 mbox, u32 request, > > - u32 reply_mask, u32 reply, int timeout_base_ms); > > +#define skl_pcode_request(i915, mbox, request, reply_mask, reply, timeout_base_ms) \ > > + intel_pcode_request(&(i915)->uncore, mbox, request, reply_mask, reply, timeout_base_ms) > > and for the exported one, since we are renaming it, shouldn't we rename > all the users instead of creating these defines? Ok, in that case we might as well retain the original function names (snb_/skl_ etc. and just change the first argument to uncore)? So will do that in the next rev unless we think we want to rename everything to intel_? Thanks. -- Ashutosh