diff mbox series

spi: atmel-quadspi: Print the controller version and used irq

Message ID 20241008083226.51163-1-mihai.sain@microchip.com (mailing list archive)
State New
Headers show
Series spi: atmel-quadspi: Print the controller version and used irq | expand

Commit Message

Mihai Sain Oct. 8, 2024, 8:32 a.m. UTC
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(+)


base-commit: 87d6aab2389e5ce0197d8257d5f8ee965a67c4cd
prerequisite-patch-id: 5e1313094386b146c9180d72c15bae49aaffbfa8

Comments

Tudor Ambarus Oct. 8, 2024, 9:34 a.m. UTC | #1
Hi, Mihai,

On 10/8/24 9:32 AM, Mihai Sain wrote:
> 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);

This pollutes the console. Better to add a dev_dbg if you care.
And irq number doesn't bring too much value as you can see it in dt,
isn't it?

Cheers,
ta
Mark Brown Oct. 8, 2024, 10:29 a.m. UTC | #2
On Tue, Oct 08, 2024 at 10:34:39AM +0100, Tudor Ambarus wrote:
> On 10/8/24 9:32 AM, Mihai Sain wrote:

> > Add support to print the controller version and used irq
> > similar to other at91 drivers (spi, twi, usart).

> > +	dev_info(&pdev->dev, "AT91 QSPI Controller version %#x (irq %d)\n",
> > +		 atmel_qspi_read(aq, QSPI_VERSION), irq);

> This pollutes the console. Better to add a dev_dbg if you care.
> And irq number doesn't bring too much value as you can see it in dt,
> isn't it?

The objective of bringing the various AT91 drivers into consistency does
seem useful so if this isn't OK for this driver we should probably
update the other drivers as well.  Ensuring that people can get at the
IP version does feel useful, I guess it could also be a sysfs thing?
Tudor Ambarus Oct. 9, 2024, 7:04 a.m. UTC | #3
On 10/8/24 11:29 AM, Mark Brown wrote:
> On Tue, Oct 08, 2024 at 10:34:39AM +0100, Tudor Ambarus wrote:
>> On 10/8/24 9:32 AM, Mihai Sain wrote:
> 
>>> Add support to print the controller version and used irq
>>> similar to other at91 drivers (spi, twi, usart).
> 
>>> +	dev_info(&pdev->dev, "AT91 QSPI Controller version %#x (irq %d)\n",
>>> +		 atmel_qspi_read(aq, QSPI_VERSION), irq);
> 
>> This pollutes the console. Better to add a dev_dbg if you care.
>> And irq number doesn't bring too much value as you can see it in dt,
>> isn't it?
> 
> The objective of bringing the various AT91 drivers into consistency does
> seem useful so if this isn't OK for this driver we should probably

right, consistency is good.

> update the other drivers as well.  Ensuring that people can get at the

Can be a goal. My point was that printing too much info in the boot log
may hide other more important information. Printing IP versions, irqs,
dma channels acquired (or worse, that a driver probed successful) shall
be part of debug prints if someone cares.

> IP version does feel useful, I guess it could also be a sysfs thing?

I'd also consider debugfs for IP version, it has less restrictions.

Mihai, do as you find best, it's just a suggestion.
diff mbox series

Patch

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;
 
 disable_qspick: