From patchwork Tue Mar 11 17:42:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 329186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BCFDC2C0089 for ; Wed, 12 Mar 2014 04:45:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755126AbaCKRmy (ORCPT ); Tue, 11 Mar 2014 13:42:54 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:64948 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755119AbaCKRmw (ORCPT ); Tue, 11 Mar 2014 13:42:52 -0400 Received: by mail-ie0-f181.google.com with SMTP id tp5so8762634ieb.26 for ; Tue, 11 Mar 2014 10:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=EZYksX7O1TyKnQzzxEooxcr2aWHTxPqGw52OjDprZjI=; b=Aw8zta3bbwxIgGOBmyAwyLVxSwCE5gwdDr18e0klAyW8zdJ4nWjiQXbs2+RZeVJCPM mu/BBFQGmG8fivS7kYVunVTFWa6dTnnA3la9OrY0LwZamP36k7f1tmfV2JLNT4z71qxj /6bP1dho45lIr+flt/ikBOnWtvpxIxy2z8hr+UoR1OC5pzynz/UfRd7Aj106kJjH8JUo l4Y4XdgLwpwNET9Y+ZG2Lfl+LQs2ENM9srrAu0i1RFqRwZ23HRezWhdu3mmKGkd0mq5B xWoQLwQ7Hbm6HEaMDh5q/2a6DYbNzqsLuaBlCpYVvMIWKxYUWo91dlNws6RqHdsl0Y1C LplQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=EZYksX7O1TyKnQzzxEooxcr2aWHTxPqGw52OjDprZjI=; b=OifS/Igyb2pt3w4UjQbR0hLE0g0H3tJyq3X8avv5nkgUwXI5foouT92NxMxXRUxrOR 3RgdIT0fVO8oZlouqCV3UJbwc7QKk72sdJbHwWuygFrG3uWYQukvcIgHMP/Aj6iA855d zixcDO1Hj59trrEi8U7el+DzgA2+i8X1goNDtLxCyNY7aE/l0a7xVXw1Sc5KkVBaIpzv E1TG3stc/xsOe4NX3tCuHL6q2+Y6GNZD91nkiib5r6bvn4c9YeW0d3uvrk2cos67vVAb KaJHf9YEZz628cgNjc65LkfMJxT4oyP2LKCGrS1bRrhOx+iOBAvkaXyOD3CBUe/FvqB1 pb3g== X-Gm-Message-State: ALoCoQlAry6KkPYt7ECQ4SrvUJqgn0MwoJVhj/gpYgFK8F8ZjR+oW6RZf3QCIWEqGMRidvMXrhx+PnUrS7Vl2CVhUnctcUKF+aNt6u5WhPOG8zsjQEZuLQb2o8MDLb/3YdycLY0pdRblVt51nvAmxoyxUryzy/2tr25InBmT9yOAvDxakoqTL5EA9+s/BkoSQpkY8fdrD0oThQWVFTJ9tGavhhTJtH2ykwrW5PHcRHFcvLAbz0O79Cs= X-Received: by 10.43.79.66 with SMTP id zp2mr1702763icb.76.1394559772398; Tue, 11 Mar 2014 10:42:52 -0700 (PDT) Received: from localhost ([172.16.50.109]) by mx.google.com with ESMTPSA id r4sm49071942igh.1.2014.03.11.10.42.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 11 Mar 2014 10:42:51 -0700 (PDT) Subject: [PATCH 2/5] resources: Set type in __request_region() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Paul Bolle , Yinghai Lu , linux-kernel@vger.kernel.org Date: Tue, 11 Mar 2014 11:42:49 -0600 Message-ID: <20140311174249.23084.66300.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140311173556.23084.57635.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140311173556.23084.57635.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We don't set the type (I/O, memory, etc.) of resources added by __request_region(), which leads to confusing messages like this: address space collision: [io 0x1000-0x107f] conflicts with ACPI CPU throttle [??? 0x00001010-0x00001015 flags 0x80000000] Set the type of a new resource added by __request_region() (used by request_region() and request_mem_region()) to the type of its parent. This makes the resource tree internally consistent and fixes messages like the above, where the ACPI CPU throttle resource really is an I/O port region, but request_region() didn't fill in the type, so %pR didn't know how to print it. Sample dmesg showing the issue at the link below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=71611 Reported-by: Paul Bolle Signed-off-by: Bjorn Helgaas --- kernel/resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" 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 a8344dda7049..ae1f742c860c 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -945,8 +945,8 @@ struct resource * __request_region(struct resource *parent, res->name = name; res->start = start; res->end = start + n - 1; - res->flags = IORESOURCE_BUSY; - res->flags |= flags; + res->flags = parent->flags; + res->flags |= IORESOURCE_BUSY | flags; write_lock(&resource_lock);