mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: driverdevel <devel@driverdev.osuosl.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Riley Andrews" <riandrews@android.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH v2 2/2] staging: ion: create one device entry per heap
Date: Tue, 19 Sep 2017 14:39:05 +0200	[thread overview]
Message-ID: <20170919123905.GA17917@kroah.com> (raw)
In-Reply-To: <CA+M3ks7Rz-OZFpARK9pcS+mQm0y2vK+YAHwF=7rCC2HDN7M3=g@mail.gmail.com>

On Tue, Sep 19, 2017 at 01:55:36PM +0200, Benjamin Gaignard wrote:
> >> +
> >>       spin_lock_init(&heap->free_lock);
> >>       heap->free_list_size = 0;
> >>
> >> @@ -595,13 +610,9 @@ static int ion_device_create(void)
> >>       if (!idev)
> >>               return -ENOMEM;
> >>
> >> -     idev->dev.minor = MISC_DYNAMIC_MINOR;
> >> -     idev->dev.name = "ion";
> >> -     idev->dev.fops = &ion_fops;
> >> -     idev->dev.parent = NULL;
> >> -     ret = misc_register(&idev->dev);
> >> +     ret = alloc_chrdev_region(&idev->devt, 0, ION_DEV_MAX, "ion");
> >
> > Did you just change the major number for the device node as well?
> >
> My understanding of alloc_chrdev_region() is that major number is chosen
> dynamically but I don't understand the link with device node, sorry.

Yes, the major is chosen dynamically if you ask for it (like you are
here), but previously you were using the misc major number.  That might
break userspace really badly if it had hard-coded /dev (like lots of
android devices do...)

> > Wow, that's a lot of userspace breakage (both major number, and name),
> > how did you test this?
> 
> I had to write a test by myself:
> https://git.linaro.org/people/benjamin.gaignard/ion_test_application.git/log/?h=one_device_per_heap
> 
> Laura have tried to push a test VGEM but I believe it hasn't be
> accepted yet (I will check)

A "test" program is a bit different than "boots and runs a working
system", right?  Please work with the correct graphics people to ensure
this change works with their code, before resending it.

thanks,

greg k-h

  parent reply	other threads:[~2017-09-19 12:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 10:25 [PATCH v2 0/2] staging: ion: get one device " Benjamin Gaignard
2017-09-19 10:25 ` [PATCH v2 1/2] staging: ion: simplify ioctl args checking function Benjamin Gaignard
2017-09-19 10:25 ` [PATCH v2 2/2] staging: ion: create one device entry per heap Benjamin Gaignard
2017-09-19 11:02   ` Greg KH
2017-09-19 11:55     ` Benjamin Gaignard
2017-09-19 12:08       ` Dan Carpenter
2017-09-19 12:39       ` Greg KH [this message]
2017-09-20  1:01       ` Laura Abbott
2017-09-20  7:47         ` Benjamin Gaignard

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=20170919123905.GA17917@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arve@android.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.com \
    --cc=sumit.semwal@linaro.org \
    /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

Powered by JetHome