linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jeffrey Hugo <quic_jhugo@quicinc.com>
Cc: Greg KH <greg@kroah.com>, Stephen Rothwell <sfr@canb.auug.org.au>,
	Oded Gabbay <ogabbay@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	DRI <dri-devel@lists.freedesktop.org>,
	Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: linux-next: build failure after merge of the driver-core tree
Date: Tue, 11 Apr 2023 20:21:22 +0200	[thread overview]
Message-ID: <ZDWlIuRHYPP1DeYi@phenom.ffwll.local> (raw)
In-Reply-To: <19e3438f-8e85-9da4-cd9d-8fc19559abd7@quicinc.com>

On Tue, Apr 11, 2023 at 11:18:29AM -0600, Jeffrey Hugo wrote:
> On 4/11/2023 10:31 AM, Daniel Vetter wrote:
> > On Tue, Apr 11, 2023 at 09:29:27AM -0600, Jeffrey Hugo wrote:
> > > On 4/11/2023 9:26 AM, Jeffrey Hugo wrote:
> > > > On 4/11/2023 9:13 AM, Greg KH wrote:
> > > > > On Tue, Apr 11, 2023 at 09:08:39AM -0600, Jeffrey Hugo wrote:
> > > > > > On 4/11/2023 9:01 AM, Daniel Vetter wrote:
> > > > > > > On Tue, Apr 11, 2023 at 12:40:28PM +0200, Greg KH wrote:
> > > > > > > > On Tue, Apr 11, 2023 at 11:55:20AM +0200, Daniel Vetter wrote:
> > > > > > > > > On Tue, Apr 11, 2023 at 02:38:12PM +1000, Stephen Rothwell wrote:
> > > > > > > > > > Hi all,
> > > > > > > > > > 
> > > > > > > > > > After merging the driver-core tree, today's linux-next build (x86_64
> > > > > > > > > > allmodconfig) failed like this:
> > > > > > > > > > 
> > > > > > > > > > In file included from include/linux/linkage.h:7,
> > > > > > > > > >                     from include/linux/kernel.h:17,
> > > > > > > > > >                     from drivers/accel/qaic/mhi_qaic_ctrl.c:4:
> > > > > > > > > > drivers/accel/qaic/mhi_qaic_ctrl.c: In function
> > > > > > > > > > 'mhi_qaic_ctrl_init':
> > > > > > > > > > include/linux/export.h:27:22: error: passing
> > > > > > > > > > argument 1 of 'class_create' from incompatible
> > > > > > > > > > pointer type
> > > > > > > > > > [-Werror=incompatible-pointer-types]
> > > > > > > > > >       27 | #define THIS_MODULE (&__this_module)
> > > > > > > > > >          |                     ~^~~~~~~~~~~~~~~
> > > > > > > > > >          |                      |
> > > > > > > > > >          |                      struct module *
> > > > > > > > > > drivers/accel/qaic/mhi_qaic_ctrl.c:544:38: note:
> > > > > > > > > > in expansion of macro 'THIS_MODULE'
> > > > > > > > > >      544 |         mqc_dev_class =
> > > > > > > > > > class_create(THIS_MODULE,
> > > > > > > > > > MHI_QAIC_CTRL_DRIVER_NAME);
> > > > > > > > > >          |                                      ^~~~~~~~~~~
> > > > > > > > > > In file included from include/linux/device.h:31,
> > > > > > > > > >                     from include/linux/mhi.h:9,
> > > > > > > > > >                     from drivers/accel/qaic/mhi_qaic_ctrl.c:5:
> > > > > > > > > > include/linux/device/class.h:229:54: note:
> > > > > > > > > > expected 'const char *' but argument is of type
> > > > > > > > > > 'struct module *'
> > > > > > > > > >      229 | struct class * __must_check
> > > > > > > > > > class_create(const char *name);
> > > > > > > > > >          |                                          ~~~~~~~~~~~~^~~~
> > > > > > > > > > drivers/accel/qaic/mhi_qaic_ctrl.c:544:25:
> > > > > > > > > > error: too many arguments to function
> > > > > > > > > > 'class_create'
> > > > > > > > > >      544 |         mqc_dev_class =
> > > > > > > > > > class_create(THIS_MODULE,
> > > > > > > > > > MHI_QAIC_CTRL_DRIVER_NAME);
> > > > > > > > > >          |                         ^~~~~~~~~~~~
> > > > > > > > > > include/linux/device/class.h:229:29: note: declared here
> > > > > > > > > >      229 | struct class * __must_check
> > > > > > > > > > class_create(const char *name);
> > > > > > > > > >          |                             ^~~~~~~~~~~~
> > > > > > > > > > 
> > > > > > > > > > Caused by commit
> > > > > > > > > > 
> > > > > > > > > >      1aaba11da9aa ("driver core: class: remove
> > > > > > > > > > module * from class_create()")
> > > > > > > > > > 
> > > > > > > > > > interacting with commit
> > > > > > > > > > 
> > > > > > > > > >      566fc96198b4 ("accel/qaic: Add mhi_qaic_cntl")
> > > > > > > > > > 
> > > > > > > > > > from the drm tree.
> > > > > > > > > > 
> > > > > > > > > > I have applied the following merge fix patch for today.
> > > > > > > > > > 
> > > > > > > > > > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > > > > > > > > > Date: Tue, 11 Apr 2023 14:16:57 +1000
> > > > > > > > > > Subject: [PATCH] fixup for "driver core: class:
> > > > > > > > > > remove module * from class_create()"
> > > > > > > > > > 
> > > > > > > > > > interacting with "accel/qaic: Add mhi_qaic_cntl"
> > > > > > > > > > 
> > > > > > > > > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > > > > > > > 
> > > > > > > > > Thanks for the fixup. Since Dave is out I've made a
> > > > > > > > > note about this in my
> > > > > > > > > handover mail so it won't get lost in the drm-next
> > > > > > > > > merge window pull. I
> > > > > > > > > don't think we need any other coordination than
> > > > > > > > > mention it in each pull to
> > > > > > > > > Linus, topic tree seems overkill for this. Plus there's no way I can
> > > > > > > > > untangle the drm tree anyway :-).
> > > > > > > > 
> > > > > > > > Want me to submit a patch for the drm tree that moves this to use
> > > > > > > > class_register() instead, which will make the
> > > > > > > > merge/build issue go away
> > > > > > > > for you?  That's my long-term goal here anyway, so converting this new
> > > > > > > > code to this api today would be something I have to do eventually :)
> > > > > > > 
> > > > > > > We kinda closed drm-next for feature work mostly already (just pulling
> > > > > > > stuff in from subtrees), so won't really help for this merge window.
> > > > > > > 
> > > > > > > For everything else I think this is up to Oded, I had no
> > > > > > > idea qaic needed
> > > > > > > it's entire own dev class and I don't want to dig into this
> > > > > > > for the risk I
> > > > > > > might freak out :-)
> > > > > > > 
> > > > > > > Adding Oded.
> > > > > > > 
> > > > > > > Cheers, Daniel
> > > > > > 
> > > > > > Sorry for the mess.
> > > > > > 
> > > > > > I made a note to update to class_register() once my drm-misc access is
> > > > > > sorted out.  Looks like we'll address the conflict in the merge
> > > > > > window, and
> > > > > > catch the update to the new API in the following release.
> > > > > 
> > > > > Wait, I think the large question is, "why does this need a separate
> > > > > class"?  Why are you not using the accel char device and class?  That is
> > > > > what everything under accel/ should be using, otherwise why put it in
> > > > > there?
> > > > > 
> > > > > And what exactly are you using that class for?  Just device nodes?  If
> > > > > so, how many?
> > > > > 
> > > > > thanks,
> > > > > 
> > > > > greg k-h
> > > > 
> > > > 
> > > > Remember MHI_UCI that then evolved into the WWAN subsystem?  I pointed
> > > > out at the time that AIC100/QAIC would need the same functionality.
> > > > You/Jakub told myself/Mani/Loic that a combined implementation is not
> > > > acceptable, and every area needs to implement their own version of
> > > > MHI_UCI.
> > > > 
> > > > We took the WWAN subsystem and simplified it to meet our needs.
> > > > 
> > > > The functionality is QAIC specific, so wedging it into the Accel node
> > > > seems to be a poor fit as it would subject Habana and iVPU to the same.
> > > 
> > > Also, I forgot to mention.  QAIC is sharing userspace components with WWAN,
> > > so we really cannot diverge from what WWAN has done and define a new API
> > > through the Accel node.
> > 
> > So there is an accel/drm_device in the qaic driver, but there's also this
> > different class thing, which I don't get.
> > 
> > And yeah if that's an entirely orthogonal thing then I guess that should
> > be in a different driver/subsystem, all supported with the aux bus to
> > multiplex the underlying device.
> > 
> > I haven't found any explanation for what MHI is (or any of the other
> > acrynoms), so I'm entirely lost.
> 
> MHI is documented at Documentation/mhi/
> It is also referenced in the QAIC documentation - Documentation/accel/qaic/
> 
> It stands for "Modem Host Interface" (arguably a bad name now, but you can
> guess where it came from).  It is a Qualcomm hardware block and associated
> software protocol that provides logical channels over a hardware link.  Most
> commonly used for PCIe.
> 
> Pretty much any modern Qualcomm PCIe device implements it.  4G modems, 5G
> modems, Wifi adapters, AIC100, etc.  Instead of talking "PCIe", the host
> talks "MHI" to the devices in most cases.
> 
> The core implementation for MHI exists in drivers/bus/mhi
> 
> MHI_UCI is the MHI Userspace Character Interface.  It looked like most buses
> (eg USB) provide some direct device access to userspace.  MHI_UCI was
> formulated along those same lines - provide direct userspace access to a
> whitelist of channels.  Qualcomm provides some fairly extensive userspace
> utilities, and various communities have developed open source alternatives
> using this mechanism.
> 
> MHI_UCI was proposed to the community as the common driver (misc device) for
> all of the MHI devices.  The Net folks came along, saw that it was used for
> 4G/5G modems (Wireless Wide Area Network devices or WWAN) and decided that
> they would not tolerate a common implementation.  They NACK'd MHI_UCI and
> required that a WWAN specific subsystem be developed which would only
> service WWAN devices.  The Net folks decreed that other subsystems which
> needed the same functionality need to have their own copy of the
> implementation.
> 
> QAIC devices expose Sahara (a boot time protocol) which has an existing
> userspace that is also used with Modems, although it looks like WWAN doesn't
> currently support those generations of products today.  QAIC devices also
> support DIAG, which is currently supported in WWAN.  The intent was to add
> the QAIC support for DIAG at a later time since it is not required for the
> bare minimum viable driver.
> 
> So, QAIC devices support the same services, would use the same userspace,
> but can't use a common implementation because Jakub(net) doesn't want to
> share and convinced Greg to go along.  I'm not interested in pushing a cross
> tree fight (arguably already did that with MHI_UCI).  If neither Greg nor
> Net will accept a common implementation that accelerators can use (QAIC),
> then the only place I can fit this is in the Accel area.
> 
> Using aux bus seems to make little difference if QAIC is the only consumer
> of this.  I'm willing to refactor the implementation with some feedback and
> guidence, but the uAPI seems set in stone due to the existing userspace and
> WWAN (char devs with open/close/read/write/poll).

Ok, so MHI _is_ the bus. Thanks for the explainer, I should have searched
a bit more in Documentation/

> What would make you less unhappy?

The MHI generic userspace driver interface needs to be in drivers/bus/mhi,
not in a random driver. I think we should revert 566fc96198b4
("accel/qaic: Add mhi_qaic_cntl") and re-land that through Greg's tree (or
wherever mhi patches go to). This of course assuming that the accel
userspace on top of the accel/drm_device does work stand-alone, and it's
just the tooling and other userspace that needs MHI_UCI. If we end with a
non-functional stack due to that, then I guess the entire driver is a bit
up for questions, because at least the accel runtime is supposed to just
run on top of the accel devnode and nothing else. Otherwise container
stuff gets really bad, among a lot of other things.

Cheers, Daniel



> 
> > -Daniel
> > 
> > > 
> > > > 
> > > > We need (eventually) 128 device nodes.  We have systems with 32 QAIC
> > > > devices, and each QAIC device uses 4 device nodes (32 * 4 = 128).  WWAN
> > > > subsystem would be similar.  Looks like each 5G modem is 6 nodes per
> > > > device, so if you had 22 5G modems on a system, you'd have 132 device
> > > > nodes.  I'm not aware of any such system, but it could exist.
> > > > 
> > > > -Jeff
> > > 
> > 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2023-04-11 18:21 UTC|newest]

Thread overview: 181+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  4:38 linux-next: build failure after merge of the driver-core tree Stephen Rothwell
2023-04-11  9:55 ` Daniel Vetter
2023-04-11 10:40   ` Greg KH
2023-04-11 15:01     ` Daniel Vetter
2023-04-11 15:08       ` Jeffrey Hugo
2023-04-11 15:13         ` Greg KH
2023-04-11 15:26           ` Jeffrey Hugo
2023-04-11 15:29             ` Jeffrey Hugo
2023-04-11 16:31               ` Daniel Vetter
2023-04-11 17:18                 ` Jeffrey Hugo
2023-04-11 18:21                   ` Daniel Vetter [this message]
2023-04-11 18:37                     ` Jeffrey Hugo
2023-04-11 18:47                       ` Daniel Vetter
2023-04-12  6:11                         ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2023-08-15  7:24 Stephen Rothwell
2023-08-15 15:21 ` Greg KH
2023-08-16  7:39   ` Maxime Ripard
2023-03-27  4:46 Stephen Rothwell
2023-03-27  7:33 ` Greg KH
2023-03-27  8:22   ` Stephen Rothwell
2023-03-27  9:15     ` Greg KH
2023-03-27 15:09       ` Vasily Gorbik
2023-01-30  4:28 Stephen Rothwell
2023-01-30 16:01 ` Greg KH
2023-01-30 16:23   ` Geert Uytterhoeven
2022-12-01  2:18 Stephen Rothwell
2022-11-30  1:38 Stephen Rothwell
2022-11-30 12:01 ` Greg KH
2022-11-28  2:36 Stephen Rothwell
2022-11-28 11:50 ` Greg KH
2022-11-28 12:44   ` Stephen Rothwell
2022-11-28 16:22     ` Greg KH
2022-11-28 19:46       ` Stephen Rothwell
2022-11-29  8:28         ` Greg KH
2022-11-28 17:35     ` Greg KH
2022-11-14  4:12 Stephen Rothwell
2022-11-14  8:46 ` Andy Shevchenko
2022-11-14  8:59   ` Greg KH
2021-07-23  5:09 Stephen Rothwell
2021-07-23  5:34 ` Uwe Kleine-König
2021-08-10 12:13   ` Geert Uytterhoeven
2021-08-12 20:51     ` Doug Anderson
2021-02-10 10:47 Stephen Rothwell
2021-02-10 18:18 ` Greg KH
2021-02-10 19:06   ` Saravana Kannan
2021-02-10 19:17     ` Saravana Kannan
2021-02-10 19:36       ` Greg KH
2021-02-10 20:14       ` Rob Herring
2021-02-10 20:43         ` Saravana Kannan
2021-02-10 20:59           ` Rob Herring
2020-09-09  5:47 Stephen Rothwell
2020-09-09  7:21 ` Greg KH
2020-09-09 21:47   ` Kees Cook
2020-09-09  7:28 ` Greg KH
2020-07-27  6:55 Stephen Rothwell
2020-07-27 10:17 ` Greg KH
2020-07-28 19:53   ` Kees Cook
2019-09-18 17:09 Mark Brown
2019-09-18 18:52 ` Greg KH
2019-09-18 19:03   ` Linus Torvalds
2019-09-18 19:07     ` Greg KH
2019-09-18 20:56       ` Suzuki K Poulose
2019-09-18 21:55     ` Mark Brown
2019-08-29  7:35 Stephen Rothwell
2019-08-29 10:10 ` Greg KH
2019-02-01  2:41 Stephen Rothwell
2019-02-01 14:18 ` Greg KH
2017-06-13  6:04 Stephen Rothwell
2017-06-13  6:20 ` Greg KH
2017-06-13  6:25   ` Stephen Rothwell
2017-06-13  6:30   ` Sergey Senozhatsky
2016-05-02  5:42 Stephen Rothwell
2016-05-02 11:40 ` William Breathitt Gray
2016-05-02 14:47   ` Greg KH
2015-05-21  7:52 Stephen Rothwell
2014-12-01  7:49 Stephen Rothwell
2014-05-28  8:03 Stephen Rothwell
2014-05-28  9:30 ` Jean Delvare
2014-03-12  0:51 Mark Brown
2014-03-12  1:50 ` Greg KH
2014-03-12  3:55   ` Benjamin Herrenschmidt
2014-03-12 11:37     ` Mark Brown
2014-03-12 19:59       ` Benjamin Herrenschmidt
2014-03-12 20:02         ` Tejun Heo
2014-03-12 20:14           ` Benjamin Herrenschmidt
2014-03-12 20:21             ` Tejun Heo
2014-03-13  0:37               ` Benjamin Herrenschmidt
2014-03-13 22:14                 ` Benjamin Herrenschmidt
2014-03-14 13:00                   ` Tejun Heo
2014-03-15  0:03                   ` Greg KH
2014-03-15  2:57                     ` Benjamin Herrenschmidt
2014-03-15  5:29                       ` Greg KH
2014-03-15  7:14                         ` Benjamin Herrenschmidt
2014-03-16 23:16                         ` Stephen Rothwell
2014-03-17 18:36                           ` Greg KH
2014-03-16 23:16   ` Stephen Rothwell
2014-03-17 18:33     ` Greg KH
2014-03-17 20:33       ` Benjamin Herrenschmidt
2014-03-17 21:56         ` Greg KH
2014-03-17 22:05           ` Tejun Heo
2014-03-17 22:21             ` Tejun Heo
2014-03-18  0:07               ` Stewart Smith
2014-03-18  0:22               ` Benjamin Herrenschmidt
2014-03-18 15:58                 ` Tejun Heo
2014-03-18  0:00           ` Stewart Smith
2014-03-18  0:16           ` Benjamin Herrenschmidt
2014-03-17  8:28 ` Stephen Rothwell
2013-08-22  5:39 Stephen Rothwell
2013-08-22 15:36 ` Greg KH
2013-01-18  2:29 Stephen Rothwell
2013-01-18  4:13 ` Greg KH
2013-01-18 14:14   ` Kondratiev, Vladimir
2012-08-17  4:01 Stephen Rothwell
2012-08-17 13:25 ` Greg KH
2012-07-10  5:32 Stephen Rothwell
2012-07-10  9:03 ` Mark Brown
2012-07-10 11:14   ` Stephen Rothwell
2012-07-10 21:10     ` Linus Walleij
2012-05-01  4:59 Stephen Rothwell
2012-05-01  7:05 ` Bart Van Assche
2012-05-01 13:45 ` Greg KH
2012-04-19  4:48 Stephen Rothwell
2012-04-19 20:07 ` Greg KH
2012-04-20  2:19 ` Greg KH
2012-01-27  2:59 Stephen Rothwell
2012-01-27 15:24 ` Alan Stern
2012-01-27 22:36 ` Greg KH
2012-01-05  6:28 Stephen Rothwell
2012-01-05 23:20 ` Greg KH
2011-12-28  6:45 Stephen Rothwell
2012-01-03 16:21 ` Greg KH
2012-01-04  0:07   ` Kay Sievers
2012-01-04  0:31     ` Greg KH
2012-01-04 22:03       ` Kay Sievers
2012-01-04 23:13         ` Greg KH
2012-01-04 23:07 ` Greg KH
2012-01-04 23:48   ` Stephen Rothwell
2012-01-05  0:01     ` Kay Sievers
2012-01-05  0:17       ` Stephen Rothwell
2012-01-05  0:57       ` Josh Triplett
2011-12-15  6:37 Stephen Rothwell
2011-12-15  7:21 ` Greg KH
2011-12-15 10:10   ` Kay Sievers
2011-12-15 19:09     ` Greg KH
2011-12-14  4:48 Stephen Rothwell
2011-12-14  9:24 ` Peter Zijlstra
2011-12-14 15:03   ` Greg KH
2011-12-14 15:13     ` Peter Zijlstra
2011-12-14 17:01       ` Greg KH
2011-12-14 19:24         ` Greg KH
2011-11-21  1:57 Stephen Rothwell
2010-08-04  4:25 Stephen Rothwell
2010-08-04  4:44 ` Guenter Roeck
2010-08-04 15:52 ` Greg KH
2010-08-04 21:24 ` Jesse Barnes
2010-05-18  6:45 Stephen Rothwell
2010-05-18  7:00 ` Eric W. Biederman
2010-05-18  7:48   ` Al Viro
2010-05-18  7:54   ` Stephen Rothwell
2010-05-18 10:35     ` Eric W. Biederman
2010-05-18 15:02       ` Al Viro
2010-05-18 19:58 ` Eric W. Biederman
2010-05-18 21:25   ` Greg KH
2010-05-18 21:59     ` Eric W. Biederman
2010-05-18  6:44 Stephen Rothwell
2010-05-18 14:02 ` Greg KH
2010-05-18 14:04   ` Chris Wright
2010-05-18 21:06   ` Chris Wright
2010-05-18 21:24     ` Greg KH
2010-03-17  4:41 Stephen Rothwell
2010-03-17  7:21 ` Neil Brown
2010-03-17 15:51   ` Sage Weil
2010-03-17 22:30     ` Stephen Rothwell
2010-03-24  1:37     ` Neil Brown
2010-03-24 14:54       ` Sage Weil
2010-03-03  6:14 Stephen Rothwell
2010-03-03  6:31 ` Stephen Rothwell
2010-02-16  6:39 Stephen Rothwell
2010-02-16  9:01 ` Jean Delvare
2010-02-17  4:56   ` Greg KH
2010-02-18  4:27     ` Greg KH

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=ZDWlIuRHYPP1DeYi@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=quic_pkanojiy@quicinc.com \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).