linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <cyndis@kapsi.fi>,
	linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] gpu: host1x: Ignore clients initialization failure
Date: Thu, 16 Aug 2018 20:20:26 +0300	[thread overview]
Message-ID: <3610451.84tSEqHynW@dimapc> (raw)
In-Reply-To: <2093022.0kn10W7Lqi@dimapc>

On Monday, 13 August 2018 20:48:25 MSK Dmitry Osipenko wrote:
> On Friday, 10 August 2018 02:12:11 MSK Dmitry Osipenko wrote:
> > From time to time new bugs are popping up, causing some host1x client to
> > fail its initialization. Currently a single clients initialization failure
> > causes whole host1x device registration to fail, as a result a single DRM
> > sub-device initialization failure makes whole DRM initialization to fail.
> > Let's ignore clients initialization failure, as a result display panel
> > lights up even if some DRM clients (say GR2D or VIC) fail to initialize.
> > Actually VIC fails if initramfs misses the firmware file, so with this
> > change a serial console isn't needed anymore to figure out why display
> > isn't working.
> > 
> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> > ---
> > 
> > Changelog:
> > 
> > v2: Added WARN_ON() that should get more attention than just a error
> > message. Made clients_lock to lock around the lists modification, that is
> > in line with the rest of the code.
> > 
> >  drivers/gpu/host1x/bus.c | 20 ++++++++------------
> >  1 file changed, 8 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
> > index 815bdb42e3f0..07bb6b6c1260 100644
> > --- a/drivers/gpu/host1x/bus.c
> > +++ b/drivers/gpu/host1x/bus.c
> > @@ -199,19 +199,23 @@ static void host1x_subdev_unregister(struct
> > host1x_device *device, */
> > 
> >  int host1x_device_init(struct host1x_device *device)
> >  {
> > 
> > -	struct host1x_client *client;
> > +	struct host1x_client *client, *cl;
> > 
> >  	int err;
> >  	
> >  	mutex_lock(&device->clients_lock);
> > 
> > -	list_for_each_entry(client, &device->clients, list) {
> > +	list_for_each_entry_safe(client, cl, &device->clients, list) {
> > 
> >  		if (client->ops && client->ops->init) {
> >  		
> >  			err = client->ops->init(client);
> > 
> > -			if (err < 0) {
> > +			if (WARN_ON(err < 0)) {
> > 
> >  				dev_err(&device->dev,
> >  				
> >  					"failed to initialize %s: %d\n",
> >  					dev_name(client->dev), err);
> > 
> > -				goto teardown;
> > +
> > +				/* add the client to the list of idle clients */
> > +				mutex_lock(&clients_lock);
> > +				list_add_tail(&client->list, &clients);
> 
> This shall be list_move_tail(), v3 is coming.
> 
> > +				mutex_unlock(&clients_lock);

I just realized that DRM won't load if any of host1x drivers fail to probe. I 
think the behaviour should be consistent in a case of driver-probe and client-
init failures. It looks like changing drivers probe error handling will be a 
much bigger change, hence let's keep the old behaviour at least for now.



      reply	other threads:[~2018-08-16 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 23:12 [PATCH v2] gpu: host1x: Ignore clients initialization failure Dmitry Osipenko
2018-08-13 17:48 ` Dmitry Osipenko
2018-08-16 17:20   ` Dmitry Osipenko [this message]

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=3610451.84tSEqHynW@dimapc \
    --to=digetx@gmail.com \
    --cc=cyndis@kapsi.fi \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.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).