Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3540614ybf; Tue, 3 Mar 2020 07:48:07 -0800 (PST) X-Google-Smtp-Source: ADFU+vtn1U/r+gWHhdnMlpWvAKn/KQLFXgdZJXS2UaoPMbkEK05OTOMiBiGIGltUJs91wAoqK/KT X-Received: by 2002:aca:3542:: with SMTP id c63mr2874692oia.135.1583250487652; Tue, 03 Mar 2020 07:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583250487; cv=none; d=google.com; s=arc-20160816; b=AvY77Z84CtPJxCMDEH1y+0kGD2+n1F6gwvll52ihDDqe3VkARf5Jpdc0D91RlH0LM2 XthKqtu3StXyB7EvIs2VPhGOqKn5sy22kebRbrEizebSqunY7BezueuDrMwaFkqS2Uu6 SHUbw9ArSAirAAncYTBY/Hh9t2fLApH7hd17KtlUipgN2wgLsuluaWrHnF74nsQ52ieh WsRlrRhj/V9+9NfP6jFpHYirbJpHc7WdktLabxqYERNmn4NWCH35meNTgi/o/mvH5yDR XhRpFWChGn43VeL2NM84QIpD+F2gY/B6dTDaMzKK73DYbA/ioH1Xi2aSgtKF9yBcaB8/ lBBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ER6Koez4OL2rqO9nwfKiAFUXJ+CuAgnaQe/x3YxpLtg=; b=fN89yjI9/+GS8G3YgnL/Kt81Ts3hbYu9ZIzXaJeHRpbfUrzTtd9fvOYN3FWgFY2ol8 EedEswkKxyFD+stgujRq6i0lKwLF6tlnKX/pHhJdZpsd44DHekRW50tR10/zuC5ORRwy ONlWmLl29djOqj/9DLlMXtqwyJurC2pcDxv8YKVZ1g+l/9J+6+V5Nt3iim+PbDhOQgHA /z1Sjhau1MBz4oT9hAdWlizreyR9ITnCf49VIpnWwtdrwP5lRpoHhlf6XHFsQyDJGmqI CYSWR014Zikmo0VRjE0XeRBvHk6T2vpp5xkKf6z7Mxwg9UUsozast40y1AKAF5GbMr50 pjow== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si1321272otg.26.2020.03.03.07.47.55; Tue, 03 Mar 2020 07:48:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729707AbgCCPNy (ORCPT + 99 others); Tue, 3 Mar 2020 10:13:54 -0500 Received: from muru.com ([72.249.23.125]:58542 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbgCCPNy (ORCPT ); Tue, 3 Mar 2020 10:13:54 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 9BD6180EE; Tue, 3 Mar 2020 15:14:37 +0000 (UTC) Date: Tue, 3 Mar 2020 07:13:49 -0800 From: Tony Lindgren To: Tomi Valkeinen Cc: linux-omap@vger.kernel.org, "Andrew F . Davis" , Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Keerthy , Nishanth Menon , Peter Ujfalusi , Roger Quadros , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jyri Sarha , Laurent Pinchart , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 3/3] bus: ti-sysc: Implement display subsystem reset quirk Message-ID: <20200303151349.GQ37466@atomide.com> References: <20200224191230.30972-1-tony@atomide.com> <20200224191230.30972-4-tony@atomide.com> <7d4af3b5-5dd7-76b3-4d3f-4698bfde288c@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d4af3b5-5dd7-76b3-4d3f-4698bfde288c@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, * Tomi Valkeinen [200303 06:03]: > On 24/02/2020 21:12, Tony Lindgren wrote: > > + /* Remap the whole module range to be able to reset dispc outputs */ > > + devm_iounmap(ddata->dev, ddata->module_va); > > + ddata->module_va = devm_ioremap(ddata->dev, > > + ddata->module_pa, > > + ddata->module_size); > > Why is this needed? The range is not mapped when sysc_pre_reset_quirk_dss() > is called? This will unmap and remap twice, as this function is called > twice. And then left mapped. That's because by default we only ioremap the module revision, sysconfig and sysstatus register are and provide the rest as a range for the child nodes. In the dss quirk case we need to tinker with registers also in the dispc range, and at the parent dss probe time dispc has not probed yet. We may be able to eventually move the reset quirk to dispc, but then it won't happen in the current setup until after dss top level driver has loaded. We leave the module range ioremapped as we still need to access sysconfig related registers for PM runtime. > > + if (!ddata->module_va) > > + return -EIO; > > + > > + /* DISP_CONTROL */ > > + val = sysc_read(ddata, dispc_offset + 0x40); > > Defines for dss/dispc register offsets could have been copied from the > platform display.c and used in this file. Yeah I though about that, but decided to keep everything local to the quirk handling. We could have them defined in some dss header though. > > + /* Clear IRQSTATUS */ > > + sysc_write(ddata, 0x1000 + 0x18, irq_mask); > > dispc_offset instead of 0x1000. OK > > + > > + /* Disable outputs */ > > + val = sysc_quirk_dispc(ddata, dispc_offset, true); > > + > > + /* Poll IRQSTATUS */ > > + error = readl_poll_timeout(ddata->module_va + dispc_offset + 0x18, > > + val, val != irq_mask, 100, 50); > > + if (error) > > + dev_warn(ddata->dev, "%s: timed out %08x !+ %08x\n", > > + __func__, val, irq_mask); > > + > > + if (sysc_soc->soc == SOC_3430) { > > + /* Clear DSS_SDI_CONTROL */ > > + sysc_write(ddata, dispc_offset + 0x44, 0); > > + > > + /* Clear DSS_PLL_CONTROL */ > > + sysc_write(ddata, dispc_offset + 0x48, 0); > > These are not dispc registers, but dss registers. Ouch. Thanks for catching this, will include in the fix. > > + } > > + > > + /* Clear DSS_CONTROL to switch DSS clock sources to PRCM if not */ > > + sysc_write(ddata, dispc_offset + 0x40, 0); > > Same here. OK Regards, Tony