Avoid printing the chip locks if chip detection was forced because lock access may involve flash chip registers which will not be mapped.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-no_force_register_access/flashrom.c =================================================================== --- flashrom-no_force_register_access/flashrom.c (Revision 1238) +++ flashrom-no_force_register_access/flashrom.c (Arbeitskopie) @@ -1163,8 +1163,12 @@ flash->vendor, flash->name, flash->total_size, flashbuses_to_text(flash->bustype), base);
- if (flash->printlock) - flash->printlock(flash); + /* Flash registers will not be mapped if the chip was forced. Lock info + * may be stored in registers, so avoid lock info printing. + */ + if (!force) + if (flash->printlock) + flash->printlock(flash);
return flash; }
On Thu, Dec 02, 2010 at 01:55:53PM +0100, Carl-Daniel Hailfinger wrote:
Avoid printing the chip locks if chip detection was forced because lock access may involve flash chip registers which will not be mapped.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Looks good. Maybe add a small message to inform the user about this?
Uwe.
On 02.12.2010 21:56, Uwe Hermann wrote:
On Thu, Dec 02, 2010 at 01:55:53PM +0100, Carl-Daniel Hailfinger wrote:
Avoid printing the chip locks if chip detection was forced because lock access may involve flash chip registers which will not be mapped.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Thanks, committed in r1240.
Looks good. Maybe add a small message to inform the user about this?
Not sure. This is for forced detection only, and there you can't read the locking status for most chips anyway because the chip didn't respond in the first place. And for pure read of a chip it is not clear whether printing locks would make sense.
Regards, Carl-Daniel
On Thu, Dec 02, 2010 at 11:02:02PM +0100, Carl-Daniel Hailfinger wrote:
On 02.12.2010 21:56, Uwe Hermann wrote:
On Thu, Dec 02, 2010 at 01:55:53PM +0100, Carl-Daniel Hailfinger wrote:
Avoid printing the chip locks if chip detection was forced because lock access may involve flash chip registers which will not be mapped.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Thanks, committed in r1240.
Looks good. Maybe add a small message to inform the user about this?
Not sure. This is for forced detection only, and there you can't read the locking status for most chips anyway because the chip didn't respond in the first place. And for pure read of a chip it is not clear whether printing locks would make sense.
No, I meant to print something like this:
This is a forced read, not trying to print chip lock status.
Trying to print any lock info would indeed make no sense.
Uwe.