Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31338
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
cpu/intel/common: Split get_ia32_fsb()
It is desireable to not have printk() inside a function body that can be used for udelay(). This avoids potential infinite recursion.
Change-Id: Ie67fc2a8da8351f22794e4d36c55b887c298e8ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/intel/common/fsb.c 1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/31338/1
diff --git a/src/cpu/intel/common/fsb.c b/src/cpu/intel/common/fsb.c index 1f7c391..9296785 100644 --- a/src/cpu/intel/common/fsb.c +++ b/src/cpu/intel/common/fsb.c @@ -18,7 +18,7 @@ #include <console/console.h> #include <commonlib/helpers.h>
-int get_ia32_fsb(void) +static int get_fsb(void) { struct cpuinfo_x86 c; static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 }; @@ -60,6 +60,14 @@ break; } } + return ret; +} + +int get_ia32_fsb(void) +{ + int ret; + + ret = get_fsb(); if (ret == -1) printk(BIOS_ERR, "FSB not found\n"); if (ret == -2)
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31338 )
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31338/1/src/cpu/intel/common/fsb.c File src/cpu/intel/common/fsb.c:
https://review.coreboot.org/#/c/31338/1/src/cpu/intel/common/fsb.c@21 PS1, Line 21: static int sorry, but how can it be used for udelay() ?
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31338 )
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31338/1/src/cpu/intel/common/fsb.c File src/cpu/intel/common/fsb.c:
https://review.coreboot.org/#/c/31338/1/src/cpu/intel/common/fsb.c@21 PS1, Line 21: static int
sorry, but how can it be used for udelay() ?
It's in followup work where I define tsc_freq_mhz() in this same file.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31338 )
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
Patch Set 1: Code-Review+1
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31338 )
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31338 )
Change subject: cpu/intel/common: Split get_ia32_fsb() ......................................................................
cpu/intel/common: Split get_ia32_fsb()
It is desireable to not have printk() inside a function body that can be used for udelay(). This avoids potential infinite recursion.
Change-Id: Ie67fc2a8da8351f22794e4d36c55b887c298e8ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/31338 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: HAOUAS Elyes ehaouas@noos.fr --- M src/cpu/intel/common/fsb.c 1 file changed, 9 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve HAOUAS Elyes: Looks good to me, approved
diff --git a/src/cpu/intel/common/fsb.c b/src/cpu/intel/common/fsb.c index 1f7c391..9296785 100644 --- a/src/cpu/intel/common/fsb.c +++ b/src/cpu/intel/common/fsb.c @@ -18,7 +18,7 @@ #include <console/console.h> #include <commonlib/helpers.h>
-int get_ia32_fsb(void) +static int get_fsb(void) { struct cpuinfo_x86 c; static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 }; @@ -60,6 +60,14 @@ break; } } + return ret; +} + +int get_ia32_fsb(void) +{ + int ret; + + ret = get_fsb(); if (ret == -1) printk(BIOS_ERR, "FSB not found\n"); if (ret == -2)