Kane Chen has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/63566 )
Change subject: cpu/x86/mp_init.c: Add wait_finished_mp_run_on_all_cpus
......................................................................
cpu/x86/mp_init.c: Add wait_finished_mp_run_on_all_cpus
This patch adds a parameter wait_ap_complete in mp_callback to decide
when APs call store_callback to notify BSP it already takes jobs.
This can allow the caller to decide whether it should wait all APs to
continue or not.
Change-Id: I8d1d49bca410c821a3ad0347548afc42eb860594
Signed-off-by: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Co-authored-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/x86/mp_init.c
M src/include/cpu/x86/mp.h
2 files changed, 34 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/63566/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/63566
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8d1d49bca410c821a3ad0347548afc42eb860594
Gerrit-Change-Number: 63566
Gerrit-PatchSet: 2
Gerrit-Owner: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-MessageType: newpatchset
Kane Chen has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/63486 )
Change subject: soc/intel/common: Enable rom cache on all CPU threads
......................................................................
Abandoned
abandon it since we have better solution in other thread
--
To view, visit https://review.coreboot.org/c/coreboot/+/63486
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1d7ffc6e5f5ec49abf848d3cd9f0435c93f834dc
Gerrit-Change-Number: 63486
Gerrit-PatchSet: 3
Gerrit-Owner: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-MessageType: abandon
Attention is currently required from: Arthur Heymans, Tim Wawrzynczak, Kane Chen.
Kane Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63553 )
Change subject: cpu/x86/mp_init.c: Add wait_finished_mp_run_on_all_cpus
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
i tried this patch and the race condition is gone.
I also base on Arthur's patch to create another solution. not sure if you like it.
see https://review.coreboot.org/c/coreboot/+/63566
basically it adds a parameter wait_ap_complete in mp_callback and it can decide AP calls store_callback before or after lcb.func(lcb.arg)
--
To view, visit https://review.coreboot.org/c/coreboot/+/63553
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I70244557bb384739e3bd06de3d8414ec9f4d5f62
Gerrit-Change-Number: 63553
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kane Chen <kane.chen(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Kane Chen <kane.chen(a)intel.com>
Gerrit-Comment-Date: Tue, 12 Apr 2022 02:14:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Kane Chen.
Hello Kane Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/63567
to review the following change.
Change subject: soc/intel/common: Use wait_finished_mp_run_on_all_cpus for APs MTRR init
......................................................................
soc/intel/common: Use wait_finished_mp_run_on_all_cpus for APs MTRR init
By using wait_finished_mp_run_on_all_cpus to run APs MTRR init, it
gurantees the BSP will run post_cpus_add_romcache until all APs finishes
_x86_setup_mtrrs task.
BUG=b:225766934
TEST=Test on gimble and found the MTRR race condition on AP/BSP is gone.
Change-Id: I1fd889f880a0c605e6c739423a434d2adbc12d26
Signed-off-by: Kane Chen <kane.chen(a)intel.com>
---
M src/soc/intel/common/block/cpu/mp_init.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/63567/1
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c
index 823f23e..5e1932e 100644
--- a/src/soc/intel/common/block/cpu/mp_init.c
+++ b/src/soc/intel/common/block/cpu/mp_init.c
@@ -169,7 +169,8 @@
/* Ensure to re-program all MTRRs based on DRAM resource settings */
static void post_cpus_init(void *unused)
{
- if (mp_run_on_all_cpus(&wrapper_x86_setup_mtrrs, NULL) != CB_SUCCESS)
+ /* Ensure all APs finish the task and continue */
+ if (wait_finished_mp_run_on_all_cpus(&wrapper_x86_setup_mtrrs, NULL) != CB_SUCCESS)
printk(BIOS_ERR, "MTRR programming failure\n");
post_cpus_add_romcache();
--
To view, visit https://review.coreboot.org/c/coreboot/+/63567
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1fd889f880a0c605e6c739423a434d2adbc12d26
Gerrit-Change-Number: 63567
Gerrit-PatchSet: 1
Gerrit-Owner: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Kane Chen <kane.chen(a)intel.com>
Gerrit-Attention: Kane Chen <kane.chen(a)intel.com>
Gerrit-MessageType: newchange
Kane Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63566 )
Change subject: cpu/x86/mp_init.c: Add wait_finished_mp_run_on_all_cpus
......................................................................
cpu/x86/mp_init.c: Add wait_finished_mp_run_on_all_cpus
This patch adds a parameter wait_ap_complete in mp_callback to decide
when APs call store_callback to notify BSP it already takes jobs.
This can allow the caller to decide whether it should wait all APs to
continue or not.
Change-Id: I8d1d49bca410c821a3ad0347548afc42eb860594
Signed-off-by: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Co-authored-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/x86/mp_init.c
M src/include/cpu/x86/mp.h
2 files changed, 34 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/63566/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index 81c987b..28febdc 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -33,6 +33,7 @@
void (*func)(void *);
void *arg;
int logical_cpu_number;
+ bool wait_ap_complete;
};
static char processor_name[49];
@@ -960,12 +961,15 @@
/* Copy to local variable before signaling consumption. */
memcpy(&lcb, cb, sizeof(lcb));
mfence();
- store_callback(per_cpu_slot, NULL);
+ if (!lcb.wait_ap_complete)
+ store_callback(per_cpu_slot, NULL);
if (lcb.logical_cpu_number && (cur_cpu !=
lcb.logical_cpu_number))
continue;
else
lcb.func(lcb.arg);
+ if (lcb.wait_ap_complete)
+ store_callback(per_cpu_slot, NULL);
}
}
@@ -977,6 +981,15 @@
return run_ap_work(&lcb, expire_us);
}
+enum cb_err mp_run_on_aps_and_wait_for_complete(void (*func)(void *), void *arg,
+ int logical_cpu_num, long expire_us)
+{
+ struct mp_callback lcb = { .func = func, .arg = arg,
+ .logical_cpu_number = logical_cpu_num,
+ .wait_ap_complete = true};
+ return run_ap_work(&lcb, expire_us);
+}
+
enum cb_err mp_run_on_all_aps(void (*func)(void *), void *arg, long expire_us,
bool run_parallel)
{
@@ -1009,6 +1022,16 @@
return mp_run_on_aps(func, arg, MP_RUN_ON_ALL_CPUS, 1000 * USECS_PER_MSEC);
}
+enum cb_err wait_finished_mp_run_on_all_cpus(void (*func)(void *), void *arg)
+{
+ /* Run on BSP first. */
+ func(arg);
+
+ /* For up to 1 second for AP to finish previous work. */
+ return mp_run_on_aps_and_wait_for_complete(func, arg, MP_RUN_ON_ALL_CPUS,
+ 1000 * USECS_PER_MSEC);
+}
+
enum cb_err mp_park_aps(void)
{
struct stopwatch sw;
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index 1b4c956..2324c48 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -106,6 +106,12 @@
*/
enum cb_err mp_run_on_aps(void (*func)(void *), void *arg, int logical_cpu_num,
long expire_us);
+/*
+ * This function is similar to mp_run_on_aps but the BSP will wait for all APs
+ * to complete the assigned tasks and continue
+ */
+enum cb_err mp_run_on_aps_and_wait_for_complete(void (*func)(void *), void *arg,
+ int logical_cpu_num, long expire_us);
/*
* Runs func on all APs excluding BSP, with a provision to run calls in parallel
@@ -117,6 +123,10 @@
/* Like mp_run_on_aps() but also runs func on BSP. */
enum cb_err mp_run_on_all_cpus(void (*func)(void *), void *arg);
+/* Like mp_run_on_all_cpus but make sure all APs finish executing the
+ function call. The time limit on a function call is 1 second. */
+enum cb_err wait_finished_mp_run_on_all_cpus(void (*func)(void *), void *arg);
+
/*
* Park all APs to prepare for OS boot. This is handled automatically
* by the coreboot infrastructure.
--
To view, visit https://review.coreboot.org/c/coreboot/+/63566
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8d1d49bca410c821a3ad0347548afc42eb860594
Gerrit-Change-Number: 63566
Gerrit-PatchSet: 1
Gerrit-Owner: Kane Chen <kane.chen(a)intel.corp-partner.google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Hung-Te Lin, Arthur Heymans, Yu-Ping Wu.
Jianjun Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63252 )
Change subject: soc/mediatek: Fill coreboot table with PCIe info
......................................................................
Patch Set 13:
(1 comment)
File src/soc/mediatek/common/pcie.c:
https://review.coreboot.org/c/coreboot/+/63252/comment/da1c6e00_ea41c963
PS12, Line 217: pcie->ctrl_base = mtk_pcie_get_controller_base(0);
> > I don't think we should initialize it here since the caller has already do it. […]
This call order is suggested by Julius, and it seems the same model with lb_gpios, is that ok for you?
https://review.coreboot.org/c/coreboot/+/63251/8..12/src/lib/coreboot_table…
--
To view, visit https://review.coreboot.org/c/coreboot/+/63252
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib2988694f60aac9cbfc09ef9a26d47e01c004406
Gerrit-Change-Number: 63252
Gerrit-PatchSet: 13
Gerrit-Owner: Jianjun Wang <jianjun.wang(a)mediatek.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Tue, 12 Apr 2022 02:07:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Comment-In-Reply-To: Yu-Ping Wu <yupingso(a)google.com>
Comment-In-Reply-To: Jianjun Wang <jianjun.wang(a)mediatek.com>
Gerrit-MessageType: comment
Raihow Shi has restored this change. ( https://review.coreboot.org/c/coreboot/+/63544 )
Change subject: mb/google/brask/variants/moli: add delay time to rtd3-cold
......................................................................
Restored
--
To view, visit https://review.coreboot.org/c/coreboot/+/63544
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idecb1c89655c9b8b720c3c65efc77e06e6a8b300
Gerrit-Change-Number: 63544
Gerrit-PatchSet: 2
Gerrit-Owner: Raihow Shi <raihow_shi(a)wistron.corp-partner.google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: restore
Attention is currently required from: Hung-Te Lin, Rex-BC Chen, Julius Werner, Arthur Heymans, Yu-Ping Wu.
Jianjun Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63251 )
Change subject: coreboot tables: Add PCIe info to coreboot table
......................................................................
Patch Set 12:
(1 comment)
File src/lib/coreboot_table.c:
https://review.coreboot.org/c/coreboot/+/63251/comment/5b5b1a6e_0e95aad1
PS12, Line 36: __weak enum cb_err lb_fill_pcie(struct lb_pcie *pcie)
: {
: return CB_ERR;
: }
> > I think we can get the information from device tree directly by define this function, so we don't […]
That might be a solution, but not every SoC will fill all of these base addresses. For MediaTek platform, we only need to fill the controller's base address, but the config and the atu base will be needed for Qualcomm platform, so I think it might be a good idea to let the caller decide which one they need to fill and pass to the payloads.
Since we have already define the controller's base address in devicetree.cb, I think we can get it directly instead of to define another macro with same value, what do you think?
--
To view, visit https://review.coreboot.org/c/coreboot/+/63251
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6cdce21efc66aa441ec077e6fc1d5d1c6a9aafb0
Gerrit-Change-Number: 63251
Gerrit-PatchSet: 12
Gerrit-Owner: Jianjun Wang <jianjun.wang(a)mediatek.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Tue, 12 Apr 2022 01:43:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Comment-In-Reply-To: Jianjun Wang <jianjun.wang(a)mediatek.com>
Gerrit-MessageType: comment
Attention is currently required from: YH Lin, Subrata Banik, Tim Wawrzynczak, Paul Menzel, Zhuohao Lee, Felix Held.
Raihow Shi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63080 )
Change subject: mb/google/brask/variants/moli: update overridetree for moli
......................................................................
Patch Set 14:
(1 comment)
File src/mainboard/google/brya/variants/moli/overridetree.cb:
https://review.coreboot.org/c/coreboot/+/63080/comment/82ec4838_c416634e
PS13, Line 109: probe STORAGE STORAGE_EMMC
> nit: indent with 1 more tab
done
--
To view, visit https://review.coreboot.org/c/coreboot/+/63080
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If83031edcd90ea746704590765102b9b0dee03c1
Gerrit-Change-Number: 63080
Gerrit-PatchSet: 14
Gerrit-Owner: Raihow Shi <raihow_shi(a)wistron.corp-partner.google.com>
Gerrit-Reviewer: Eric Lai <eric_lai(a)quanta.corp-partner.google.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: YH Lin <yueherngl(a)google.com>
Gerrit-Reviewer: Zhuohao Lee <zhuohao(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: 9elements QA <hardwaretestrobot(a)gmail.com>
Gerrit-CC: Anfernee Chen <anfernee_chen(a)wistron.corp-partner.google.com>
Gerrit-CC: Ariel Fang <ariel_fang(a)wistron.corp-partner.google.com>
Gerrit-CC: Casper Chang <casper_chang(a)wistron.corp-partner.google.com>
Gerrit-CC: Malik Hsu <malik_hsu(a)wistron.com>
Gerrit-CC: Mark Hsieh <mark_hsieh(a)wistron.corp-partner.google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Peter Chi <peter_chi(a)wistron.corp-partner.google.com>
Gerrit-CC: Scott Chao <scott_chao(a)wistron.corp-partner.google.com>
Gerrit-CC: Terry Chen <terry_chen(a)wistron.corp-partner.google.com>
Gerrit-CC: Will Tsai <will_tsai(a)wistron.corp-partner.google.com>
Gerrit-CC: Zoey Wu <zoey_wu(a)wistron.corp-partner.google.com>
Gerrit-Attention: YH Lin <yueherngl(a)google.com>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Zhuohao Lee <zhuohao(a)google.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Tue, 12 Apr 2022 01:37:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: comment