From: Greg KH <gregkh@linuxfoundation.org>
To: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: arnd@arndb.de, manivannan.sadhasivam@linaro.org,
bjorn.andersson@linaro.org, wufan@codeaurora.org,
pratanan@codeaurora.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/8] qaic: Create char dev
Date: Thu, 14 May 2020 17:56:15 +0200 [thread overview]
Message-ID: <20200514155615.GA2963499@kroah.com> (raw)
In-Reply-To: <0421a64a-10f3-08df-9ef1-14fdb570db0d@codeaurora.org>
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
next prev parent reply other threads:[~2020-05-14 15:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 14:07 [RFC PATCH 0/8] Qualcomm Cloud AI 100 driver Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 1/8] qaic: Add skeleton driver Jeffrey Hugo
2020-05-15 0:43 ` Jeffrey Hugo
2020-05-15 6:37 ` Greg KH
2020-05-14 14:07 ` [RFC PATCH 2/8] qaic: Add and init a basic mhi controller Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 3/8] qaic: Create char dev Jeffrey Hugo
2020-05-14 14:12 ` Greg KH
2020-05-14 15:05 ` Jeffrey Hugo
2020-05-14 15:56 ` Greg KH [this message]
2020-05-14 16:24 ` Jeffrey Hugo
2020-05-15 21:08 ` Jeffrey Hugo
2020-05-16 7:01 ` Greg KH
2020-05-16 21:29 ` Jeffrey Hugo
2020-05-17 7:14 ` Greg KH
2020-05-17 19:37 ` Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 4/8] qaic: Implement control path Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 5/8] qaic: Implement data path Jeffrey Hugo
2020-05-14 14:14 ` Greg KH
2020-05-14 15:06 ` Jeffrey Hugo
2020-05-14 15:56 ` Greg KH
2020-05-14 16:12 ` Jeffrey Hugo
2020-05-14 16:37 ` Greg KH
2020-05-14 16:45 ` Jeffrey Hugo
2020-05-14 21:36 ` Arnd Bergmann
2020-05-14 22:06 ` Jeffrey Hugo
2020-05-14 22:20 ` Arnd Bergmann
2020-05-14 14:07 ` [RFC PATCH 6/8] qaic: Implement PCI link status error handlers Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 7/8] qaic: Implement MHI error status handler Jeffrey Hugo
2020-05-14 14:07 ` [RFC PATCH 8/8] MAINTAINERS: Add entry for QAIC driver Jeffrey Hugo
2020-05-19 5:08 ` [RFC PATCH 0/8] Qualcomm Cloud AI 100 driver Dave Airlie
2020-05-19 14:57 ` Jeffrey Hugo
2020-05-19 17:41 ` Greg Kroah-Hartman
2020-05-19 18:07 ` Jeffrey Hugo
2020-05-19 18:12 ` Greg Kroah-Hartman
2020-05-19 18:26 ` Jeffrey Hugo
2020-05-20 5:32 ` Greg Kroah-Hartman
2020-05-19 17:33 ` Greg Kroah-Hartman
2020-05-19 6:57 ` Manivannan Sadhasivam
2020-05-19 14:16 ` Jeffrey Hugo
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=20200514155615.GA2963499@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=bjorn.andersson@linaro.org \
--cc=jhugo@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=pratanan@codeaurora.org \
--cc=wufan@codeaurora.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