From patchwork Sun Jun 7 11:16:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 6561671 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 789539F326 for ; Sun, 7 Jun 2015 17:01:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FF3320453 for ; Sun, 7 Jun 2015 17:01:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9756E20451 for ; Sun, 7 Jun 2015 17:01:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbbFGQ7u (ORCPT ); Sun, 7 Jun 2015 12:59:50 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:34536 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202AbbFGQ7c (ORCPT ); Sun, 7 Jun 2015 12:59:32 -0400 Received: by wgv5 with SMTP id 5so86917157wgv.1 for ; Sun, 07 Jun 2015 09:59:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:subject:to:cc:in-reply-to:references :date:message-id; bh=AJRUSAMQJ0FoC6kZa1L57s4d0UI/QgtZclqDaNTue4Q=; b=Xskhl/K6OcbedvDrZPzoN5maLkdL9/m1rtHWDXPwyaEjNKdL3VZGxbKMUUx/TYH940 nxT+TuZypDfsXXXhVK+Ry7+74jxAT22fjK74KL+Ly1StCFXBq1nS1Y0ALQ4SbTgvRkom TYGGxCnTNkU0ff4pONrcyDlcTQxTTxoPX5tl1bkpgs2Nw65rYQPMSFKNyezVlLRR4AF7 HZo46CAy3/PzzeEuphlX7hk//x8qwO6gPnHUJEpQLRq/jD5LCNaDGHj6Dd+0OBUQeNvk TMzRqfScRLGQPdzy81di0nFcYzuQZMTv5r2XK91v4Adsro+0JwxeQtU5DmWIm134lHL4 JjOQ== X-Gm-Message-State: ALoCoQmcRDjw1G96JyeMXsznLkAddRN4+rUVfjf3BLAgiq+d3rqmU5HqeCqpaBg6L30vgumeYcz3 X-Received: by 10.180.73.236 with SMTP id o12mr14577199wiv.56.1433696371534; Sun, 07 Jun 2015 09:59:31 -0700 (PDT) Received: from trevor.secretlab.ca (host81-159-186-103.range81-159.btcentralplus.com. [81.159.186.103]) by mx.google.com with ESMTPSA id gw7sm7550401wib.15.2015.06.07.09.59.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jun 2015 09:59:28 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id CC7A4C410F0; Sun, 7 Jun 2015 20:16:32 +0900 (JST) From: Grant Likely Subject: Re: [PATCH] TESTCASE: of: OOPS when disabling node via OF_DYNAMIC To: Pantelis Antoniou , Wolfram Sang Cc: devicetree@vger.kernel.org, linux-sh@vger.kernel.org, Magnus Damm , Simon Horman , Laurent Pinchart , Geert Uytterhoeven , Rob Herring , linux-kernel@vger.kernel.org In-Reply-To: <83B5C458-8D49-4EF6-9F4A-6C0E2579AB9F@konsulko.com> References: <1427814771-30335-1-git-send-email-wsa@the-dreams.de> <20150414132709.GA1375@katana> <83B5C458-8D49-4EF6-9F4A-6C0E2579AB9F@konsulko.com> Date: Sun, 07 Jun 2015 12:16:32 +0100 Message-Id: <20150607111632.CC7A4C410F0@trevor.secretlab.ca> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, RCVD_IN_DNSWL_HI, T_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 On Wed, 22 Apr 2015 15:30:28 +0300 , Pantelis Antoniou wrote: > Hi Wolfram, > > > On Apr 14, 2015, at 16:27 , Wolfram Sang wrote: > > > > Hi Pantelis, > > > > thanks for your prompt reply. Unfortunately, I had to wait until I could > > access the test system again. > > > > [snip] > > Sorry for the non-prompt reply; but just for kicks, can you try the attached patch? > > I have a hunch this might be the problem. > > Regards > > — Pantelis > > I played around with this some today. If I'm reading it correctly, the following patch reproduces the same problem: (continued below patch) Acked-by: Pantelis Antoniou --- -- To unsubscribe from this list: send the line "unsubscribe linux-sh" 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/drivers/of/unittest.c b/drivers/of/unittest.c index 18016341d5a9..0a27b38c3041 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -753,6 +753,11 @@ static void __init of_unittest_match_node(void) } } +static struct resource test_bus_res = { + .start = 0xfffffff8, + .end = 0xfffffff9, + .flags = IORESOURCE_MEM, +}; static const struct platform_device_info test_bus_info = { .name = "unittest-bus", }; @@ -795,6 +800,7 @@ static void __init of_unittest_platform_populate(void) if (rc) return; test_bus->dev.of_node = np; + platform_device_add_resources(test_bus, &test_bus_res, 1); of_platform_populate(np, match, NULL, &test_bus->dev); for_each_child_of_node(np, child) { --- I think the fixup patch boils down to the following. It's hard to tell because it combines refactoring with the bug fix. Do I have it correct? If so, I'd rather commit the simple fix which can be committed now for v4.1, and the refactoring can be pushed for v4.2 --- diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ebf034b97278..b3042e6ee3ef 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -377,7 +377,7 @@ int platform_device_add(struct platform_device *pdev) struct resource *r = &pdev->resource[i]; unsigned long type = resource_type(r); - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } @@ -410,7 +410,7 @@ void platform_device_del(struct platform_device *pdev) struct resource *r = &pdev->resource[i]; unsigned long type = resource_type(r); - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } }