All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] omap3 crypto fixes
@ 2015-02-26 13:49 Pali Rohár
  2015-02-26 13:49 ` [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod Pali Rohár
                   ` (11 more replies)
  0 siblings, 12 replies; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

This patch series fix crypto support for omap3 devices which use DT.

It enables AES and SHAM on N9/N950 and SHAM on N900. AES is still disabled for N900.

Pali Rohár (10):
  ARM: OMAP2+: Return correct error values from device and hwmod
  ARM: OMAP3: Fix crypto support for HS devices
  crypto: omap-sham: Add support for omap3 devices
  crypto: omap-sham: Check for return value from pm_runtime_get_sync
  ARM: dts: omap3 hs: Remove timer12
  ARM: dts: omap3: Add missing dmas for crypto
  ARM: dts: n9/n950: Enable omap crypto support
  ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi
  ARM: dts: omap3-tao3530: Include directly omap34xx.dtsi
  ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi

 arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
 arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
 arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
 arch/arm/boot/dts/omap3.dtsi               |    4 ++
 arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
 arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
 arch/arm/mach-omap2/omap_device.c          |   30 ++++++-----
 arch/arm/mach-omap2/omap_hwmod.c           |   10 ++--
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79 +++++++++++++++++++++++-----
 drivers/crypto/omap-sham.c                 |   13 ++++-
 10 files changed, 131 insertions(+), 66 deletions(-)
 delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
 delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 66+ messages in thread

* [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-05-21 11:44   ` Pali Rohár
  2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Without this patch function pm_runtime_get_sync() returns 0 even when some
omap subfunction fails. This patch properly propagate error codes from omap
functions back to caller.

This patch fix problem, when loading omap-aes driver in qemu cause kernel oops.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/mach-omap2/omap_device.c |   30 +++++++++++++++++-------------
 arch/arm/mach-omap2/omap_hwmod.c  |   10 ++++++----
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index be9541e..9fd47a9 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -224,13 +224,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
  */
 static int _omap_device_enable_hwmods(struct omap_device *od)
 {
+	int ret = 0;
 	int i;
 
 	for (i = 0; i < od->hwmods_cnt; i++)
-		omap_hwmod_enable(od->hwmods[i]);
+		ret |= omap_hwmod_enable(od->hwmods[i]);
 
-	/* XXX pass along return value here? */
-	return 0;
+	return ret;
 }
 
 /**
@@ -241,13 +241,13 @@ static int _omap_device_enable_hwmods(struct omap_device *od)
  */
 static int _omap_device_idle_hwmods(struct omap_device *od)
 {
+	int ret = 0;
 	int i;
 
 	for (i = 0; i < od->hwmods_cnt; i++)
-		omap_hwmod_idle(od->hwmods[i]);
+		ret |= omap_hwmod_idle(od->hwmods[i]);
 
-	/* XXX pass along return value here? */
-	return 0;
+	return ret;
 }
 
 /* Public functions for use by core code */
@@ -595,18 +595,20 @@ static int _od_runtime_suspend(struct device *dev)
 	int ret;
 
 	ret = pm_generic_runtime_suspend(dev);
+	if (ret)
+		return ret;
 
-	if (!ret)
-		omap_device_idle(pdev);
-
-	return ret;
+	return omap_device_idle(pdev);
 }
 
 static int _od_runtime_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
+	int ret;
 
-	omap_device_enable(pdev);
+	ret = omap_device_enable(pdev);
+	if (ret)
+		return ret;
 
 	return pm_generic_runtime_resume(dev);
 }
@@ -740,7 +742,8 @@ int omap_device_enable(struct platform_device *pdev)
 
 	ret = _omap_device_enable_hwmods(od);
 
-	od->_state = OMAP_DEVICE_STATE_ENABLED;
+	if (ret == 0)
+		od->_state = OMAP_DEVICE_STATE_ENABLED;
 
 	return ret;
 }
@@ -770,7 +773,8 @@ int omap_device_idle(struct platform_device *pdev)
 
 	ret = _omap_device_idle_hwmods(od);
 
-	od->_state = OMAP_DEVICE_STATE_IDLE;
+	if (ret == 0)
+		od->_state = OMAP_DEVICE_STATE_IDLE;
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 92afb72..870e984 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3350,16 +3350,17 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
  */
 int omap_hwmod_idle(struct omap_hwmod *oh)
 {
+	int r;
 	unsigned long flags;
 
 	if (!oh)
 		return -EINVAL;
 
 	spin_lock_irqsave(&oh->_lock, flags);
-	_idle(oh);
+	r = _idle(oh);
 	spin_unlock_irqrestore(&oh->_lock, flags);
 
-	return 0;
+	return r;
 }
 
 /**
@@ -3372,16 +3373,17 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
  */
 int omap_hwmod_shutdown(struct omap_hwmod *oh)
 {
+	int r;
 	unsigned long flags;
 
 	if (!oh)
 		return -EINVAL;
 
 	spin_lock_irqsave(&oh->_lock, flags);
-	_shutdown(oh);
+	r = _shutdown(oh);
 	spin_unlock_irqrestore(&oh->_lock, flags);
 
-	return 0;
+	return r;
 }
 
 /*
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
  2015-02-26 13:49 ` [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-02-28 16:24   ` Pavel Machek
  2015-02-26 13:49 ` [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices Pali Rohár
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Register crypto hwmod links only if they are not disabled in DT.
If DT information is missing, enable them only for GP devices.

Before this patch crypto hwmod links were always disabled for all HS devices
and it was not possible to use omap-aes and omap-sham linux drivers.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79 +++++++++++++++++++++++-----
 1 file changed, 66 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4e8e93c..de13a06 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3744,29 +3744,54 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
 /* GP-only hwmod links */
 static struct omap_hwmod_ocp_if *omap34xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	&omap3xxx_l4_core__sham,
-	&omap3xxx_l4_core__aes,
 	NULL
 };
 
 static struct omap_hwmod_ocp_if *omap36xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	&omap3xxx_l4_core__sham,
-	&omap3xxx_l4_core__aes,
 	NULL
 };
 
 static struct omap_hwmod_ocp_if *am35xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	/*
-	 * Apparently the SHA/MD5 and AES accelerator IP blocks are
-	 * only present on some AM35xx chips, and no one knows which
-	 * ones.  See
-	 * http://www.spinics.net/lists/arm-kernel/msg215466.html So
-	 * if you need these IP blocks on an AM35xx, try uncommenting
-	 * the following lines.
-	 */
+	NULL
+};
+
+/* crypto hwmod links */
+static struct omap_hwmod_ocp_if *omap34xx_sham_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__sham,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_aes_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__aes,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_sham_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__sham,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_aes_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__aes,
+	NULL
+};
+
+/*
+ * Apparently the SHA/MD5 and AES accelerator IP blocks are
+ * only present on some AM35xx chips, and no one knows which
+ * ones.  See
+ * http://www.spinics.net/lists/arm-kernel/msg215466.html So
+ * if you need these IP blocks on an AM35xx, try uncommenting
+ * the following lines.
+ */
+static struct omap_hwmod_ocp_if *am35xx_sham_hwmod_ocp_ifs[] __initdata = {
 	/* &omap3xxx_l4_core__sham, */
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *am35xx_aes_hwmod_ocp_ifs[] __initdata = {
 	/* &omap3xxx_l4_core__aes, */
 	NULL
 };
@@ -3871,7 +3896,8 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_hwmod_ocp_ifs[] __initdata = {
 int __init omap3xxx_hwmod_init(void)
 {
 	int r;
-	struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL;
+	struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL, **h_aes = NULL;
+	struct device_node *bus = NULL;
 	unsigned int rev;
 
 	omap_hwmod_init();
@@ -3893,13 +3919,19 @@ int __init omap3xxx_hwmod_init(void)
 	    rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) {
 		h = omap34xx_hwmod_ocp_ifs;
 		h_gp = omap34xx_gp_hwmod_ocp_ifs;
+		h_sham = omap34xx_sham_hwmod_ocp_ifs;
+		h_aes = omap34xx_aes_hwmod_ocp_ifs;
 	} else if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
 		h = am35xx_hwmod_ocp_ifs;
 		h_gp = am35xx_gp_hwmod_ocp_ifs;
+		h_sham = am35xx_sham_hwmod_ocp_ifs;
+		h_aes = am35xx_aes_hwmod_ocp_ifs;
 	} else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 ||
 		   rev == OMAP3630_REV_ES1_2) {
 		h = omap36xx_hwmod_ocp_ifs;
 		h_gp = omap36xx_gp_hwmod_ocp_ifs;
+		h_sham = omap36xx_sham_hwmod_ocp_ifs;
+		h_aes = omap36xx_aes_hwmod_ocp_ifs;
 	} else {
 		WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
 		return -EINVAL;
@@ -3916,6 +3948,27 @@ int __init omap3xxx_hwmod_init(void)
 			return r;
 	}
 
+	/*
+	 * Register crypto hwmod links only if they are not disabled in DT.
+	 * If DT information is missing, enable them only for GP devices.
+	 */
+
+	if (of_have_populated_dt())
+		bus = of_find_node_by_name(NULL, "ocp");
+
+	if (h_sham && ((!bus && omap_type() == OMAP2_DEVICE_TYPE_GP) ||
+	    (bus && of_device_is_available(of_find_node_by_name(bus, "sham"))))) {
+		r = omap_hwmod_register_links(h_sham);
+		if (r < 0)
+			return r;
+	}
+
+	if (h_aes && ((!bus && omap_type() == OMAP2_DEVICE_TYPE_GP) ||
+	    (bus && of_device_is_available(of_find_node_by_name(bus, "aes"))))) {
+		r = omap_hwmod_register_links(h_aes);
+		if (r < 0)
+			return r;
+	}
 
 	/*
 	 * Register hwmod links specific to certain ES levels of a
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
  2015-02-26 13:49 ` [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod Pali Rohár
  2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
       [not found]   ` <1424958600-18881-4-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-02-26 13:49 ` [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync Pali Rohár
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

omap3 support is same as omap2, just with different IO address (specified in DT)

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/crypto/omap-sham.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 3c76696..b20e374 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
 		.data		= &omap_sham_pdata_omap2,
 	},
 	{
+		.compatible	= "ti,omap3-sham",
+		.data		= &omap_sham_pdata_omap2,
+	},
+	{
 		.compatible	= "ti,omap4-sham",
 		.data		= &omap_sham_pdata_omap4,
 	},
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (2 preceding siblings ...)
  2015-02-26 13:49 ` [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-02-28 16:39   ` Pavel Machek
  2015-03-08 10:01   ` [PATCH v2] " Pali Rohár
  2015-02-26 13:49 ` [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12 Pali Rohár
                   ` (7 subsequent siblings)
  11 siblings, 2 replies; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Function pm_runtime_get_sync could fail and we need to check return
value to prevent kernel crash.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/crypto/omap-sham.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index b20e374..5573a1c 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1949,7 +1949,13 @@ static int omap_sham_probe(struct platform_device *pdev)
 	dd->flags |= dd->pdata->flags;
 
 	pm_runtime_enable(dev);
-	pm_runtime_get_sync(dev);
+
+	err = pm_runtime_get_sync(dev);
+	if (err < 0) {
+		dev_err(dev, "failed to get sync: %d\n", err);
+		goto err_pm;
+	}
+
 	rev = omap_sham_read(dd, SHA_REG_REV(dd));
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -1979,6 +1985,7 @@ err_algs:
 		for (j = dd->pdata->algs_info[i].registered - 1; j >= 0; j--)
 			crypto_unregister_ahash(
 					&dd->pdata->algs_info[i].algs_list[j]);
+err_pm:
 	pm_runtime_disable(dev);
 	if (dd->dma_lch)
 		dma_release_channel(dd->dma_lch);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (3 preceding siblings ...)
  2015-02-26 13:49 ` [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-02-28 16:54   ` Pavel Machek
  2015-02-26 13:49 ` [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto Pali Rohár
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Device timer12 is automatically disabled on all HS devices via DTS property
"ti,timer-secure" in file omap3.dtsi so it can be safely removed. We do not
need to disable it on another place.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap34xx-hs.dtsi |    4 ----
 arch/arm/boot/dts/omap36xx-hs.dtsi |    4 ----
 2 files changed, 8 deletions(-)

diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
index 1ff6264..d4be302 100644
--- a/arch/arm/boot/dts/omap34xx-hs.dtsi
+++ b/arch/arm/boot/dts/omap34xx-hs.dtsi
@@ -10,7 +10,3 @@
 &sham {
 	status = "disabled";
 };
-
-&timer12 {
-	status = "disabled";
-};
diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
index 2c7febb..e93ff8d 100644
--- a/arch/arm/boot/dts/omap36xx-hs.dtsi
+++ b/arch/arm/boot/dts/omap36xx-hs.dtsi
@@ -10,7 +10,3 @@
 &sham {
 	status = "disabled";
 };
-
-&timer12 {
-	status = "disabled";
-};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (4 preceding siblings ...)
  2015-02-26 13:49 ` [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12 Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
       [not found]   ` <1424958600-18881-7-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-02-26 13:49   ` Pali Rohár
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

This patch adds missing dma DTS definitions for omap aes and sham drivers.
Without it kernel drivers do not work.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap3.dtsi |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 60e6d6b..6e8b58f 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -92,6 +92,8 @@
 			ti,hwmods = "aes";
 			reg = <0x480c5000 0x50>;
 			interrupts = <0>;
+			dmas = <&sdma 65 &sdma 66>;
+			dma-names = "tx", "rx";
 		};
 
 		prm: prm@48306000 {
@@ -551,6 +553,8 @@
 			ti,hwmods = "sham";
 			reg = <0x480c3000 0x64>;
 			interrupts = <49>;
+			dmas = <&sdma 69>;
+			dma-names = "rx";
 		};
 
 		smartreflex_core: smartreflex@480cb000 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
@ 2015-02-26 13:49   ` Pali Rohár
  2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
Bootloader on those devices is known that it enables HW crypto support.
This patch just include omap36xx.dtsi directly, so aes and sham is enabled.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index c41db94..800b379 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -8,7 +8,7 @@
  * published by the Free Software Foundation.
  */
 
-#include "omap36xx-hs.dtsi"
+#include "omap36xx.dtsi"
 
 / {
 	cpus {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
@ 2015-02-26 13:49   ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
Bootloader on those devices is known that it enables HW crypto support.
This patch just include omap36xx.dtsi directly, so aes and sham is enabled.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index c41db94..800b379 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -8,7 +8,7 @@
  * published by the Free Software Foundation.
  */
 
-#include "omap36xx-hs.dtsi"
+#include "omap36xx.dtsi"
 
 / {
 	cpus {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 08/10] ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (6 preceding siblings ...)
  2015-02-26 13:49   ` Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-02-28 16:44   ` Pavel Machek
  2015-02-26 13:49 ` [PATCH 09/10] ARM: dts: omap3-tao3530: Include " Pali Rohár
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

This patch moves content of file omap34xx-hs.dtsi into omap3-n900.dts and enable
omap sham support (omap HW support for SHA + MD5). After testing both omap hwmod
and omap-sham.ko drivers it looks like signed Nokia X-Loader enable L3 firewall
for omap sham. There is no kernel crash with both official bootloader and crypto
enable bootloader. So we can safely enable sham code.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap3-n900.dts |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index d16aa9c..10d5305 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -9,9 +9,23 @@
 
 /dts-v1/;
 
-#include "omap34xx-hs.dtsi"
+#include "omap34xx.dtsi"
 #include <dt-bindings/input/input.h>
 
+/*
+ * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
+ * for omap AES HW crypto support. When linux kernel try to access memory of AES
+ * blocks then kernel receive "Unhandled fault: external abort on non-linefetch"
+ * and crash. Until somebody fix omap-aes.c and omap_hwmod_3xxx_data.c code (no
+ * crash anymore) omap AES support will be disabled for all Nokia N900 devices.
+ * There is "unofficial" version of bootloader which enables AES in L3 firewall
+ * but it is not widely used and to prevent kernel crash rather AES is disabled.
+ * There is also no runtime detection code if AES is disabled in L3 firewall...
+ */
+&aes {
+	status = "disabled";
+};
+
 / {
 	model = "Nokia N900";
 	compatible = "nokia,omap3-n900", "ti,omap3430", "ti,omap3";
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 09/10] ARM: dts: omap3-tao3530: Include directly omap34xx.dtsi
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (7 preceding siblings ...)
  2015-02-26 13:49 ` [PATCH 08/10] ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi Pali Rohár
@ 2015-02-26 13:49 ` Pali Rohár
  2015-02-28 16:44   ` Pavel Machek
  2015-02-26 13:50 ` [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi Pali Rohár
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:49 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

This patch just move content of file omap34xx-hs.dtsi into omap3-tao3530.dts.
There is no code change, patch is just preparation for removing -hs file.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap3-tao3530.dtsi |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-tao3530.dtsi b/arch/arm/boot/dts/omap3-tao3530.dtsi
index e89820a..873aa10 100644
--- a/arch/arm/boot/dts/omap3-tao3530.dtsi
+++ b/arch/arm/boot/dts/omap3-tao3530.dtsi
@@ -8,7 +8,16 @@
  */
 /dts-v1/;
 
-#include "omap34xx-hs.dtsi"
+#include "omap34xx.dtsi"
+
+/* Secure omaps have some devices inaccessible depending on the firmware */
+&aes {
+	status = "disabled";
+};
+
+&sham {
+	status = "disabled";
+};
 
 / {
 	cpus {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (8 preceding siblings ...)
  2015-02-26 13:49 ` [PATCH 09/10] ARM: dts: omap3-tao3530: Include " Pali Rohár
@ 2015-02-26 13:50 ` Pali Rohár
       [not found]   ` <1424958600-18881-11-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-02-26 22:46 ` [PATCH 00/10] omap3 crypto fixes Aaro Koskinen
  2015-03-06 18:36   ` Tony Lindgren
  11 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-26 13:50 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

These files are not used by any DTS file anymore.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/boot/dts/omap34xx-hs.dtsi |   12 ------------
 arch/arm/boot/dts/omap36xx-hs.dtsi |   12 ------------
 2 files changed, 24 deletions(-)
 delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
 delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi

diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
deleted file mode 100644
index d4be302..0000000
--- a/arch/arm/boot/dts/omap34xx-hs.dtsi
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Disabled modules for secure omaps */
-
-#include "omap34xx.dtsi"
-
-/* Secure omaps have some devices inaccessible depending on the firmware */
-&aes {
-	status = "disabled";
-};
-
-&sham {
-	status = "disabled";
-};
diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
deleted file mode 100644
index e93ff8d..0000000
--- a/arch/arm/boot/dts/omap36xx-hs.dtsi
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Disabled modules for secure omaps */
-
-#include "omap36xx.dtsi"
-
-/* Secure omaps have some devices inaccessible depending on the firmware */
-&aes {
-	status = "disabled";
-};
-
-&sham {
-	status = "disabled";
-};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
                   ` (9 preceding siblings ...)
  2015-02-26 13:50 ` [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi Pali Rohár
@ 2015-02-26 22:46 ` Aaro Koskinen
  2015-02-27 12:40   ` Pali Rohár
  2015-03-06 18:36   ` Tony Lindgren
  11 siblings, 1 reply; 66+ messages in thread
From: Aaro Koskinen @ 2015-02-26 22:46 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

Hi,

On Thu, Feb 26, 2015 at 02:49:50PM +0100, Pali Rohár wrote:
> This patch series fix crypto support for omap3 devices which use DT.
> 
> It enables AES and SHAM on N9/N950 and SHAM on N900. AES is still disabled for N900.

(Please format your lines somewhere near < 76 chars, especially in
commit logs, otherwise "git log" looks ugly on 80 char terminals.)

I tested these with stock bootloaders, and devices boot normally
and I can now modprobe omap-aes (on N9 and N950) and omap-sham
(on all three):

	omap-aes 480c5000.aes: OMAP AES hw accel rev: 2.6
	omap-sham 480c3000.sham: hw accel on OMAP rev 0.9

However I get these when CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set:

	alg: hash: Chunking test 1 failed for omap-sha1
	alg: hash: Chunking test 1 failed for omap-md5
	alg: hash: Chunking test 1 failed for omap-hmac-sha1
	alg: hash: Chunking test 1 failed for omap-hmac-md5

But that's probably unrelated to this series. For patches 1-8,
feel free to add:

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>

A.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-02-26 22:46 ` [PATCH 00/10] omap3 crypto fixes Aaro Koskinen
@ 2015-02-27 12:40   ` Pali Rohár
  2015-03-07 23:19       ` Aaro Koskinen
  0 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-27 12:40 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 1695 bytes --]

On Thursday 26 February 2015 23:46:05 Aaro Koskinen wrote:
> Hi,
> 
> On Thu, Feb 26, 2015 at 02:49:50PM +0100, Pali Rohár wrote:
> > This patch series fix crypto support for omap3 devices which
> > use DT.
> > 
> > It enables AES and SHAM on N9/N950 and SHAM on N900. AES is
> > still disabled for N900.
> 
> (Please format your lines somewhere near < 76 chars,
> especially in commit logs, otherwise "git log" looks ugly on
> 80 char terminals.)
> 
> I tested these with stock bootloaders, and devices boot
> normally and I can now modprobe omap-aes (on N9 and N950) and
> omap-sham (on all three):
> 
> 	omap-aes 480c5000.aes: OMAP AES hw accel rev: 2.6
> 	omap-sham 480c3000.sham: hw accel on OMAP rev 0.9
> 
> However I get these when CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
> is not set:
> 
> 	alg: hash: Chunking test 1 failed for omap-sha1
> 	alg: hash: Chunking test 1 failed for omap-md5
> 	alg: hash: Chunking test 1 failed for omap-hmac-sha1
> 	alg: hash: Chunking test 1 failed for omap-hmac-md5
> 
> But that's probably unrelated to this series. For patches 1-8,
> feel free to add:
> 
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> 
> A.

Hi, thanks for testing!

Now I'm happy that I can load omap-aes and omap-sham drivers on 
real n900 device, qemu n900 and after your tests also on real n9 
and n950 without any kernel crash or oops. Of course omap-aes is 
disabled on n900, but loading omap-aes.ko (accidentally) does not 
hurt.

It looks like there are other parts in md5 and sha broken, but 
first step is load & register all drivers without kernel crash. 
And this is working now.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-26 13:49   ` Pali Rohár
  (?)
@ 2015-02-27 15:43   ` Tony Lindgren
  2015-02-27 16:01     ` Pali Rohár
  -1 siblings, 1 reply; 66+ messages in thread
From: Tony Lindgren @ 2015-02-27 15:43 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
> Bootloader on those devices is known that it enables HW crypto support.
> This patch just include omap36xx.dtsi directly, so aes and sham is enabled.

Let's also remove omap36xx-hs.dtsi with this patch if no other users.

Regards,

Tony
 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  arch/arm/boot/dts/omap3-n950-n9.dtsi |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
> index c41db94..800b379 100644
> --- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
> +++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
> @@ -8,7 +8,7 @@
>   * published by the Free Software Foundation.
>   */
>  
> -#include "omap36xx-hs.dtsi"
> +#include "omap36xx.dtsi"
>  
>  / {
>  	cpus {
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-27 15:43   ` Tony Lindgren
@ 2015-02-27 16:01     ` Pali Rohár
  2015-02-27 16:10         ` Tony Lindgren
  0 siblings, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-02-27 16:01 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 545 bytes --]

On Friday 27 February 2015 16:43:20 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> > Harmattan system on Nokia N9 and N950 devices uses omap
> > crypto support. Bootloader on those devices is known that
> > it enables HW crypto support. This patch just include
> > omap36xx.dtsi directly, so aes and sham is enabled.
> 
> Let's also remove omap36xx-hs.dtsi with this patch if no other
> users.
> 

Removing both -hs files is done by last patch in this series.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-27 16:01     ` Pali Rohár
@ 2015-02-27 16:10         ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-02-27 16:10 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150227 08:05]:
> On Friday 27 February 2015 16:43:20 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> > > Harmattan system on Nokia N9 and N950 devices uses omap
> > > crypto support. Bootloader on those devices is known that
> > > it enables HW crypto support. This patch just include
> > > omap36xx.dtsi directly, so aes and sham is enabled.
> > 
> > Let's also remove omap36xx-hs.dtsi with this patch if no other
> > users.
> > 
> 
> Removing both -hs files is done by last patch in this series.

Yes just noticed thanks, no need to change.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
@ 2015-02-27 16:10         ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-02-27 16:10 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150227 08:05]:
> On Friday 27 February 2015 16:43:20 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> > > Harmattan system on Nokia N9 and N950 devices uses omap
> > > crypto support. Bootloader on those devices is known that
> > > it enables HW crypto support. This patch just include
> > > omap36xx.dtsi directly, so aes and sham is enabled.
> > 
> > Let's also remove omap36xx-hs.dtsi with this patch if no other
> > users.
> > 
> 
> Removing both -hs files is done by last patch in this series.

Yes just noticed thanks, no need to change.

Regards,

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices
  2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
@ 2015-02-28 16:24   ` Pavel Machek
  2015-05-26 10:54       ` Pali Rohár
  0 siblings, 1 reply; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:24 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:52, Pali Rohár wrote:
> Register crypto hwmod links only if they are not disabled in DT.
> If DT information is missing, enable them only for GP devices.
> 
> Before this patch crypto hwmod links were always disabled for all HS devices
> and it was not possible to use omap-aes and omap-sham linux drivers.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
  2015-02-26 13:49 ` [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices Pali Rohár
@ 2015-02-28 16:25       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:25 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> omap3 support is same as omap2, just with different IO address (specified in DT)
> 
> Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

> @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
>  		.data		= &omap_sham_pdata_omap2,
>  	},
>  	{
> +		.compatible	= "ti,omap3-sham",
> +		.data		= &omap_sham_pdata_omap2,
> +	},
> +	{
>  		.compatible	= "ti,omap4-sham",
>  		.data		= &omap_sham_pdata_omap4,
>  	},

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
@ 2015-02-28 16:25       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:25 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> omap3 support is same as omap2, just with different IO address (specified in DT)
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

> @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
>  		.data		= &omap_sham_pdata_omap2,
>  	},
>  	{
> +		.compatible	= "ti,omap3-sham",
> +		.data		= &omap_sham_pdata_omap2,
> +	},
> +	{
>  		.compatible	= "ti,omap4-sham",
>  		.data		= &omap_sham_pdata_omap4,
>  	},

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-02-26 13:49 ` [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync Pali Rohár
@ 2015-02-28 16:39   ` Pavel Machek
  2015-03-08 10:01   ` [PATCH v2] " Pali Rohár
  1 sibling, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:39 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:54, Pali Rohár wrote:
> Function pm_runtime_get_sync could fail and we need to check return
> value to prevent kernel crash.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-26 13:49   ` Pali Rohár
  (?)
  (?)
@ 2015-02-28 16:41   ` Pavel Machek
  2015-03-19 16:43       ` Tony Lindgren
  -1 siblings, 1 reply; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:41 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:57, Pali Rohár wrote:
> Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
> Bootloader on those devices is known that it enables HW crypto support.
> This patch just include omap36xx.dtsi directly, so aes and sham is enabled.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

> --- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
> +++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
> @@ -8,7 +8,7 @@
>   * published by the Free Software Foundation.
>   */
>  
> -#include "omap36xx-hs.dtsi"
> +#include "omap36xx.dtsi"
>  
>  / {
>  	cpus {

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 08/10] ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi
  2015-02-26 13:49 ` [PATCH 08/10] ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi Pali Rohár
@ 2015-02-28 16:44   ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:44 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:58, Pali Rohár wrote:
> This patch moves content of file omap34xx-hs.dtsi into omap3-n900.dts and enable
> omap sham support (omap HW support for SHA + MD5). After testing both omap hwmod
> and omap-sham.ko drivers it looks like signed Nokia X-Loader enable L3 firewall
> for omap sham. There is no kernel crash with both official bootloader and crypto
> enable bootloader. So we can safely enable sham code.
> 

> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel	 Machek <pavel@ucw.cz>


> +/*
> + * Default secure signed bootloader (Nokia X-Loader) does not enable L3 firewall
> + * for omap AES HW crypto support. When linux kernel try to access memory of AES

                                      When Linux Kernel tries...

> + * blocks then kernel receive "Unhandled fault: external abort on non-linefetch"
            , the kernel receives
	    
> + * and crash. Until somebody fix omap-aes.c and omap_hwmod_3xxx_data.c code (no

      and crashes. Until somebody fixes
      
> + * crash anymore) omap AES support will be disabled for all Nokia N900 devices.
> + * There is "unofficial" version of bootloader which enables AES in L3 firewall
                                                                          firewall,
									  
> + * but it is not widely used and to prevent kernel crash rather AES is disabled.
> + * There is also no runtime detection code if AES is disabled in L3 firewall...
> + */
> +&aes {
> +	status = "disabled";
> +};
> +
>  / {
>  	model = "Nokia N900";
>  	compatible = "nokia,omap3-n900", "ti,omap3430", "ti,omap3";

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 09/10] ARM: dts: omap3-tao3530: Include directly omap34xx.dtsi
  2015-02-26 13:49 ` [PATCH 09/10] ARM: dts: omap3-tao3530: Include " Pali Rohár
@ 2015-02-28 16:44   ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:44 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:59, Pali Rohár wrote:
> This patch just move content of file omap34xx-hs.dtsi into omap3-tao3530.dts.
> There is no code change, patch is just preparation for removing -hs file.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

> --- a/arch/arm/boot/dts/omap3-tao3530.dtsi
> +++ b/arch/arm/boot/dts/omap3-tao3530.dtsi
> @@ -8,7 +8,16 @@
>   */
>  /dts-v1/;
>  
> -#include "omap34xx-hs.dtsi"
> +#include "omap34xx.dtsi"
> +
> +/* Secure omaps have some devices inaccessible depending on the firmware */
> +&aes {
> +	status = "disabled";
> +};
> +
> +&sham {
> +	status = "disabled";
> +};
>  
>  / {
>  	cpus {

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi
  2015-02-26 13:50 ` [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi Pali Rohár
@ 2015-02-28 16:45       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:45 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:50:00, Pali Rohár wrote:
> These files are not used by any DTS file anymore.
> 
> Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Pavel	 Machek <pavel-+ZI9xUNit7I@public.gmane.org>

> ---
>  arch/arm/boot/dts/omap34xx-hs.dtsi |   12 ------------
>  arch/arm/boot/dts/omap36xx-hs.dtsi |   12 ------------
>  2 files changed, 24 deletions(-)
>  delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
>  delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi
> 
> diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
> deleted file mode 100644
> index d4be302..0000000
> --- a/arch/arm/boot/dts/omap34xx-hs.dtsi
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -/* Disabled modules for secure omaps */
> -
> -#include "omap34xx.dtsi"
> -
> -/* Secure omaps have some devices inaccessible depending on the firmware */
> -&aes {
> -	status = "disabled";
> -};
> -
> -&sham {
> -	status = "disabled";
> -};
> diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
> deleted file mode 100644
> index e93ff8d..0000000
> --- a/arch/arm/boot/dts/omap36xx-hs.dtsi
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -/* Disabled modules for secure omaps */
> -
> -#include "omap36xx.dtsi"
> -
> -/* Secure omaps have some devices inaccessible depending on the firmware */
> -&aes {
> -	status = "disabled";
> -};
> -
> -&sham {
> -	status = "disabled";
> -};

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi
@ 2015-02-28 16:45       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:45 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:50:00, Pali Rohár wrote:
> These files are not used by any DTS file anymore.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel	 Machek <pavel@ucw.cz>

> ---
>  arch/arm/boot/dts/omap34xx-hs.dtsi |   12 ------------
>  arch/arm/boot/dts/omap36xx-hs.dtsi |   12 ------------
>  2 files changed, 24 deletions(-)
>  delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
>  delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi
> 
> diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
> deleted file mode 100644
> index d4be302..0000000
> --- a/arch/arm/boot/dts/omap34xx-hs.dtsi
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -/* Disabled modules for secure omaps */
> -
> -#include "omap34xx.dtsi"
> -
> -/* Secure omaps have some devices inaccessible depending on the firmware */
> -&aes {
> -	status = "disabled";
> -};
> -
> -&sham {
> -	status = "disabled";
> -};
> diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
> deleted file mode 100644
> index e93ff8d..0000000
> --- a/arch/arm/boot/dts/omap36xx-hs.dtsi
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -/* Disabled modules for secure omaps */
> -
> -#include "omap36xx.dtsi"
> -
> -/* Secure omaps have some devices inaccessible depending on the firmware */
> -&aes {
> -	status = "disabled";
> -};
> -
> -&sham {
> -	status = "disabled";
> -};

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto
  2015-02-26 13:49 ` [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto Pali Rohár
@ 2015-02-28 16:46       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:46 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:56, Pali Rohár wrote:
> This patch adds missing dma DTS definitions for omap aes and sham drivers.
> Without it kernel drivers do not work.
> 
> Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Pavel	 Machek <pavel-+ZI9xUNit7I@public.gmane.org>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto
@ 2015-02-28 16:46       ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:46 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:56, Pali Rohár wrote:
> This patch adds missing dma DTS definitions for omap aes and sham drivers.
> Without it kernel drivers do not work.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel	 Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12
  2015-02-26 13:49 ` [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12 Pali Rohár
@ 2015-02-28 16:54   ` Pavel Machek
  0 siblings, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-02-28 16:54 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu 2015-02-26 14:49:55, Pali Rohár wrote:
> Device timer12 is automatically disabled on all HS devices via DTS property
> "ti,timer-secure" in file omap3.dtsi so it can be safely removed. We do not
> need to disable it on another place.

Dunno. Theoretically, Linux is not the only user of dts... so even if
linux handles ti,timer-secure as "don't use it", that may not be right
for bootloaders etc.

> diff --git a/arch/arm/boot/dts/omap34xx-hs.dtsi b/arch/arm/boot/dts/omap34xx-hs.dtsi
> index 1ff6264..d4be302 100644
> --- a/arch/arm/boot/dts/omap34xx-hs.dtsi
> +++ b/arch/arm/boot/dts/omap34xx-hs.dtsi
> @@ -10,7 +10,3 @@
>  &sham {
>  	status = "disabled";
>  };
> -
> -&timer12 {
> -	status = "disabled";
> -};
> diff --git a/arch/arm/boot/dts/omap36xx-hs.dtsi b/arch/arm/boot/dts/omap36xx-hs.dtsi
> index 2c7febb..e93ff8d 100644
> --- a/arch/arm/boot/dts/omap36xx-hs.dtsi
> +++ b/arch/arm/boot/dts/omap36xx-hs.dtsi
> @@ -10,7 +10,3 @@
>  &sham {
>  	status = "disabled";
>  };
> -
> -&timer12 {
> -	status = "disabled";
> -};

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
@ 2015-03-06 18:36   ` Tony Lindgren
  2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-06 18:36 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> This patch series fix crypto support for omap3 devices which use DT.
> 
> It enables AES and SHAM on N9/N950 and SHAM on N900. AES is still disabled for N900.
> 
> Pali Rohár (10):
>   ARM: OMAP2+: Return correct error values from device and hwmod
>   ARM: OMAP3: Fix crypto support for HS devices
>   crypto: omap-sham: Add support for omap3 devices
>   crypto: omap-sham: Check for return value from pm_runtime_get_sync
>   ARM: dts: omap3 hs: Remove timer12
>   ARM: dts: omap3: Add missing dmas for crypto
>   ARM: dts: n9/n950: Enable omap crypto support
>   ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi
>   ARM: dts: omap3-tao3530: Include directly omap34xx.dtsi
>   ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi
> 
>  arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
>  arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
>  arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
>  arch/arm/boot/dts/omap3.dtsi               |    4 ++
>  arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
>  arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
>  arch/arm/mach-omap2/omap_device.c          |   30 ++++++-----
>  arch/arm/mach-omap2/omap_hwmod.c           |   10 ++--
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79 +++++++++++++++++++++++-----
>  drivers/crypto/omap-sham.c                 |   13 ++++-
>  10 files changed, 131 insertions(+), 66 deletions(-)
>  delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
>  delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi

Are there any fixes in this series that should go into
v4.0-rc series, or can it all wait for v4.1?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-03-06 18:36   ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-06 18:36 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> This patch series fix crypto support for omap3 devices which use DT.
> 
> It enables AES and SHAM on N9/N950 and SHAM on N900. AES is still disabled for N900.
> 
> Pali Rohár (10):
>   ARM: OMAP2+: Return correct error values from device and hwmod
>   ARM: OMAP3: Fix crypto support for HS devices
>   crypto: omap-sham: Add support for omap3 devices
>   crypto: omap-sham: Check for return value from pm_runtime_get_sync
>   ARM: dts: omap3 hs: Remove timer12
>   ARM: dts: omap3: Add missing dmas for crypto
>   ARM: dts: n9/n950: Enable omap crypto support
>   ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi
>   ARM: dts: omap3-tao3530: Include directly omap34xx.dtsi
>   ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi
> 
>  arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
>  arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
>  arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
>  arch/arm/boot/dts/omap3.dtsi               |    4 ++
>  arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
>  arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
>  arch/arm/mach-omap2/omap_device.c          |   30 ++++++-----
>  arch/arm/mach-omap2/omap_hwmod.c           |   10 ++--
>  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79 +++++++++++++++++++++++-----
>  drivers/crypto/omap-sham.c                 |   13 ++++-
>  10 files changed, 131 insertions(+), 66 deletions(-)
>  delete mode 100644 arch/arm/boot/dts/omap34xx-hs.dtsi
>  delete mode 100644 arch/arm/boot/dts/omap36xx-hs.dtsi

Are there any fixes in this series that should go into
v4.0-rc series, or can it all wait for v4.1?

Regards,

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-06 18:36   ` Tony Lindgren
@ 2015-03-06 19:16       ` Pali Rohár
  -1 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-06 19:16 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 2220 bytes --]

On Friday 06 March 2015 19:36:32 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [150226 05:54]:
> > This patch series fix crypto support for omap3 devices which
> > use DT.
> > 
> > It enables AES and SHAM on N9/N950 and SHAM on N900. AES is
> > still disabled for N900.
> > 
> > Pali Rohár (10):
> >   ARM: OMAP2+: Return correct error values from device and
> >   hwmod ARM: OMAP3: Fix crypto support for HS devices
> >   crypto: omap-sham: Add support for omap3 devices
> >   crypto: omap-sham: Check for return value from
> >   pm_runtime_get_sync ARM: dts: omap3 hs: Remove timer12
> >   ARM: dts: omap3: Add missing dmas for crypto
> >   ARM: dts: n9/n950: Enable omap crypto support
> >   ARM: dts: n900: Enable omap sham and include directly
> >   omap34xx.dtsi ARM: dts: omap3-tao3530: Include directly
> >   omap34xx.dtsi ARM: dts: Remove files omap34xx-hs.dtsi and
> >   omap36xx-hs.dtsi
> >  
> >  arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
> >  arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
> >  arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
> >  arch/arm/boot/dts/omap3.dtsi               |    4 ++
> >  arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
> >  arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
> >  arch/arm/mach-omap2/omap_device.c          |   30
> >  ++++++----- arch/arm/mach-omap2/omap_hwmod.c           |  
> >  10 ++-- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79
> >  +++++++++++++++++++++++----- drivers/crypto/omap-sham.c   
> >               |   13 ++++- 10 files changed, 131
> >  insertions(+), 66 deletions(-) delete mode 100644
> >  arch/arm/boot/dts/omap34xx-hs.dtsi delete mode 100644
> >  arch/arm/boot/dts/omap36xx-hs.dtsi
> 
> Are there any fixes in this series that should go into
> v4.0-rc series, or can it all wait for v4.1?
> 
> Regards,
> 
> Tony

I do not know which patches are you sending to 4.0-rc series, but 
omap crypto is totally broken in linus tree for both GP & HS 
omap3 devices when DT booting is used. This patch series fix that 
problem.

-- 
Pali Rohár
pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-03-06 19:16       ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-06 19:16 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 2160 bytes --]

On Friday 06 March 2015 19:36:32 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> > This patch series fix crypto support for omap3 devices which
> > use DT.
> > 
> > It enables AES and SHAM on N9/N950 and SHAM on N900. AES is
> > still disabled for N900.
> > 
> > Pali Rohár (10):
> >   ARM: OMAP2+: Return correct error values from device and
> >   hwmod ARM: OMAP3: Fix crypto support for HS devices
> >   crypto: omap-sham: Add support for omap3 devices
> >   crypto: omap-sham: Check for return value from
> >   pm_runtime_get_sync ARM: dts: omap3 hs: Remove timer12
> >   ARM: dts: omap3: Add missing dmas for crypto
> >   ARM: dts: n9/n950: Enable omap crypto support
> >   ARM: dts: n900: Enable omap sham and include directly
> >   omap34xx.dtsi ARM: dts: omap3-tao3530: Include directly
> >   omap34xx.dtsi ARM: dts: Remove files omap34xx-hs.dtsi and
> >   omap36xx-hs.dtsi
> >  
> >  arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
> >  arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
> >  arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
> >  arch/arm/boot/dts/omap3.dtsi               |    4 ++
> >  arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
> >  arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
> >  arch/arm/mach-omap2/omap_device.c          |   30
> >  ++++++----- arch/arm/mach-omap2/omap_hwmod.c           |  
> >  10 ++-- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79
> >  +++++++++++++++++++++++----- drivers/crypto/omap-sham.c   
> >               |   13 ++++- 10 files changed, 131
> >  insertions(+), 66 deletions(-) delete mode 100644
> >  arch/arm/boot/dts/omap34xx-hs.dtsi delete mode 100644
> >  arch/arm/boot/dts/omap36xx-hs.dtsi
> 
> Are there any fixes in this series that should go into
> v4.0-rc series, or can it all wait for v4.1?
> 
> Regards,
> 
> Tony

I do not know which patches are you sending to 4.0-rc series, but 
omap crypto is totally broken in linus tree for both GP & HS 
omap3 devices when DT booting is used. This patch series fix that 
problem.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-06 19:16       ` Pali Rohár
  (?)
@ 2015-03-06 19:18       ` Tony Lindgren
  -1 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-06 19:18 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Rob Herring, Russell King, Paul Walmsley,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150306 11:16]:
> On Friday 06 March 2015 19:36:32 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar@gmail.com> [150226 05:54]:
> > > This patch series fix crypto support for omap3 devices which
> > > use DT.
> > > 
> > > It enables AES and SHAM on N9/N950 and SHAM on N900. AES is
> > > still disabled for N900.
> > > 
> > > Pali Rohár (10):
> > >   ARM: OMAP2+: Return correct error values from device and
> > >   hwmod ARM: OMAP3: Fix crypto support for HS devices
> > >   crypto: omap-sham: Add support for omap3 devices
> > >   crypto: omap-sham: Check for return value from
> > >   pm_runtime_get_sync ARM: dts: omap3 hs: Remove timer12
> > >   ARM: dts: omap3: Add missing dmas for crypto
> > >   ARM: dts: n9/n950: Enable omap crypto support
> > >   ARM: dts: n900: Enable omap sham and include directly
> > >   omap34xx.dtsi ARM: dts: omap3-tao3530: Include directly
> > >   omap34xx.dtsi ARM: dts: Remove files omap34xx-hs.dtsi and
> > >   omap36xx-hs.dtsi
> > >  
> > >  arch/arm/boot/dts/omap3-n900.dts           |   16 +++++-
> > >  arch/arm/boot/dts/omap3-n950-n9.dtsi       |    2 +-
> > >  arch/arm/boot/dts/omap3-tao3530.dtsi       |   11 +++-
> > >  arch/arm/boot/dts/omap3.dtsi               |    4 ++
> > >  arch/arm/boot/dts/omap34xx-hs.dtsi         |   16 ------
> > >  arch/arm/boot/dts/omap36xx-hs.dtsi         |   16 ------
> > >  arch/arm/mach-omap2/omap_device.c          |   30
> > >  ++++++----- arch/arm/mach-omap2/omap_hwmod.c           |  
> > >  10 ++-- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   79
> > >  +++++++++++++++++++++++----- drivers/crypto/omap-sham.c   
> > >               |   13 ++++- 10 files changed, 131
> > >  insertions(+), 66 deletions(-) delete mode 100644
> > >  arch/arm/boot/dts/omap34xx-hs.dtsi delete mode 100644
> > >  arch/arm/boot/dts/omap36xx-hs.dtsi
> > 
> > Are there any fixes in this series that should go into
> > v4.0-rc series, or can it all wait for v4.1?
> > 
> > Regards,
> > 
> > Tony
> 
> I do not know which patches are you sending to 4.0-rc series, but 
> omap crypto is totally broken in linus tree for both GP & HS 
> omap3 devices when DT booting is used. This patch series fix that 
> problem.

OK so the whole series is needed then. It seems too intrusive for
the v4.0-rc series unless this fixes a regression with some earlier
commit.

Regards,

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-06 18:36   ` Tony Lindgren
  (?)
  (?)
@ 2015-03-06 22:23   ` Aaro Koskinen
       [not found]     ` <20150306222306.GB587-+UqvGBo8NkiJ/SmVcN9c7yH8jP4CeeTLqBW4ids5wwA@public.gmane.org>
  2015-05-14 21:17     ` Pali Rohár
  -1 siblings, 2 replies; 66+ messages in thread
From: Aaro Koskinen @ 2015-03-06 22:23 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Pali Rohár, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

Hi,

On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> Are there any fixes in this series that should go into
> v4.0-rc series, or can it all wait for v4.1?

I think these all should wait for v4.1.

A.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-02-27 12:40   ` Pali Rohár
@ 2015-03-07 23:19       ` Aaro Koskinen
  0 siblings, 0 replies; 66+ messages in thread
From: Aaro Koskinen @ 2015-03-07 23:19 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

Hi,

On Fri, Feb 27, 2015 at 01:40:44PM +0100, Pali Rohár wrote:
> > However I get these when CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
> > is not set:
> > 
> > 	alg: hash: Chunking test 1 failed for omap-sha1
> > 	alg: hash: Chunking test 1 failed for omap-md5
> > 	alg: hash: Chunking test 1 failed for omap-hmac-sha1
> > 	alg: hash: Chunking test 1 failed for omap-hmac-md5

BTW, it seems these errors are reported to be introduced possibly
somewhere between 3.11 and 3.15:

	https://lists.fedoraproject.org/pipermail/arm/2014-August/008240.html 

A.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-03-07 23:19       ` Aaro Koskinen
  0 siblings, 0 replies; 66+ messages in thread
From: Aaro Koskinen @ 2015-03-07 23:19 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

Hi,

On Fri, Feb 27, 2015 at 01:40:44PM +0100, Pali Rohár wrote:
> > However I get these when CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
> > is not set:
> > 
> > 	alg: hash: Chunking test 1 failed for omap-sha1
> > 	alg: hash: Chunking test 1 failed for omap-md5
> > 	alg: hash: Chunking test 1 failed for omap-hmac-sha1
> > 	alg: hash: Chunking test 1 failed for omap-hmac-md5

BTW, it seems these errors are reported to be introduced possibly
somewhere between 3.11 and 3.15:

	https://lists.fedoraproject.org/pipermail/arm/2014-August/008240.html 

A.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-02-26 13:49 ` [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync Pali Rohár
  2015-02-28 16:39   ` Pavel Machek
@ 2015-03-08 10:01   ` Pali Rohár
  2015-03-09 20:52     ` Pavel Machek
  2015-05-14 21:40     ` Pali Rohár
  1 sibling, 2 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-08 10:01 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Pali Rohár

Function pm_runtime_get_sync could fail and we need to check return
value to prevent kernel crash.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
v2: Check return value for all pm_runtime_get_sync() calls
---
 drivers/crypto/omap-sham.c |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index b20e374..c5df53d 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -362,7 +362,13 @@ static void omap_sham_copy_ready_hash(struct ahash_request *req)
 
 static int omap_sham_hw_init(struct omap_sham_dev *dd)
 {
-	pm_runtime_get_sync(dd->dev);
+	int err;
+
+	err = pm_runtime_get_sync(dd->dev);
+	if (err < 0) {
+		dev_err(dd->dev, "failed to get sync: %d\n", err);
+		return err;
+	}
 
 	if (!test_bit(FLAGS_INIT, &dd->flags)) {
 		set_bit(FLAGS_INIT, &dd->flags);
@@ -1949,7 +1955,13 @@ static int omap_sham_probe(struct platform_device *pdev)
 	dd->flags |= dd->pdata->flags;
 
 	pm_runtime_enable(dev);
-	pm_runtime_get_sync(dev);
+
+	err = pm_runtime_get_sync(dev);
+	if (err < 0) {
+		dev_err(dev, "failed to get sync: %d\n", err);
+		goto err_pm;
+	}
+
 	rev = omap_sham_read(dd, SHA_REG_REV(dd));
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -1979,6 +1991,7 @@ err_algs:
 		for (j = dd->pdata->algs_info[i].registered - 1; j >= 0; j--)
 			crypto_unregister_ahash(
 					&dd->pdata->algs_info[i].algs_list[j]);
+err_pm:
 	pm_runtime_disable(dev);
 	if (dd->dma_lch)
 		dma_release_channel(dd->dma_lch);
@@ -2021,7 +2034,11 @@ static int omap_sham_suspend(struct device *dev)
 
 static int omap_sham_resume(struct device *dev)
 {
-	pm_runtime_get_sync(dev);
+	int err = pm_runtime_get_sync(dev);
+	if (err < 0) {
+		dev_err(dev, "failed to get sync: %d\n", err);
+		return err;
+	}
 	return 0;
 }
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-06 22:23   ` Aaro Koskinen
@ 2015-03-08 10:01         ` Pali Rohár
  2015-05-14 21:17     ` Pali Rohár
  1 sibling, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-08 10:01 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 507 bytes --]

On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> Hi,
> 
> On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > Are there any fixes in this series that should go into
> > v4.0-rc series, or can it all wait for v4.1?
> 
> I think these all should wait for v4.1.
> 
> A.

I would suggest to include at least patches 01, 04, 06. Probably 
those could go to -stable tree... but this decision is up to you.

-- 
Pali Rohár
pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-03-08 10:01         ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-08 10:01 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 477 bytes --]

On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> Hi,
> 
> On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > Are there any fixes in this series that should go into
> > v4.0-rc series, or can it all wait for v4.1?
> 
> I think these all should wait for v4.1.
> 
> A.

I would suggest to include at least patches 01, 04, 06. Probably 
those could go to -stable tree... but this decision is up to you.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-08 10:01         ` Pali Rohár
@ 2015-03-08 16:35           ` Paul Walmsley
  -1 siblings, 0 replies; 66+ messages in thread
From: Paul Walmsley @ 2015-03-08 16:35 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Tony Lindgren, Benoît Cousson, Rob Herring,
	Russell King, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 726 bytes --]

On Sun, 8 Mar 2015, Pali Rohár wrote:

> On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > Are there any fixes in this series that should go into
> > > v4.0-rc series, or can it all wait for v4.1?
> > 
> > I think these all should wait for v4.1.
> > 
> > A.
> 
> I would suggest to include at least patches 01, 04, 06. Probably 
> those could go to -stable tree... but this decision is up to you.

I'm not sure patch 1 is a fix.  As far as I know we haven't 
run into any issues with it on real hardware - only on QEMU - unless you 
know otherwise, Pali?  Are we sure that the QEMU model behavior matches 
the hardware?


- Paul

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-03-08 16:35           ` Paul Walmsley
  0 siblings, 0 replies; 66+ messages in thread
From: Paul Walmsley @ 2015-03-08 16:35 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Tony Lindgren, Benoît Cousson, Rob Herring,
	Russell King, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 726 bytes --]

On Sun, 8 Mar 2015, Pali Rohár wrote:

> On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > Are there any fixes in this series that should go into
> > > v4.0-rc series, or can it all wait for v4.1?
> > 
> > I think these all should wait for v4.1.
> > 
> > A.
> 
> I would suggest to include at least patches 01, 04, 06. Probably 
> those could go to -stable tree... but this decision is up to you.

I'm not sure patch 1 is a fix.  As far as I know we haven't 
run into any issues with it on real hardware - only on QEMU - unless you 
know otherwise, Pali?  Are we sure that the QEMU model behavior matches 
the hardware?


- Paul

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-03-08 10:01   ` [PATCH v2] " Pali Rohár
@ 2015-03-09 20:52     ` Pavel Machek
  2015-05-14 21:40     ` Pali Rohár
  1 sibling, 0 replies; 66+ messages in thread
From: Pavel Machek @ 2015-03-09 20:52 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Sun 2015-03-08 11:01:01, Pali Rohár wrote:
> Function pm_runtime_get_sync could fail and we need to check return
> value to prevent kernel crash.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-08 16:35           ` Paul Walmsley
  (?)
@ 2015-03-15  9:59           ` Pali Rohár
  -1 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-03-15  9:59 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Aaro Koskinen, Tony Lindgren, Benoît Cousson, Rob Herring,
	Russell King, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 1268 bytes --]

On Sunday 08 March 2015 17:35:13 Paul Walmsley wrote:
> On Sun, 8 Mar 2015, Pali Rohár wrote:
> > On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren 
wrote:
> > > > Are there any fixes in this series that should go into
> > > > v4.0-rc series, or can it all wait for v4.1?
> > > 
> > > I think these all should wait for v4.1.
> > > 
> > > A.
> > 
> > I would suggest to include at least patches 01, 04, 06.
> > Probably those could go to -stable tree... but this
> > decision is up to you.
> 
> I'm not sure patch 1 is a fix.  As far as I know we haven't
> run into any issues with it on real hardware - only on QEMU -
> unless you know otherwise, Pali?  Are we sure that the QEMU
> model behavior matches the hardware?
> 
> 
> - Paul

Patch 1 check for return value of more functions. If real HW or 
software emulated HW (in qemu) does not support e.g. aes then 
kernel show oops message, because kernel does not check return 
values and try to touch non-existent HW. So I think patch 1 is 
really fix. In my opinion if something can fail, then kernel 
should check if it failed. And not expect that function call 
always pass.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto
  2015-02-28 16:46       ` Pavel Machek
  (?)
@ 2015-03-16 21:44       ` Tony Lindgren
  -1 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-16 21:44 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pali Rohár, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pavel Machek <pavel@ucw.cz> [150228 08:49]:
> On Thu 2015-02-26 14:49:56, Pali Rohár wrote:
> > This patch adds missing dma DTS definitions for omap aes and sham drivers.
> > Without it kernel drivers do not work.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel	 Machek <pavel@ucw.cz>

Applying this into omap-for-v4.0/fixes to remove the regression
for legacy vs DT based booting for GP omap3 boards.

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
  2015-02-28 16:41   ` Pavel Machek
@ 2015-03-19 16:43       ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-19 16:43 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pali Rohár, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org> [150228 08:45]:
> On Thu 2015-02-26 14:49:57, Pali Rohár wrote:
> > Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
> > Bootloader on those devices is known that it enables HW crypto support.
> > This patch just include omap36xx.dtsi directly, so aes and sham is enabled.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

I'm picking patches 7 - 10 into omap-for-v4.1/dt branch thanks.

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support
@ 2015-03-19 16:43       ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-03-19 16:43 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Pali Rohár, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

* Pavel Machek <pavel@ucw.cz> [150228 08:45]:
> On Thu 2015-02-26 14:49:57, Pali Rohár wrote:
> > Harmattan system on Nokia N9 and N950 devices uses omap crypto support.
> > Bootloader on those devices is known that it enables HW crypto support.
> > This patch just include omap36xx.dtsi directly, so aes and sham is enabled.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>

I'm picking patches 7 - 10 into omap-for-v4.1/dt branch thanks.

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-03-06 22:23   ` Aaro Koskinen
       [not found]     ` <20150306222306.GB587-+UqvGBo8NkiJ/SmVcN9c7yH8jP4CeeTLqBW4ids5wwA@public.gmane.org>
@ 2015-05-14 21:17     ` Pali Rohár
  2015-05-14 21:34       ` Tony Lindgren
  1 sibling, 1 reply; 66+ messages in thread
From: Pali Rohár @ 2015-05-14 21:17 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 412 bytes --]

On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> Hi,
> 
> On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > Are there any fixes in this series that should go into
> > v4.0-rc series, or can it all wait for v4.1?
> 
> I think these all should wait for v4.1.
> 
> A.

4.1-rc3 was released and this patch series is still not included...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-05-14 21:17     ` Pali Rohár
@ 2015-05-14 21:34       ` Tony Lindgren
       [not found]         ` <20150514213418.GP15563-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 66+ messages in thread
From: Tony Lindgren @ 2015-05-14 21:34 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150514 14:19]:
> On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > Hi,
> > 
> > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > Are there any fixes in this series that should go into
> > > v4.0-rc series, or can it all wait for v4.1?
> > 
> > I think these all should wait for v4.1.
> > 
> > A.
> 
> 4.1-rc3 was released and this patch series is still not included...

The dts changes should be merged?

I suggest you repost the driver fixes so Herbert can queue them.

Regards,

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-05-14 21:34       ` Tony Lindgren
@ 2015-05-14 21:39             ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-14 21:39 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 849 bytes --]

On Thursday 14 May 2015 23:34:19 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [150514 14:19]:
> > On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > > Hi,
> > > 
> > > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > > Are there any fixes in this series that should go into
> > > > v4.0-rc series, or can it all wait for v4.1?
> > > 
> > > I think these all should wait for v4.1.
> > > 
> > > A.
> > 
> > 4.1-rc3 was released and this patch series is still not included...
> 
> The dts changes should be merged?
> 

Looks like yes, but first two arch/arm/mach-omap2 patches not.

> I suggest you repost the driver fixes so Herbert can queue them.
> 

Ok.

> Regards,
> 
> Tony

-- 
Pali Rohár
pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-05-14 21:39             ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-14 21:39 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 789 bytes --]

On Thursday 14 May 2015 23:34:19 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar@gmail.com> [150514 14:19]:
> > On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > > Hi,
> > > 
> > > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > > Are there any fixes in this series that should go into
> > > > v4.0-rc series, or can it all wait for v4.1?
> > > 
> > > I think these all should wait for v4.1.
> > > 
> > > A.
> > 
> > 4.1-rc3 was released and this patch series is still not included...
> 
> The dts changes should be merged?
> 

Looks like yes, but first two arch/arm/mach-omap2 patches not.

> I suggest you repost the driver fixes so Herbert can queue them.
> 

Ok.

> Regards,
> 
> Tony

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-03-08 10:01   ` [PATCH v2] " Pali Rohár
  2015-03-09 20:52     ` Pavel Machek
@ 2015-05-14 21:40     ` Pali Rohár
  2015-05-15  0:15       ` Herbert Xu
  2015-05-15  7:02       ` Herbert Xu
  1 sibling, 2 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-14 21:40 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

[-- Attachment #1: Type: Text/Plain, Size: 2161 bytes --]

On Sunday 08 March 2015 11:01:01 Pali Rohár wrote:
> Function pm_runtime_get_sync could fail and we need to check return
> value to prevent kernel crash.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
> v2: Check return value for all pm_runtime_get_sync() calls
> ---
>  drivers/crypto/omap-sham.c |   23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
> index b20e374..c5df53d 100644
> --- a/drivers/crypto/omap-sham.c
> +++ b/drivers/crypto/omap-sham.c
> @@ -362,7 +362,13 @@ static void omap_sham_copy_ready_hash(struct
> ahash_request *req)
> 
>  static int omap_sham_hw_init(struct omap_sham_dev *dd)
>  {
> -	pm_runtime_get_sync(dd->dev);
> +	int err;
> +
> +	err = pm_runtime_get_sync(dd->dev);
> +	if (err < 0) {
> +		dev_err(dd->dev, "failed to get sync: %d\n", err);
> +		return err;
> +	}
> 
>  	if (!test_bit(FLAGS_INIT, &dd->flags)) {
>  		set_bit(FLAGS_INIT, &dd->flags);
> @@ -1949,7 +1955,13 @@ static int omap_sham_probe(struct
> platform_device *pdev) dd->flags |= dd->pdata->flags;
> 
>  	pm_runtime_enable(dev);
> -	pm_runtime_get_sync(dev);
> +
> +	err = pm_runtime_get_sync(dev);
> +	if (err < 0) {
> +		dev_err(dev, "failed to get sync: %d\n", err);
> +		goto err_pm;
> +	}
> +
>  	rev = omap_sham_read(dd, SHA_REG_REV(dd));
>  	pm_runtime_put_sync(&pdev->dev);
> 
> @@ -1979,6 +1991,7 @@ err_algs:
>  		for (j = dd->pdata->algs_info[i].registered - 1; j >= 0; j--)
>  			crypto_unregister_ahash(
>  					&dd->pdata->algs_info[i].algs_list[j]);
> +err_pm:
>  	pm_runtime_disable(dev);
>  	if (dd->dma_lch)
>  		dma_release_channel(dd->dma_lch);
> @@ -2021,7 +2034,11 @@ static int omap_sham_suspend(struct device
> *dev)
> 
>  static int omap_sham_resume(struct device *dev)
>  {
> -	pm_runtime_get_sync(dev);
> +	int err = pm_runtime_get_sync(dev);
> +	if (err < 0) {
> +		dev_err(dev, "failed to get sync: %d\n", err);
> +		return err;
> +	}
>  	return 0;
>  }
>  #endif

Herbert, can you apply this patch?

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
  2015-05-14 21:39             ` Pali Rohár
@ 2015-05-14 22:03               ` Tony Lindgren
  -1 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-05-14 22:03 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

* Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [150514 14:40]:
> On Thursday 14 May 2015 23:34:19 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [150514 14:19]:
> > > On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > > > Hi,
> > > > 
> > > > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > > > Are there any fixes in this series that should go into
> > > > > v4.0-rc series, or can it all wait for v4.1?
> > > > 
> > > > I think these all should wait for v4.1.
> > > > 
> > > > A.
> > > 
> > > 4.1-rc3 was released and this patch series is still not included...
> > 
> > The dts changes should be merged?
> > 
> 
> Looks like yes, but first two arch/arm/mach-omap2 patches not.

I suggest you repost those to separately so Paul can take
a look at them. It seems they can be merged separately from
the driver changes?
 
Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 00/10] omap3 crypto fixes
@ 2015-05-14 22:03               ` Tony Lindgren
  0 siblings, 0 replies; 66+ messages in thread
From: Tony Lindgren @ 2015-05-14 22:03 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Benoît Cousson, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Sebastian Reichel

* Pali Rohár <pali.rohar@gmail.com> [150514 14:40]:
> On Thursday 14 May 2015 23:34:19 Tony Lindgren wrote:
> > * Pali Rohár <pali.rohar@gmail.com> [150514 14:19]:
> > > On Friday 06 March 2015 23:23:06 Aaro Koskinen wrote:
> > > > Hi,
> > > > 
> > > > On Fri, Mar 06, 2015 at 10:36:32AM -0800, Tony Lindgren wrote:
> > > > > Are there any fixes in this series that should go into
> > > > > v4.0-rc series, or can it all wait for v4.1?
> > > > 
> > > > I think these all should wait for v4.1.
> > > > 
> > > > A.
> > > 
> > > 4.1-rc3 was released and this patch series is still not included...
> > 
> > The dts changes should be merged?
> > 
> 
> Looks like yes, but first two arch/arm/mach-omap2 patches not.

I suggest you repost those to separately so Paul can take
a look at them. It seems they can be merged separately from
the driver changes?
 
Regards,

Tony

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-05-14 21:40     ` Pali Rohár
@ 2015-05-15  0:15       ` Herbert Xu
  2015-05-15  7:02       ` Herbert Xu
  1 sibling, 0 replies; 66+ messages in thread
From: Herbert Xu @ 2015-05-15  0:15 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu, May 14, 2015 at 11:40:37PM +0200, Pali Rohár wrote:
>
> Herbert, can you apply this patch?

OK I dug this out of patchwork for you.  In future please post
patches that you want me to apply separately.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-05-14 21:40     ` Pali Rohár
  2015-05-15  0:15       ` Herbert Xu
@ 2015-05-15  7:02       ` Herbert Xu
  2015-05-15  9:20         ` Pali Rohár
  1 sibling, 1 reply; 66+ messages in thread
From: Herbert Xu @ 2015-05-15  7:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Thu, May 14, 2015 at 11:40:37PM +0200, Pali Rohár wrote:
> On Sunday 08 March 2015 11:01:01 Pali Rohár wrote:
> > Function pm_runtime_get_sync could fail and we need to check return
> > value to prevent kernel crash.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
  2015-02-28 16:25       ` Pavel Machek
@ 2015-05-15  9:19         ` Pali Rohár
  -1 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-15  9:19 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Nishanth Menon, Ivaylo Dimitrov,
	Aaro Koskinen, Sebastian Reichel, Pavel Machek

On Saturday 28 February 2015 17:25:02 Pavel Machek wrote:
> On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> > omap3 support is same as omap2, just with different IO address (specified in DT)
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 
> > @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
> >  		.data		= &omap_sham_pdata_omap2,
> >  	},
> >  	{
> > +		.compatible	= "ti,omap3-sham",
> > +		.data		= &omap_sham_pdata_omap2,
> > +	},
> > +	{
> >  		.compatible	= "ti,omap4-sham",
> >  		.data		= &omap_sham_pdata_omap4,
> >  	},
> 

Herbert, this is second crypto patch in this series, can you apply it too?

-- 
Pali Rohár
pali.rohar@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
@ 2015-05-15  9:19         ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-15  9:19 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Nishanth Menon, Ivaylo Dimitrov,
	Aaro Koskinen, Sebastian Reichel, Pavel Machek

On Saturday 28 February 2015 17:25:02 Pavel Machek wrote:
> On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> > omap3 support is same as omap2, just with different IO address (specified in DT)
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 
> > @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
> >  		.data		= &omap_sham_pdata_omap2,
> >  	},
> >  	{
> > +		.compatible	= "ti,omap3-sham",
> > +		.data		= &omap_sham_pdata_omap2,
> > +	},
> > +	{
> >  		.compatible	= "ti,omap4-sham",
> >  		.data		= &omap_sham_pdata_omap4,
> >  	},
> 

Herbert, this is second crypto patch in this series, can you apply it too?

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Check for return value from pm_runtime_get_sync
  2015-05-15  7:02       ` Herbert Xu
@ 2015-05-15  9:20         ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-15  9:20 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Pavel Machek, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel

On Friday 15 May 2015 15:02:29 Herbert Xu wrote:
> On Thu, May 14, 2015 at 11:40:37PM +0200, Pali Rohár wrote:
> > On Sunday 08 March 2015 11:01:01 Pali Rohár wrote:
> > > Function pm_runtime_get_sync could fail and we need to check return
> > > value to prevent kernel crash.
> > > 
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Applied.

Thanks! In this patch series is also another one patch for crypto
subsystem. I replied to that patch email.

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
  2015-05-15  9:19         ` Pali Rohár
@ 2015-05-18  4:30           ` Herbert Xu
  -1 siblings, 0 replies; 66+ messages in thread
From: Herbert Xu @ 2015-05-18  4:30 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel, Pavel Machek

On Fri, May 15, 2015 at 11:19:33AM +0200, Pali Rohár wrote:
> On Saturday 28 February 2015 17:25:02 Pavel Machek wrote:
> > On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> > > omap3 support is same as omap2, just with different IO address (specified in DT)
> > > 
> > > Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
> > 
> > > @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
> > >  		.data		= &omap_sham_pdata_omap2,
> > >  	},
> > >  	{
> > > +		.compatible	= "ti,omap3-sham",
> > > +		.data		= &omap_sham_pdata_omap2,
> > > +	},
> > > +	{
> > >  		.compatible	= "ti,omap4-sham",
> > >  		.data		= &omap_sham_pdata_omap4,
> > >  	},
> > 
> 
> Herbert, this is second crypto patch in this series, can you apply it too?

Applied.
-- 
Email: Herbert Xu <herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices
@ 2015-05-18  4:30           ` Herbert Xu
  0 siblings, 0 replies; 66+ messages in thread
From: Herbert Xu @ 2015-05-18  4:30 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Nishanth Menon, Ivaylo Dimitrov,
	Aaro Koskinen, Sebastian Reichel, Pavel Machek

On Fri, May 15, 2015 at 11:19:33AM +0200, Pali Rohár wrote:
> On Saturday 28 February 2015 17:25:02 Pavel Machek wrote:
> > On Thu 2015-02-26 14:49:53, Pali Rohár wrote:
> > > omap3 support is same as omap2, just with different IO address (specified in DT)
> > > 
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > 
> > Acked-by: Pavel Machek <pavel@ucw.cz>
> > 
> > > @@ -1792,6 +1792,10 @@ static const struct of_device_id omap_sham_of_match[] = {
> > >  		.data		= &omap_sham_pdata_omap2,
> > >  	},
> > >  	{
> > > +		.compatible	= "ti,omap3-sham",
> > > +		.data		= &omap_sham_pdata_omap2,
> > > +	},
> > > +	{
> > >  		.compatible	= "ti,omap4-sham",
> > >  		.data		= &omap_sham_pdata_omap4,
> > >  	},
> > 
> 
> Herbert, this is second crypto patch in this series, can you apply it too?

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod
  2015-02-26 13:49 ` [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod Pali Rohár
@ 2015-05-21 11:44   ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-21 11:44 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-omap, devicetree, linux-kernel, linux-crypto, Pavel Machek,
	Nishanth Menon, Ivaylo Dimitrov, Aaro Koskinen,
	Sebastian Reichel, Benoît Cousson, Tony Lindgren,
	Rob Herring, Russell King, Herbert Xu, David S. Miller

On Thursday 26 February 2015 14:49:51 Pali Rohár wrote:
> Without this patch function pm_runtime_get_sync() returns 0 even when some
> omap subfunction fails. This patch properly propagate error codes from omap
> functions back to caller.
> 
> This patch fix problem, when loading omap-aes driver in qemu cause kernel oops.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  arch/arm/mach-omap2/omap_device.c |   30 +++++++++++++++++-------------
>  arch/arm/mach-omap2/omap_hwmod.c  |   10 ++++++----
>  2 files changed, 23 insertions(+), 17 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
> index be9541e..9fd47a9 100644
> --- a/arch/arm/mach-omap2/omap_device.c
> +++ b/arch/arm/mach-omap2/omap_device.c
> @@ -224,13 +224,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
>   */
>  static int _omap_device_enable_hwmods(struct omap_device *od)
>  {
> +	int ret = 0;
>  	int i;
>  
>  	for (i = 0; i < od->hwmods_cnt; i++)
> -		omap_hwmod_enable(od->hwmods[i]);
> +		ret |= omap_hwmod_enable(od->hwmods[i]);
>  
> -	/* XXX pass along return value here? */
> -	return 0;
> +	return ret;
>  }
>  
>  /**
> @@ -241,13 +241,13 @@ static int _omap_device_enable_hwmods(struct omap_device *od)
>   */
>  static int _omap_device_idle_hwmods(struct omap_device *od)
>  {
> +	int ret = 0;
>  	int i;
>  
>  	for (i = 0; i < od->hwmods_cnt; i++)
> -		omap_hwmod_idle(od->hwmods[i]);
> +		ret |= omap_hwmod_idle(od->hwmods[i]);
>  
> -	/* XXX pass along return value here? */
> -	return 0;
> +	return ret;
>  }
>  
>  /* Public functions for use by core code */
> @@ -595,18 +595,20 @@ static int _od_runtime_suspend(struct device *dev)
>  	int ret;
>  
>  	ret = pm_generic_runtime_suspend(dev);
> +	if (ret)
> +		return ret;
>  
> -	if (!ret)
> -		omap_device_idle(pdev);
> -
> -	return ret;
> +	return omap_device_idle(pdev);
>  }
>  
>  static int _od_runtime_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
> +	int ret;
>  
> -	omap_device_enable(pdev);
> +	ret = omap_device_enable(pdev);
> +	if (ret)
> +		return ret;
>  
>  	return pm_generic_runtime_resume(dev);
>  }
> @@ -740,7 +742,8 @@ int omap_device_enable(struct platform_device *pdev)
>  
>  	ret = _omap_device_enable_hwmods(od);
>  
> -	od->_state = OMAP_DEVICE_STATE_ENABLED;
> +	if (ret == 0)
> +		od->_state = OMAP_DEVICE_STATE_ENABLED;
>  
>  	return ret;
>  }
> @@ -770,7 +773,8 @@ int omap_device_idle(struct platform_device *pdev)
>  
>  	ret = _omap_device_idle_hwmods(od);
>  
> -	od->_state = OMAP_DEVICE_STATE_IDLE;
> +	if (ret == 0)
> +		od->_state = OMAP_DEVICE_STATE_IDLE;
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
> index 92afb72..870e984 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -3350,16 +3350,17 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
>   */
>  int omap_hwmod_idle(struct omap_hwmod *oh)
>  {
> +	int r;
>  	unsigned long flags;
>  
>  	if (!oh)
>  		return -EINVAL;
>  
>  	spin_lock_irqsave(&oh->_lock, flags);
> -	_idle(oh);
> +	r = _idle(oh);
>  	spin_unlock_irqrestore(&oh->_lock, flags);
>  
> -	return 0;
> +	return r;
>  }
>  
>  /**
> @@ -3372,16 +3373,17 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
>   */
>  int omap_hwmod_shutdown(struct omap_hwmod *oh)
>  {
> +	int r;
>  	unsigned long flags;
>  
>  	if (!oh)
>  		return -EINVAL;
>  
>  	spin_lock_irqsave(&oh->_lock, flags);
> -	_shutdown(oh);
> +	r = _shutdown(oh);
>  	spin_unlock_irqrestore(&oh->_lock, flags);
>  
> -	return 0;
> +	return r;
>  }
>  
>  /*

Hello Paul, can you apply this patch?

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices
  2015-02-28 16:24   ` Pavel Machek
@ 2015-05-26 10:54       ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-26 10:54 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel, Pavel Machek

Hi Paul,

this patch is also for omap2... Can you review it too?

On Saturday 28 February 2015 17:24:36 Pavel Machek wrote:
> On Thu 2015-02-26 14:49:52, Pali Rohár wrote:
> > Register crypto hwmod links only if they are not disabled in DT.
> > If DT information is missing, enable them only for GP devices.
> > 
> > Before this patch crypto hwmod links were always disabled for all HS devices
> > and it was not possible to use omap-aes and omap-sham linux drivers.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices
@ 2015-05-26 10:54       ` Pali Rohár
  0 siblings, 0 replies; 66+ messages in thread
From: Pali Rohár @ 2015-05-26 10:54 UTC (permalink / raw)
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Paul Walmsley, Herbert Xu, David S. Miller, linux-omap,
	devicetree, linux-kernel, linux-crypto, Nishanth Menon,
	Ivaylo Dimitrov, Aaro Koskinen, Sebastian Reichel, Pavel Machek

Hi Paul,

this patch is also for omap2... Can you review it too?

On Saturday 28 February 2015 17:24:36 Pavel Machek wrote:
> On Thu 2015-02-26 14:49:52, Pali Rohár wrote:
> > Register crypto hwmod links only if they are not disabled in DT.
> > If DT information is missing, enable them only for GP devices.
> > 
> > Before this patch crypto hwmod links were always disabled for all HS devices
> > and it was not possible to use omap-aes and omap-sham linux drivers.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 

-- 
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices
  2015-05-26 10:54       ` Pali Rohár
  (?)
@ 2015-06-02 18:36       ` Paul Walmsley
  -1 siblings, 0 replies; 66+ messages in thread
From: Paul Walmsley @ 2015-06-02 18:36 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Russell King,
	Herbert Xu, David S. Miller, linux-omap, devicetree,
	linux-kernel, linux-crypto, Nishanth Menon, Ivaylo Dimitrov,
	Aaro Koskinen, Sebastian Reichel, Pavel Machek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 6894 bytes --]

On Tue, 26 May 2015, Pali Rohár wrote:

> Hi Paul,
> 
> this patch is also for omap2... Can you review it too?
> 
> On Saturday 28 February 2015 17:24:36 Pavel Machek wrote:
> > On Thu 2015-02-26 14:49:52, Pali Rohár wrote:
> > > Register crypto hwmod links only if they are not disabled in DT.
> > > If DT information is missing, enable them only for GP devices.
> > > 
> > > Before this patch crypto hwmod links were always disabled for all HS devices
> > > and it was not possible to use omap-aes and omap-sham linux drivers.
> > > 
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > 
> > Acked-by: Pavel Machek <pavel@ucw.cz>
> > 

Sent to Tony for v4.2, after tweaking it a bit (below)

- Paul

Subject: [PATCH] ARM: OMAP3: Fix crypto support for HS devices

Register crypto hwmod links only if they are not disabled in DT.
If DT information is missing, enable them only for GP devices.

Before this patch crypto hwmod links were always disabled for all HS
devices and it was not possible to use omap-aes and omap-sham linux
drivers.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
[paul@pwsan.com: move the complex IP-block presence heuristics into their
 own function to simplify the code; fix some checkpatch warnings]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 107 +++++++++++++++++++++++++----
 1 file changed, 94 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 0ca4d3fb7df6..dc55f8dedf2c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3736,29 +3736,54 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
 /* GP-only hwmod links */
 static struct omap_hwmod_ocp_if *omap34xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	&omap3xxx_l4_core__sham,
-	&omap3xxx_l4_core__aes,
 	NULL
 };
 
 static struct omap_hwmod_ocp_if *omap36xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	&omap3xxx_l4_core__sham,
-	&omap3xxx_l4_core__aes,
 	NULL
 };
 
 static struct omap_hwmod_ocp_if *am35xx_gp_hwmod_ocp_ifs[] __initdata = {
 	&omap3xxx_l4_sec__timer12,
-	/*
-	 * Apparently the SHA/MD5 and AES accelerator IP blocks are
-	 * only present on some AM35xx chips, and no one knows which
-	 * ones.  See
-	 * http://www.spinics.net/lists/arm-kernel/msg215466.html So
-	 * if you need these IP blocks on an AM35xx, try uncommenting
-	 * the following lines.
-	 */
+	NULL
+};
+
+/* crypto hwmod links */
+static struct omap_hwmod_ocp_if *omap34xx_sham_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__sham,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_aes_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__aes,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_sham_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__sham,
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_aes_hwmod_ocp_ifs[] __initdata = {
+	&omap3xxx_l4_core__aes,
+	NULL
+};
+
+/*
+ * Apparently the SHA/MD5 and AES accelerator IP blocks are
+ * only present on some AM35xx chips, and no one knows which
+ * ones.  See
+ * http://www.spinics.net/lists/arm-kernel/msg215466.html So
+ * if you need these IP blocks on an AM35xx, try uncommenting
+ * the following lines.
+ */
+static struct omap_hwmod_ocp_if *am35xx_sham_hwmod_ocp_ifs[] __initdata = {
 	/* &omap3xxx_l4_core__sham, */
+	NULL
+};
+
+static struct omap_hwmod_ocp_if *am35xx_aes_hwmod_ocp_ifs[] __initdata = {
 	/* &omap3xxx_l4_core__aes, */
 	NULL
 };
@@ -3860,10 +3885,41 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_hwmod_ocp_ifs[] __initdata = {
 	NULL
 };
 
+/**
+ * omap3xxx_hwmod_is_hs_ip_block_usable - is a security IP block accessible?
+ * @bus: struct device_node * for the top-level OMAP DT data
+ * @dev_name: device name used in the DT file
+ *
+ * Determine whether a "secure" IP block @dev_name is usable by Linux.
+ * There doesn't appear to be a 100% reliable way to determine this,
+ * so we rely on heuristics.  If @bus is null, meaning there's no DT
+ * data, then we only assume the IP block is accessible if the OMAP is
+ * fused as a 'general-purpose' SoC.  If however DT data is present,
+ * test to see if the IP block is described in the DT data and set to
+ * 'status = "okay"'.  If so then we assume the ODM has configured the
+ * OMAP firewalls to allow access to the IP block.
+ *
+ * Return: 0 if device named @dev_name is not likely to be accessible,
+ * or 1 if it is likely to be accessible.
+ */
+static int __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
+						       const char *dev_name)
+{
+	if (!bus)
+		return (omap_type() == OMAP2_DEVICE_TYPE_GP) ? 1 : 0;
+
+	if (of_device_is_available(of_find_node_by_name(bus, dev_name)))
+		return 1;
+
+	return 0;
+}
+
 int __init omap3xxx_hwmod_init(void)
 {
 	int r;
-	struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL;
+	struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL;
+	struct omap_hwmod_ocp_if **h_aes = NULL;
+	struct device_node *bus = NULL;
 	unsigned int rev;
 
 	omap_hwmod_init();
@@ -3885,13 +3941,19 @@ int __init omap3xxx_hwmod_init(void)
 	    rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) {
 		h = omap34xx_hwmod_ocp_ifs;
 		h_gp = omap34xx_gp_hwmod_ocp_ifs;
+		h_sham = omap34xx_sham_hwmod_ocp_ifs;
+		h_aes = omap34xx_aes_hwmod_ocp_ifs;
 	} else if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
 		h = am35xx_hwmod_ocp_ifs;
 		h_gp = am35xx_gp_hwmod_ocp_ifs;
+		h_sham = am35xx_sham_hwmod_ocp_ifs;
+		h_aes = am35xx_aes_hwmod_ocp_ifs;
 	} else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 ||
 		   rev == OMAP3630_REV_ES1_2) {
 		h = omap36xx_hwmod_ocp_ifs;
 		h_gp = omap36xx_gp_hwmod_ocp_ifs;
+		h_sham = omap36xx_sham_hwmod_ocp_ifs;
+		h_aes = omap36xx_aes_hwmod_ocp_ifs;
 	} else {
 		WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
 		return -EINVAL;
@@ -3908,6 +3970,25 @@ int __init omap3xxx_hwmod_init(void)
 			return r;
 	}
 
+	/*
+	 * Register crypto hwmod links only if they are not disabled in DT.
+	 * If DT information is missing, enable them only for GP devices.
+	 */
+
+	if (of_have_populated_dt())
+		bus = of_find_node_by_name(NULL, "ocp");
+
+	if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
+		r = omap_hwmod_register_links(h_sham);
+		if (r < 0)
+			return r;
+	}
+
+	if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
+		r = omap_hwmod_register_links(h_aes);
+		if (r < 0)
+			return r;
+	}
 
 	/*
 	 * Register hwmod links specific to certain ES levels of a
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2015-06-02 18:36 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 13:49 [PATCH 00/10] omap3 crypto fixes Pali Rohár
2015-02-26 13:49 ` [PATCH 01/10] ARM: OMAP2+: Return correct error values from device and hwmod Pali Rohár
2015-05-21 11:44   ` Pali Rohár
2015-02-26 13:49 ` [PATCH 02/10] ARM: OMAP3: Fix crypto support for HS devices Pali Rohár
2015-02-28 16:24   ` Pavel Machek
2015-05-26 10:54     ` Pali Rohár
2015-05-26 10:54       ` Pali Rohár
2015-06-02 18:36       ` Paul Walmsley
2015-02-26 13:49 ` [PATCH 03/10] crypto: omap-sham: Add support for omap3 devices Pali Rohár
     [not found]   ` <1424958600-18881-4-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-28 16:25     ` Pavel Machek
2015-02-28 16:25       ` Pavel Machek
2015-05-15  9:19       ` Pali Rohár
2015-05-15  9:19         ` Pali Rohár
2015-05-18  4:30         ` Herbert Xu
2015-05-18  4:30           ` Herbert Xu
2015-02-26 13:49 ` [PATCH 04/10] crypto: omap-sham: Check for return value from pm_runtime_get_sync Pali Rohár
2015-02-28 16:39   ` Pavel Machek
2015-03-08 10:01   ` [PATCH v2] " Pali Rohár
2015-03-09 20:52     ` Pavel Machek
2015-05-14 21:40     ` Pali Rohár
2015-05-15  0:15       ` Herbert Xu
2015-05-15  7:02       ` Herbert Xu
2015-05-15  9:20         ` Pali Rohár
2015-02-26 13:49 ` [PATCH 05/10] ARM: dts: omap3 hs: Remove timer12 Pali Rohár
2015-02-28 16:54   ` Pavel Machek
2015-02-26 13:49 ` [PATCH 06/10] ARM: dts: omap3: Add missing dmas for crypto Pali Rohár
     [not found]   ` <1424958600-18881-7-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-28 16:46     ` Pavel Machek
2015-02-28 16:46       ` Pavel Machek
2015-03-16 21:44       ` Tony Lindgren
2015-02-26 13:49 ` [PATCH 07/10] ARM: dts: n9/n950: Enable omap crypto support Pali Rohár
2015-02-26 13:49   ` Pali Rohár
2015-02-27 15:43   ` Tony Lindgren
2015-02-27 16:01     ` Pali Rohár
2015-02-27 16:10       ` Tony Lindgren
2015-02-27 16:10         ` Tony Lindgren
2015-02-28 16:41   ` Pavel Machek
2015-03-19 16:43     ` Tony Lindgren
2015-03-19 16:43       ` Tony Lindgren
2015-02-26 13:49 ` [PATCH 08/10] ARM: dts: n900: Enable omap sham and include directly omap34xx.dtsi Pali Rohár
2015-02-28 16:44   ` Pavel Machek
2015-02-26 13:49 ` [PATCH 09/10] ARM: dts: omap3-tao3530: Include " Pali Rohár
2015-02-28 16:44   ` Pavel Machek
2015-02-26 13:50 ` [PATCH 10/10] ARM: dts: Remove files omap34xx-hs.dtsi and omap36xx-hs.dtsi Pali Rohár
     [not found]   ` <1424958600-18881-11-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-28 16:45     ` Pavel Machek
2015-02-28 16:45       ` Pavel Machek
2015-02-26 22:46 ` [PATCH 00/10] omap3 crypto fixes Aaro Koskinen
2015-02-27 12:40   ` Pali Rohár
2015-03-07 23:19     ` Aaro Koskinen
2015-03-07 23:19       ` Aaro Koskinen
2015-03-06 18:36 ` Tony Lindgren
2015-03-06 18:36   ` Tony Lindgren
     [not found]   ` <20150306183631.GA13520-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-03-06 19:16     ` Pali Rohár
2015-03-06 19:16       ` Pali Rohár
2015-03-06 19:18       ` Tony Lindgren
2015-03-06 22:23   ` Aaro Koskinen
     [not found]     ` <20150306222306.GB587-+UqvGBo8NkiJ/SmVcN9c7yH8jP4CeeTLqBW4ids5wwA@public.gmane.org>
2015-03-08 10:01       ` Pali Rohár
2015-03-08 10:01         ` Pali Rohár
2015-03-08 16:35         ` Paul Walmsley
2015-03-08 16:35           ` Paul Walmsley
2015-03-15  9:59           ` Pali Rohár
2015-05-14 21:17     ` Pali Rohár
2015-05-14 21:34       ` Tony Lindgren
     [not found]         ` <20150514213418.GP15563-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-05-14 21:39           ` Pali Rohár
2015-05-14 21:39             ` Pali Rohár
2015-05-14 22:03             ` Tony Lindgren
2015-05-14 22:03               ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.