mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: Mihai Sain <mihai.sain@microchip.com>
Cc: broonie@kernel.org, nicolas.ferre@microchip.com,
	alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev,
	linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: atmel-quadspi: Print the controller version and used irq
Date: Fri, 10 Jan 2025 11:25:24 +0100	[thread overview]
Message-ID: <20250110-reshuffle-thrower-3212ad741403@thorsis.com> (raw)
In-Reply-To: <20241008083226.51163-1-mihai.sain@microchip.com>

Hello Mihai,

just saw I made a similar patch for myself lately, so regarding the
discussion of the need of such a patch, I would opt for it.  However,
see below …

Am Tue, Oct 08, 2024 at 11:32:26AM +0300 schrieb Mihai Sain:
> Add support to print the controller version and used irq
> similar to other at91 drivers (spi, twi, usart).
> 
> Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> ---
>  drivers/spi/atmel-quadspi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
> index 95cdfc28361e..757f07132585 100644
> --- a/drivers/spi/atmel-quadspi.c
> +++ b/drivers/spi/atmel-quadspi.c
> @@ -687,6 +687,8 @@ static int atmel_qspi_probe(struct platform_device *pdev)
>  	pm_runtime_mark_last_busy(&pdev->dev);
>  	pm_runtime_put_autosuspend(&pdev->dev);
>  
> +	dev_info(&pdev->dev, "AT91 QSPI Controller version %#x (irq %d)\n",
> +		 atmel_qspi_read(aq, QSPI_VERSION), irq);
>  	return 0;

I think this should go above pm_runtime functions, because it does i/o
on a register.  This is how my diff looks like:

diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index 3d95b887235e6..7405b66e14b30 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -1356,6 +1356,7 @@ static int atmel_qspi_probe(struct platform_device *pdev)
         struct atmel_qspi *aq;
         struct resource *res;
         int irq, err = 0;
+        u32 version;
 
         ctrl = devm_spi_alloc_host(&pdev->dev, sizeof(*aq));
         if (!ctrl)
@@ -1470,6 +1471,12 @@ static int atmel_qspi_probe(struct platform_device *pdev)
                 pm_runtime_dont_use_autosuspend(&pdev->dev);
                 goto dma_release;
         }
+
+        version = atmel_qspi_read(aq, QSPI_VERSION) & 0x00000fff;
+        dev_info(&pdev->dev,
+                 "Atmel QSPI Controller version 0x%x at %pR (irq %d)\n",
+                 version, pdev->resource, irq);
+
         pm_runtime_mark_last_busy(&pdev->dev);
         pm_runtime_put_autosuspend(&pdev->dev);

Greets
Alex


  parent reply	other threads:[~2025-01-10 10:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  8:32 Mihai Sain
2024-10-08  9:34 ` Tudor Ambarus
2024-10-08 10:29   ` Mark Brown
2024-10-09  7:04     ` Tudor Ambarus
2025-01-10 10:25 ` Alexander Dahl [this message]
2025-01-13  7:52   ` Mihai.Sain

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=20250110-reshuffle-thrower-3212ad741403@thorsis.com \
    --to=ada@thorsis.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mihai.sain@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®