diff mbox

mtd: m25p80: add message if mmap flash read is supported

Message ID 9111b023-d1e5-3084-4320-acf727e828f4@gmail.com
State Rejected
Headers show

Commit Message

Heiner Kallweit April 27, 2016, 8:36 p.m. UTC
As a follow-up to commit 08922f644878c9 "mtd: devices: m25p80: add support for
mmap read request" add an info to syslog if mmap flash read is supported for a
device.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/mtd/devices/m25p80.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Brian Norris May 5, 2016, 12:54 a.m. UTC | #1
(moving linux-spi to BCC, since this is MTD-only, and doesn't concern
the SPI core)

On Wed, Apr 27, 2016 at 10:36:48PM +0200, Heiner Kallweit wrote:
> As a follow-up to commit 08922f644878c9 "mtd: devices: m25p80: add support for
> mmap read request" add an info to syslog if mmap flash read is supported for a
> device.

Any particular reason you want this to be printed? There are quite a few
other features we don't print to the log right now.

Brian
Heiner Kallweit May 5, 2016, 3:28 p.m. UTC | #2
Am 05.05.2016 um 02:54 schrieb Brian Norris:
> (moving linux-spi to BCC, since this is MTD-only, and doesn't concern
> the SPI core)
> 
> On Wed, Apr 27, 2016 at 10:36:48PM +0200, Heiner Kallweit wrote:
>> As a follow-up to commit 08922f644878c9 "mtd: devices: m25p80: add support for
>> mmap read request" add an info to syslog if mmap flash read is supported for a
>> device.
> 
> Any particular reason you want this to be printed? There are quite a few
> other features we don't print to the log right now.
> 
I see few scenarios where this information may be useful:
- Confirmation that the mmap feature was properly configured for a device
  (e.g. if mmap feature is enabled by platform data / DT for a flash chip)
- There are devices with >1 flash chip and just one can be accessed mmapped.
  Then this information can give a hint e.g. why accessing one chip is faster than
  accessing other(s).
- Debugging purposes (e.g. mmap is configured but not supported and flash read fails)

Rgds, Heiner

> Brian
>
diff mbox

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 9d68544..433b100 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -233,6 +233,9 @@  static int m25p_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
+	if (spi_flash_read_supported(spi))
+		dev_info(&spi->dev, "memory-mapped flash read supported\n");
+
 	return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
 				   data ? data->nr_parts : 0);
 }