[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200514155615.GA2963499@kroah.com>
Date: Thu, 14 May 2020 17:56:15 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Jeffrey Hugo <jhugo@...eaurora.org>
Cc: arnd@...db.de, manivannan.sadhasivam@...aro.org,
bjorn.andersson@...aro.org, wufan@...eaurora.org,
pratanan@...eaurora.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 3/8] qaic: Create char dev
On Thu, May 14, 2020 at 09:05:30AM -0600, Jeffrey Hugo wrote:
> Wow, thank you for the near immediate response. I'm am quite impressed.
>
> On 5/14/2020 8:12 AM, Greg KH wrote:
> > On Thu, May 14, 2020 at 08:07:41AM -0600, Jeffrey Hugo wrote:
> > > /* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */
> > > +#include <linux/cdev.h>
> > > +#include <linux/idr.h>
> > > +#include <linux/list.h>
> > > +#include <linux/kref.h>
> > > +#include <linux/mhi.h>
> > > #include <linux/module.h>
> > > #include <linux/msi.h>
> > > +#include <linux/mutex.h>
> > > #include <linux/pci.h>
> > > #include <linux/pci_ids.h>
> > > @@ -13,9 +19,242 @@
> > > #define PCI_DEV_AIC100 0xa100
> > > #define QAIC_NAME "Qualcomm Cloud AI 100"
> > > +#define QAIC_MAX_MINORS 256
> >
> > Why have a max?
> >
> > Why not just use a misc device so you make the logic a lot simple, no
> > class or chardev logic to mess with at all.
>
> It was our understanding that the preference is not to add new misc devices.
Huh, who said that? Not the char/misc maintainer (i.e. me) :)
> As I go and try to find a supporting reference for that, I cannot find one,
> so I'm not entirely sure where that idea came from.
>
> In addition, we see that the Habana Labs driver also uses chardev, and has
> chosen the same max. We assumed that since their driver is already
> accepted, using the same mechanisms where applicable would be the preferred
> approach.
They had good reasons why not to use a chardev and convinced me of it.
If you can't come up with them, then stick with a misc for now please.
> Specific to the max, 256 was chosen as being a factor larger than the
> largest system we have, therefore we figured it wouldn't be hit for a long
> while even as we try to have a look at what might happen down the road.
> Looking at the Habana code, it looks like they have the same value for much
> of the same reasons, although their usecases may vary from ours somewhat.
Max numbers for no good reason are not a good thing to have.
> At this time, I don't think we have a strong requirement for a chardev, so
> we could investigate a switch over to a misc dev if you would prefer that
> over following the Habana Labs precedent. All I ask is a confirmation that
> is the approach you would like to see going forward after reviewing the
> above.
Please use misc.
That is, if you even need a character device node :)
thanks,
greg k-h
Powered by blists - more mailing lists