All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org, linux-pci@vger.kernel.org,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Subject: Re: [linux-pm] [PATCH 7/8] ACPI / PCI: Do not preserve _OSC control bits returned by a query (v2)
Date: Fri, 06 Aug 2010 10:28:47 +0900	[thread overview]
Message-ID: <4C5B654F.2090105@jp.fujitsu.com> (raw)
In-Reply-To: <201008051625.07190.rjw@sisk.pl>

(2010/08/05 23:25), Rafael J. Wysocki wrote:
> On Thursday, August 05, 2010, Hidetoshi Seto wrote:
>> (2010/08/05 8:51), Rafael J. Wysocki wrote:
<snip>
>>> Actually, having reconsidered that, I don't think this approach is valid.
>>>
>>> First, it has the problem that if acpi_pci_osc_control_set() returns error
>>> code, the caller doesn't really know whether the query failed, or the final
>>> request failed.  Arguably, it won't matter for the majority of callers, but
>>> some of them might be interested in knowing that in principle.
>>
>> Ugh... there are only 2 callers now and both of them are in the majority.
>> I don't think it is a time to take care of an invisible minority who might
>> require acpi_pci_osc_raw() to complete its work.
>>
>>>
>>> Second, the callers that call acpi_pci_osc_control_query() before
>>> acpi_pci_osc_control_set() don't need the additional query inside
>>> of acpi_pci_osc_control_set().
>>
>> So we can recommend all of callers not to call acpi_pci_osc_control_query()
>> before acpi_pci_osc_control_set().
> 
> Please consider pcie_port_acpi_setup() in [4/8].
> 
> It has to do the query by itself, because it may not request the controls
> _even_ _if_ _the_ _query_ _is_ _successful_.  Namely, if the result of the
> query is that the BIOS won't let us control the PCIe Capability Structure,
> pcie_port_acpi_setup() should return error code instead of requesting control
> of the other features.  Now, if you put the query into
> acpi_pci_osc_control_set(), it won't be able to recognize this corner case and
> handle it correctly.

Then please rewrite your pcie_port_acpi_setup() to clarify that it cannot live
without separated "query" and "set".

I already stated that current pcie_port_acpi_setup() can do its work using a
modified acpi_pci_osc_control_set().
https://patchwork.kernel.org/patch/116976/

Or you might invent new function like:
 acpi_pci_osc_control_set2(*dev, required_bits, optional_bits)

Anyway I'm going to cancel my plan to test your patches today.

>> I suppose that almost all of "the majority" just want to set fixed set of
>> controls and they will just return error when fails anyway.
>>
>>>
>>> Therefore I'd prefer to have two separate functions, one for querying and the
>>> other for requesting control.  Then, we can provide a helper that calls the
>>> both of them for the callers of acpi_pci_osc_control_set() that don't need
>>> to call acpi_pci_osc_control_query() directly by themselves.
>>
>> I'm afraid the "two" is not enough for the minority.
>>
>> Therefore I don't think it is a time to prepare for such an inexistent
>> minor usage.
> 
> As explained above, I think there is a reason to do that, because
> pcie_port_acpi_setup() has to run a query anyway.

I believe I already reviewed your patch enough, but I couldn't find out
the reason that you are claiming now.

If that helps, one of the reasons why I can accept Kaneshige-san's suggestion
to have a smart acpi_pci_osc_control_set() instead of separated functions is
because I remember a function pci_enable_msix() that returns '0' on success,
'< 0' on failure, and '> 0' when retry might be possible with the returned
value. 


Thanks,
H.Seto


  parent reply	other threads:[~2010-08-06  1:29 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 21:51 [PATCH 0/8] ACPI / PCI / PCIe: Rework _OSC handling (v2) Rafael J. Wysocki
2010-08-02 21:53 ` [PATCH 1/8] ACPI / PCI: Introduce acpi_pci_osc_control_query() Rafael J. Wysocki
2010-08-02 21:53 ` Rafael J. Wysocki
2010-08-03  4:52   ` Kenji Kaneshige
2010-08-03  9:24     ` Rafael J. Wysocki
2010-08-03  9:24     ` Rafael J. Wysocki
2010-08-03  4:52   ` Kenji Kaneshige
2010-08-03  5:04   ` Kenji Kaneshige
2010-08-03  5:04   ` Kenji Kaneshige
2010-08-03  9:27     ` Rafael J. Wysocki
2010-08-03  9:27     ` Rafael J. Wysocki
2010-08-03 20:58       ` [linux-pm] " Rafael J. Wysocki
2010-08-04  4:28         ` Kenji Kaneshige
2010-08-04 23:37           ` Rafael J. Wysocki
2010-08-04 23:37           ` [linux-pm] " Rafael J. Wysocki
2010-08-05 23:46             ` Rafael J. Wysocki
2010-08-05 23:46             ` Rafael J. Wysocki
2010-08-04  4:28         ` Kenji Kaneshige
2010-08-03 20:58       ` Rafael J. Wysocki
2010-08-02 21:54 ` [PATCH 2/8] PCI / PCIe/ AER: Introduce pci_aer_available() Rafael J. Wysocki
2010-08-03  0:46   ` Hidetoshi Seto
2010-08-03  9:28     ` Rafael J. Wysocki
2010-08-03 20:59       ` Rafael J. Wysocki
2010-08-03 20:59       ` [linux-pm] " Rafael J. Wysocki
2010-08-03  9:28     ` Rafael J. Wysocki
2010-08-03  0:46   ` Hidetoshi Seto
2010-08-03  9:41   ` Jike Song
2010-08-03  9:41   ` Jike Song
2010-08-03 19:50     ` Rafael J. Wysocki
2010-08-03 19:50     ` Rafael J. Wysocki
2010-08-02 21:54 ` Rafael J. Wysocki
2010-08-02 21:55 ` [PATCH 3/8] PCI / PCIe: Introduce commad line switch for disabling port services Rafael J. Wysocki
2010-08-02 21:55 ` Rafael J. Wysocki
2010-08-02 21:56 ` [PATCH 4/8] PCI / PCIe: Ask BIOS for control of all native services at once (v6) Rafael J. Wysocki
2010-08-02 21:56 ` Rafael J. Wysocki
2010-08-03  1:14   ` Hidetoshi Seto
2010-08-03  1:14   ` Hidetoshi Seto
2010-08-03 21:01     ` Rafael J. Wysocki
2010-08-03 21:01     ` Rafael J. Wysocki
2010-08-06  1:33   ` Hidetoshi Seto
2010-08-06 10:47     ` Rafael J. Wysocki
2010-08-06  1:33   ` Hidetoshi Seto
2010-08-02 21:57 ` [PATCH 5/8] PCI / PCIe: Disable PCIe port services during port initialization Rafael J. Wysocki
2010-08-02 21:57 ` Rafael J. Wysocki
2010-08-02 21:58 ` [PATCH 6/8] PCI / PCIe: Remove the port driver module exit routine Rafael J. Wysocki
2010-08-02 21:58 ` Rafael J. Wysocki
2010-08-02 21:59 ` [PATCH 7/8] ACPI / PCI: Do not preserve _OSC control bits returned by a query (v2) Rafael J. Wysocki
2010-08-03  4:52   ` Kenji Kaneshige
2010-08-03  4:52   ` Kenji Kaneshige
2010-08-03  7:13     ` Hidetoshi Seto
2010-08-03  9:33       ` Rafael J. Wysocki
2010-08-03 21:02         ` Rafael J. Wysocki
2010-08-03 21:02         ` [linux-pm] " Rafael J. Wysocki
2010-08-04  5:46           ` Kenji Kaneshige
2010-08-04  8:41             ` Hidetoshi Seto
2010-08-04  8:41             ` [linux-pm] " Hidetoshi Seto
2010-08-04  9:23               ` Kenji Kaneshige
2010-08-04  9:23               ` Kenji Kaneshige
2010-08-04 10:29               ` Rafael J. Wysocki
2010-08-04 10:29               ` [linux-pm] " Rafael J. Wysocki
2010-08-04 23:51                 ` Rafael J. Wysocki
2010-08-05  3:40                   ` Hidetoshi Seto
2010-08-05 14:25                     ` Rafael J. Wysocki
2010-08-05 14:25                     ` [linux-pm] " Rafael J. Wysocki
2010-08-06  1:28                       ` Hidetoshi Seto
2010-08-06  1:28                       ` Hidetoshi Seto [this message]
2010-08-05  3:40                   ` Hidetoshi Seto
2010-08-04 23:51                 ` Rafael J. Wysocki
2010-08-04  8:43             ` [linux-pm] " Hidetoshi Seto
2010-08-04  9:39               ` Kenji Kaneshige
2010-08-04  9:39               ` [linux-pm] " Kenji Kaneshige
2010-08-04 12:15                 ` Rafael J. Wysocki
2010-08-05  3:38                   ` [linux-pm] " Hidetoshi Seto
2010-08-05  3:38                   ` Hidetoshi Seto
2010-08-04 10:38               ` [linux-pm] " Rafael J. Wysocki
2010-08-04 10:38               ` Rafael J. Wysocki
2010-08-04  8:43             ` Hidetoshi Seto
2010-08-04  5:46           ` Kenji Kaneshige
2010-08-03  9:33       ` Rafael J. Wysocki
2010-08-03  7:13     ` Hidetoshi Seto
2010-08-02 21:59 ` Rafael J. Wysocki
2010-08-02 22:00 ` [PATCH 8/8] ACPI / PCI: Reorder checks in acpi_pci_osc_control_set() Rafael J. Wysocki
2010-08-02 22:00 ` Rafael J. Wysocki
2010-08-03  4:51 ` [PATCH 0/8] ACPI / PCI / PCIe: Rework _OSC handling (v2) Kenji Kaneshige
2010-08-03  4:51 ` Kenji Kaneshige

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=4C5B654F.2090105@jp.fujitsu.com \
    --to=seto.hidetoshi@jp.fujitsu.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /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.