All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugen Hristev <eugen.hristev@microchip.com>
To: <jic23@kernel.org>, <robh+dt@kernel.org>
Cc: <ludovic.desroches@microchip.com>, <linux-iio@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Eugen Hristev <eugen.hristev@microchip.com>
Subject: [PATCH 2/4] iio: adc: at91-sama5d2: initialize hardware after clock is started
Date: Mon, 1 Mar 2021 16:32:54 +0200	[thread overview]
Message-ID: <20210301143256.16502-3-eugen.hristev@microchip.com> (raw)
In-Reply-To: <20210301143256.16502-1-eugen.hristev@microchip.com>

The hw_init hardware init call must happen after the clock is prepared and
enabled. Otherwise, writing to the registers might lead to a block or
external abort.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index a7826f097b95..63325f037f09 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1832,12 +1832,12 @@ static int at91_adc_probe(struct platform_device *pdev)
 		goto vref_disable;
 	}
 
-	at91_adc_hw_init(indio_dev);
-
 	ret = clk_prepare_enable(st->per_clk);
 	if (ret)
 		goto vref_disable;
 
+	at91_adc_hw_init(indio_dev);
+
 	platform_set_drvdata(pdev, indio_dev);
 
 	ret = at91_adc_buffer_and_trigger_init(&pdev->dev, indio_dev);
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Eugen Hristev <eugen.hristev@microchip.com>
To: <jic23@kernel.org>, <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com,
	Eugen Hristev <eugen.hristev@microchip.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] iio: adc: at91-sama5d2: initialize hardware after clock is started
Date: Mon, 1 Mar 2021 16:32:54 +0200	[thread overview]
Message-ID: <20210301143256.16502-3-eugen.hristev@microchip.com> (raw)
In-Reply-To: <20210301143256.16502-1-eugen.hristev@microchip.com>

The hw_init hardware init call must happen after the clock is prepared and
enabled. Otherwise, writing to the registers might lead to a block or
external abort.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index a7826f097b95..63325f037f09 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1832,12 +1832,12 @@ static int at91_adc_probe(struct platform_device *pdev)
 		goto vref_disable;
 	}
 
-	at91_adc_hw_init(indio_dev);
-
 	ret = clk_prepare_enable(st->per_clk);
 	if (ret)
 		goto vref_disable;
 
+	at91_adc_hw_init(indio_dev);
+
 	platform_set_drvdata(pdev, indio_dev);
 
 	ret = at91_adc_buffer_and_trigger_init(&pdev->dev, indio_dev);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-03-01 14:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 14:32 [PATCH 0/4] iio: adc: at91-sama5d2: add support for sama7g5 Eugen Hristev
2021-03-01 14:32 ` Eugen Hristev
2021-03-01 14:32 ` [PATCH 1/4] dt-bindings: iio: adc: at91-sama5d2: add compatible for sama7g5-adc Eugen Hristev
2021-03-01 14:32   ` Eugen Hristev
2021-03-08 17:36   ` Rob Herring
2021-03-08 17:36     ` Rob Herring
2021-03-01 14:32 ` Eugen Hristev [this message]
2021-03-01 14:32   ` [PATCH 2/4] iio: adc: at91-sama5d2: initialize hardware after clock is started Eugen Hristev
2021-03-06 17:20   ` Jonathan Cameron
2021-03-06 17:20     ` Jonathan Cameron
2021-03-08 13:33     ` Eugen.Hristev
2021-03-08 13:33       ` Eugen.Hristev
2021-03-01 14:32 ` [PATCH 3/4] iio: adc: at91-sama5d2: remove unused definition Eugen Hristev
2021-03-01 14:32   ` Eugen Hristev
2021-03-01 14:32 ` [PATCH 4/4] iio: adc: at91-sama5d2: add support for sama7g5 device Eugen Hristev
2021-03-01 14:32   ` Eugen Hristev
2021-03-06 17:30   ` Jonathan Cameron
2021-03-06 17:30     ` Jonathan Cameron
2021-03-08 13:27     ` Eugen.Hristev
2021-03-08 13:27       ` Eugen.Hristev
2021-03-08 19:54       ` Jonathan Cameron
2021-03-08 19:54         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301143256.16502-3-eugen.hristev@microchip.com \
    --to=eugen.hristev@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.