Commit 57f87c79 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'soc-fsl-next-v5.1-2' of...

Merge tag 'soc-fsl-next-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/drivers

NXP/FSL SoC driver updates for v5.1

DPIO driver
- Clean up the remove path in the dpio driver so that successive
  bind/unbind commands behave properly
- Add the ability to automatically create a device link between a
  consumer device on the fsl-mc bus and a supplier one
- Add prefetch to dpio dequeue to improve performance
- Update the type of dpio APIs to align with buffer pool id register
  field

guts driver
- Prevent allocation failure by reuse the machine type data from device
  tree directly

* tag 'soc-fsl-next-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux

:
  soc: fsl: guts: reuse machine name from device tree
  soc: fsl: dpio: Change bpid type to u16
  soc: fsl: dpio: Add prefetch instruction
  bus: fsl-mc: automatically add a device_link on fsl_mc_[portal,object]_allocate
  soc: fsl: dpio: add a device_link at dpaa2_io_service_register
  soc: fsl: dpio: store a backpointer to the device backing the dpaa2_io
  soc: fsl: dpio: keep a per dpio device MC portal
  soc: fsl: dpio: perform DPIO Reset on Probe
  soc: fsl: dpio: use a cpumask to identify which cpus are unused
  soc: fsl: dpio: cleanup the cpu array on dpaa2_io_down

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents f17b5f06 3c0d64e8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -295,6 +295,14 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
	if (!mc_adev)
		goto error;

	mc_adev->consumer_link = device_link_add(&mc_dev->dev,
						 &mc_adev->dev,
						 DL_FLAG_AUTOREMOVE_CONSUMER);
	if (!mc_adev->consumer_link) {
		error = -EINVAL;
		goto error;
	}

	*new_mc_adev = mc_adev;
	return 0;
error:
@@ -321,6 +329,9 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
		return;

	fsl_mc_resource_free(resource);

	device_link_del(mc_adev->consumer_link);
	mc_adev->consumer_link = NULL;
}
EXPORT_SYMBOL_GPL(fsl_mc_object_free);

+13 −0
Original line number Diff line number Diff line
@@ -209,9 +209,19 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
	if (error < 0)
		goto error_cleanup_resource;

	dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
						   &dpmcp_dev->dev,
						   DL_FLAG_AUTOREMOVE_CONSUMER);
	if (!dpmcp_dev->consumer_link) {
		error = -EINVAL;
		goto error_cleanup_mc_io;
	}

	*new_mc_io = mc_io;
	return 0;

error_cleanup_mc_io:
	fsl_destroy_mc_io(mc_io);
error_cleanup_resource:
	fsl_mc_resource_free(resource);
	return error;
@@ -244,6 +254,9 @@ void fsl_mc_portal_free(struct fsl_mc_io *mc_io)

	fsl_destroy_mc_io(mc_io);
	fsl_mc_resource_free(resource);

	device_link_del(dpmcp_dev->consumer_link);
	dpmcp_dev->consumer_link = NULL;
}
EXPORT_SYMBOL_GPL(fsl_mc_portal_free);

+3 −3
Original line number Diff line number Diff line
@@ -4503,7 +4503,7 @@ static int __cold dpaa2_dpseci_dpio_setup(struct dpaa2_caam_priv *priv)
		nctx->cb = dpaa2_caam_fqdan_cb;

		/* Register notification callbacks */
		err = dpaa2_io_service_register(NULL, nctx);
		err = dpaa2_io_service_register(NULL, nctx, dev);
		if (unlikely(err)) {
			dev_dbg(dev, "No affine DPIO for cpu %d\n", cpu);
			nctx->cb = NULL;
@@ -4536,7 +4536,7 @@ err:
		ppriv = per_cpu_ptr(priv->ppriv, cpu);
		if (!ppriv->nctx.cb)
			break;
		dpaa2_io_service_deregister(NULL, &ppriv->nctx);
		dpaa2_io_service_deregister(NULL, &ppriv->nctx, dev);
	}

	for_each_online_cpu(cpu) {
@@ -4556,7 +4556,7 @@ static void __cold dpaa2_dpseci_dpio_free(struct dpaa2_caam_priv *priv)

	for_each_online_cpu(cpu) {
		ppriv = per_cpu_ptr(priv->ppriv, cpu);
		dpaa2_io_service_deregister(NULL, &ppriv->nctx);
		dpaa2_io_service_deregister(NULL, &ppriv->nctx, priv->dev);
		dpaa2_io_store_destroy(ppriv->store);

		if (++i == priv->num_pairs)
+5 −4
Original line number Diff line number Diff line
@@ -1902,7 +1902,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)

		/* Register the new context */
		channel->dpio = dpaa2_io_service_select(i);
		err = dpaa2_io_service_register(channel->dpio, nctx);
		err = dpaa2_io_service_register(channel->dpio, nctx, dev);
		if (err) {
			dev_dbg(dev, "No affine DPIO for cpu %d\n", i);
			/* If no affine DPIO for this core, there's probably
@@ -1942,7 +1942,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
	return 0;

err_set_cdan:
	dpaa2_io_service_deregister(channel->dpio, nctx);
	dpaa2_io_service_deregister(channel->dpio, nctx, dev);
err_service_reg:
	free_channel(priv, channel);
err_alloc_ch:
@@ -1962,13 +1962,14 @@ err_alloc_ch:

static void free_dpio(struct dpaa2_eth_priv *priv)
{
	int i;
	struct device *dev = priv->net_dev->dev.parent;
	struct dpaa2_eth_channel *ch;
	int i;

	/* deregister CDAN notifications and free channels */
	for (i = 0; i < priv->num_channels; i++) {
		ch = priv->channel[i];
		dpaa2_io_service_deregister(ch->dpio, &ch->nctx);
		dpaa2_io_service_deregister(ch->dpio, &ch->nctx, dev);
		free_channel(priv, ch);
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#define DPIO_CMDID_ENABLE				DPIO_CMD(0x002)
#define DPIO_CMDID_DISABLE				DPIO_CMD(0x003)
#define DPIO_CMDID_GET_ATTR				DPIO_CMD(0x004)
#define DPIO_CMDID_RESET				DPIO_CMD(0x005)

struct dpio_cmd_open {
	__le32 dpio_id;
Loading