From patchwork Sat Nov 10 11:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10677057 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 F2A26175A for ; Sat, 10 Nov 2018 11:16:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D90B629DC9 for ; Sat, 10 Nov 2018 11:16:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7BED2C1E1; Sat, 10 Nov 2018 11:16:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69CE229DC9 for ; Sat, 10 Nov 2018 11:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728951AbeKJVBW (ORCPT ); Sat, 10 Nov 2018 16:01:22 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:39082 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728883AbeKJVBW (ORCPT ); Sat, 10 Nov 2018 16:01:22 -0500 Received: from avalon.ideasonboard.com (unknown [212.213.198.112]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2355D510; Sat, 10 Nov 2018 12:16:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1541848602; bh=KGQcJLZyZmKUB4EpONlykGgc6eWkW966slk16aLg9T0=; h=From:To:Cc:Subject:Date:From; b=Zi19WyFYd5GLGuhUGftXxN0yiRoIrXhtt6CH9trFNURYfAEMMbzKqtbBOHsu2V3c5 jlsDmEVtPE88ICOQ4ciMT0AMSq4ko+UTICbbHGZ+YfQsI+49mXPl6RZjnEGULNzWW0 ekvkpDrl/eekcVc3hXSCh69uItqZjW9to9fCWxk4= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Cc: Tony Lindgren , Tomi Valkeinen , linux-omap@vger.kernel.org Subject: [PATCH v3 0/4] omapdrm: Fix runtime PM issues at module load and unload time Date: Sat, 10 Nov 2018 13:16:50 +0200 Message-Id: <20181110111654.4387-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.18.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, This series fixes crashes in the omapdss driver at both load and unload time, due to runtime PM problems related to probe deferral. The bugs got introduced in v4.20-rc, this should thus be considered as v4.20 fixes. At the core of the problem comes commit 27d624527d99 ("drm/omap: dss: Acquire next dssdev at probe time") which can cause probe deferral for the DSS when the encoder and panel modules are not loaded yet. As the omapdss module contains drivers for the DSS and all its children, this results in the internal encoders being probed before the DSS. Missing runtime PM handling around register access then caused imprecise external aborts. Patch 1/4 moves population of the DSS children from arch code to the omapdss driver. This prevents the DSS children from being probed before the DSS. The change can be considered as a workaround in the sense that runtime PM of the DSS children should operate correctly even when the DSS probe fail. However, given that reducing the amount of arch code is an improvement in itself, I believe the solution to be acceptable. Patches 2/4 and 3/4 then ensure that the HDMI4 and DSI devices are active at bind and probe time respectively, in order to access hardware registers there. Patch 4/4 finally fixes the internal encoders crash in their runtime PM handlers by moving DISPC runtime PM state management to omapdrm. This is the biggest change compared to v3 that went for a less intrusive (in my opinion at least) workaround. As Tomi and Tony were in favour of a real fix instead of a workaround, I gave the RFC fix more testing on Beagleboard, Pandaboard and AM57xx EVM and concluded it should be safe. Patch 1/4 touches both the mach-omap2 and omapdss, and has been acked by Tony to be merged through the DRM tree. Laurent Pinchart (4): drm/omap: Populate DSS children in omapdss driver drm/omap: hdmi4: Ensure the device is active during bind drm/omap: dsi: Ensure the device is active during probe drm/omap: Move DISPC runtime PM handling to omapdrm arch/arm/mach-omap2/display.c | 111 +++++++++++++--------------- drivers/gpu/drm/omapdrm/dss/dsi.c | 14 ++-- drivers/gpu/drm/omapdrm/dss/dss.c | 11 ++- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 37 +++------- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 27 ------- drivers/gpu/drm/omapdrm/dss/venc.c | 7 -- drivers/gpu/drm/omapdrm/omap_crtc.c | 6 ++ 7 files changed, 83 insertions(+), 130 deletions(-)