From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wallner Date: Thu, 25 Jun 2020 14:45:35 +0200 Subject: [PATCH v1 04/43] acpi: Allow creating the GNVS to fail In-Reply-To: <20200614215726.v1.4.Id6c2992321a188f3fa0eacc84bbd5568b6e750fe@changeid> References: <20200614215726.v1.4.Id6c2992321a188f3fa0eacc84bbd5568b6e750fe@changeid> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, -----"Simon Glass" schrieb: ----- > Betreff: [PATCH v1 04/43] acpi: Allow creating the GNVS to fail > > In some cases an internal error may prevent this from working. Update the > function return value and report the error. At present the API for writing > tables does not easily support reporting errors, but once it is fully > updated to use a context pointer, this will be easier. > > Signed-off-by: Simon Glass > --- > > Changes in v1: > - Add linux/err.h header > > arch/x86/cpu/baytrail/acpi.c | 4 +++- > arch/x86/cpu/quark/acpi.c | 4 +++- > arch/x86/cpu/tangier/acpi.c | 4 +++- > arch/x86/include/asm/acpi_table.h | 10 +++++++++- > arch/x86/lib/acpi_table.c | 11 +++++++++-- > 5 files changed, 27 insertions(+), 6 deletions(-) > [snip] > diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c > index eeacfe9b06..27869a0e5e 100644 > --- a/arch/x86/lib/acpi_table.c > +++ b/arch/x86/lib/acpi_table.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > /* > * IASL compiles the dsdt entries and writes the hex values > @@ -443,8 +444,14 @@ ulong write_acpi_tables(ulong start_addr) > dsdt->checksum = 0; > dsdt->checksum = table_compute_checksum((void *)dsdt, dsdt->length); > > - /* Fill in platform-specific global NVS variables */ > - acpi_create_gnvs(ctx->current); > + /* > + * Fill in platform-specific global NVS variables. If this fails we > + * cannot return the error but this should only happen while debugging. > + */ > + addr = acpi_create_gnvs(ctx->current); > + if (IS_ERR_VALUE(addr)) > + printf("Error: Gailed to create GNVS\n"); Typo: Failed > + > acpi_inc_align(ctx, sizeof(struct acpi_global_nvs)); > > debug("ACPI: * FADT\n"); > -- > 2.27.0.290.gba653c62da-goog Reviewed-by: Wolfgang Wallner