2014-09-01 15:00:44 +05:30
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2012-06-22 19:48:52 -05: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
|
|
|
|
2016-05-19 18:11:26 +03:00
|
|
|
|
|
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
2017-09-01 17:12:59 +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
|
|
|
|
2013-09-09 18:56:31 +03: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
|
|
|
|
2013-09-09 18:56:30 +03: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-21 11:53:31 +02:00
|
|
|
|
2015-07-17 16:54:53 +03: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-18 18:30:47 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
|
|
|
|
|
2014-02-06 10:27:19 +02:00
|
|
|
|
2012-07-11 11:06:11 +08:00
|
|
|
|
2014-02-06 10:27:19 +02: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
remove lots of IS_ERR_VALUE abuses
Most users of IS_ERR_VALUE() in the kernel are wrong, as they
pass an 'int' into a function that takes an 'unsigned long'
argument. This happens to work because the type is sign-extended
on 64-bit architectures before it gets converted into an
unsigned type.
However, anything that passes an 'unsigned short' or 'unsigned int'
argument into IS_ERR_VALUE() is guaranteed to be broken, as are
8-bit integers and types that are wider than 'unsigned long'.
Andrzej Hajda has already fixed a lot of the worst abusers that
were causing actual bugs, but it would be nice to prevent any
users that are not passing 'unsigned long' arguments.
This patch changes all users of IS_ERR_VALUE() that I could find
on 32-bit ARM randconfig builds and x86 allmodconfig. For the
moment, this doesn't change the definition of IS_ERR_VALUE()
because there are probably still architecture specific users
elsewhere.
Almost all the warnings I got are for files that are better off
using 'if (err)' or 'if (err < 0)'.
The only legitimate user I could find that we get a warning for
is the (32-bit only) freescale fman driver, so I did not remove
the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
For 9pfs, I just worked around one user whose calling conventions
are so obscure that I did not dare change the behavior.
I was using this definition for testing:
#define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
which ends up making all 16-bit or wider types work correctly with
the most plausible interpretation of what IS_ERR_VALUE() was supposed
to return according to its users, but also causes a compile-time
warning for any users that do not pass an 'unsigned long' argument.
I suggested this approach earlier this year, but back then we ended
up deciding to just fix the users that are obviously broken. After
the initial warning that caused me to get involved in the discussion
(fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
asked me to send the whole thing again.
[ Updated the 9p parts as per Al Viro - Linus ]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.org/lkml/2016/1/7/363
Link: https://lkml.org/lkml/2016/5/27/486
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-27 23:23:25 +02:00
|
|
|
|
2012-07-11 11:06:11 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-06-23 15:08:28 +05:30
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08: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
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-05 21:57:07 +08:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
2014-02-09 09:59:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-09 10:46:14 +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
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
|
|
|
|
|
2012-03-21 14:09:10 +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
|
|
|
|
2011-03-13 16:54:26 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
2014-09-01 15:00:44 +05:30
|
|
|
|
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
|
|
|
|
2017-07-18 18:30:47 +03:00
|
|
|
|
2012-06-22 19:48:52 -05:00
|
|
|
|
2017-07-18 18:30:47 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-02-06 10:27:19 +02:00
|
|
|
|
2017-07-18 18:30:47 +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
|
|
|
|
|
|
|
|
|
2011-07-24 04:32:53 -04: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
|
|
|
|
|
|
|
|
|
2011-07-24 04:32:53 -04: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
|
|
|
|
|
|
|
|
|
2011-07-24 04:32:53 -04:00
|
|
|
|
2011-03-13 16:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
|
|
|
|
|
2017-03-17 12:06:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-21 13:51:58 -03:00
|
|
|
|
2016-08-09 08:30:10 +01: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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|