From patchwork Wed Feb 28 11:09:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 129946 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp893008lja; Wed, 28 Feb 2018 03:10:10 -0800 (PST) X-Google-Smtp-Source: AH8x225xq9agWgGoKxIM01U7uTWy4BwmDtxwvckybSHlIaHXDQz/KEQK1bQAWAA4rA3sWqkGNcJc X-Received: by 2002:a17:902:6f17:: with SMTP id w23-v6mr17663002plk.336.1519816209841; Wed, 28 Feb 2018 03:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519816209; cv=none; d=google.com; s=arc-20160816; b=m0IkPULuB46Jm4QxFJZdUVkSHtnvbRpQ/yHdyEzHY07xwS2u5g9SbNo9oqdQgxPxTN ytV6i10OgbI9vHO0ncFNbc+qZ8S2uzMgVjwWIcPYYky+BIXXXVFM5S2Fowd+jRrBGZgj vewdvaFpzv/kUuoSbAaogfyIWr+pbzeSR4jD2M1ZvD85xkrDSOO26RA3jSEgCZaGDeZN n/tPWLAg/kOgS08ZMSh9I1aKGN9QPfy32ZNF+sgnSbdUD7jWTQMVXB6bU+VUjfOzAETu NBubsdi0hUFyfHjmbevCzBssfCXYaoR+A0HERk4SbXArpbotyxVZqhUPZ6tqlAn2OBtv qFHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=Y7+l2p7nWEjDANYqpuBFsacBXG8PPNn7aPFdaNk5/rE=; b=i1QXKZArwipF3FJ6kGvN23Avl6qp5WN5czprMi09ijbKideGuEMFlsNSq7o6lE0mAo PqJ/upm+UtrsUaJGrNmWmbt1IgQrHivT5vFXQhXMNlBw9iKraJludh6HSR82D1dRnqhB v8BWLTYwgn846eihgqhLR2hVz3zrAcQHouCgRBDtyO0tLVxEW8qkiMYmVc/jPdOb8Dhg hEbVxj9IC651uEzzlo+s7smTFLoZr2qtmnK9cf7QCQfvQB5KKzzKDNzlWABF3oNmeeHw tDfh6K7yJ0kBIwv2zLg/cNDPseS5AmZmUEfEHzmELW9r5b4FnXDb+xjMa2AZq1h6/4EA yKPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=KUlE6IfD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id i9si903590pgn.33.2018.02.28.03.10.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 03:10:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=KUlE6IfD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 867CC6E93F; Wed, 28 Feb 2018 11:09:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68BAE6E93A for ; Wed, 28 Feb 2018 11:09:37 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1SB9Zx9005835; Wed, 28 Feb 2018 05:09:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1519816175; bh=zKBgWB1DknswofOXDVP0mGiTTpM5vHeAZ6Tb9hcrdLc=; h=From:To:CC:Subject:Date; b=KUlE6IfDlokkbQxhxVwk+m/9oQrB+xw4/OCh80/KE5OY1nGukLgeHYAE7sGI075BY wjGFwIYISWYe++RtJEo3eNUX01lPOKKsqaa+jPuJxCo4/DpmKuNO5Jf3UW16BJR5pO tu0MeBtuP6pjc4wltm7f2wBgx3ckZbpKzkL15i5M= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SB9ZWC032570; Wed, 28 Feb 2018 05:09:35 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 28 Feb 2018 05:09:34 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 28 Feb 2018 05:09:34 -0600 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SB9WKE009418; Wed, 28 Feb 2018 05:09:33 -0600 From: Jyri Sarha To: Subject: [PATCH v2 0/2] drm/panel: Add device link in drm_panel_attach() Date: Wed, 28 Feb 2018 13:09:28 +0200 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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: airlied@linux.ie, Jyri Sarha , tomi.valkeinen@ti.com, thierry.reding@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The first version of the series can be found here: https://lists.freedesktop.org/archives/dri-devel/2018-February/166909.html The only change is the dev_err print in drm_panel_attach() if device_link_add() fails. The device_link_del() is still there in drm_panel_detach(), despite Lukas Wunner's comment[1]. In the usual (currently all) cases things would work perfectly without the call too, because device_links_driver_cleanup() will eventually remove all orphaned links. However, this would cause an error in the situation where a drm device would like to detach a panel but remain operational, since the drm device would be unbound for no good reason if the detached panel is later unbound. Anyway, if somebody still comes up with an argument for dropping the device_link_del() from drm_panel_detach(), I'll do it as things will normally work fine either case (drm devices don't normally detach panels and remain operational). These older comment still apply: The first patch could be squashed to second, but kept is separate since I think it is correct even without the second patch. With these patches unbinding a panel driver in use does not cause nasty backtraces and corrupted drm core structures, but instead it cleanly unbind the drm master device at the same time. The only down side (currently[2]) is that the drm device does not reprobe if the panel driver is bound again, but everything should work if the drm master driver is bound manually. Best regards, Jyri [1] https://lists.freedesktop.org/archives/dri-devel/2018-February/167047.html [2] https://lists.freedesktop.org/archives/dri-devel/2018-February/166907.html Jyri Sarha (2): drm/panel: Remove drm_panel_detach() calls from all panel drives drm/panel: Add device_link from panel device to drm device drivers/gpu/drm/drm_panel.c | 12 ++++++++++++ drivers/gpu/drm/panel/panel-innolux-p079zca.c | 1 - drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 1 - drivers/gpu/drm/panel/panel-lvds.c | 1 - drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 1 - drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 1 - drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 1 - drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 1 - drivers/gpu/drm/panel/panel-simple.c | 1 - drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 1 - include/drm/drm_panel.h | 1 + 11 files changed, 13 insertions(+), 9 deletions(-)