Commit 9dd24d4e authored by Herbert Xu's avatar Herbert Xu
Browse files
Pull changes from Freescale SoC drivers tree that are required by
subsequent caam/qi2 patches.
parents cf64e495 afb77422
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
@@ -4502,7 +4502,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;
@@ -4535,7 +4535,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) {
@@ -4555,7 +4555,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