[PATCH 04/22] x86: mp_init: Switch parameter names in start_aps()
Wolfgang Wallner
wolfgang.wallner at br-automation.com
Wed Jun 10 15:25:49 CEST 2020
Hi Simon,
-----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH 04/22] x86: mp_init: Switch parameter names in start_aps()
>
> These parameters are named differently from elsewhere in this file. Switch
> them to avoid confusion.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> arch/x86/cpu/mp_init.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
> index e77d7f2cd6c..4b678cde313 100644
> --- a/arch/x86/cpu/mp_init.c
> +++ b/arch/x86/cpu/mp_init.c
> @@ -308,13 +308,13 @@ static int apic_wait_timeout(int total_delay, const char *msg)
> return 0;
> }
>
> -static int start_aps(int ap_count, atomic_t *num_aps)
> +static int start_aps(int num_aps, atomic_t *ap_count)
A description of this function and its parameters would be really helpful.
I got confused trying to understand what it did before the patch, what it
does now, and what the original intent was ...
> {
> int sipi_vector;
> /* Max location is 4KiB below 1MiB */
> const int max_vector_loc = ((1 << 20) - (1 << 12)) >> 12;
>
> - if (ap_count == 0)
> + if (num_aps == 0)
> return 0;
>
> /* The vector is sent as a 4k aligned address in one byte */
> @@ -326,7 +326,7 @@ static int start_aps(int ap_count, atomic_t *num_aps)
> return -ENOSPC;
> }
>
> - debug("Attempting to start %d APs\n", ap_count);
> + debug("Attempting to start %d APs\n", num_aps);
>
> if (apic_wait_timeout(1000, "ICR not to be busy"))
> return -ETIMEDOUT;
> @@ -349,7 +349,7 @@ static int start_aps(int ap_count, atomic_t *num_aps)
> return -ETIMEDOUT;
>
> /* Wait for CPUs to check in up to 200 us */
> - wait_for_aps(num_aps, ap_count, 200, 15);
> + wait_for_aps(ap_count, num_aps, 200, 15);
>
> /* Send 2nd SIPI */
> if (apic_wait_timeout(1000, "ICR not to be busy"))
> @@ -362,9 +362,9 @@ static int start_aps(int ap_count, atomic_t *num_aps)
> return -ETIMEDOUT;
>
> /* Wait for CPUs to check in */
> - if (wait_for_aps(num_aps, ap_count, 10000, 50)) {
> + if (wait_for_aps(ap_count, num_aps, 10000, 50)) {
> debug("Not all APs checked in: %d/%d\n",
> - atomic_read(num_aps), ap_count);
> + atomic_read(ap_count), num_aps);
> return -EIO;
> }
>
> --
> 2.27.0.rc0.183.gde8f92d652-goog
regards, Wolfgang
More information about the U-Boot
mailing list