[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87r0y1l7m1.ffs@tglx>
Date: Thu, 17 Nov 2022 20:10:46 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Nipun Gupta <nipun.gupta@....com>, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, gregkh@...uxfoundation.org,
rafael@...nel.org, eric.auger@...hat.com,
alex.williamson@...hat.com, cohuck@...hat.com,
puneet.gupta@....com, song.bao.hua@...ilicon.com,
mchehab+huawei@...nel.org, maz@...nel.org, f.fainelli@...il.com,
jeffrey.l.hugo@...il.com, saravanak@...gle.com,
Michael.Srba@...nam.cz, mani@...nel.org, yishaih@...dia.com,
jgg@...pe.ca, jgg@...dia.com, robin.murphy@....com,
will@...nel.org, joro@...tes.org, masahiroy@...nel.org,
ndesaulniers@...gle.com, linux-arm-kernel@...ts.infradead.org,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, kvm@...r.kernel.org
Cc: okaya@...nel.org, harpreet.anand@....com, nikhil.agarwal@....com,
michal.simek@....com, aleksandar.radovanovic@....com, git@....com,
Nipun Gupta <nipun.gupta@....com>
Subject: Re: [RFC PATCH v4 7/8] bus/cdx: add cdx-MSI domain with gic-its
domain as parent
On Fri, Oct 14 2022 at 10:10, Nipun Gupta wrote:
> Since CDX devices are not linked to of node they need a
> separate MSI domain for handling device ID to be provided to
> the GIC ITS domain.
>
> This also introduces APIs to alloc and free IRQs for CDX domain.
This is not really much of an explanation.
> +#include "cdx.h"
> +
> +#define REQ_ID_SHIFT 10
> +
> +/*
> + * Convert an msi_desc to a globaly unique identifier (per-device
> + * reqid + msi_desc position in the msi_list).
> + */
> +static irq_hw_number_t cdx_domain_calc_hwirq(struct cdx_device *dev,
> + struct msi_desc *desc)
> +{
> + return (dev->req_id << REQ_ID_SHIFT) | desc->msi_index;
> +}
> +
> +static void cdx_msi_set_desc(msi_alloc_info_t *arg,
> + struct msi_desc *desc)
> +{
> + arg->desc = desc;
> + arg->hwirq = cdx_domain_calc_hwirq(to_cdx_device(desc->dev), desc);
> +}
> +
> +static void cdx_msi_write_msg(struct irq_data *irq_data,
> + struct msi_msg *msg)
> +{
> + struct msi_desc *msi_desc = irq_data_get_msi_desc(irq_data);
> + struct cdx_device *cdx_dev = to_cdx_device(msi_desc->dev);
> + struct cdx_controller_t *cdx = cdx_dev->cdx;
> + uint64_t addr;
> + int ret;
> +
> + addr = ((uint64_t)(msi_desc->msg.address_hi) << 32) |
> + msi_desc->msg.address_lo;
> +
> + ret = cdx->ops.write_msi(cdx, cdx_dev->bus_num, cdx_dev->dev_num,
> + msi_desc->msi_index, msi_desc->msg.data,
> + addr);
> + if (ret)
> + dev_err(&cdx_dev->dev, "Write MSI failed to CDX controller\n");
> +}
So this is yet another variant of platform-MSI which is about to be
kicked from the planet.
Please check:
https://lore.kernel.org/r/20221111131813.914374272@linutronix.de
https://lore.kernel.org/r/20221111133158.196269823@linutronix.de
and the ARM/GIC conversion in:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/log/?h=devmsi-arm
The latter is WIP, but functional.
I'm sure you replace your yet another magic MSI domain which only
provides a device specific MSI write function with the new
infrastructure trivially.
Thanks,
tglx
Powered by blists - more mailing lists