From patchwork Wed Aug 1 15:08:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10553315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9992015E2 for ; Thu, 2 Aug 2018 07:24:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 851032AF7A for ; Thu, 2 Aug 2018 07:24:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 797A62AF8B; Thu, 2 Aug 2018 07:24:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D9FD2AF7A for ; Thu, 2 Aug 2018 07:24:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEAFB6E379; Thu, 2 Aug 2018 07:19:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC08D6E48D for ; Wed, 1 Aug 2018 15:08:46 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id u7-v6so17218475lji.3 for ; Wed, 01 Aug 2018 08:08:46 -0700 (PDT) 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=GNK3eXIdRTNNvMEG9F1yQVWzPlIPhqiqOLRVnXsREfY=; b=jhLqq5qleCqcuws5yp/aSNpJ0o38OnwviSxppg8I7PSV0hza1hnNoYfml7Kru6kcY9 33DSXYGfNtaUdEZGRtAjA3m9jKzGTqkn6QDoOn5sDN8b3hihj0SbD+dk0ja4OWTKTg6U AD/IGdENUFnQ/T1SqTWBkP0wCiavlU+jBjjX8l6ZwN/C11UJ54KJ/7VysE/bKzZLBX3F wIY+YRs9/0QZHc6GBSTTQkdBd1yYobXV+QubN3sfo7nsLTeIcSxNz7ThrMNuRHFOgiuK QJ1/bGSWjZdUMoTBwjPtOUxS/4SBc5X1vgBGspn2/pNTsCeR6GNrkXyreH71kDhUJfy0 KpJg== X-Gm-Message-State: AOUpUlHcreR2XWFrkyoc4pggGFk15tE30TujCsEE8wVZmyEyEVoQV7pb F55f76uIqoR1duSpYlLP5zA= X-Google-Smtp-Source: AAOMgpfJDNyL2Kb+Bp9uk4vyVnBL5sEhMP7i7C50gUps7M+el31dxacuhor3bTbRwclVJsq9JUKWMw== X-Received: by 2002:a2e:6d0a:: with SMTP id i10-v6mr20875832ljc.145.1533136125147; Wed, 01 Aug 2018 08:08:45 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id g12-v6sm1004814ljf.5.2018.08.01.08.08.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 08:08:44 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen , Kyle Evans Subject: [PATCH v1] gpu: host1x: Ignore clients initialization failure Date: Wed, 1 Aug 2018 18:08:07 +0300 Message-Id: <20180801150807.15926-1-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 X-Mailman-Approved-At: Thu, 02 Aug 2018 07:19:10 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Dmitry Osipenko --- drivers/gpu/host1x/bus.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index 815bdb42e3f0..145019e105e4 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -199,34 +199,30 @@ 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(&clients_lock); 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) { 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 */ + list_add_tail(&client->list, &clients); } } } mutex_unlock(&device->clients_lock); + mutex_unlock(&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);