Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1663038ybv; Fri, 21 Feb 2020 01:14:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyHtX6XlvhqAIGHFZvtHuC5o6K5xNcFLG4d+dOVZK+HmKClkgkhk5f85QJeGdj9hPzY3vok X-Received: by 2002:aca:2315:: with SMTP id e21mr1106157oie.147.1582276477720; Fri, 21 Feb 2020 01:14:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582276477; cv=none; d=google.com; s=arc-20160816; b=DAwxcU61Bvu2y2J86ERsdAS+EV0d2ujv1Db7da2vX2NFyWOgctdCsxzOuy7F54CRMc m+xIO0OoF3wlQPGXO27H9lHG7vShPOsZKKFX/jlIEwI8q7q/FQCUam4mfdcc/FPUuDJm OVZc8EkDcNgBhb9/TQ+JC/JcLX67LSbSSJUcV2ez+mkzlVOW/nadz7vQJgJUsyRUPhJN pLD04IAmyMiN+BWc/hkA7On9sZASIL5IgOEEPyK/4qYeF3mY4ZUdC/IOxjBUfddMAeFN X6rbNiCeJRpy3qzLqzTBRZRmmp/xcsuZBF7sOPri0vjtHSQlRNpujsGGeQ72suTWzP0m TOxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NDfQtCwT3RbaSa+6Tilh87wSMRhn32KkYOC6FcwnBsM=; b=quSSU9xChK5B3whQM8MnRrzP/QGX2GKiIbbKxPg4HfpuRF2GJnaTSkmFI2BIPBPdmb QMn1rwYq1y5ndkEYQwalzUkDO9zn6WmWcJovrfHRmjR9ycefcSGI5XbPbxr73Zh0Rw/o 7JXwC5ulzRbWW1LgP7ttRgZjkleBboVyl461zneU2n3pl0tuEqwqdMmm/1GyOce8MFiA nDSrDS0lDMvuMNMemanM5OkXOz2kZcBKsJ7MsHuB9z6qQzUSPzyML/uNPs7apRpBF2JK 8BO5XWJHH90HbzmHCMzDGkRDUk/KRNOnFoOyMKTomXms3k2aUQ/aOb4DBwrx9UilyHlx leIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x207si497709oif.193.2020.02.21.01.14.25; Fri, 21 Feb 2020 01:14:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731928AbgBUI5F (ORCPT + 99 others); Fri, 21 Feb 2020 03:57:05 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55442 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727213AbgBUI5F (ORCPT ); Fri, 21 Feb 2020 03:57:05 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 986C728CC36 Subject: Re: [PATCH v8 0/6] arm/arm64: mediatek: Fix mmsys device probing To: CK Hu Cc: robh+dt@kernel.org, mark.rutland@arm.com, p.zabel@pengutronix.de, airlied@linux.ie, mturquette@baylibre.com, sboyd@kernel.org, ulrich.hecht+renesas@gmail.com, laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , rdunlap@infradead.org, dri-devel@lists.freedesktop.org, Weiyi Lu , Seiya Wang , linux-clk@vger.kernel.org, Collabora Kernel ML , mtk01761 , Allison Randal , Thomas Gleixner , wens@csie.org, Kate Stewart , Greg Kroah-Hartman , Houlong Wei , Matthias Brugger , linux-media@vger.kernel.org, devicetree@vger.kernel.org, sean.wang@mediatek.com, frank-w@public-files.de, Minghsiu Tsai , Andrew-CT Chen , linux-mediatek@lists.infradead.org, hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, Richard Fontana , linux-kernel@vger.kernel.org, matthias.bgg@kernel.org, Daniel Vetter , Fabien Parent , Krzysztof Kozlowski , Nicolas Boichat , Owen Chen References: <20200220172147.919996-1-enric.balletbo@collabora.com> <1582259996.1846.7.camel@mtksdaap41> From: Enric Balletbo i Serra Message-ID: <7a87b486-1622-7f27-f5af-427b94a14c00@collabora.com> Date: Fri, 21 Feb 2020 09:56:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1582259996.1846.7.camel@mtksdaap41> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi CK, Thanks for your quick answer. On 21/2/20 5:39, CK Hu wrote: > Hi, Enric: > > On Thu, 2020-02-20 at 18:21 +0100, Enric Balletbo i Serra wrote: >> Dear all, >> >> Those patches are intended to solve an old standing issue on some >> Mediatek devices (mt8173, mt2701 and mt2712) in a slightly different way >> to the precedent series. >> >> Up to now both drivers, clock and drm are probed with the same device tree >> compatible. But only the first driver get probed, which in effect breaks >> graphics on those devices. >> >> The version eight of the series tries to solve the problem with a >> different approach than the previous series but similar to how is solved >> on other Mediatek devices. >> >> The MMSYS (Multimedia subsystem) in Mediatek SoCs has some registers to >> control clock gates (which is used in the clk driver) and some registers >> to set the routing and enable the differnet blocks of the display >> and MDP (Media Data Path) subsystem. On this series the clk driver is >> not a pure clock controller but a system controller that can provide >> access to the shared registers between the different drivers that need >> it (mediatek-drm and mediatek-mdp). And the biggest change is, that in >> this version, clk driver is the entry point (parent) which will trigger >> the probe of the corresponding mediatek-drm driver and pass its MMSYS >> platform data for display configuration. > > When mmsys is a system controller, I prefer to place mmsys in > drivers/soc/mediatek, and it share registers for clock, display, and mdp > driver. This means the probe function is placed in > drivers/soc/mediatek ,its display clock function, mdp clock function are > placed in drivers/clk, display routing are placed in drivers/gpu/drm, > and mdp routing are placed in dirvers/video. > I understand what you mean but I am not sure this makes the code clearer and useful. The driver in drivers/soc/mediatek will be a simple dummy implementation of a "simple-mfd" device (a driver that simply matches with "mediatek,mt8173-mmsys" and instantiates the "clk-mt8173-mm" and the "mediatek-drm" driver (note that mediatek-mdp" is already instantiated via device-tree). It'd be nice had a proper device-tree with a "simple-mfd" for mmsys from the beginning representing how really hardwware is, but I think that, change this now, will break backward compatibility. IMHO I think that considering the clk driver as entry point is fine, but this is something that the clock maintainers should decide. Also note that this is not only a MT8173 problem I am seeing the same problem on all other Mediatek SoCs. Thanks. > Regards, > CK > >> >> All this series was tested on the Acer R13 Chromebook only. >> >> For reference, here are the links to the old discussions: >> >> * v7: https://patchwork.kernel.org/project/linux-mediatek/list/?series=241217 >> * v6: https://patchwork.kernel.org/project/linux-mediatek/list/?series=213219 >> * v5: https://patchwork.kernel.org/project/linux-mediatek/list/?series=44063 >> * v4: >> * https://patchwork.kernel.org/patch/10530871/ >> * https://patchwork.kernel.org/patch/10530883/ >> * https://patchwork.kernel.org/patch/10530885/ >> * https://patchwork.kernel.org/patch/10530911/ >> * https://patchwork.kernel.org/patch/10530913/ >> * v3: >> * https://patchwork.kernel.org/patch/10367857/ >> * https://patchwork.kernel.org/patch/10367861/ >> * https://patchwork.kernel.org/patch/10367877/ >> * https://patchwork.kernel.org/patch/10367875/ >> * https://patchwork.kernel.org/patch/10367885/ >> * https://patchwork.kernel.org/patch/10367883/ >> * https://patchwork.kernel.org/patch/10367889/ >> * https://patchwork.kernel.org/patch/10367907/ >> * https://patchwork.kernel.org/patch/10367909/ >> * https://patchwork.kernel.org/patch/10367905/ >> * v2: No relevant discussion, see v3 >> * v1: >> * https://patchwork.kernel.org/patch/10016497/ >> * https://patchwork.kernel.org/patch/10016499/ >> * https://patchwork.kernel.org/patch/10016505/ >> * https://patchwork.kernel.org/patch/10016507/ >> >> Best regards, >> Enric >> >> Changes in v8: >> - Be a builtin_platform_driver like other mediatek mmsys drivers. >> - New patches introduced in this series. >> >> Changes in v7: >> - Add R-by from CK >> - Add R-by from CK >> - Fix check of return value of of_clk_get >> - Fix identation >> - Free clk_data->clks as well >> - Get rid of private data structure >> >> Enric Balletbo i Serra (2): >> drm/mediatek: Move MMSYS configuration to include/linux/platform_data >> clk/drm: mediatek: Fix mediatek-drm device probing >> >> Matthias Brugger (4): >> drm/mediatek: Use regmap for register access >> drm/mediatek: Omit warning on probe defers >> media: mtk-mdp: Check return value of of_clk_get >> clk: mediatek: mt8173: Switch MMSYS to platform driver >> >> drivers/clk/mediatek/Kconfig | 6 + >> drivers/clk/mediatek/Makefile | 1 + >> drivers/clk/mediatek/clk-mt2701-mm.c | 30 +++ >> drivers/clk/mediatek/clk-mt2712-mm.c | 44 +++++ >> drivers/clk/mediatek/clk-mt8173-mm.c | 172 ++++++++++++++++++ >> drivers/clk/mediatek/clk-mt8173.c | 104 ----------- >> drivers/gpu/drm/mediatek/mtk_disp_color.c | 5 +- >> drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 5 +- >> drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 5 +- >> drivers/gpu/drm/mediatek/mtk_dpi.c | 12 +- >> drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +- >> drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 53 +++--- >> drivers/gpu/drm/mediatek/mtk_drm_ddp.h | 4 +- >> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 56 +----- >> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 113 +----------- >> drivers/gpu/drm/mediatek/mtk_drm_drv.h | 13 +- >> drivers/gpu/drm/mediatek/mtk_dsi.c | 8 +- >> drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 +- >> drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 + >> include/linux/platform_data/mtk_mmsys.h | 73 ++++++++ >> 20 files changed, 401 insertions(+), 317 deletions(-) >> create mode 100644 drivers/clk/mediatek/clk-mt8173-mm.c >> create mode 100644 include/linux/platform_data/mtk_mmsys.h >> >