xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Port two ACPI fixes from Linux
@ 2015-08-14  3:36 Shannon Zhao
  2015-08-14  3:36 ` [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries Shannon Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Shannon Zhao @ 2015-08-14  3:36 UTC (permalink / raw)
  To: xen-devel, jbeulich; +Cc: shannon.zhao, zhaoshenglong

From: Shannon Zhao <shannon.zhao@linaro.org>

Len Brown (1):
  ACPI: disable ACPI cleanly when bad RSDP found

Tomasz Nowicki (1):
  ACPI/table: Always count matched and successfully parsed entries

 xen/drivers/acpi/tables.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

-- 
2.0.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries
  2015-08-14  3:36 [PATCH v2 0/2] Port two ACPI fixes from Linux Shannon Zhao
@ 2015-08-14  3:36 ` Shannon Zhao
  2015-08-14 10:50   ` Julien Grall
  2015-08-14  3:36 ` [PATCH v2 2/2] ACPI: disable ACPI cleanly when bad RSDP found Shannon Zhao
  2015-08-14 10:24 ` [PATCH v2 0/2] Port two ACPI fixes from Linux Jan Beulich
  2 siblings, 1 reply; 9+ messages in thread
From: Shannon Zhao @ 2015-08-14  3:36 UTC (permalink / raw)
  To: xen-devel, jbeulich
  Cc: Hanjun Guo, Rafael J. Wysocki, shannon.zhao, Tomasz Nowicki,
	zhaoshenglong

From: Tomasz Nowicki <tomasz.nowicki@linaro.org>

Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.

acpi_parse_entries() allows to traverse all available table entries (aka
subtables) by passing max_entries parameter equal to 0, but since its count
variable is only incremented if max_entries is not 0, the function always
returns 0 for max_entries equal to 0.  It would be more useful if it returned
the number of entries matched instead, so make it increment count in that
case too.

Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/drivers/acpi/tables.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index e57cf2a..1da2127 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -239,10 +239,13 @@ acpi_table_parse_entries(char *id,
 		}
 
 		if (entry->type == entry_id
-		    && (!max_entries || count++ < max_entries))
+		    && (!max_entries || count < max_entries)) {
 			if (handler(entry, table_end))
 				return -EINVAL;
 
+			count++;
+		}
+
 		entry = (struct acpi_subtable_header *)
 		    ((unsigned long)entry + entry->length);
 	}
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] ACPI: disable ACPI cleanly when bad RSDP found
  2015-08-14  3:36 [PATCH v2 0/2] Port two ACPI fixes from Linux Shannon Zhao
  2015-08-14  3:36 ` [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries Shannon Zhao
@ 2015-08-14  3:36 ` Shannon Zhao
  2015-08-14 10:24 ` [PATCH v2 0/2] Port two ACPI fixes from Linux Jan Beulich
  2 siblings, 0 replies; 9+ messages in thread
From: Shannon Zhao @ 2015-08-14  3:36 UTC (permalink / raw)
  To: xen-devel, jbeulich; +Cc: Len Brown, shannon.zhao, zhaoshenglong

From: Len Brown <len.brown@intel.com>

Ported from Linux commit 9e3a9d1ed8cc8db93e5c53e9a5b09065bd95de8b.

When ACPI is disabled in the BIOS of this VIA C3 box,
it invalidates the RSDP, which Linux notices:

ACPI Error (tbxfroot-0218): A valid RSDP was not found [20080926]

Bug Linux neglected to disable ACPI at that stage,
and later scribbled on smp_found_config:

ACPI: No APIC-table, disabling MPS

But this box doesn't run well in legacy PIC mode,
it needed IOAPIC mode to perform correctly:

http://lkml.org/lkml/2009/2/5/39

So exit ACPI mode cleanly when we first detect
that it is hopeless.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/drivers/acpi/tables.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 1da2127..6085fda 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -329,7 +329,12 @@ static void __init check_multiple_madt(void)
 
 int __init acpi_table_init(void)
 {
-	acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
+	acpi_status status;
+
+	status = acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0);
+	if (ACPI_FAILURE(status))
+		return 1;
+
 	check_multiple_madt();
 	return 0;
 }
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Port two ACPI fixes from Linux
  2015-08-14  3:36 [PATCH v2 0/2] Port two ACPI fixes from Linux Shannon Zhao
  2015-08-14  3:36 ` [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries Shannon Zhao
  2015-08-14  3:36 ` [PATCH v2 2/2] ACPI: disable ACPI cleanly when bad RSDP found Shannon Zhao
@ 2015-08-14 10:24 ` Jan Beulich
  2015-08-14 14:16   ` Shannon Zhao
  2 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2015-08-14 10:24 UTC (permalink / raw)
  To: Shannon Zhao; +Cc: shannon.zhao, xen-devel

>>> On 14.08.15 at 05:36, <zhaoshenglong@huawei.com> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Len Brown (1):
>   ACPI: disable ACPI cleanly when bad RSDP found
> 
> Tomasz Nowicki (1):
>   ACPI/table: Always count matched and successfully parsed entries

These look good now, but is there a reason you didn't also port
the third commit I had referred you to (95df812dbd)?

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries
  2015-08-14  3:36 ` [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries Shannon Zhao
@ 2015-08-14 10:50   ` Julien Grall
  2015-08-14 11:00     ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Grall @ 2015-08-14 10:50 UTC (permalink / raw)
  To: Shannon Zhao, xen-devel, jbeulich
  Cc: Rafael J. Wysocki, Hanjun Guo, Tomasz Nowicki, shannon.zhao

Hi Shannon,

On 14/08/15 04:36, Shannon Zhao wrote:
> From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
> 
> Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.
> 
> acpi_parse_entries() allows to traverse all available table entries (aka
> subtables) by passing max_entries parameter equal to 0, but since its count
> variable is only incremented if max_entries is not 0, the function always
> returns 0 for max_entries equal to 0.  It would be more useful if it returned
> the number of entries matched instead, so make it increment count in that
> case too.
> 
> Acked-by: Grant Likely <grant.likely@linaro.org>
> Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>

You may want to add an indentation to show this is the commit message
from Linux and not Xen.

One of the reason behind that it's Grant acked the patch for Linux and
not Xen. The patch is nearly the same this time (only the lines change),
but it may happen that we need to fix a bit.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries
  2015-08-14 10:50   ` Julien Grall
@ 2015-08-14 11:00     ` Jan Beulich
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2015-08-14 11:00 UTC (permalink / raw)
  To: Julien Grall, Shannon Zhao
  Cc: Rafael J. Wysocki, xen-devel, Hanjun Guo, Tomasz Nowicki, shannon.zhao

>>> On 14.08.15 at 12:50, <julien.grall@citrix.com> wrote:
> Hi Shannon,
> 
> On 14/08/15 04:36, Shannon Zhao wrote:
>> From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
>> 
>> Ported from Linux commit 4ceacd02f5a1795c5c697e0345ee10beef675290.
>> 
>> acpi_parse_entries() allows to traverse all available table entries (aka
>> subtables) by passing max_entries parameter equal to 0, but since its count
>> variable is only incremented if max_entries is not 0, the function always
>> returns 0 for max_entries equal to 0.  It would be more useful if it 
> returned
>> the number of entries matched instead, so make it increment count in that
>> case too.
>> 
>> Acked-by: Grant Likely <grant.likely@linaro.org>
>> Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> 
> You may want to add an indentation to show this is the commit message
> from Linux and not Xen.
> 
> One of the reason behind that it's Grant acked the patch for Linux and
> not Xen. The patch is nearly the same this time (only the lines change),
> but it may happen that we need to fix a bit.

Which is why I find it generally better to do

S-o-b:
S-o-b:
[Linux commit ...]
S-o-b:

(when no other comments need adding) which implicitly draws a line
between the Linux and Xen tags.

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Port two ACPI fixes from Linux
  2015-08-14 10:24 ` [PATCH v2 0/2] Port two ACPI fixes from Linux Jan Beulich
@ 2015-08-14 14:16   ` Shannon Zhao
  2015-08-14 14:29     ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Shannon Zhao @ 2015-08-14 14:16 UTC (permalink / raw)
  To: Jan Beulich, Shannon Zhao; +Cc: xen-devel

Hi Jan,

On 2015/8/14 18:24, Jan Beulich wrote:
>>>> On 14.08.15 at 05:36, <zhaoshenglong@huawei.com> wrote:
>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> Len Brown (1):
>>    ACPI: disable ACPI cleanly when bad RSDP found
>>
>> Tomasz Nowicki (1):
>>    ACPI/table: Always count matched and successfully parsed entries
>
> These look good now, but is there a reason you didn't also port
> the third commit I had referred you to (95df812dbd)?
>

Oh, sorry, forgot that. So this two patches could go first and port 
95df812dbd later or send a new version with 95df812dbd?

Thanks,
-- 
Shannon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Port two ACPI fixes from Linux
  2015-08-14 14:16   ` Shannon Zhao
@ 2015-08-14 14:29     ` Jan Beulich
  2015-08-14 14:37       ` Shannon Zhao
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2015-08-14 14:29 UTC (permalink / raw)
  To: Shannon Zhao, Shannon Zhao; +Cc: xen-devel

>>> On 14.08.15 at 16:16, <shannon.zhao@linaro.org> wrote:
> On 2015/8/14 18:24, Jan Beulich wrote:
>>>>> On 14.08.15 at 05:36, <zhaoshenglong@huawei.com> wrote:
>>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>>
>>> Len Brown (1):
>>>    ACPI: disable ACPI cleanly when bad RSDP found
>>>
>>> Tomasz Nowicki (1):
>>>    ACPI/table: Always count matched and successfully parsed entries
>>
>> These look good now, but is there a reason you didn't also port
>> the third commit I had referred you to (95df812dbd)?
>>
> 
> Oh, sorry, forgot that. So this two patches could go first and port 
> 95df812dbd later or send a new version with 95df812dbd?

Since the patches will have to wait for the tree to re-open, there's
no big difference to me (I'd hope to have the 3rd patch from you
by the time they all could get committed).

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Port two ACPI fixes from Linux
  2015-08-14 14:29     ` Jan Beulich
@ 2015-08-14 14:37       ` Shannon Zhao
  0 siblings, 0 replies; 9+ messages in thread
From: Shannon Zhao @ 2015-08-14 14:37 UTC (permalink / raw)
  To: Jan Beulich, Shannon Zhao; +Cc: xen-devel



On 2015/8/14 22:29, Jan Beulich wrote:
>>>> On 14.08.15 at 16:16, <shannon.zhao@linaro.org> wrote:
>> On 2015/8/14 18:24, Jan Beulich wrote:
>>>>>> On 14.08.15 at 05:36, <zhaoshenglong@huawei.com> wrote:
>>>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>>>
>>>> Len Brown (1):
>>>>     ACPI: disable ACPI cleanly when bad RSDP found
>>>>
>>>> Tomasz Nowicki (1):
>>>>     ACPI/table: Always count matched and successfully parsed entries
>>>
>>> These look good now, but is there a reason you didn't also port
>>> the third commit I had referred you to (95df812dbd)?
>>>
>>
>> Oh, sorry, forgot that. So this two patches could go first and port
>> 95df812dbd later or send a new version with 95df812dbd?
>
> Since the patches will have to wait for the tree to re-open, there's
> no big difference to me (I'd hope to have the 3rd patch from you
> by the time they all could get committed).
>
Ok, will send a new version.

Thanks,
-- 
Shannon

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-08-14 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14  3:36 [PATCH v2 0/2] Port two ACPI fixes from Linux Shannon Zhao
2015-08-14  3:36 ` [PATCH v2 1/2] ACPI/table: Always count matched and successfully parsed entries Shannon Zhao
2015-08-14 10:50   ` Julien Grall
2015-08-14 11:00     ` Jan Beulich
2015-08-14  3:36 ` [PATCH v2 2/2] ACPI: disable ACPI cleanly when bad RSDP found Shannon Zhao
2015-08-14 10:24 ` [PATCH v2 0/2] Port two ACPI fixes from Linux Jan Beulich
2015-08-14 14:16   ` Shannon Zhao
2015-08-14 14:29     ` Jan Beulich
2015-08-14 14:37       ` Shannon Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).