2020-09-29 08:58:12

by Diana Madalina Craciun

[permalink] [raw]
Subject: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

The vfio-mc bus driver needs some additional services to be exported by the
mc-bus driver like:
- a way to reset the DPRC container
- driver_override support
- functions to setup/tear down a DPRC
- functions for allocating the pool of interrupts. In case of VFIO the
interrupts are not configured at probe time, but later by userspace
request

v4 -> v5
- dprc_celanup should not fail

v3 -> v4
- Rebased on the latest kernel.
- Exported a dprc_remove function

v2 -> v3
- Add a new version for dprc_get_obj_region
- Export the cacheability bus specific bits defines

v1 -> v2
- Remove driver_override propagation through various functions
- Cache the DPRC API version

The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
devices" patches, but the series were split because they are targeting
different subsystems. However, the mc-bus patches may suffer changes
when addressing the VFIO review comments.

The patches do not address the comment regarding moving driver_override
in the core code. I prefer not to tie these patches on that change and
address that separately.

Bharat Bhushan (3):
bus/fsl-mc: add support for 'driver_override' in the mc-bus
bus/fsl-mc: Add dprc-reset-container support
bus/fsl-mc: Extend ICID size from 16bit to 32bit

Diana Craciun (10):
bus/fsl-mc: Do no longer export the total number of irqs outside
dprc_scan_objects
bus/fsl-mc: Add a new parameter to dprc_scan_objects function
bus/fsl-mc: Set the QMAN/BMAN region flags
bus/fsl-mc: Cache the DPRC API version
bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
multiple entities
bus/fsl-mc: Export a cleanup function for DPRC
bus/fsl-mc: Add a container setup function
bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
bus/fsl-mc: Add a new version for dprc_get_obj_region command

drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
drivers/bus/fsl-mc/mc-io.c | 7 +-
include/linux/fsl/mc.h | 41 +++++-
7 files changed, 359 insertions(+), 127 deletions(-)

--
2.17.1


2020-09-29 08:58:30

by Diana Madalina Craciun

[permalink] [raw]
Subject: [PATCH v5 01/13] bus/fsl-mc: Do no longer export the total number of irqs outside dprc_scan_objects

The total number of interrupts is only used for some checks
outside the dprc_scan_objects function. Furthermore, in some
situations the check is made twice. Move the bounds check inside
the function for all situations.

Signed-off-by: Diana Craciun <[email protected]>
---
drivers/bus/fsl-mc/dprc-driver.c | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c
index 2a473c09bc33..54c576d68122 100644
--- a/drivers/bus/fsl-mc/dprc-driver.c
+++ b/drivers/bus/fsl-mc/dprc-driver.c
@@ -3,6 +3,7 @@
* Freescale data path resource container (DPRC) driver
*
* Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2019-2020 NXP
* Author: German Rivera <[email protected]>
*
*/
@@ -220,8 +221,6 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
* dprc_scan_objects - Discover objects in a DPRC
*
* @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC object
- * @total_irq_count: If argument is provided the function populates the
- * total number of IRQs created by objects in the DPRC.
*
* Detects objects added and removed from a DPRC and synchronizes the
* state of the Linux bus driver, MC by adding and removing
@@ -235,8 +234,7 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
* populated before they can get allocation requests from probe callbacks
* of the device drivers for the non-allocatable devices.
*/
-static int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
- unsigned int *total_irq_count)
+static int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev)
{
int num_child_objects;
int dprc_get_obj_failures;
@@ -317,22 +315,21 @@ static int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
* Allocate IRQ's before binding the scanned devices with their
* respective drivers.
*/
- if (dev_get_msi_domain(&mc_bus_dev->dev) && !mc_bus->irq_resources) {
+ if (dev_get_msi_domain(&mc_bus_dev->dev)) {
if (irq_count > FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS) {
dev_warn(&mc_bus_dev->dev,
"IRQs needed (%u) exceed IRQs preallocated (%u)\n",
irq_count, FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS);
}

- error = fsl_mc_populate_irq_pool(mc_bus,
+ if (!mc_bus->irq_resources) {
+ error = fsl_mc_populate_irq_pool(mc_bus,
FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS);
- if (error < 0)
- return error;
+ if (error < 0)
+ return error;
+ }
}

- if (total_irq_count)
- *total_irq_count = irq_count;
-
dprc_remove_devices(mc_bus_dev, child_obj_desc_array,
num_child_objects);

@@ -365,7 +362,7 @@ static int dprc_scan_container(struct fsl_mc_device *mc_bus_dev)
* Discover objects in the DPRC:
*/
mutex_lock(&mc_bus->scan_mutex);
- error = dprc_scan_objects(mc_bus_dev, NULL);
+ error = dprc_scan_objects(mc_bus_dev);
mutex_unlock(&mc_bus->scan_mutex);
if (error < 0) {
fsl_mc_cleanup_all_resource_pools(mc_bus_dev);
@@ -434,9 +431,8 @@ static irqreturn_t dprc_irq0_handler_thread(int irq_num, void *arg)
DPRC_IRQ_EVENT_CONTAINER_DESTROYED |
DPRC_IRQ_EVENT_OBJ_DESTROYED |
DPRC_IRQ_EVENT_OBJ_CREATED)) {
- unsigned int irq_count;

- error = dprc_scan_objects(mc_dev, &irq_count);
+ error = dprc_scan_objects(mc_dev);
if (error < 0) {
/*
* If the error is -ENXIO, we ignore it, as it indicates
@@ -451,12 +447,6 @@ static irqreturn_t dprc_irq0_handler_thread(int irq_num, void *arg)

goto out;
}
-
- if (irq_count > FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS) {
- dev_warn(dev,
- "IRQs needed (%u) exceed IRQs preallocated (%u)\n",
- irq_count, FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS);
- }
}

out:
--
2.17.1

2020-09-29 09:00:06

by Diana Madalina Craciun

[permalink] [raw]
Subject: [PATCH v5 06/13] bus/fsl-mc: Add dprc-reset-container support

From: Bharat Bhushan <[email protected]>

DPRC reset is required by VFIO-mc in order to stop a device
to further generate DMA transactions.

Signed-off-by: Bharat Bhushan <[email protected]>
Signed-off-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Diana Craciun <[email protected]>
---
drivers/bus/fsl-mc/dprc.c | 71 +++++++++++++++++++++++++++++
drivers/bus/fsl-mc/fsl-mc-private.h | 7 +++
include/linux/fsl/mc.h | 7 +++
3 files changed, 85 insertions(+)

diff --git a/drivers/bus/fsl-mc/dprc.c b/drivers/bus/fsl-mc/dprc.c
index e76f2c76f4c8..2448a723eb28 100644
--- a/drivers/bus/fsl-mc/dprc.c
+++ b/drivers/bus/fsl-mc/dprc.c
@@ -80,6 +80,77 @@ int dprc_close(struct fsl_mc_io *mc_io,
}
EXPORT_SYMBOL_GPL(dprc_close);

+/**
+ * dprc_reset_container - Reset child container.
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPRC object
+ * @child_container_id: ID of the container to reset
+ * @options: 32 bit options:
+ * - 0 (no bits set) - all the objects inside the container are
+ * reset. The child containers are entered recursively and the
+ * objects reset. All the objects (including the child containers)
+ * are closed.
+ * - bit 0 set - all the objects inside the container are reset.
+ * However the child containers are not entered recursively.
+ * This option is supported for API versions >= 6.5
+ * In case a software context crashes or becomes non-responsive, the parent
+ * may wish to reset its resources container before the software context is
+ * restarted.
+ *
+ * This routine informs all objects assigned to the child container that the
+ * container is being reset, so they may perform any cleanup operations that are
+ * needed. All objects handles that were owned by the child container shall be
+ * closed.
+ *
+ * Note that such request may be submitted even if the child software context
+ * has not crashed, but the resulting object cleanup operations will not be
+ * aware of that.
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dprc_reset_container(struct fsl_mc_io *mc_io,
+ u32 cmd_flags,
+ u16 token,
+ int child_container_id,
+ u32 options)
+{
+ struct fsl_mc_command cmd = { 0 };
+ struct dprc_cmd_reset_container *cmd_params;
+ u32 cmdid = DPRC_CMDID_RESET_CONT;
+ int err;
+
+ /*
+ * If the DPRC object version was not yet cached, cache it now.
+ * Otherwise use the already cached value.
+ */
+ if (!dprc_major_ver && !dprc_minor_ver) {
+ err = dprc_get_api_version(mc_io, 0,
+ &dprc_major_ver,
+ &dprc_minor_ver);
+ if (err)
+ return err;
+ }
+
+ /*
+ * MC API 6.5 introduced a new field in the command used to pass
+ * some flags.
+ * Bit 0 indicates that the child containers are not recursively reset.
+ */
+ if (dprc_major_ver > 6 || (dprc_major_ver == 6 && dprc_minor_ver >= 5))
+ cmdid = DPRC_CMDID_RESET_CONT_V2;
+
+ /* prepare command */
+ cmd.header = mc_encode_cmd_header(cmdid, cmd_flags, token);
+ cmd_params = (struct dprc_cmd_reset_container *)cmd.params;
+ cmd_params->child_container_id = cpu_to_le32(child_container_id);
+ cmd_params->options = cpu_to_le32(options);
+
+ /* send command to mc*/
+ return mc_send_command(mc_io, &cmd);
+}
+EXPORT_SYMBOL_GPL(dprc_reset_container);
+
/**
* dprc_set_irq() - Set IRQ information for the DPRC to trigger an interrupt.
* @mc_io: Pointer to MC portal's I/O object
diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h b/drivers/bus/fsl-mc/fsl-mc-private.h
index 9f200731b274..5f7e762d517c 100644
--- a/drivers/bus/fsl-mc/fsl-mc-private.h
+++ b/drivers/bus/fsl-mc/fsl-mc-private.h
@@ -91,6 +91,8 @@ int dpmcp_reset(struct fsl_mc_io *mc_io,
#define DPRC_CMDID_GET_API_VERSION DPRC_CMD(0xa05)

#define DPRC_CMDID_GET_ATTR DPRC_CMD(0x004)
+#define DPRC_CMDID_RESET_CONT DPRC_CMD(0x005)
+#define DPRC_CMDID_RESET_CONT_V2 DPRC_CMD_V2(0x005)

#define DPRC_CMDID_SET_IRQ DPRC_CMD(0x010)
#define DPRC_CMDID_SET_IRQ_ENABLE DPRC_CMD(0x012)
@@ -111,6 +113,11 @@ struct dprc_cmd_open {
__le32 container_id;
};

+struct dprc_cmd_reset_container {
+ __le32 child_container_id;
+ __le32 options;
+};
+
struct dprc_cmd_set_irq {
/* cmd word 0 */
__le32 irq_val;
diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index 03a5d16dde73..1d8800acf21f 100644
--- a/include/linux/fsl/mc.h
+++ b/include/linux/fsl/mc.h
@@ -524,6 +524,13 @@ static inline bool is_fsl_mc_bus_dpdmai(const struct fsl_mc_device *mc_dev)
return mc_dev->dev.type == &fsl_mc_bus_dpdmai_type;
}

+#define DPRC_RESET_OPTION_NON_RECURSIVE 0x00000001
+int dprc_reset_container(struct fsl_mc_io *mc_io,
+ u32 cmd_flags,
+ u16 token,
+ int child_container_id,
+ u32 options);
+
/*
* Data Path Buffer Pool (DPBP) API
* Contains initialization APIs and runtime control APIs for DPBP
--
2.17.1

2020-09-29 09:00:19

by Diana Madalina Craciun

[permalink] [raw]
Subject: [PATCH v5 03/13] bus/fsl-mc: add support for 'driver_override' in the mc-bus

From: Bharat Bhushan <[email protected]>

This patch is required for vfio-fsl-mc meta driver to successfully bind
layerscape container devices for device passthrough. This patch adds
a mechanism to allow a layerscape device to specify a driver rather than
a layerscape driver provide a device match.

Example to allow a device (dprc.1) to specifically bind
with driver (vfio-fsl-mc):-
- echo vfio-fsl-mc > /sys/bus/fsl-mc/devices/dprc.1/driver_override
- echo dprc.1 > /sys/bus/fsl-mc/drivers/fsl_mc_dprc/unbind
- echo dprc.1 > /sys/bus/fsl-mc/drivers/vfio-fsl-mc/bind

Signed-off-by: Bharat Bhushan <[email protected]>
Signed-off-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Diana Craciun <[email protected]>
---

The patch does not address the comment regarding moving driver_override
in the core code. I prefer not to tie these patches on that change and
address that separately.

drivers/bus/fsl-mc/fsl-mc-bus.c | 54 +++++++++++++++++++++++++++++++++
include/linux/fsl/mc.h | 2 ++
2 files changed, 56 insertions(+)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index b69794e7364d..9a884936e53e 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -3,6 +3,7 @@
* Freescale Management Complex (MC) bus driver
*
* Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2019-2020 NXP
* Author: German Rivera <[email protected]>
*
*/
@@ -78,6 +79,12 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv)
struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(drv);
bool found = false;

+ /* When driver_override is set, only bind to the matching driver */
+ if (mc_dev->driver_override) {
+ found = !strcmp(mc_dev->driver_override, mc_drv->driver.name);
+ goto out;
+ }
+
if (!mc_drv->match_id_table)
goto out;

@@ -147,8 +154,52 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
}
static DEVICE_ATTR_RO(modalias);

+static ssize_t driver_override_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
+ char *driver_override, *old = mc_dev->driver_override;
+ char *cp;
+
+ if (WARN_ON(dev->bus != &fsl_mc_bus_type))
+ return -EINVAL;
+
+ if (count >= (PAGE_SIZE - 1))
+ return -EINVAL;
+
+ driver_override = kstrndup(buf, count, GFP_KERNEL);
+ if (!driver_override)
+ return -ENOMEM;
+
+ cp = strchr(driver_override, '\n');
+ if (cp)
+ *cp = '\0';
+
+ if (strlen(driver_override)) {
+ mc_dev->driver_override = driver_override;
+ } else {
+ kfree(driver_override);
+ mc_dev->driver_override = NULL;
+ }
+
+ kfree(old);
+
+ return count;
+}
+
+static ssize_t driver_override_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
+
+ return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
+}
+static DEVICE_ATTR_RW(driver_override);
+
static struct attribute *fsl_mc_dev_attrs[] = {
&dev_attr_modalias.attr,
+ &dev_attr_driver_override.attr,
NULL,
};

@@ -748,6 +799,9 @@ EXPORT_SYMBOL_GPL(fsl_mc_device_add);
*/
void fsl_mc_device_remove(struct fsl_mc_device *mc_dev)
{
+ kfree(mc_dev->driver_override);
+ mc_dev->driver_override = NULL;
+
/*
* The device-specific remove callback will get invoked by device_del()
*/
diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index a428c61ead6e..3b5f0c98636d 100644
--- a/include/linux/fsl/mc.h
+++ b/include/linux/fsl/mc.h
@@ -161,6 +161,7 @@ struct fsl_mc_obj_desc {
* @regions: pointer to array of MMIO region entries
* @irqs: pointer to array of pointers to interrupts allocated to this device
* @resource: generic resource associated with this MC object device, if any.
+ * @driver_override: driver name to force a match
*
* Generic device object for MC object devices that are "attached" to a
* MC bus.
@@ -194,6 +195,7 @@ struct fsl_mc_device {
struct fsl_mc_device_irq **irqs;
struct fsl_mc_resource *resource;
struct device_link *consumer_link;
+ char *driver_override;
};

#define to_fsl_mc_device(_dev) \
--
2.17.1

2020-09-29 11:09:24

by Laurentiu Tudor

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support



On 9/29/2020 11:54 AM, Diana Craciun wrote:
> The vfio-mc bus driver needs some additional services to be exported by the
> mc-bus driver like:
> - a way to reset the DPRC container
> - driver_override support
> - functions to setup/tear down a DPRC
> - functions for allocating the pool of interrupts. In case of VFIO the
> interrupts are not configured at probe time, but later by userspace
> request
>
> v4 -> v5
> - dprc_celanup should not fail
>
> v3 -> v4
> - Rebased on the latest kernel.
> - Exported a dprc_remove function
>
> v2 -> v3
> - Add a new version for dprc_get_obj_region
> - Export the cacheability bus specific bits defines
>
> v1 -> v2
> - Remove driver_override propagation through various functions
> - Cache the DPRC API version
>
> The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
> devices" patches, but the series were split because they are targeting
> different subsystems. However, the mc-bus patches may suffer changes
> when addressing the VFIO review comments.
>
> The patches do not address the comment regarding moving driver_override
> in the core code. I prefer not to tie these patches on that change and
> address that separately.
>
> Bharat Bhushan (3):
> bus/fsl-mc: add support for 'driver_override' in the mc-bus
> bus/fsl-mc: Add dprc-reset-container support
> bus/fsl-mc: Extend ICID size from 16bit to 32bit
>
> Diana Craciun (10):
> bus/fsl-mc: Do no longer export the total number of irqs outside
> dprc_scan_objects
> bus/fsl-mc: Add a new parameter to dprc_scan_objects function
> bus/fsl-mc: Set the QMAN/BMAN region flags
> bus/fsl-mc: Cache the DPRC API version
> bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
> multiple entities
> bus/fsl-mc: Export a cleanup function for DPRC
> bus/fsl-mc: Add a container setup function
> bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
> bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
> bus/fsl-mc: Add a new version for dprc_get_obj_region command
>
> drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
> drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
> drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
> drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
> drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
> drivers/bus/fsl-mc/mc-io.c | 7 +-
> include/linux/fsl/mc.h | 41 +++++-
> 7 files changed, 359 insertions(+), 127 deletions(-)
>

For the series:
Reviewed-by: Laurentiu Tudor <[email protected]>
Acked-by: Laurentiu Tudor <[email protected]>

---
Best Regards, Laurentiu

2020-10-02 13:56:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

On Tue, Sep 29, 2020 at 02:06:41PM +0300, Laurentiu Tudor wrote:
>
>
> On 9/29/2020 11:54 AM, Diana Craciun wrote:
> > The vfio-mc bus driver needs some additional services to be exported by the
> > mc-bus driver like:
> > - a way to reset the DPRC container
> > - driver_override support
> > - functions to setup/tear down a DPRC
> > - functions for allocating the pool of interrupts. In case of VFIO the
> > interrupts are not configured at probe time, but later by userspace
> > request
> >
> > v4 -> v5
> > - dprc_celanup should not fail
> >
> > v3 -> v4
> > - Rebased on the latest kernel.
> > - Exported a dprc_remove function
> >
> > v2 -> v3
> > - Add a new version for dprc_get_obj_region
> > - Export the cacheability bus specific bits defines
> >
> > v1 -> v2
> > - Remove driver_override propagation through various functions
> > - Cache the DPRC API version
> >
> > The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
> > devices" patches, but the series were split because they are targeting
> > different subsystems. However, the mc-bus patches may suffer changes
> > when addressing the VFIO review comments.
> >
> > The patches do not address the comment regarding moving driver_override
> > in the core code. I prefer not to tie these patches on that change and
> > address that separately.
> >
> > Bharat Bhushan (3):
> > bus/fsl-mc: add support for 'driver_override' in the mc-bus
> > bus/fsl-mc: Add dprc-reset-container support
> > bus/fsl-mc: Extend ICID size from 16bit to 32bit
> >
> > Diana Craciun (10):
> > bus/fsl-mc: Do no longer export the total number of irqs outside
> > dprc_scan_objects
> > bus/fsl-mc: Add a new parameter to dprc_scan_objects function
> > bus/fsl-mc: Set the QMAN/BMAN region flags
> > bus/fsl-mc: Cache the DPRC API version
> > bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
> > multiple entities
> > bus/fsl-mc: Export a cleanup function for DPRC
> > bus/fsl-mc: Add a container setup function
> > bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
> > bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
> > bus/fsl-mc: Add a new version for dprc_get_obj_region command
> >
> > drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
> > drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
> > drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
> > drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
> > drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
> > drivers/bus/fsl-mc/mc-io.c | 7 +-
> > include/linux/fsl/mc.h | 41 +++++-
> > 7 files changed, 359 insertions(+), 127 deletions(-)
> >
>
> For the series:
> Reviewed-by: Laurentiu Tudor <[email protected]>
> Acked-by: Laurentiu Tudor <[email protected]>

Do you want me to take these patches in my tree, or are they going to
Linus some other way?

thanks,

greg k-h

2020-10-02 13:58:51

by Laurentiu Tudor

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

Hi Greg,

On 10/2/2020 4:55 PM, Greg KH wrote:
> On Tue, Sep 29, 2020 at 02:06:41PM +0300, Laurentiu Tudor wrote:
>>
>>
>> On 9/29/2020 11:54 AM, Diana Craciun wrote:
>>> The vfio-mc bus driver needs some additional services to be exported by the
>>> mc-bus driver like:
>>> - a way to reset the DPRC container
>>> - driver_override support
>>> - functions to setup/tear down a DPRC
>>> - functions for allocating the pool of interrupts. In case of VFIO the
>>> interrupts are not configured at probe time, but later by userspace
>>> request
>>>
>>> v4 -> v5
>>> - dprc_celanup should not fail
>>>
>>> v3 -> v4
>>> - Rebased on the latest kernel.
>>> - Exported a dprc_remove function
>>>
>>> v2 -> v3
>>> - Add a new version for dprc_get_obj_region
>>> - Export the cacheability bus specific bits defines
>>>
>>> v1 -> v2
>>> - Remove driver_override propagation through various functions
>>> - Cache the DPRC API version
>>>
>>> The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
>>> devices" patches, but the series were split because they are targeting
>>> different subsystems. However, the mc-bus patches may suffer changes
>>> when addressing the VFIO review comments.
>>>
>>> The patches do not address the comment regarding moving driver_override
>>> in the core code. I prefer not to tie these patches on that change and
>>> address that separately.
>>>
>>> Bharat Bhushan (3):
>>> bus/fsl-mc: add support for 'driver_override' in the mc-bus
>>> bus/fsl-mc: Add dprc-reset-container support
>>> bus/fsl-mc: Extend ICID size from 16bit to 32bit
>>>
>>> Diana Craciun (10):
>>> bus/fsl-mc: Do no longer export the total number of irqs outside
>>> dprc_scan_objects
>>> bus/fsl-mc: Add a new parameter to dprc_scan_objects function
>>> bus/fsl-mc: Set the QMAN/BMAN region flags
>>> bus/fsl-mc: Cache the DPRC API version
>>> bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
>>> multiple entities
>>> bus/fsl-mc: Export a cleanup function for DPRC
>>> bus/fsl-mc: Add a container setup function
>>> bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
>>> bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
>>> bus/fsl-mc: Add a new version for dprc_get_obj_region command
>>>
>>> drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
>>> drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
>>> drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
>>> drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
>>> drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
>>> drivers/bus/fsl-mc/mc-io.c | 7 +-
>>> include/linux/fsl/mc.h | 41 +++++-
>>> 7 files changed, 359 insertions(+), 127 deletions(-)
>>>
>>
>> For the series:
>> Reviewed-by: Laurentiu Tudor <[email protected]>
>> Acked-by: Laurentiu Tudor <[email protected]>
>
> Do you want me to take these patches in my tree, or are they going to
> Linus some other way?

I'm prefectly fine with you picking up the patches through your tree.

---
Thanks & Best Regards, Laurentiu

2020-10-02 14:07:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

On Fri, Oct 02, 2020 at 04:56:52PM +0300, Laurentiu Tudor wrote:
> Hi Greg,
>
> On 10/2/2020 4:55 PM, Greg KH wrote:
> > On Tue, Sep 29, 2020 at 02:06:41PM +0300, Laurentiu Tudor wrote:
> >>
> >>
> >> On 9/29/2020 11:54 AM, Diana Craciun wrote:
> >>> The vfio-mc bus driver needs some additional services to be exported by the
> >>> mc-bus driver like:
> >>> - a way to reset the DPRC container
> >>> - driver_override support
> >>> - functions to setup/tear down a DPRC
> >>> - functions for allocating the pool of interrupts. In case of VFIO the
> >>> interrupts are not configured at probe time, but later by userspace
> >>> request
> >>>
> >>> v4 -> v5
> >>> - dprc_celanup should not fail
> >>>
> >>> v3 -> v4
> >>> - Rebased on the latest kernel.
> >>> - Exported a dprc_remove function
> >>>
> >>> v2 -> v3
> >>> - Add a new version for dprc_get_obj_region
> >>> - Export the cacheability bus specific bits defines
> >>>
> >>> v1 -> v2
> >>> - Remove driver_override propagation through various functions
> >>> - Cache the DPRC API version
> >>>
> >>> The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
> >>> devices" patches, but the series were split because they are targeting
> >>> different subsystems. However, the mc-bus patches may suffer changes
> >>> when addressing the VFIO review comments.
> >>>
> >>> The patches do not address the comment regarding moving driver_override
> >>> in the core code. I prefer not to tie these patches on that change and
> >>> address that separately.
> >>>
> >>> Bharat Bhushan (3):
> >>> bus/fsl-mc: add support for 'driver_override' in the mc-bus
> >>> bus/fsl-mc: Add dprc-reset-container support
> >>> bus/fsl-mc: Extend ICID size from 16bit to 32bit
> >>>
> >>> Diana Craciun (10):
> >>> bus/fsl-mc: Do no longer export the total number of irqs outside
> >>> dprc_scan_objects
> >>> bus/fsl-mc: Add a new parameter to dprc_scan_objects function
> >>> bus/fsl-mc: Set the QMAN/BMAN region flags
> >>> bus/fsl-mc: Cache the DPRC API version
> >>> bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
> >>> multiple entities
> >>> bus/fsl-mc: Export a cleanup function for DPRC
> >>> bus/fsl-mc: Add a container setup function
> >>> bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
> >>> bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
> >>> bus/fsl-mc: Add a new version for dprc_get_obj_region command
> >>>
> >>> drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
> >>> drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
> >>> drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
> >>> drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
> >>> drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
> >>> drivers/bus/fsl-mc/mc-io.c | 7 +-
> >>> include/linux/fsl/mc.h | 41 +++++-
> >>> 7 files changed, 359 insertions(+), 127 deletions(-)
> >>>
> >>
> >> For the series:
> >> Reviewed-by: Laurentiu Tudor <[email protected]>
> >> Acked-by: Laurentiu Tudor <[email protected]>
> >
> > Do you want me to take these patches in my tree, or are they going to
> > Linus some other way?
>
> I'm prefectly fine with you picking up the patches through your tree.

Great, now queued up.

greg k-h

2020-10-15 04:17:46

by Alex Williamson

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

On Fri, 2 Oct 2020 16:05:49 +0200
Greg KH <[email protected]> wrote:

> On Fri, Oct 02, 2020 at 04:56:52PM +0300, Laurentiu Tudor wrote:
> > Hi Greg,
> >
> > On 10/2/2020 4:55 PM, Greg KH wrote:
> > > On Tue, Sep 29, 2020 at 02:06:41PM +0300, Laurentiu Tudor wrote:
> > >>
> > >>
> > >> On 9/29/2020 11:54 AM, Diana Craciun wrote:
> > >>> The vfio-mc bus driver needs some additional services to be exported by the
> > >>> mc-bus driver like:
> > >>> - a way to reset the DPRC container
> > >>> - driver_override support
> > >>> - functions to setup/tear down a DPRC
> > >>> - functions for allocating the pool of interrupts. In case of VFIO the
> > >>> interrupts are not configured at probe time, but later by userspace
> > >>> request
> > >>>
> > >>> v4 -> v5
> > >>> - dprc_celanup should not fail
> > >>>
> > >>> v3 -> v4
> > >>> - Rebased on the latest kernel.
> > >>> - Exported a dprc_remove function
> > >>>
> > >>> v2 -> v3
> > >>> - Add a new version for dprc_get_obj_region
> > >>> - Export the cacheability bus specific bits defines
> > >>>
> > >>> v1 -> v2
> > >>> - Remove driver_override propagation through various functions
> > >>> - Cache the DPRC API version
> > >>>
> > >>> The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
> > >>> devices" patches, but the series were split because they are targeting
> > >>> different subsystems. However, the mc-bus patches may suffer changes
> > >>> when addressing the VFIO review comments.
> > >>>
> > >>> The patches do not address the comment regarding moving driver_override
> > >>> in the core code. I prefer not to tie these patches on that change and
> > >>> address that separately.
> > >>>
> > >>> Bharat Bhushan (3):
> > >>> bus/fsl-mc: add support for 'driver_override' in the mc-bus
> > >>> bus/fsl-mc: Add dprc-reset-container support
> > >>> bus/fsl-mc: Extend ICID size from 16bit to 32bit
> > >>>
> > >>> Diana Craciun (10):
> > >>> bus/fsl-mc: Do no longer export the total number of irqs outside
> > >>> dprc_scan_objects
> > >>> bus/fsl-mc: Add a new parameter to dprc_scan_objects function
> > >>> bus/fsl-mc: Set the QMAN/BMAN region flags
> > >>> bus/fsl-mc: Cache the DPRC API version
> > >>> bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
> > >>> multiple entities
> > >>> bus/fsl-mc: Export a cleanup function for DPRC
> > >>> bus/fsl-mc: Add a container setup function
> > >>> bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
> > >>> bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
> > >>> bus/fsl-mc: Add a new version for dprc_get_obj_region command
> > >>>
> > >>> drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
> > >>> drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
> > >>> drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
> > >>> drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
> > >>> drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
> > >>> drivers/bus/fsl-mc/mc-io.c | 7 +-
> > >>> include/linux/fsl/mc.h | 41 +++++-
> > >>> 7 files changed, 359 insertions(+), 127 deletions(-)
> > >>>
> > >>
> > >> For the series:
> > >> Reviewed-by: Laurentiu Tudor <[email protected]>
> > >> Acked-by: Laurentiu Tudor <[email protected]>
> > >
> > > Do you want me to take these patches in my tree, or are they going to
> > > Linus some other way?
> >
> > I'm prefectly fine with you picking up the patches through your tree.
>
> Great, now queued up.

Hi Greg,

Diana has a vfio bus driver for fsl-mc devices queued up in my tree as
well. After a linux-next build failure due to our branches being
applied in the wrong order, Stephen advised that the proper way to
handle this is to merge a shared branch with this series. Do you have
a pull request imminent with this series or if not, would you mind
pushing such a branch? Thanks,

Alex

2020-10-15 21:22:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 00/13] bus/fsl-mc: Extend mc-bus driver functionalities in preparation for mc-bus VFIO support

On Wed, Oct 14, 2020 at 08:27:42PM -0600, Alex Williamson wrote:
> On Fri, 2 Oct 2020 16:05:49 +0200
> Greg KH <[email protected]> wrote:
>
> > On Fri, Oct 02, 2020 at 04:56:52PM +0300, Laurentiu Tudor wrote:
> > > Hi Greg,
> > >
> > > On 10/2/2020 4:55 PM, Greg KH wrote:
> > > > On Tue, Sep 29, 2020 at 02:06:41PM +0300, Laurentiu Tudor wrote:
> > > >>
> > > >>
> > > >> On 9/29/2020 11:54 AM, Diana Craciun wrote:
> > > >>> The vfio-mc bus driver needs some additional services to be exported by the
> > > >>> mc-bus driver like:
> > > >>> - a way to reset the DPRC container
> > > >>> - driver_override support
> > > >>> - functions to setup/tear down a DPRC
> > > >>> - functions for allocating the pool of interrupts. In case of VFIO the
> > > >>> interrupts are not configured at probe time, but later by userspace
> > > >>> request
> > > >>>
> > > >>> v4 -> v5
> > > >>> - dprc_celanup should not fail
> > > >>>
> > > >>> v3 -> v4
> > > >>> - Rebased on the latest kernel.
> > > >>> - Exported a dprc_remove function
> > > >>>
> > > >>> v2 -> v3
> > > >>> - Add a new version for dprc_get_obj_region
> > > >>> - Export the cacheability bus specific bits defines
> > > >>>
> > > >>> v1 -> v2
> > > >>> - Remove driver_override propagation through various functions
> > > >>> - Cache the DPRC API version
> > > >>>
> > > >>> The patches are related with "vfio/fsl-mc: VFIO support for FSL-MC
> > > >>> devices" patches, but the series were split because they are targeting
> > > >>> different subsystems. However, the mc-bus patches may suffer changes
> > > >>> when addressing the VFIO review comments.
> > > >>>
> > > >>> The patches do not address the comment regarding moving driver_override
> > > >>> in the core code. I prefer not to tie these patches on that change and
> > > >>> address that separately.
> > > >>>
> > > >>> Bharat Bhushan (3):
> > > >>> bus/fsl-mc: add support for 'driver_override' in the mc-bus
> > > >>> bus/fsl-mc: Add dprc-reset-container support
> > > >>> bus/fsl-mc: Extend ICID size from 16bit to 32bit
> > > >>>
> > > >>> Diana Craciun (10):
> > > >>> bus/fsl-mc: Do no longer export the total number of irqs outside
> > > >>> dprc_scan_objects
> > > >>> bus/fsl-mc: Add a new parameter to dprc_scan_objects function
> > > >>> bus/fsl-mc: Set the QMAN/BMAN region flags
> > > >>> bus/fsl-mc: Cache the DPRC API version
> > > >>> bus/fsl-mc: Export dprc_scan/dprc_remove functions to be used by
> > > >>> multiple entities
> > > >>> bus/fsl-mc: Export a cleanup function for DPRC
> > > >>> bus/fsl-mc: Add a container setup function
> > > >>> bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
> > > >>> bus/fsl-mc: Export IRQ pool handling functions to be used by VFIO
> > > >>> bus/fsl-mc: Add a new version for dprc_get_obj_region command
> > > >>>
> > > >>> drivers/bus/fsl-mc/dprc-driver.c | 190 ++++++++++++++++----------
> > > >>> drivers/bus/fsl-mc/dprc.c | 141 +++++++++++++++----
> > > >>> drivers/bus/fsl-mc/fsl-mc-allocator.c | 12 +-
> > > >>> drivers/bus/fsl-mc/fsl-mc-bus.c | 64 ++++++++-
> > > >>> drivers/bus/fsl-mc/fsl-mc-private.h | 31 ++---
> > > >>> drivers/bus/fsl-mc/mc-io.c | 7 +-
> > > >>> include/linux/fsl/mc.h | 41 +++++-
> > > >>> 7 files changed, 359 insertions(+), 127 deletions(-)
> > > >>>
> > > >>
> > > >> For the series:
> > > >> Reviewed-by: Laurentiu Tudor <[email protected]>
> > > >> Acked-by: Laurentiu Tudor <[email protected]>
> > > >
> > > > Do you want me to take these patches in my tree, or are they going to
> > > > Linus some other way?
> > >
> > > I'm prefectly fine with you picking up the patches through your tree.
> >
> > Great, now queued up.
>
> Hi Greg,
>
> Diana has a vfio bus driver for fsl-mc devices queued up in my tree as
> well. After a linux-next build failure due to our branches being
> applied in the wrong order, Stephen advised that the proper way to
> handle this is to merge a shared branch with this series. Do you have
> a pull request imminent with this series or if not, would you mind
> pushing such a branch? Thanks,

This should all now be in Linus's tree, so I don't think you need any
shared branch anymore :)

thanks,

greg k-h