Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp126812ybj; Thu, 19 Sep 2019 11:43:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOPwca/04g/jOzd7JrjOk5AHdWY6cU6EdyzXw+LEoAjCcwtPYjUyOkdkB5lbygCz+uiMhN X-Received: by 2002:a17:906:4890:: with SMTP id v16mr15722647ejq.3.1568918637902; Thu, 19 Sep 2019 11:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568918637; cv=none; d=google.com; s=arc-20160816; b=qvBWq+CRy6pj7Y7TLhH7/RndHnyVK9xknJPaens5pPrS8N0m1eIqjmJeRIOViNgoVW UgvnG0qjRGtsPEB6LtG6P8bBiCmMn+Quq6e0/xnOSXLxCo9xiO48t2faIzzm5SVpp70j BKx1lsCqw+t9XH3gN+/+O3ccpBZWtYKmRTtIBQZ/nUeyht8r2xsWrnHMXQFZcJF41cCt 57wefPrRTiJL4w2J0huBnIlWhVTwTVi4M8Z4TTLsLFgmeDOMFIlnLg8YoQyO40otsOEf 07YqudwLU1cj2GkwDJbJr5BAfC972ieCYeHNCMPYTODwP3mrAJ3B0TZFx9U1d/b4FTIJ wuwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Eu7+yotnpIraCsb87QaXWHlHdAHUdNT5rvA/xL0sOuo=; b=VBEfeuI9wvWLQ7i2r9AIEcbCcbpd5tD+MENkjmsmGR4iB2ClWiz11hMW8NcNM2fJ5j nP0vJXlOCxNKcvhkjUENAJklqhhZAIu9FmKxb0kT+lbDnUpSoP2OGN/Xm34/zz9dthAV AX6/CHygYJffbr12FPeGnlOVv1cPWd6zC1EH6AXdgWrLDtpf5DuXhAbGyCbafrxsPz5B 91u1l3wgCfVhMBRBgPnxgHKxZkVNXug51OCn6p7nH651WVS6mwqDJPV8z9xpLAb+1IuP iLeYAgwEimeytth6gOWMcurSM3lT+KKxIEbMkVuoRD0WggKxRHF361DoEUxBs4sGq6kB HJ5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fjoeJ4FZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si5021084ejk.250.2019.09.19.11.43.34; Thu, 19 Sep 2019 11:43:57 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fjoeJ4FZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389977AbfISQzV (ORCPT + 99 others); Thu, 19 Sep 2019 12:55:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:58632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388051AbfISQzU (ORCPT ); Thu, 19 Sep 2019 12:55:20 -0400 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4DE421928 for ; Thu, 19 Sep 2019 16:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568912119; bh=5rVjIPHL2cnlL1gfY8saDq0zSQ2lRGBAEHD4oLsuXQY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fjoeJ4FZTnG/THhXTEtMWSn8XpndCUl/IjvLFRu3quQ+4snlo6kqL7vxTMUdmvCRT XD8n5v5BcKnQt2iKeOJ2avf35XY75Jh95sLZzdJd1fOf+22BFR9WDHj/QrDjG+Xgyh rdEvz9EWHvjwEJDWQfKCpc9hqugR0JQsO3ACQpps= Received: by mail-qk1-f177.google.com with SMTP id u186so4108934qkc.5 for ; Thu, 19 Sep 2019 09:55:19 -0700 (PDT) X-Gm-Message-State: APjAAAUGDlU7zzAye4LjfOoheHTzehEO7Ex2ajmp2EFOtm4pR1LX2eLv YDCC9dESPoMVaKhpUG/PMay1SBvWuA6XYy6r9w== X-Received: by 2002:a37:682:: with SMTP id 124mr3783029qkg.393.1568912118989; Thu, 19 Sep 2019 09:55:18 -0700 (PDT) MIME-Version: 1.0 References: <20190904123032.23263-1-broonie@kernel.org> <3e3a2c8a-b4fc-8af6-39e1-b26160db2c7c@arm.com> In-Reply-To: <3e3a2c8a-b4fc-8af6-39e1-b26160db2c7c@arm.com> From: Rob Herring Date: Thu, 19 Sep 2019 11:55:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/panfrost: Fix regulator_get_optional() misuse To: Steven Price Cc: Tomeu Vizoso , David Airlie , "linux-kernel@vger.kernel.org" , dri-devel , Mark Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 9, 2019 at 11:22 AM Steven Price wrote: > > On 09/09/2019 16:41, Rob Herring wrote: > > On Fri, Sep 6, 2019 at 4:23 PM Steven Price wrote: > >> > >> On 04/09/2019 13:30, Mark Brown wrote: > >>> The panfrost driver requests a supply using regulator_get_optional() > >>> but both the name of the supply and the usage pattern suggest that it is > >>> being used for the main power for the device and is not at all optional > >>> for the device for function, there is no meaningful handling for absent > >>> supplies. Such regulators should use the vanilla regulator_get() > >>> interface, it will ensure that even if a supply is not described in the > >>> system integration one will be provided in software. > >>> > >>> Signed-off-by: Mark Brown > >> > >> Tested-by: Steven Price > >> > >> Looks like my approach to this was wrong - so we should also revert the > >> changes I made previously. > >> > >> ----8<---- > >> From fe20f8abcde8444bb41a8f72fb35de943a27ec5c Mon Sep 17 00:00:00 2001 > >> From: Steven Price > >> Date: Fri, 6 Sep 2019 15:20:53 +0100 > >> Subject: [PATCH] drm/panfrost: Revert changes to cope with NULL regulator > >> > >> Handling a NULL return from devm_regulator_get_optional() doesn't seem > >> like the correct way of handling this. Instead revert the changes in > >> favour of switching to using devm_regulator_get() which will return a > >> dummy regulator instead. > >> > >> Reverts commit 52282163dfa6 ("drm/panfrost: Add missing check for pfdev->regulator") > >> Reverts commit e21dd290881b ("drm/panfrost: Enable devfreq to work without regulator") > > > > Does a straight revert of these 2 patches not work? If it does work, > > can you do that and send to the list. I don't want my hand slapped > > again reverting things. > > I wasn't sure what was best here - 52282163dfa6 is a bug fix, so > reverting that followed by e21dd290881b would (re-)introduce a > regression for that one commit (i.e. not completely bisectable). > Reverting in the other order would work, but seems a little odd. > Squashing the reverts seemed the neatest option - but it's not my hand > at risk... :) > > Perhaps it would be best to simply apply Mark's change followed by > something like the following. That way it's not actually a revert! > It also avoids (re-)adding the now redundant check in > panfrost_devfreq_init(). > > Steve > > ---8<---- > From fb2956acdf46ca04095ef11363c136dc94a1ab18 Mon Sep 17 00:00:00 2001 > From: Steven Price > Date: Fri, 6 Sep 2019 15:20:53 +0100 > Subject: [PATCH] drm/panfrost: Remove NULL checks for regulator > > devm_regulator_get() is now used to populate pfdev->regulator which > ensures that this cannot be NULL (a dummy regulator will be returned if > necessary). So remove the checks in panfrost_devfreq_target(). > > Signed-off-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) Okay, I've gone this route and applied Mark's patch and this one. Rob