[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54BF3B24.10209@linux.intel.com>
Date: Wed, 21 Jan 2015 13:37:40 +0800
From: Jiang Liu <jiang.liu@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
CC: Thomas Gleixner <tglx@...utronix.de>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yinghai Lu <yinghai@...nel.org>,
Borislav Petkov <bp@...en8.de>, Len Brown <lenb@...nel.org>,
Tony Luck <tony.luck@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org
Subject: Re: [RFC Patch 15/19] ACPI: Add field offset to struct resource_list_entry
On 2015/1/21 8:53, Rafael J. Wysocki wrote:
> On Thursday, January 08, 2015 10:33:02 AM Jiang Liu wrote:
>> Add field offset to struct resource_list_entry to host address space
>> translation offset so it could be used to represent bridge resources.
>>
>> Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
>> ---
>> drivers/acpi/resource.c | 13 ++++++++-----
>> include/linux/acpi.h | 1 +
>> 2 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
>> index 16d334a1ee25..54204ac94f8e 100644
>> --- a/drivers/acpi/resource.c
>> +++ b/drivers/acpi/resource.c
>> @@ -462,7 +462,8 @@ struct res_proc_context {
>> };
>>
>> static acpi_status acpi_dev_new_resource_entry(struct resource *r,
>> - struct res_proc_context *c)
>> + struct res_proc_context *c,
>> + resource_size_t offset)
>> {
>> struct resource_list_entry *rentry;
>>
>> @@ -472,6 +473,7 @@ static acpi_status acpi_dev_new_resource_entry(struct resource *r,
>> return AE_NO_MEMORY;
>> }
>> rentry->res = *r;
>> + rentry->offset = offset;
>> list_add_tail(&rentry->node, c->list);
>> c->count++;
>> return AE_OK;
>> @@ -480,6 +482,7 @@ static acpi_status acpi_dev_new_resource_entry(struct resource *r,
>> static acpi_status acpi_dev_process_resource(struct acpi_resource *ares,
>> void *context)
>> {
>> + resource_size_t offset = 0;
>> struct res_proc_context *c = context;
>> struct resource r;
>> int i;
>> @@ -500,14 +503,14 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares,
>>
>> if (acpi_dev_resource_memory(ares, &r)
>> || acpi_dev_resource_io(ares, &r)
>> - || acpi_dev_resource_address_space(ares, &r, NULL)
>> - || acpi_dev_resource_ext_address_space(ares, &r, NULL))
>> - return acpi_dev_new_resource_entry(&r, c);
>> + || acpi_dev_resource_address_space(ares, &r, &offset)
>> + || acpi_dev_resource_ext_address_space(ares, &r, &offset))
>> + return acpi_dev_new_resource_entry(&r, c, offset);
>>
>> for (i = 0; acpi_dev_resource_interrupt(ares, i, &r); i++) {
>> acpi_status status;
>>
>> - status = acpi_dev_new_resource_entry(&r, c);
>> + status = acpi_dev_new_resource_entry(&r, c, 0);
>> if (ACPI_FAILURE(status))
>> return status;
>> }
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index bde8119f5897..fea78e772450 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -300,6 +300,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
>> struct resource_list_entry {
>> struct list_head node;
>> struct resource res;
>> + resource_size_t offset;
>
> Well, so instead of adding the offset thing here and there, wouldn't it be
> cleaner to introduce something like
>
> struct ext_resource {
> sturct resource res;
> resource_size_t offset;
> };
>
> and use struct ext_resource instead of struct resource where an offset is needed?
>
> Just a thought ...
Hi Rafael,
Following patches will achieve this by sharing struct resource_list_entry.
Regards!
Gerry
>
>> };
>>
>> void acpi_dev_free_resource_list(struct list_head *list);
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists