Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1136971ybe; Fri, 6 Sep 2019 12:25:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUNcOW0rqe54NBoUJFJGFaVO9Z5YLwOIIgBXM3Xgg8fSaCi13oRQPdx6GGQcn24CoEkiT1 X-Received: by 2002:a65:52ca:: with SMTP id z10mr9630071pgp.424.1567797913835; Fri, 06 Sep 2019 12:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567797913; cv=none; d=google.com; s=arc-20160816; b=bS94DxD2jqpHYKbSyCnaUz5XLvhLZik26jTIP0d0Er3hX3K6+V8A8XDyHXCXoR9Pzv 75YL/bgyLvnGIPBZlY1mnlpFCtWdcw0TSW1w6bE6sRdx9YA9vk9j+a6OpZ5oxjgIkvb8 EnNIK0NXNrXh4UKxrWu2t8NIXsEiS88kUL8znqgVV3umKHfNHARiuQyh1On7BkovCtX2 +r+FzS/DjSumzCgLelk2JsitD/8kdBXa1ytKq3NjByL8FVX6s0ja9TulAjz7jdMYFJhS FFFBlTS7CDxFPc9OF7asXwHjuhRQuB1jADkdP/4agpUQoCcCpiFdghNPh8V7zcdMSZrZ i84w== 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=JC8JaGD7QKU5ZWo60PR/h58Rh9vc2jtNbC6NhTLnbog=; b=UKKEW+yty36KIFxC/8j9ERnPC44ExF138c63lrlLaIzpnSNrY03vYjOU3Q/TXPIMbd XlEX+0sspWMRdiW0cIED3zQ4Ak5Vqiv1nrql0wNMRs9EaC9fODDiW3yR1dGSBL1tj+LT jskW4tke0d0dSxPP7VkwkCRB2CkPGlP72J/Vsj1bTU3jHEf4aSvSfy+URVhThsaEC0QW fHYYB3fj1CqmYrSAGBzNt2JIezr3e2omG641lxUvRn581nPN9gBI4RqsFo6Y0adwQwx+ Y5rq3IqeiXt1MWWObfgLIkDl4WI3x4zZ1uzLnYxjT+WwHvJkYDaJJaUia6ol8w3nooRM 45rw== 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 i12si6337310pfo.126.2019.09.06.12.24.59; Fri, 06 Sep 2019 12:25:13 -0700 (PDT) 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 S1727970AbfIFOpP (ORCPT + 99 others); Fri, 6 Sep 2019 10:45:15 -0400 Received: from foss.arm.com ([217.140.110.172]:57400 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbfIFOpP (ORCPT ); Fri, 6 Sep 2019 10:45:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2B7AB28; Fri, 6 Sep 2019 07:45:14 -0700 (PDT) Received: from [10.1.196.133] (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 752063F718; Fri, 6 Sep 2019 07:45:13 -0700 (PDT) Subject: Re: [PATCH] drm/panfrost: Fix regulator_get_optional() misuse To: Mark Brown Cc: David Airlie , Tomeu Vizoso , dri-devel , "linux-kernel@vger.kernel.org" References: <20190904123032.23263-1-broonie@kernel.org> <20190905124014.GA4053@sirena.co.uk> <93b8910d-fc01-4c16-fd7e-86abfc3cc617@arm.com> <20190905163420.GD4053@sirena.co.uk> <58594735-c079-74e5-26c8-4911f073d4df@arm.com> <20190906105523.GR23391@sirena.co.uk> From: Steven Price Message-ID: <1bfa2b93-301f-22ff-7208-b337b8f3820d@arm.com> Date: Fri, 6 Sep 2019 15:45:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190906105523.GR23391@sirena.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2019 11:55, Mark Brown wrote: [...] >>> However you're probably better off hiding all this stuff with the >>> generic OPP code rather than open coding it - this already has much >>> better handling for this, it supports voltage ranges rather than single >>> voltages and optional regulators already. I'm not 100% clear why this >>> is open coded TBH but I might be missing something, if there's some >>> restriction preventing the generic code being used it seems like those >>> sohuld be fixed. > >> To be honest I've no idea how to use the generic OPP code to do this. I >> suspect the original open coding was cargo-culted from another driver: >> the comments in the function look like they were lifted from >> drivers/devfreq/rk3399_dmc.c. Any help tidying this up would be appreciated. > > Yes, there's a lot of cargo culting of bad regulator API usage in > the DRM subsystem for some reason, I keep having to do these > periodic sweeps and there's always stuff in there. I think a lot > of it comes from BSP code that just gets dropped in without > review and then cut'n'pasted but I've not figured out why DRM is > so badly affected. I've been working on tidying up the devfreq usage in Panfrost. From what I can see your patch is correct and I just needed to work out how to fix my DT. Steve