From patchwork Tue Feb 2 18:55:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kani, Toshi" X-Patchwork-Id: 8194371 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5480BEEE5 for ; Tue, 2 Feb 2016 18:57:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0465202EB for ; Tue, 2 Feb 2016 18:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E52B420270 for ; Tue, 2 Feb 2016 18:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756932AbcBBS50 (ORCPT ); Tue, 2 Feb 2016 13:57:26 -0500 Received: from g4t3425.houston.hp.com ([15.201.208.53]:29273 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933574AbcBBS4W (ORCPT ); Tue, 2 Feb 2016 13:56:22 -0500 Received: from g9t2301.houston.hp.com (g9t2301.houston.hp.com [16.216.185.78]) by g4t3425.houston.hp.com (Postfix) with ESMTP id 5418D4D; Tue, 2 Feb 2016 18:56:21 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.78.168.61]) by g9t2301.houston.hp.com (Postfix) with ESMTP id 9903D4F; Tue, 2 Feb 2016 18:56:20 +0000 (UTC) From: Toshi Kani To: mingo@kernel.org, bp@suse.de, dan.j.williams@intel.com, rjw@rjwysocki.net, akpm@linux-foundation.org Cc: linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Toshi Kani Subject: [PATCH 1/3] resource: Make __request_region to inherit from immediate parent Date: Tue, 2 Feb 2016 11:55:09 -0700 Message-Id: <1454439311-23690-2-git-send-email-toshi.kani@hpe.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1454439311-23690-1-git-send-email-toshi.kani@hpe.com> References: <1454439311-23690-1-git-send-email-toshi.kani@hpe.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __request_region() sets 'flags' from a given 'parent' to inherit its attribute. When a target resource has conflict, this function inserts a resource entry under the conflicted entry by updating 'parent'. In this case, the new resource entry needs to inherit attribute from the updated parent. For instance, request_mem_region() calls __request_region() with 'parent' set to &iomem_resource, which is the root entry of the whole iomem range. When this request results in inserting a new entry "new" under "DEV-A", "new" needs to inherit from the immediate parent "DEV-A" as it holds specific attribute for the range. root (&iomem_resource) : + "DEV-A" + "new" Change __request_region() to set 'flags' and 'desc' of a new entry from the immediate parent. Signed-off-by: Toshi Kani Cc: Ingo Molnar Cc: Borislav Petkov Cc: Andrew Morton Cc: Dan Williams --- kernel/resource.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/resource.c b/kernel/resource.c index 4983430..9df79ff 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -1085,15 +1085,16 @@ struct resource * __request_region(struct resource *parent, res->name = name; res->start = start; res->end = start + n - 1; - res->flags = resource_type(parent) | resource_ext_type(parent); - res->flags |= IORESOURCE_BUSY | flags; - res->desc = IORES_DESC_NONE; write_lock(&resource_lock); for (;;) { struct resource *conflict; + res->flags = resource_type(parent) | resource_ext_type(parent); + res->flags |= IORESOURCE_BUSY | flags; + res->desc = parent->desc; + conflict = __request_resource(parent, res); if (!conflict) break;