From: Pierre-Louis Bossart <email@example.com> To: Jason Gunthorpe <firstname.lastname@example.org> Cc: Ranjani Sridharan <email@example.com>, Jeff Kirsher <firstname.lastname@example.org>, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, Fred Oh <email@example.com> Subject: Re: [net-next v4 10/12] ASoC: SOF: Introduce descriptors for SOF client Date: Fri, 22 May 2020 10:33:20 -0500 [thread overview] Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <20200522145542.GI17583@ziepe.ca> On 5/22/20 9:55 AM, Jason Gunthorpe wrote: > On Fri, May 22, 2020 at 09:29:57AM -0500, Pierre-Louis Bossart wrote: >> >>>>>> + ret = virtbus_register_device(vdev); >>>>>> + if (ret < 0) >>>>>> + return ret; >>>>>> + >>>>>> + /* make sure the probe is complete before updating client list >>>>>> */ >>>>>> + timeout = msecs_to_jiffies(SOF_CLIENT_PROBE_TIMEOUT_MS); >>>>>> + time = wait_for_completion_timeout(&cdev->probe_complete, >>>>>> timeout); >>>>> >>>>> This seems bonkers - the whole point of something like virtual bus is >>>>> to avoid madness like this. >>>> >>>> Thanks for your review, Jason. The idea of the times wait here is to >>>> make the registration of the virtbus devices synchronous so that the >>>> SOF core device has knowledge of all the clients that have been able to >>>> probe successfully. This part is domain-specific and it works very well >>>> in the audio driver case. >>> >>> This need to be hot plug safe. What if the module for this driver is >>> not available until later in boot? What if the user unplugs the >>> driver? What if the kernel runs probing single threaded? >>> >>> It is really unlikely you can both have the requirement that things be >>> synchronous and also be doing all the other lifetime details properly.. >> >> Can you suggest an alternate solution then? > > I don't even know what problem you are trying to solve. > >> The complete/wait_for_completion is a simple mechanism to tell that the >> action requested by the parent is done. Absent that, we can end-up in a >> situation where the probe may fail, or the requested module does not exist, >> and the parent knows nothing about the failure - so the system is in a >> zombie state and users are frustrated. It's not great either, is it? > > Maybe not great, but at least it is consistent with all the lifetime > models and the operation of the driver core. I agree your comments are valid ones, I just don't have a solution to be fully compliant with these models and report failures of the driver probe for a child device due to configuration issues (bad audio topology, etc). My understanding is that errors on probe are explicitly not handled in the driver core, see e.g. comments such as: /* * Ignore errors returned by ->probe so that the next driver can try * its luck. */ https://elixir.bootlin.com/linux/latest/source/drivers/base/dd.c#L636 If somehow we could request the error to be reported then probably we wouldn't need this complete/wait_for_completion mechanism as a custom notification. >> This is not an hypothetical case, we've had this recurring problem when a >> PCI device creates an audio card represented as a platform device. When the >> card registration fails, typically due to configuration issues, the PCI >> probe still completes. That's really confusing and the source of lots of >> support questions. If we use these virtual bus extensions to stpo abusing >> platform devices, it'd be really nice to make those unreported probe >> failures go away. > > I think you need to address this in some other way that is hot plug > safe. > > Surely you can make this failure visible to users in some other way? Not at the moment, no. there are no failures reported in dmesg, and the user does not see any card created. This is a silent error. This is probably domain-specific btw, the use of complete() is only part of the SOF core where we extended the virtual bus to support SOF clients. This is not a requirement in general for virtual bus users. We are not forcing anyone to rely on this complete/wait_for_completion, and if someone has a better idea to help us report probe failures we are all ears.
next prev parent reply other threads:[~2020-05-22 15:33 UTC|newest] Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-20 7:02 [net-next v4 00/12][pull request] 100GbE Intel Wired LAN Driver Updates 2020-05-19 Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 01/12] Implementation of Virtual Bus Jeff Kirsher 2020-05-21 14:57 ` Parav Pandit 2020-05-21 17:43 ` gregkh 2020-05-21 20:10 ` Jason Gunthorpe 2020-05-20 7:02 ` [net-next v4 02/12] ice: Create and register virtual bus for RDMA Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 03/12] ice: Complete RDMA peer registration Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 04/12] ice: Support resource allocation requests Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 05/12] ice: Enable event notifications Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 06/12] ice: Allow reset operations Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 07/12] ice: Pass through communications to VF Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 08/12] i40e: Move client header location Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 09/12] i40e: Register a virtbus device to provide RDMA Jeff Kirsher 2020-05-20 7:02 ` [net-next v4 10/12] ASoC: SOF: Introduce descriptors for SOF client Jeff Kirsher 2020-05-20 7:20 ` Greg KH 2020-05-20 12:54 ` Jason Gunthorpe 2020-05-20 12:57 ` Jason Gunthorpe 2020-05-21 21:11 ` Ranjani Sridharan 2020-05-21 23:34 ` Jason Gunthorpe 2020-05-22 14:29 ` Pierre-Louis Bossart 2020-05-22 14:55 ` Jason Gunthorpe 2020-05-22 15:33 ` Pierre-Louis Bossart [this message] 2020-05-22 17:10 ` Jason Gunthorpe 2020-05-22 18:35 ` Pierre-Louis Bossart 2020-05-22 18:40 ` Jason Gunthorpe 2020-05-22 18:48 ` Pierre-Louis Bossart 2020-05-22 19:44 ` Jason Gunthorpe 2020-05-22 21:05 ` Pierre-Louis Bossart 2020-06-29 20:59 ` Mark Brown 2020-05-23 6:23 ` Greg KH 2020-05-23 19:41 ` Pierre-Louis Bossart 2020-05-24 6:35 ` Greg KH 2020-05-26 13:15 ` Pierre-Louis Bossart 2020-05-26 13:37 ` Takashi Iwai 2020-05-27 7:17 ` Greg KH 2020-05-27 14:05 ` Pierre-Louis Bossart 2020-06-29 20:33 ` Mark Brown 2020-06-29 22:59 ` Jason Gunthorpe 2020-06-29 23:13 ` Kirsher, Jeffrey T 2020-06-30 10:31 ` Mark Brown 2020-06-30 11:32 ` Jason Gunthorpe 2020-06-30 14:16 ` Mark Brown 2020-06-30 17:24 ` Ranjani Sridharan 2020-06-30 17:27 ` Jason Gunthorpe 2020-07-01 9:50 ` Mark Brown 2020-07-01 23:32 ` Jason Gunthorpe 2020-07-02 11:15 ` Mark Brown 2020-07-02 12:11 ` Jason Gunthorpe 2020-07-02 12:20 ` Mark Brown 2020-07-01 6:59 ` Greg KH 2020-07-02 13:43 ` Ranjani Sridharan 2020-07-06 23:02 ` Dan Williams 2020-07-07 14:16 ` Greg KH 2020-05-25 16:55 ` Jason Gunthorpe 2020-06-29 20:21 ` Mark Brown 2020-06-29 17:36 ` Mark Brown 2020-05-20 7:02 ` [net-next v4 11/12] ASoC: SOF: Create client driver for IPC test Jeff Kirsher 2020-05-20 7:22 ` Greg KH 2020-05-20 12:56 ` Jason Gunthorpe 2020-05-27 20:18 ` Ranjani Sridharan 2020-05-28 0:12 ` Jason Gunthorpe 2020-05-28 1:40 ` Ranjani Sridharan 2020-05-28 10:45 ` Greg KH 2020-06-29 20:37 ` Mark Brown 2020-05-20 7:02 ` [net-next v4 12/12] ASoC: SOF: ops: Add new op for client registration Jeff Kirsher 2020-05-20 7:23 ` Greg KH 2020-05-20 7:17 ` [net-next v4 00/12][pull request] 100GbE Intel Wired LAN Driver Updates 2020-05-19 Greg KH 2020-05-20 7:25 ` Kirsher, Jeffrey T 2020-05-20 9:08 ` 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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: [net-next v4 10/12] ASoC: SOF: Introduce descriptors for SOF client' \ /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
This is a public inbox, see mirroring instructions on how to clone and mirror all data and code used for this inbox