Hello Douglas Anderson, Philip Chen, mturney mturney,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/45882
to review the following change.
Change subject: drivers: sn65dsi86: Retry link training up to 5 times
......................................................................
drivers: sn65dsi86: Retry link training up to 5 times
The kernel guys have found that automatic link training from this bridge
can occasionally fail and needs to be retried. They think 5 retries
should be enough but have added up to 10 to be sure. Let's do the same,
but since things are synchronous for us and every try takes 500ms, maybe
better restrict it to 5.
BUG=b:169535092
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I713b6851bd51d3527ed4c6e6407dee6b42d09955
---
M src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c
1 file changed, 9 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/45882/1
diff --git a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c
index e0058c4..91e64aa 100644
--- a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c
+++ b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c
@@ -415,15 +415,18 @@
sn65dsi86_bridge_dpcd_request(bus, chip,
DP_BRIDGE_CONFIGURATION_SET, 1, DPCD_WRITE, &buf);
- /* semi auto link training mode */
- i2c_writeb(bus, chip, SN_ML_TX_MODE_REG, 0xa);
+ int i; /* Kernel driver suggests to retry this a few times if it fails. */
+ for (i = 0; i < 5; i++) {
+ i2c_writeb(bus, chip, SN_ML_TX_MODE_REG, SEMI_AUTO_LINK_TRAINING);
- if (!wait_ms(500,
- !(i2c_readb(bus, chip, SN_ML_TX_MODE_REG, &buf)) &&
- (buf & NORMAL_MODE))) {
- printk(BIOS_ERR, "ERROR: Link training failed");
+ wait_ms(500, !(i2c_readb(bus, chip, SN_ML_TX_MODE_REG, &buf)) &&
+ (buf == NORMAL_MODE || buf == MAIN_LINK_OFF))
+
+ if (buf == NORMAL_MODE)
+ return;
}
+ printk(BIOS_ERR, "ERROR: Link training failed 5 times\n");
}
static enum cb_err sn65dsi86_bridge_get_plug_in_status(uint8_t bus, uint8_t chip)
--
To view, visit https://review.coreboot.org/c/coreboot/+/45882
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I713b6851bd51d3527ed4c6e6407dee6b42d09955
Gerrit-Change-Number: 45882
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Douglas Anderson <dianders(a)chromium.org>
Gerrit-Reviewer: Philip Chen <philipchen(a)chromium.org>
Gerrit-Reviewer: mturney mturney <mturney(a)codeaurora.org>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45872 )
Change subject: security/intel/stm: Fix size_t printf format error
......................................................................
security/intel/stm: Fix size_t printf format error
This sort-of reverts commit 075df92298fe3bb0ef04233395effe668c4a5550 and
fixes the underlying issue. The printf format string type/length
specifier for a size_t type is z.
Change-Id: I897380060f7ea09700f77beb81d52c18a45326ad
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/security/intel/stm/SmmStm.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/45872/1
diff --git a/src/security/intel/stm/SmmStm.c b/src/security/intel/stm/SmmStm.c
index 00490cf..e2fab0c 100644
--- a/src/security/intel/stm/SmmStm.c
+++ b/src/security/intel/stm/SmmStm.c
@@ -477,7 +477,7 @@
return -1; // INVALID_PARAMETER;
resource_size = get_resource_size(resource_list, num_entries);
- printk(BIOS_DEBUG, "STM: ResourceSize - 0x%08x\n", (int) resource_size);
+ printk(BIOS_DEBUG, "STM: ResourceSize - 0x%08zx\n", resource_size);
if (resource_size == 0)
return -1; // INVALID_PARAMETER;
--
To view, visit https://review.coreboot.org/c/coreboot/+/45872
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I897380060f7ea09700f77beb81d52c18a45326ad
Gerrit-Change-Number: 45872
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange