2018-10-10 14:26:48 +03:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2019-05-03 17:17:39 +03:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
crypto: caam - Introduce the use of the managed version of kzalloc
This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions. Also, linux/device.h is added to make sure the devm_*()
routine declarations are unambiguously available. Earlier, in the probe
function ctrlpriv was leaked on the failure of ctrl = of_iomap(nprop, 0);
as well as on the failure of ctrlpriv->jrpdev = kzalloc(...); . These
two bugs have been fixed by the patch.
The following Coccinelle semantic patch was used for making the change:
identifier p, probefn, removefn;
@@
struct platform_driver p = {
.probe = probefn,
.remove = removefn,
};
@prb@
identifier platform.probefn, pdev;
expression e, e1, e2;
@@
probefn(struct platform_device *pdev, ...) {
<+...
- e = kzalloc(e1, e2)
+ e = devm_kzalloc(&pdev->dev, e1, e2)
...
?-kfree(e);
...+>
}
@rem depends on prb@
identifier platform.removefn;
expression e;
@@
removefn(...) {
<...
- kfree(e);
...>
}
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2014-05-27 23:55:48 +05:30
|
|
|
|
2013-09-17 14:28:33 -05:00
|
|
|
|
|
|
|
|
|
2017-09-01 17:12:59 +03:00
|
|
|
|
2013-09-17 14:28:33 -05:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2016-08-26 17:56:24 +08:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
2015-08-17 15:24:10 +03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-01 17:12:59 +03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:28 +03:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2014-07-21 16:03:21 +03:00
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2014-07-21 16:03:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2015-07-17 16:54:53 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-05 11:15:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-04 11:26:03 +05:30
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-27 14:29:45 -08:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2017-04-05 11:41:03 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
crypto: caam - fix JR platform device subsequent (re)creations
The way Job Ring platform devices are created and released does not
allow for multiple create-release cycles.
JR0 Platform device creation error
JR0 Platform device creation error
caam 2100000.caam: no queues configured, terminating
caam: probe of 2100000.caam failed with error -12
The reason is that platform devices are created for each job ring:
for_each_available_child_of_node(nprop, np)
if (of_device_is_compatible(np, "fsl,sec-v4.0-job-ring") ||
of_device_is_compatible(np, "fsl,sec4.0-job-ring")) {
ctrlpriv->jrpdev[ring] =
of_platform_device_create(np, NULL, dev);
which sets OF_POPULATED on the device node, but then it cleans these up:
/* Remove platform devices for JobRs */
for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) {
if (ctrlpriv->jrpdev[ring])
of_device_unregister(ctrlpriv->jrpdev[ring]);
}
which leaves OF_POPULATED set.
Use of_platform_populate / of_platform_depopulate instead.
This allows for a bit of driver clean-up, jrpdev is no longer needed.
Logic changes a bit too:
-exit in case of_platform_populate fails, since currently even QI backend
depends on JR; true, we no longer support the case when "some" of the JR
DT nodes are incorrect
-when cleaning up, caam_remove() would also depopulate RTIC in case
it would have been populated somewhere else - not the case for now
Cc: <stable@vger.kernel.org>
Fixes: 313ea293e9c4d ("crypto: caam - Add Platform driver for Job Ring")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Suggested-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-04-03 18:12:04 +03:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
2019-05-03 17:17:40 +03:00
|
|
|
|
|
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2013-09-09 18:56:32 +03:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-15 16:52:58 -07:00
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
2016-11-28 12:53:28 -05:00
|
|
|
|
2016-10-17 13:28:00 +02:00
|
|
|
|
2015-08-12 14:39:38 -03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
|
|
|
|
|
2014-08-11 11:40:15 +03:00
|
|
|
|
|
|
|
|
|
2014-08-11 11:40:17 +03:00
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2014-08-11 11:40:17 +03:00
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2014-08-11 11:40:17 +03:00
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
2018-04-11 09:45:20 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
|
|
|
|
|
2018-04-11 09:45:20 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2018-04-11 09:45:20 -03:00
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2014-02-06 10:27:19 +02:00
|
|
|
|
2015-07-17 16:54:51 +03:00
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2015-07-17 16:54:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-11 09:45:20 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
|
|
|
|
|
2019-03-22 15:39:28 +02:00
|
|
|
|
2019-05-14 20:13:09 +03:00
|
|
|
|
2019-03-22 15:39:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
crypto: caam - fix JR platform device subsequent (re)creations
The way Job Ring platform devices are created and released does not
allow for multiple create-release cycles.
JR0 Platform device creation error
JR0 Platform device creation error
caam 2100000.caam: no queues configured, terminating
caam: probe of 2100000.caam failed with error -12
The reason is that platform devices are created for each job ring:
for_each_available_child_of_node(nprop, np)
if (of_device_is_compatible(np, "fsl,sec-v4.0-job-ring") ||
of_device_is_compatible(np, "fsl,sec4.0-job-ring")) {
ctrlpriv->jrpdev[ring] =
of_platform_device_create(np, NULL, dev);
which sets OF_POPULATED on the device node, but then it cleans these up:
/* Remove platform devices for JobRs */
for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) {
if (ctrlpriv->jrpdev[ring])
of_device_unregister(ctrlpriv->jrpdev[ring]);
}
which leaves OF_POPULATED set.
Use of_platform_populate / of_platform_depopulate instead.
This allows for a bit of driver clean-up, jrpdev is no longer needed.
Logic changes a bit too:
-exit in case of_platform_populate fails, since currently even QI backend
depends on JR; true, we no longer support the case when "some" of the JR
DT nodes are incorrect
-when cleaning up, caam_remove() would also depopulate RTIC in case
it would have been populated somewhere else - not the case for now
Cc: <stable@vger.kernel.org>
Fixes: 313ea293e9c4d ("crypto: caam - Add Platform driver for Job Ring")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Suggested-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-04-03 18:12:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2011-05-14 22:07:55 -05:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
crypto: caam - fix JR platform device subsequent (re)creations
The way Job Ring platform devices are created and released does not
allow for multiple create-release cycles.
JR0 Platform device creation error
JR0 Platform device creation error
caam 2100000.caam: no queues configured, terminating
caam: probe of 2100000.caam failed with error -12
The reason is that platform devices are created for each job ring:
for_each_available_child_of_node(nprop, np)
if (of_device_is_compatible(np, "fsl,sec-v4.0-job-ring") ||
of_device_is_compatible(np, "fsl,sec4.0-job-ring")) {
ctrlpriv->jrpdev[ring] =
of_platform_device_create(np, NULL, dev);
which sets OF_POPULATED on the device node, but then it cleans these up:
/* Remove platform devices for JobRs */
for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) {
if (ctrlpriv->jrpdev[ring])
of_device_unregister(ctrlpriv->jrpdev[ring]);
}
which leaves OF_POPULATED set.
Use of_platform_populate / of_platform_depopulate instead.
This allows for a bit of driver clean-up, jrpdev is no longer needed.
Logic changes a bit too:
-exit in case of_platform_populate fails, since currently even QI backend
depends on JR; true, we no longer support the case when "some" of the JR
DT nodes are incorrect
-when cleaning up, caam_remove() would also depopulate RTIC in case
it would have been populated somewhere else - not the case for now
Cc: <stable@vger.kernel.org>
Fixes: 313ea293e9c4d ("crypto: caam - Add Platform driver for Job Ring")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Suggested-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-04-03 18:12:04 +03:00
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2017-09-01 17:12:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
2011-06-05 16:42:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2015-08-21 13:52:00 -03:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-01 17:12:59 +03:00
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:59 -03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
2019-05-31 14:06:34 +03:00
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:59 -03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
|
|
|
|
|
2019-05-31 14:06:34 +03:00
|
|
|
|
|
|
|
|
|
2016-10-17 13:28:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
2016-11-28 12:53:28 -05:00
|
|
|
|
2016-10-17 13:28:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-05 11:28:37 -07:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2013-09-18 15:24:44 +02:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2019-03-22 15:39:28 +02:00
|
|
|
|
|
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-23 17:42:33 +05:30
|
|
|
|
2017-02-10 14:07:15 +02:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 14:07:15 +02:00
|
|
|
|
2012-06-22 19:48:51 -05:00
|
|
|
|
2017-02-10 14:07:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2018-04-11 09:45:20 -03:00
|
|
|
|
2019-05-03 17:17:41 +03:00
|
|
|
|
2017-12-19 12:16:06 +02:00
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-05 21:57:07 +08:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2019-05-03 17:17:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:54 +05:30
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-04-26 15:44:54 +05:30
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2018-11-08 15:36:27 +02:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-11 11:40:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-11 11:40:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-09 18:56:31 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:30 +03:00
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2013-09-09 18:56:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-12 13:55:21 +05:30
|
|
|
|
|
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2017-12-19 12:16:06 +02:00
|
|
|
|
2018-05-23 14:32:40 +03:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2017-08-01 10:45:01 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2017-08-01 10:45:01 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2019-01-22 16:14:22 +01:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2019-01-22 16:14:22 +01:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2016-11-09 10:46:14 +02:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2019-01-22 16:14:22 +01:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-09 08:30:10 +01:00
|
|
|
|
|
|
|
|
|
2019-05-03 17:17:39 +03:00
|
|
|
|
|
|
|
|
|
2019-05-03 17:17:40 +03:00
|
|
|
|
|
|
|
|
|
2019-05-03 17:17:39 +03:00
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-28 12:53:28 -05:00
|
|
|
|
2016-10-17 13:28:00 +02:00
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-22 14:22:48 +00:00
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2011-05-14 22:07:55 -05:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 13:14:09 -08:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2011-11-26 21:26:19 +08:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|