mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: Rob Herring <robh@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: Re: [PATCH 1/2] of/unittest: Show broken behaviour in the platform bus
Date: Tue, 09 Jun 2015 12:05:37 +0100	[thread overview]
Message-ID: <20150609110537.CC767C40580@trevor.secretlab.ca> (raw)
In-Reply-To: <CAL_JsqK0rq6+WeK4hVMYQnKUd2K7co3vi=DpF8pjH6tbt0B5vQ@mail.gmail.com>

On Mon, 8 Jun 2015 15:16:39 -0500
, Rob Herring <robh@kernel.org>
 wrote:
> On Sun, Jun 7, 2015 at 9:20 AM, Grant Likely <grant.likely@linaro.org> wrote:
> > Add a single resource to the test bus device to exercise the platform
> > bus code a little more. This isn't strictly a devicetree test, but it is
> > a corner case that the devicetree runs into. Until we've got platform
> > device unittests, it can live here. It doesn't need to be an explicit
> > text because the kernel will oops when it is wrong.
> 
> Isn't the unittest oops'ing a problem?

Yes, but an oops while running unittests automatically means unittests
have failed. :-)

> > Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> > Cc: Wolfram Sang <wsa@the-dreams.de>
> > Cc: Rob Herring <robh@kernel.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> > Signed-off-by: Grant Likely <grant.likely@linaro.org>
> > ---
> >  drivers/of/unittest.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > 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);
> 
> A comment here as to the purpose of this would be useful.

I'll add this:
	/*
	 * Add a dummy resource to the test bus node after it is
	 * registered to catch problems with un-inserted resources. The
	 * DT code doesn't insert the resources, and it has caused the
	 * kernel to oops in the past. This makes sure the same bug
	 * doesn't crop up again.
	 */

g.

  reply	other threads:[~2015-06-09 11:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 14:20 [PATCH 0/2] Fix oops in platform_device resource unregister Grant Likely
2015-06-07 14:20 ` [PATCH 1/2] of/unittest: Show broken behaviour in the platform bus Grant Likely
2015-06-08 20:16   ` Rob Herring
2015-06-09 11:05     ` Grant Likely [this message]
2015-06-15 16:45   ` Wolfram Sang
2015-06-07 14:20 ` [PATCH 2/2] drivercore: Fix unregistration path of platform devices Grant Likely
2015-06-07 18:13   ` Ricardo Ribalda Delgado
2015-06-08  8:14     ` Pantelis Antoniou
2015-06-08  8:42       ` Ricardo Ribalda Delgado
2015-06-08 18:47     ` Grant Likely
2015-06-08 20:09       ` Ricardo Ribalda Delgado
2015-06-08 20:47         ` Ricardo Ribalda Delgado
2015-06-09 11:00         ` Grant Likely
2015-06-10  0:22           ` Kevin Hilman
2015-06-10  7:11             ` Ricardo Ribalda Delgado
2015-06-10 14:03               ` Rob Herring
2015-06-16  7:58                 ` Tony Lindgren
2015-06-10 14:38               ` Kevin Hilman
2015-06-10 14:46                 ` Ricardo Ribalda Delgado
2015-06-10 15:34                   ` Greg Kroah-Hartman
2015-06-10 15:40                   ` Greg Kroah-Hartman
2015-06-10 17:11                     ` Grant Likely
2015-06-10 17:12                       ` Pantelis Antoniou
2015-06-10 23:38                       ` Wolfram Sang
2015-06-12 14:00   ` Ricardo Ribalda Delgado
2015-06-15 16:46   ` Wolfram Sang
2015-06-23 17:12     ` Ricardo Ribalda Delgado
2015-07-16 20:33       ` Ricardo Ribalda Delgado
2015-08-22 12:57         ` Ricardo Ribalda Delgado
2015-08-23 21:52         ` Rob Herring
2015-08-23 21:58           ` Ricardo Ribalda Delgado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150609110537.CC767C40580@trevor.secretlab.ca \
    --to=grant.likely@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=robh@kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®