From patchwork Thu Sep 27 12:41:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 147706 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1953499lji; Thu, 27 Sep 2018 05:41:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV62o8UVwEwpuQVEJSjdQeRHCW0Vmj/B6Zaxg2O0ZF3XLKc9ApISsVzjkubdGUOe+JVLluvdP X-Received: by 2002:a17:902:a618:: with SMTP id u24-v6mr10926673plq.77.1538052100266; Thu, 27 Sep 2018 05:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538052100; cv=none; d=google.com; s=arc-20160816; b=G17fLy7qCPQqNwrRneJfgKRPk0C21rQ1YBdjwZLfbIWM7Vra2hfvSpFgnKqao+QT2m ckrE1bJ6+FLAqoEGH9Q6VgKXu4+I0fp0bnHqlRjIM0RFF+iuea6xbp3fEVLNE/nMfG2Z Z1z+U/GsoDKfk52mehZKZoZZxZ1cDvf1x26CQ/0ftvwClHyKnscyV6apwtVNik8ZKLqP /cjHn/4dvomHV46lrwyS360QJMstN1/x8HJRf3URTc/wL/ocrYx6ztIFW1Ek53QMmimM xaXU4oktr61dX6N3jzkJroHJNZPjVDdElLlR3H167nRdVGH+T820sCyJ+jlVjiRKaC5m qgVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:delivered-to; bh=woGsX/mlcYpXwJfg0A1UK7iXJP4fo/JECZp9bmFc3Qw=; b=YOQdwNsKcDgN0oWANhVbrcCscRHlTCmnPBWSju4SiHz8LXXH5Mdwl3YvWm0xLhSf7J XeSwjogNUmJkZODrj2Pk7fHdLwRpIfd6cBCISf1bjho5Z3tldajeIFvnu3R6joWq7HRw wsuXbh+rQF+KEkJ5+zrEYWLNUXYqehKIWNirDfnwYJ5kefkGE+6IQLMvsOfuMWLsDiXa Mc0ce3y1OdZZth4schP4po/aDvHRsrDZUI5ykLWA/YcenJ4pv8wCJrolOjCV+Nu+EqOI gayUQ1VDBT5LIl8uJhrKpluf8si7OFkaOoCB51V7+8130PvQJhCB5WsrhcK/sjIeA6DF r2SA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z11-v6si1843364plk.490.2018.09.27.05.41.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Sep 2018 05:41:40 -0700 (PDT) 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; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 112FF6E08D; Thu, 27 Sep 2018 12:41:39 +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 123906E08D for ; Thu, 27 Sep 2018 12:41:37 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id v9-v6so2264512ljk.4 for ; Thu, 27 Sep 2018 05:41:36 -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=oZsTq1AcEMo2aWK1t9U3FYx4PLMj9qfOG/CHbsC4GMg=; b=IuERNh60yTxBttINs6OHugW+69FIjTSL3Vw1LIWMg7vVQtJkGygi7OIUP6ECm80BqF RUL46ZjOdB4CWFRKb8hhBjdU1UVJTJ5u94kG2OUIS3Jwzr0Hu4VC03O9EpsIwvOpywSS QB53av9gQG0jdz7Nl9QXyYbjIw6Yh4bhxAamqvj2pzLRtbT5tqXOh5Xd4Vb6lYHn7jgr +76zpkx1sHS6iU5thIk0n6/efpu84LNX1P6cKHLj+JqB/uAiqC1kX/sm9qeJHem2miSK mev5sG5aQrAqE5tVbAFYegHYKqqIYI8hlxnbbPlG6/5W7vw/9QmCuB/rKinhdjCUD4kX 1iKA== X-Gm-Message-State: ABuFfoh+cBt/mHV1Drxk9eMHG3/+2FtfFsxzDPe6QXHe2iNv3jcEfwp3 qS7diy3wqYh/1xloRaHfRA+oxA== X-Received: by 2002:a2e:9e10:: with SMTP id e16-v6mr478832ljk.169.1538052095282; Thu, 27 Sep 2018 05:41:35 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e21-v6sm18863lfb.52.2018.09.27.05.41.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Sep 2018 05:41:33 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH] Revert "drm/panel: Add device_link from panel device to DRM device" Date: Thu, 27 Sep 2018 14:41:30 +0200 Message-Id: <20180927124130.9102-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 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: Jyri Sarha MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This reverts commit 0c08754b59da5557532d946599854e6df28edc22. commit 0c08754b59da ("drm/panel: Add device_link from panel device to DRM device") creates a circular dependency under these circumstances: 1. The panel depends on dsi-host because it is MIPI-DSI child device. 2. dsi-host depends on the drm parent device (connector->dev->dev) this should be allowed. 3. drm parent dev (connector->dev->dev) depends on the panel after this patch. This makes the dependency circular and while it appears it does not affect any in-tree drivers (they do not seem to have dsi hosts depending on the same parent device) this does not seem right. As noted in a response from Andrzej Hajda, the intent is likely to make the panel dependent on the DRM device (connector->dev) not its parent. But we have no way of doing that since the DRM device doesn't contain any struct device on its own (arguably it should). Revert this until a proper approach is figured out. Cc: Jyri Sarha Cc: Eric Anholt Cc: Andrzej Hajda Signed-off-by: Linus Walleij --- drivers/gpu/drm/drm_panel.c | 10 ---------- include/drm/drm_panel.h | 1 - 2 files changed, 11 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index b902361dee6e..1d9a9d2fe0e0 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -105,13 +104,6 @@ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) if (panel->connector) return -EBUSY; - panel->link = device_link_add(connector->dev->dev, panel->dev, 0); - if (!panel->link) { - dev_err(panel->dev, "failed to link panel to %s\n", - dev_name(connector->dev->dev)); - return -EINVAL; - } - panel->connector = connector; panel->drm = connector->dev; @@ -133,8 +125,6 @@ EXPORT_SYMBOL(drm_panel_attach); */ int drm_panel_detach(struct drm_panel *panel) { - device_link_del(panel->link); - panel->connector = NULL; panel->drm = NULL; diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 582a0ec0aa70..777814755fa6 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -89,7 +89,6 @@ struct drm_panel { struct drm_device *drm; struct drm_connector *connector; struct device *dev; - struct device_link *link; const struct drm_panel_funcs *funcs;