CHROMIUM: internal.c: laptop_ok global state can become stale

Craask and similar DUT's are erroneously probing random second chips.

```
Found chipset "Intel Alder Lake-N".
Enabling flash write... SPI Configuration is locked down.
FREG0: Flash Descriptor region (0x00000000-0x00000fff) is read-write.
FREG1: BIOS region (0x003a0000-0x00ffffff) is read-write.
FREG2: Management Engine region (0x00001000-0x0039ffff) is read-write.
OK.
Found Winbond flash chip "W25Q128.V..M" (16384 kB, Programmer-specific) on host.
Warning: Setting BIOS Control at 0xdc from 0x8b to 0x89 failed.
New value is 0x8b.
Found MoselVitelic flash chip "V29C51000T" (64 kB, Parallel) mapped at physical address 0x00000000ffff0000.
```

This seems to be due to `laptop_ok` becoming a stale global state
after the first operation leading to probing on unrelated buses.

Therefore unconditionally reset the global state upon entry into
the internal driver.

BUG=b:260518132,b:260151917
BRANCH=none
TEST=Craask reportly no longer finds duplicate chip.

Change-Id: I2c00c351904307eeb1488c5dfaffc91d6468ee25
Signed-off-by: Edward O'Callaghan <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/4059786
Reviewed-by: Sam McNally <[email protected]>
Commit-Queue: Edward O'Callaghan <[email protected]>
Tested-by: Edward O'Callaghan <[email protected]>
(cherry picked from commit 326f547a6f02606504b385d6a8161a3273d2f4df)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/4075026
Commit-Queue: Sam McNally <[email protected]>
Tested-by: Sam McNally <[email protected]>
Reviewed-by: Reka Norman <[email protected]>
1 file changed
tree: 4a9664b256e5225692b4dd57dc62c9d24f7aef70
  1. .github/
  2. bindings/
  3. Documentation/
  4. include/
  5. Makefile.d/
  6. platform/
  7. subprojects/
  8. tests/
  9. util/
  10. .gitattributes
  11. .gitignore
  12. 82802ab.c
  13. action_descriptor.c
  14. action_descriptor.h
  15. amd_imc.c
  16. at45db.c
  17. atahpt.c
  18. atapromise.c
  19. atavia.c
  20. big_lock.c
  21. big_lock.h
  22. bitbang_spi.c
  23. board_enable.c
  24. buspirate_spi.c
  25. cbtable.c
  26. ch341a_spi.c
  27. chipset_enable.c
  28. cli_classic.c
  29. cli_common.c
  30. cli_output.c
  31. COPYING
  32. cros_alias.c
  33. cros_ec.c
  34. cros_ec.h
  35. cros_ec_commands.h
  36. cros_ec_dev.c
  37. cros_ec_wp.c
  38. custom_baud.c
  39. custom_baud_linux.c
  40. dediprog.c
  41. developerbox_spi.c
  42. digilent_spi.c
  43. DIR_METADATA
  44. dmi.c
  45. Doxyfile
  46. drkaiser.c
  47. dummyflasher.c
  48. edi.c
  49. en29lv640b.c
  50. file_lock.c
  51. flashchips.c
  52. flashchips_crosbl.c
  53. flashrom.8.tmpl
  54. flashrom.c
  55. fmap.c
  56. ft2232_spi.c
  57. gfxnvidia.c
  58. helpers.c
  59. helpers_fileio.c
  60. hwaccess_physmap.c
  61. hwaccess_x86_io.c
  62. hwaccess_x86_msr.c
  63. i2c_helper_linux.c
  64. ich_descriptors.c
  65. ichspi.c
  66. internal.c
  67. ipc_lock.h
  68. it8212.c
  69. it87spi.c
  70. jedec.c
  71. jlink_spi.c
  72. known_boards.c
  73. layout.c
  74. libflashrom.c
  75. libflashrom.map
  76. linux_mtd.c
  77. linux_spi.c
  78. MAINTAINERS
  79. Makefile
  80. Makefile.include
  81. mcp6x_spi.c
  82. mediatek_i2c_spi.c
  83. meson.build
  84. meson_options.txt
  85. mstarddc_spi.c
  86. ni845x_spi.c
  87. nic3com.c
  88. nicintel.c
  89. nicintel_eeprom.c
  90. nicintel_spi.c
  91. nicnatsemi.c
  92. nicrealtek.c
  93. ogp_spi.c
  94. opaque.c
  95. opaque_statusreg.c
  96. OWNERS
  97. parade_lspcon.c
  98. parallel.c
  99. pcidev.c
  100. pickit2_spi.c
  101. pony_spi.c
  102. power.c
  103. power.h
  104. PRESUBMIT.cfg
  105. print.c
  106. print_wiki.c
  107. processor_enable.c
  108. programmer.c
  109. programmer_table.c
  110. raiden_debug_spi.c
  111. rayer_spi.c
  112. README
  113. README.chromiumos
  114. realtek_mst_i2c_spi.c
  115. s25f.c
  116. satamv.c
  117. satasii.c
  118. sb600spi.c
  119. serial.c
  120. serprog.c
  121. sfdp.c
  122. spi.c
  123. spi25.c
  124. spi25_statusreg.c
  125. spi95.c
  126. sst28sf040.c
  127. sst49lfxxxc.c
  128. sst_fwhub.c
  129. stlinkv3_spi.c
  130. stm50.c
  131. udelay.c
  132. unblocked_terms.txt
  133. usb_device.c
  134. usbblaster_spi.c
  135. usbdev.c
  136. w29ee011.c
  137. w39.c
  138. wbsio_spi.c
  139. writeprotect.c
  140. writeprotect_ranges.c