All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Kani, Toshimitsu" <toshi.kani@hpe.com>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"bp@alien8.de" <bp@alien8.de>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: Re: [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list()
Date: Tue, 22 Aug 2017 00:26:51 +0200	[thread overview]
Message-ID: <CAJZ5v0hjP6AymwZSNe09Zt2T8=xGE+xC2vLrsEb7YVsALREbNw@mail.gmail.com> (raw)
In-Reply-To: <1503353508.2042.170.camel@hpe.com>

On Tue, Aug 22, 2017 at 12:21 AM, Kani, Toshimitsu <toshi.kani@hpe.com> wrote:
> On Mon, 2017-08-21 at 23:49 +0200, Rafael J. Wysocki wrote:
>> On Mon, Aug 21, 2017 at 11:06 PM, Kani, Toshimitsu <toshi.kani@hpe.co
>> m> wrote:
>> > On Mon, 2017-08-21 at 22:31 +0200, Rafael J. Wysocki wrote:
>> > > On Mon, Aug 21, 2017 at 7:36 PM, Borislav Petkov <bp@alien8.de>
>> > > wrote:
>> > > > On Mon, Aug 21, 2017 at 05:23:37PM +0000, Kani, Toshimitsu
>> > > > wrote:
>> > > > > > > 'data' here is private to the caller.  So, I do not think
>> > > > > > > we need to define the bits.  Shall I change the name to
>> > > > > > > 'driver_data' to make it more explicit?
>> > > > > >
>> > > > > > You changed it to 'data'. It was a u32-used-as-boolean
>> > > > > > is_critical_error before.
>> > > > > >
>> > > > > > So you can just as well make it into flags and people can
>> > > > > > extend those flags if needed. A flag bit should be enough
>> > > > > > in most cases anyway. If they really need driver_data, then
>> > > > > > they can add a void *member.
>> > > > >
>> > > > > Hmm.. In patch 2, intel_pstate_platform_pwr_mgmt_exists()
>> > > > > uses this field for PSS and PCC, which are enum values.  I
>> > > > > think we should allow drivers to set any values here.  I
>> > > > > agree that it may need to be void * if we also allow drivers
>> > > > > to set a pointer here.
>> > > >
>> > > > Let's see what Rafael prefers.
>> > >
>> > > I would retain the is_critical_error field and use that for
>> > > printing the recoverable / non-recoverable message.  This is kind
>> > > of orthogonal to whether or not any extra data is needed and that
>> > > can be an additional field.  In that case unsigned long should be
>> > > sufficient to accommodate a pointer if need be.
>> >
>> > Yes, we will retain the field.  The question is whether this field
>> > should be retained as a driver's private data or ACPI-managed
>> > flags.
>>
>> Thanks for the clarification.
>>
>> > My patch implements the former, which lets the callers to define
>> > the data values.  For instance, acpi_blacklisted() uses this field
>> > as is_critical_error value, and
>> > intel_pstate_platform_pwr_mgmt_exists() uses it as oem_pwr_table
>> > value.
>> >
>> > Boris suggested the latter, which lets ACPI to define the flags,
>> > which are then used by the callers.  For instance, he suggested
>> > ACPI to define bit0 as is_critical_error.
>> >
>> > #define ACPI_PLAT_IS_CRITICAL_ERROR     BIT(0)
>>
>> So my point is that we can have both the ACPI-managed flags and the
>> the caller-defined data at the same time as separate items.
>>
>> That would allow of maximum flexibility IMO.
>
> I agree in general.  Driver private data allows flexibility to drivers
> when the values are driver-private.  ACPI-managed flags allows ACPI to
> control the interfaces based on the flags.
>
> Since we do not have use-case of the latter case yet, i.e.
> acpi_match_platform_list() does not need to check the flags, I'd
> suggest that we keep 'data' as driver-private.  We can add 'flags' as a
> separate member to the structure when we find the latter use-case.

OK

Thanks,
Rafael

WARNING: multiple messages have this Message-ID (diff)
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Kani, Toshimitsu" <toshi.kani@hpe.com>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"bp@alien8.de" <bp@alien8.de>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: [v3,1/5] ACPI / blacklist: add acpi_match_platform_list()
Date: Tue, 22 Aug 2017 00:26:51 +0200	[thread overview]
Message-ID: <CAJZ5v0hjP6AymwZSNe09Zt2T8=xGE+xC2vLrsEb7YVsALREbNw@mail.gmail.com> (raw)

On Tue, Aug 22, 2017 at 12:21 AM, Kani, Toshimitsu <toshi.kani@hpe.com> wrote:
> On Mon, 2017-08-21 at 23:49 +0200, Rafael J. Wysocki wrote:
>> On Mon, Aug 21, 2017 at 11:06 PM, Kani, Toshimitsu <toshi.kani@hpe.co
>> m> wrote:
>> > On Mon, 2017-08-21 at 22:31 +0200, Rafael J. Wysocki wrote:
>> > > On Mon, Aug 21, 2017 at 7:36 PM, Borislav Petkov <bp@alien8.de>
>> > > wrote:
>> > > > On Mon, Aug 21, 2017 at 05:23:37PM +0000, Kani, Toshimitsu
>> > > > wrote:
>> > > > > > > 'data' here is private to the caller.  So, I do not think
>> > > > > > > we need to define the bits.  Shall I change the name to
>> > > > > > > 'driver_data' to make it more explicit?
>> > > > > >
>> > > > > > You changed it to 'data'. It was a u32-used-as-boolean
>> > > > > > is_critical_error before.
>> > > > > >
>> > > > > > So you can just as well make it into flags and people can
>> > > > > > extend those flags if needed. A flag bit should be enough
>> > > > > > in most cases anyway. If they really need driver_data, then
>> > > > > > they can add a void *member.
>> > > > >
>> > > > > Hmm.. In patch 2, intel_pstate_platform_pwr_mgmt_exists()
>> > > > > uses this field for PSS and PCC, which are enum values.  I
>> > > > > think we should allow drivers to set any values here.  I
>> > > > > agree that it may need to be void * if we also allow drivers
>> > > > > to set a pointer here.
>> > > >
>> > > > Let's see what Rafael prefers.
>> > >
>> > > I would retain the is_critical_error field and use that for
>> > > printing the recoverable / non-recoverable message.  This is kind
>> > > of orthogonal to whether or not any extra data is needed and that
>> > > can be an additional field.  In that case unsigned long should be
>> > > sufficient to accommodate a pointer if need be.
>> >
>> > Yes, we will retain the field.  The question is whether this field
>> > should be retained as a driver's private data or ACPI-managed
>> > flags.
>>
>> Thanks for the clarification.
>>
>> > My patch implements the former, which lets the callers to define
>> > the data values.  For instance, acpi_blacklisted() uses this field
>> > as is_critical_error value, and
>> > intel_pstate_platform_pwr_mgmt_exists() uses it as oem_pwr_table
>> > value.
>> >
>> > Boris suggested the latter, which lets ACPI to define the flags,
>> > which are then used by the callers.  For instance, he suggested
>> > ACPI to define bit0 as is_critical_error.
>> >
>> > #define ACPI_PLAT_IS_CRITICAL_ERROR     BIT(0)
>>
>> So my point is that we can have both the ACPI-managed flags and the
>> the caller-defined data at the same time as separate items.
>>
>> That would allow of maximum flexibility IMO.
>
> I agree in general.  Driver private data allows flexibility to drivers
> when the values are driver-private.  ACPI-managed flags allows ACPI to
> control the interfaces based on the flags.
>
> Since we do not have use-case of the latter case yet, i.e.
> acpi_match_platform_list() does not need to check the flags, I'd
> suggest that we keep 'data' as driver-private.  We can add 'flags' as a
> separate member to the structure when we find the latter use-case.

OK

Thanks,
Rafael
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-08-21 22:26 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 19:46 [PATCH v3 0/5] enable ghes_edac on selected platforms Toshi Kani
2017-08-18 19:46 ` [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list() Toshi Kani
2017-08-18 19:46   ` [v3,1/5] " Toshi Kani
2017-08-21 11:27   ` [PATCH v3 1/5] " Borislav Petkov
2017-08-21 11:27     ` [v3,1/5] " Borislav Petkov
2017-08-21 12:25     ` [PATCH v3 1/5] " Rafael J. Wysocki
2017-08-21 12:25       ` [v3,1/5] " Rafael J. Wysocki
2017-08-21 13:20       ` [PATCH] ACPICA: Check whether ACPI is disabled before getting a table Borislav Petkov
2017-08-21 13:20         ` Borislav Petkov
2017-08-21 13:30         ` [PATCH] " Rafael J. Wysocki
2017-08-21 13:30           ` Rafael J. Wysocki
2017-08-21 15:34           ` [PATCH] " Borislav Petkov
2017-08-21 15:34             ` Borislav Petkov
2017-09-03  0:43         ` [PATCH] " kbuild test robot
2017-09-03  0:43           ` kbuild test robot
2017-08-21 16:41     ` [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list() Kani, Toshimitsu
2017-08-21 16:41       ` [v3,1/5] " Toshi Kani
2017-08-21 17:04       ` [PATCH v3 1/5] " Borislav Petkov
2017-08-21 17:04         ` [v3,1/5] " Borislav Petkov
2017-08-21 17:23         ` [PATCH v3 1/5] " Kani, Toshimitsu
2017-08-21 17:23           ` [v3,1/5] " Toshi Kani
2017-08-21 17:36           ` [PATCH v3 1/5] " Borislav Petkov
2017-08-21 17:36             ` [v3,1/5] " Borislav Petkov
2017-08-21 20:31             ` [PATCH v3 1/5] " Rafael J. Wysocki
2017-08-21 20:31               ` [v3,1/5] " Rafael J. Wysocki
2017-08-21 21:06               ` [PATCH v3 1/5] " Kani, Toshimitsu
2017-08-21 21:06                 ` [v3,1/5] " Toshi Kani
2017-08-21 21:49                 ` [PATCH v3 1/5] " Rafael J. Wysocki
2017-08-21 21:49                   ` [v3,1/5] " Rafael J. Wysocki
2017-08-21 22:21                   ` [PATCH v3 1/5] " Kani, Toshimitsu
2017-08-21 22:21                     ` [v3,1/5] " Toshi Kani
2017-08-21 22:26                     ` Rafael J. Wysocki [this message]
2017-08-21 22:26                       ` Rafael J. Wysocki
2017-08-18 19:46 ` [PATCH v3 2/5] intel_pstate: convert to use acpi_match_platform_list() Toshi Kani
2017-08-18 19:46   ` [v3,2/5] " Toshi Kani
2017-08-21 17:53   ` [PATCH v3 2/5] " Srinivas Pandruvada
2017-08-21 17:53     ` [v3,2/5] " Srinivas Pandruvada
2017-08-23 15:46   ` [PATCH v3 2/5] " Borislav Petkov
2017-08-23 15:46     ` [v3,2/5] " Borislav Petkov
2017-08-23 15:56     ` [PATCH v3 2/5] " Kani, Toshimitsu
2017-08-23 15:56       ` [v3,2/5] " Toshi Kani
2017-08-23 15:56       ` [PATCH v3 2/5] " Kani, Toshimitsu
2017-08-18 19:46 ` [PATCH v3 3/5] ghes_edac: add platform check to enable ghes_edac Toshi Kani
2017-08-18 19:46   ` [v3,3/5] " Toshi Kani
2017-08-23 16:20   ` [PATCH v3 3/5] " Borislav Petkov
2017-08-23 16:20     ` [v3,3/5] " Borislav Petkov
2017-08-23 16:20     ` [PATCH v3 3/5] " Borislav Petkov
2017-08-23 20:46     ` Rafael J. Wysocki
2017-08-23 20:46       ` [v3,3/5] " Rafael J. Wysocki
2017-08-24  7:54       ` [PATCH v3 3/5] " Borislav Petkov
2017-08-24  7:54         ` [v3,3/5] " Borislav Petkov
2017-08-18 19:46 ` [PATCH v3 4/5] EDAC: add edac_get_owner() to check MC owner Toshi Kani
2017-08-18 19:46   ` [v3,4/5] " Toshi Kani
2017-08-18 19:46 ` [PATCH v3 5/5] edac drivers: add MC owner check in init Toshi Kani
2017-08-18 19:46   ` [v3,5/5] " Toshi Kani

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='CAJZ5v0hjP6AymwZSNe09Zt2T8=xGE+xC2vLrsEb7YVsALREbNw@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=bp@alien8.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tony.luck@intel.com \
    --cc=toshi.kani@hpe.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.