All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	linux-edac@vger.kernel.org
Subject: [4/5] EDAC, dsm_edac: Wrap ACPI DSM methods for address translation
Date: Sat, 6 Oct 2018 22:44:56 +0200	[thread overview]
Message-ID: <20181006204456.GB30241@zn.tnic> (raw)

On Fri, Oct 05, 2018 at 03:25:57PM -0700, Luck, Tony wrote:
> It's like acpi_extlog.c in that it uses an ACPI DSM. Also related
> to error reporting.  No, we aren't abandoning extlog, but it seems
> that fewer OEMs than we hoped are adopting eMCA and implementing
> the extended log in their BIOS.

Ok, but what is the difference with this DSM thing and why would OEMs
use that? They get it for free from you? Or?

> The module syning part is painful/ugly.  Making this built-in would
> be far prettier (more maintainable).

Yap.

> > Practically, this is going to be enabled on 99.9% of the boxes so making
> > it part of the core is, I guess, just as well.
> 
> So I dropped Qiuxu's code into a blender and ran it on high
> for a few minutes.  Below is an RFC patch (compiles, but
> otherwise untested) to see what things would looks like with
> a built in ACPI block with no registrations to EDAC core, or
> other stuff that is specific to the EDAC usage model.

Looks nice and clean to me.

...

> diff --git a/drivers/acpi/acpi_adxl.c b/drivers/acpi/acpi_adxl.c
> new file mode 100644
> index 000000000000..a0e026680c3d
> --- /dev/null
> +++ b/drivers/acpi/acpi_adxl.c
> @@ -0,0 +1,156 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Address translation interface via ACPI DSM.
> + * Copyright (C) 2018 Intel Corporation
> + */
> +
> +#ifdef CONFIG_ACPI_ADXL
> +#include <linux/acpi.h>
> +#include <linux/adxl.h>
> +
> +#define ADXL_REV				0x1
> +#define ADXL_IDX_GET_ADDR_PARAMS		0x1
> +#define ADXL_IDX_FORWARD_TRANSLATE	0x2
> +#define ACPI_ADXL_PATH			"\\_SB.ADXL"
> +
> +#undef pr_fmt
> +#define pr_fmt(fmt) "ADXL: " fmt
> +
> +static acpi_handle handle;
> +static union acpi_object *params;
> +static const guid_t adxl_guid =
> +	GUID_INIT(0xAA3C050A, 0x7EA4, 0x4C1F,
> +		  0xAF, 0xDA, 0x12, 0x67, 0xDF, 0xD3, 0xD4, 0x8D);
> +
> +int adxl_count;
> +EXPORT_SYMBOL_GPL(adxl_count);

That's the length of the address components adxl_component_names array?

> +char **adxl_component_names;
> +EXPORT_SYMBOL_GPL(adxl_component_names);

I guess I'm still unclear on how this is going to be used...

/me goes and looks at the initial patch.

aha, the DSM replies with a bunch of components which map to the names
and they'll get filled up by BIOS and the driver simply dumps them.
Something along those lines at least.

So you don't need count if you NULL-terminate the names array, right?

So you can simply do

	kcalloc(cnt + 1, ...

and the last element will be NULL.

Somehow exporting that naked count looks strange to me. If at all, it
should be read-only, I guess __ro_after_init or so.

Other than that minor stuff, it looks ok to me.

Thx.

             reply	other threads:[~2018-10-06 20:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-06 20:44 Borislav Petkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-10-09 18:33 [4/5] EDAC, dsm_edac: Wrap ACPI DSM methods for address translation Luck, Tony
2018-10-09 18:29 Luck, Tony
2018-10-09 16:17 Borislav Petkov
2018-10-09 15:29 Rafael J. Wysocki
2018-10-09 15:25 Rafael J. Wysocki
2018-10-09 15:22 Luck, Tony
2018-10-09 15:14 Borislav Petkov
2018-10-09 11:43 Qiuxu Zhuo
2018-10-09 10:28 Rafael J. Wysocki
2018-10-08 16:57 Luck, Tony
2018-10-05 22:25 Luck, Tony
2018-10-04  9:31 Borislav Petkov
2018-10-03 17:58 Luck, Tony
2018-09-26 18:22 Luck, Tony
2018-09-26 17:33 Borislav Petkov
2018-09-24 20:16 Luck, Tony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181006204456.GB30241@zn.tnic \
    --to=bp@alien8.de \
    --cc=aris@redhat.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.