From patchwork Thu Aug 9 23:12:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 955894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BLvyrI2w"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41mkYc6fDPz9s4b for ; Fri, 10 Aug 2018 09:12:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbeHJBjj (ORCPT ); Thu, 9 Aug 2018 21:39:39 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43804 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727140AbeHJBjj (ORCPT ); Thu, 9 Aug 2018 21:39:39 -0400 Received: by mail-lf1-f66.google.com with SMTP id f135-v6so5272667lfg.10; Thu, 09 Aug 2018 16:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PRu/WH3UfsbVfxNrOd5qm0di6r14wGa6ruxSLvmGvrA=; b=BLvyrI2w71Bbt8HCYBPwIZE+IHVn8FTbE7EPg687uqxrXfU1PxjkwHDnEeespaf0x5 9z56DbKQExi5ouSMAcpK52otXKNoIr3nrAT40g08f+NQKQKH4c7+x+Jdzd05BsosXmuY epEFMdA2iDcys91RWeg9BPaJ6PtKuHWGAe3LzUos0tA91Qkh4pu0mD7x1I60r5KnsbkT r8B6kwObiGA3I4wtwLuRJl5Su2a4T8KMhEEGF1Kc2mRKMxtrQJv1xaq4d4C3kQBWeN8Z PEQbLzxf7lo/2pkd3tGuILq9+LsVTGKpYa93pu7fmiC7kQsaQybI7vyurzs3B8umMzv+ P5Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PRu/WH3UfsbVfxNrOd5qm0di6r14wGa6ruxSLvmGvrA=; b=dQ9QuKNcc/bsq2s7/J3yIRZPR7AGgASbAFzIXPGHDq1+N3CubkL659yh0G+nmiJlYm lovO0p91BGWjY20NxataBsm6UZi1vtVw8o1LGSAug0ayCD/1oLFjBXGwswPiOcQ+x0W+ JKaEoY/7Rz1Gd+nSoulyxhVmBkw2Rh35IXCmVUW02/9Glxw46NZIOh0H1IjVBfTN2ewz wnuQ1pUDXse7Un1hXut+E38Ih3QuN6nLjMvMYhQvcuQCqUEFmJJdU3oTzyRNvNiaxP7a U9uqUKw4jos3yPb/kNxJMPOKn2/YdFHA0npocworZMUXhDLGHOyzeSYzincltV+WWpM5 tPyg== X-Gm-Message-State: AOUpUlEjcBho324AhL4AS5eihXhv4RgtfBNwbJghFSIvuh8dUWlkkXfn oF/o+8jUbaGvzawhlZQIumY= X-Google-Smtp-Source: AA+uWPww8D9HzZlQqeLui4IpnjGTu2HxJdRXdUvEzUv6LN7qkNXTWKz5BTNUJUsXSklN8YcmFxHDIw== X-Received: by 2002:a19:93d2:: with SMTP id w79-v6mr2968971lfk.20.1533856352982; Thu, 09 Aug 2018 16:12:32 -0700 (PDT) Received: from localhost.localdomain ([109.252.90.13]) by smtp.gmail.com with ESMTPSA id v9-v6sm1352177lje.20.2018.08.09.16.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 16:12:32 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] gpu: host1x: Ignore clients initialization failure Date: Fri, 10 Aug 2018 02:12:11 +0300 Message-Id: <20180809231211.26182-1-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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 --- 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); + mutex_unlock(&clients_lock); } } } @@ -219,14 +223,6 @@ int host1x_device_init(struct host1x_device *device) mutex_unlock(&device->clients_lock); return 0; - -teardown: - list_for_each_entry_continue_reverse(client, &device->clients, list) - if (client->ops->exit) - client->ops->exit(client); - - mutex_unlock(&device->clients_lock); - return err; } EXPORT_SYMBOL(host1x_device_init);