public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
	treding@nvidia.com, vbhadram@nvidia.com, jonathanh@nvidia.com,
	mperttunen@nvidia.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, alex.williamson@redhat.com, clg@redhat.com,
	alexandre.torgue@foss.st.com, joabreu@synopsys.com
Cc: msalter@redhat.com
Subject: [RFC PATCH 0/5] vfio: platform: reset: Introduce tegra234 mgbe reset module
Date: Thu, 29 Aug 2024 18:11:04 +0200	[thread overview]
Message-ID: <20240829161302.607928-1-eric.auger@redhat.com> (raw)

We introduce a new vfio platform reset module for the tegra234
Multi-Gigabit Ethernet (MGBE).

This reset driver is more complex than previous ones because some
resources need to be prepared and released (clocks and reset). The
existing infrastructure was too simplistic to do that. So this series
extends the original single reset function to an ops struct enhanced
with optional open/close callbacks.

There the reset and clocks are handled. the functions are
called on open_device/close_device callback. That's questionable
whether this should be called in init/release instead but memory
regions cannot be ioremapped at that time since
vfio_platform_regions_init is called on .opendevice.

The actual reset toggles the mac reset, disable mac interrupts,
stop DMA requests and do a SW reset.

The reset code is inspired of the native driver:
net/ethernet/stmicro/stmmac/dwxgmac2_dma.c and
net/ethernet/stmicro/stmmac/dwmac-tegra.c

This series can be found at:
https://github.com/eauger/linux/tree/tegra234-mgbe-reset-module-rfc

The qemu series to test with can be found at
https://github.com/eauger/qemu/tree/tegra234-mgbe-rfc

Best Regards

Eric


Eric Auger (5):
  vfio_platform: Introduce vfio_platform_get_region helper
  vfio_platform: reset: Prepare for additional reset ops
  vfio_platform: reset: Introduce new open and close callbacks
  vfio-platform: Add a new handle to store reset data
  vfio/platform: Add tegra234-mgbe vfio platform reset module

 drivers/vfio/platform/reset/Kconfig           |   7 +
 drivers/vfio/platform/reset/Makefile          |   2 +
 .../platform/reset/vfio_platform_amdxgbe.c    |   7 +-
 .../reset/vfio_platform_calxedaxgmac.c        |   7 +-
 .../reset/vfio_platform_tegra234_mgbe.c       | 245 ++++++++++++++++++
 drivers/vfio/platform/vfio_platform_common.c  |  78 ++++--
 drivers/vfio/platform/vfio_platform_private.h |  43 ++-
 7 files changed, 358 insertions(+), 31 deletions(-)
 create mode 100644 drivers/vfio/platform/reset/vfio_platform_tegra234_mgbe.c

-- 
2.41.0


             reply	other threads:[~2024-08-29 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 16:11 Eric Auger [this message]
2024-08-29 16:11 ` [RFC PATCH 1/5] vfio_platform: Introduce vfio_platform_get_region helper Eric Auger
2024-08-29 16:11 ` [RFC PATCH 2/5] vfio_platform: reset: Prepare for additional reset ops Eric Auger
2024-08-29 16:11 ` [RFC PATCH 3/5] vfio_platform: reset: Introduce new open and close callbacks Eric Auger
2024-08-29 23:21   ` Alex Williamson
2024-09-02 16:03     ` Eric Auger
2024-09-04 19:40       ` Alex Williamson
2024-09-11 12:18         ` Eric Auger
2024-08-29 16:11 ` [RFC PATCH 4/5] vfio-platform: Add a new handle to store reset data Eric Auger
2024-08-29 16:11 ` [RFC PATCH 5/5] vfio/platform: Add tegra234-mgbe vfio platform reset module Eric Auger

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=20240829161302.607928-1-eric.auger@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=clg@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=jonathanh@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=msalter@redhat.com \
    --cc=treding@nvidia.com \
    --cc=vbhadram@nvidia.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