Edward O'Callaghan has uploaded this change for review.

View Change

spi: Call clear_spi_id_cache() before probing next chip

The original author David Hendricks <dhendrix@chromium.org>
introducted the clear_spi_id_cache() however it seems this
was actually never used before attempting a new probe_flash()
cycle.

<NOT-FOR-MERGE-YET> unclear what was originally intended here.

BUG=b:224375126
TEST=`./flashrom -p internal --flash-name`.

Change-Id: I7033ac7f013c06be1c84465923890bb3911800d9
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Spotted-by: Nico Huber <nico.h@gmx.de>
---
M flash.h
M flashrom.c
M spi.h
3 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/69/62769/1
diff --git a/flash.h b/flash.h
index f63aa5d..fddbd40 100644
--- a/flash.h
+++ b/flash.h
@@ -487,6 +487,7 @@
#define NULL_SPI_CMD { 0, 0, NULL, NULL, }
int spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);
int spi_send_multicommand(const struct flashctx *flash, struct spi_command *cmds);
+void clear_spi_id_cache(void);

enum chipbustype get_buses_supported(void);
#endif /* !__FLASH_H__ */
diff --git a/flashrom.c b/flashrom.c
index ac61259..6ee1407 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -794,6 +794,7 @@
if (force)
break;

+ clear_spi_id_cache();
if (flash->chip->probe(flash) != 1)
goto notfound;

diff --git a/spi.h b/spi.h
index 845b6c2..1f60f70 100644
--- a/spi.h
+++ b/spi.h
@@ -209,6 +209,4 @@
#define SPI_FLASHROM_BUG -5
#define SPI_PROGRAMMER_ERROR -6

-void clear_spi_id_cache(void);
-
#endif /* !__SPI_H__ */

To view, visit change 62769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7033ac7f013c06be1c84465923890bb3911800d9
Gerrit-Change-Number: 62769
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange