From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: <kamil.konieczny@linux.intel.com>,
<adam.miszczak@linux.intel.com>, <jakub1.kolakowski@intel.com>,
<michal.wajdeczko@intel.com>, <michal.winiarski@intel.com>,
<narasimha.c.v@intel.com>, <piotr.piorkowski@intel.com>,
<satyanarayana.k.v.p@intel.com>, <tomasz.lis@intel.com>
Subject: Re: [PATCH i-g-t 1/3] lib/xe/xe_mmio: Replace open-coded init/cleanup with existing functions
Date: Wed, 20 Nov 2024 12:02:05 +0100 [thread overview]
Message-ID: <0038a4e9-88ca-46bb-b4a7-e9964fb0823a@intel.com> (raw)
In-Reply-To: <20241119155538.605000-2-marcin.bernatowicz@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
On 11/19/2024 16:55, Marcin Bernatowicz wrote:
> Use intel_register_access_init and intel_register_access_fini to handle
> initialization and cleanup, reducing code duplication. This improves
> maintainability and ensures consistency, including handling forcewake
> for Xe.
>
> Signed-off-by: Marcin Bernatowicz<marcin.bernatowicz@linux.intel.com>
> Cc: Adam Miszczak<adam.miszczak@linux.intel.com>
> Cc: Jakub Kolakowski<jakub1.kolakowski@intel.com>
> Cc: Kamil Konieczny<kamil.konieczny@linux.intel.com>
> Cc: Lukasz Laguna<lukasz.laguna@intel.com>
> Cc: Piotr Piórkowski<piotr.piorkowski@intel.com>
> ---
> lib/xe/xe_mmio.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/lib/xe/xe_mmio.c b/lib/xe/xe_mmio.c
> index 0817c12f6..834816133 100644
> --- a/lib/xe/xe_mmio.c
> +++ b/lib/xe/xe_mmio.c
> @@ -23,13 +23,8 @@ void xe_mmio_vf_access_init(int pf_fd, int vf_id, struct xe_mmio *mmio)
>
> igt_assert_f(pci_dev, "No PCI device found for VF%u\n", vf_id);
>
> - intel_mmio_use_pci_bar(&mmio->intel_mmio, pci_dev);
> -
> - igt_assert(mmio->intel_mmio.igt_mmio);
> -
> + intel_register_access_init(&mmio->intel_mmio, pci_dev, false);
> mmio->fd = pf_fd;
> - mmio->intel_mmio.safe = false;
> - mmio->intel_mmio.pci_device_id = pci_dev->device_id;
> }
>
> /**
> @@ -53,8 +48,7 @@ void xe_mmio_access_init(int pf_fd, struct xe_mmio *mmio)
> */
> void xe_mmio_access_fini(struct xe_mmio *mmio)
> {
> - mmio->intel_mmio.pci_device_id = 0;
> - intel_mmio_unmap_pci_bar(&mmio->intel_mmio);
> + intel_register_access_fini(&mmio->intel_mmio);
> }
>
> /**
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com
<mailto:lukasz.laguna@intel.com>>
[-- Attachment #2: Type: text/html, Size: 2817 bytes --]
next prev parent reply other threads:[~2024-11-20 11:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 15:55 [PATCH i-g-t 0/3] Improvements for xe_sriov_flr test and xe_mmio lib Marcin Bernatowicz
2024-11-19 15:55 ` [PATCH i-g-t 1/3] lib/xe/xe_mmio: Replace open-coded init/cleanup with existing functions Marcin Bernatowicz
2024-11-20 11:02 ` Laguna, Lukasz [this message]
2024-11-19 15:55 ` [PATCH i-g-t 2/3] lib/xe/xe_sriov_provisioning: Refactor range handling and logging Marcin Bernatowicz
2024-11-20 10:33 ` Laguna, Lukasz
2024-11-19 15:55 ` [PATCH i-g-t 3/3] tests/xe/xe_sriov_flr: Improve clear-ggtt subcheck initialization Marcin Bernatowicz
2024-11-20 10:53 ` Laguna, Lukasz
2024-11-20 16:20 ` Bernatowicz, Marcin
2024-11-20 0:30 ` ✗ CI.xeBAT: failure for Improvements for xe_sriov_flr test and xe_mmio lib Patchwork
2024-11-20 0:46 ` ✗ Fi.CI.BAT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0038a4e9-88ca-46bb-b4a7-e9964fb0823a@intel.com \
--to=lukasz.laguna@intel.com \
--cc=adam.miszczak@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=marcin.bernatowicz@linux.intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@intel.com \
--cc=narasimha.c.v@intel.com \
--cc=piotr.piorkowski@intel.com \
--cc=satyanarayana.k.v.p@intel.com \
--cc=tomasz.lis@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox