From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Umang Jain <umang.jain@ideasonboard.com>,
linux-staging@lists.linux.dev,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Stefan Wahren <stefan.wahren@i2se.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Adrien Thierry <athierry@redhat.com>,
Dan Carpenter <error27@gmail.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Paul Elder <paul.elder@ideasonboard.com>
Subject: Re: [PATCH v5 6/6] staging: vc04_services: vchiq: Register devices with a custom bus_type
Date: Fri, 20 Jan 2023 07:58:49 +0100 [thread overview]
Message-ID: <Y8o7qXl9dSRdt1JO@kroah.com> (raw)
In-Reply-To: <Y8nz1inld2Hwdc5i@pendragon.ideasonboard.com>
On Fri, Jan 20, 2023 at 03:52:22AM +0200, Laurent Pinchart wrote:
> Hi Umang,
>
> Thank you for the patch.
>
> On Thu, Jan 19, 2023 at 05:25:03PM +0530, Umang Jain wrote:
> > The devices that the vchiq interface registers(bcm2835-audio,
>
> Missing space before '('.
>
> > bcm2835-camera) are implemented and exposed by the VC04 firmware.
> > The device tree describes the VC04 itself with the resources
> > required to communicate with it through a mailbox interface. However,
> > the vchiq interface registers these devices as platform devices. This
> > also means the specific drivers for these devices are also getting
>
> Drop one of the two "also".
>
> > registered as platform drivers. This is not correct and a blatant
> > abuse of platform device/driver.
> >
> > Replace the platform device/driver model with a standard device driver
> > model. A custom bus_type, vchiq_bus_type, is created in the vchiq
> > interface which matches the devices to their specific device drivers
> > thereby, establishing driver binding. A struct vchiq_device wraps the
> > struct device for each device being registered on the bus by the vchiq
> > interface.
> >
> > Each device registered will expose a 'name' read-only device attribute
> > in sysfs (/sys/bus/vchiq-bus/devices). New devices and drivers can be
> > added by registering on vchiq_bus_type and adding a corresponding
> > device name entry in the static list of devices, vchiq_devices. There
> > is currently no way to enumerate the VCHIQ devices that are available
> > from the firmware.
>
> Greg, I don't know if you've followed the conversation in earlier mail
> threads, so I'll try to summarize it here.
>
> There are two layers involved: the VCHIQ layer, which has two clients
> (audio and MMAL), and the MMAL layer, which has multiple clients
> (camera, codec, ISP). The reason for this is that audio and mmal are
> separate hardware, while camera, codec and ISP share some hardware
> blocks.
>
> The VCHIQ layer provides a mailbox API to its clients to communicate
> with the firmware, and the MMAL layer provides another API implemented
> on top of the VCHIQ layer. Neither APIs offer a way to discover devices
> dynamically (that's not a feature implemented by the firmware). We've
> decided that implementing two buses would be overkill, so Umang went for
> a single vchiq_bus_type. The only value it provides is to stop abusing
> platform_device. That's pretty much it.
>
> Given the above explanation, do you still think the additional
> complexity introduced by the vchiq bus type is worth it (it more or less
> duplicates a small subset of the platform bus type implementation), and
> are you fine with a single bus type, even if it doesn't exactly match
> the firmware layers ?
Yes, this is the correct way forward. I didn't review the changes yet,
but I see you just gave a good first pass, so I'll wait for the next
revision.
thanks,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-01-20 6:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 11:54 [PATCH v5 0/6] staging: vc04_services: vchiq: Register devices with a custom bus_type Umang Jain
2023-01-19 11:54 ` [PATCH v5 1/6] staging: vc04_services: Drop __VCCOREVER__ remnants Umang Jain
2023-01-19 12:14 ` Greg Kroah-Hartman
2023-01-20 1:22 ` Laurent Pinchart
2023-01-19 11:54 ` [PATCH v5 2/6] staging: vc04_services: bcm2835-audio: Drop include Makefile directive Umang Jain
2023-01-20 1:28 ` Laurent Pinchart
2023-01-20 6:57 ` Greg Kroah-Hartman
2023-01-19 11:55 ` [PATCH v5 3/6] staging: vc04_services: bcm2835-camera: " Umang Jain
2023-01-20 1:32 ` Laurent Pinchart
2023-01-19 11:55 ` [PATCH v5 4/6] staging: vc04_services: vchiq-mmal: " Umang Jain
2023-01-20 1:33 ` Laurent Pinchart
2023-01-19 11:55 ` [PATCH v5 5/6] staging: vc04_services: interface: " Umang Jain
2023-01-20 1:35 ` Laurent Pinchart
2023-01-19 11:55 ` [PATCH v5 6/6] staging: vc04_services: vchiq: Register devices with a custom bus_type Umang Jain
2023-01-20 1:52 ` Laurent Pinchart
2023-01-20 6:58 ` Greg Kroah-Hartman [this message]
2023-01-20 10:56 ` Umang Jain
2023-01-20 15:18 ` Laurent Pinchart
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=Y8o7qXl9dSRdt1JO@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=athierry@redhat.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=error27@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=paul.elder@ideasonboard.com \
--cc=stefan.wahren@i2se.com \
--cc=umang.jain@ideasonboard.com \
/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).