Re: [PATCH 02/18] ACPICA: Export acpi_ut_verify_cdat_checksum()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2/7/23 7:19 AM, Rafael J. Wysocki wrote:
On Mon, Feb 6, 2023 at 9:49 PM Dave Jiang <dave.jiang@xxxxxxxxx> wrote:

Export the CDAT checksum verify function so CXL driver can use it to verify
CDAT coming from the CXL devices.

Given that this function isn't actually being used by ACPI internals,
removing the define check of APCI_CHECKSUM_ABORT so the function would
return failure on checksum fail since the driver will need to know.

If you want to make ACPICA changes, please first submit a pull request
to the upstream ACPICA project on GitHub.

Having done that, please resubmit the corresponding Linux patch with a
Link tag pointing to the upstream PR.

Ok will do. Thanks!

Thanks!

Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
---
  drivers/acpi/acpica/utcksum.c |    4 +---
  include/linux/acpi.h          |    7 +++++++
  2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/utcksum.c b/drivers/acpi/acpica/utcksum.c
index c166e4c05ab6..c0f98c8f9a0b 100644
--- a/drivers/acpi/acpica/utcksum.c
+++ b/drivers/acpi/acpica/utcksum.c
@@ -102,15 +102,13 @@ acpi_ut_verify_cdat_checksum(struct acpi_table_cdat *cdat_table, u32 length)
                                    "should be 0x%2.2X",
                                    acpi_gbl_CDAT, cdat_table->checksum,
                                    checksum));
-
-#if (ACPI_CHECKSUM_ABORT)
                 return (AE_BAD_CHECKSUM);
-#endif
         }

         cdat_table->checksum = checksum;
         return (AE_OK);
  }
+EXPORT_SYMBOL_GPL(acpi_ut_verify_cdat_checksum);

  /*******************************************************************************
   *
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 5e6a876e17ba..09b44afef7df 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1504,9 +1504,16 @@ static inline void acpi_init_ffh(void) { }
  #ifdef CONFIG_ACPI
  extern void acpi_device_notify(struct device *dev);
  extern void acpi_device_notify_remove(struct device *dev);
+extern acpi_status
+acpi_ut_verify_cdat_checksum(struct acpi_table_cdat *cdat_table, u32 length);
  #else
  static inline void acpi_device_notify(struct device *dev) { }
  static inline void acpi_device_notify_remove(struct device *dev) { }
+static inline acpi_status
+acpi_ut_verify_cdat_checksum(struct acpi_table_cdat *cdat_table, u32 length)
+{
+       return (AE_NOT_CONFIGURED);
+}
  #endif

  #endif /*_LINUX_ACPI_H*/





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux