Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1250268imu; Tue, 20 Nov 2018 14:19:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/VY3jHXer31g+TIQLhn7LUoEfn/YRIgdlNX/G84/fPJ40cPdBY6KHzeZU2UM0Shers9NEIl X-Received: by 2002:a65:47ca:: with SMTP id f10mr3682769pgs.166.1542752382128; Tue, 20 Nov 2018 14:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542752382; cv=none; d=google.com; s=arc-20160816; b=iITPSDBqbrt9vTbjFdFaAC9PPNOoYDvwupQwDbSW3izhzAq0qsZZCmFrxUMeWFizNQ gwtR0zZMlRjTMiH35LQAK1Np86rTyl4Fgk7nrF7QQN1qWO5u9wxlRnNuw/z1WtBUfFmN Z7qHPayPvRvatJe3tWVbLXG3BsNYNdR5sCHPJRKCwdG9weVnJoDPXCvE98PZB0Y85BU4 9YUIs05+BDKQxlzu0yZ2zqCkMW089d+0wPa7hpPn+QdJWuuOVxgcS793XGTxqFQJelAp gNP+AKqBo8aiUZdzTTeLf1RyeA6fqcIq5RMKTz023lArUsI514mbGlgauTMY164A3WNd kIcw== 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; bh=HU7xGkvRNAh4jCxhrScaeICEtY2/sG34XNWqPuzs+0U=; b=S5pXOoa3t12waH16lsLDOi8WnzFI4u0tQCXfpv/Saoum/WTq56nJQHFTNYJHS7wQex l8TKEINHTmz2yVg/EgUm+s9maG+dtSqEOJDVgnXRMofS1B1W2J45dRSPMmHVDWbu0++P SMcdtDwhayBMMkCGVxPSud5RgJV2EeUTz8unzunJnHqiMonR+mf6TNHK1B9BkbaYXk3V dsm/EpYa1PAmZnfEsNTUTBVLCmXvkHEBWr350Ngk0gzVA3BUX8G/dh8QKAX30HDSeGan p5BAvUU6qQWKgExWFDOz96sU8HsCQRQPcebRzxq0OnIkllLVA/3RJinxPZxnIyCgK7v0 fGRw== 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 k11si39315318pgh.132.2018.11.20.14.19.26; Tue, 20 Nov 2018 14:19:42 -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 S1725977AbeKUILL (ORCPT + 99 others); Wed, 21 Nov 2018 03:11:11 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:43440 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbeKUILL (ORCPT ); Wed, 21 Nov 2018 03:11:11 -0500 Received: by mail-qt1-f195.google.com with SMTP id i7so1727012qtj.10; Tue, 20 Nov 2018 13:39:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HU7xGkvRNAh4jCxhrScaeICEtY2/sG34XNWqPuzs+0U=; b=tAyAZq0oaEH2FPp9zgqRqP0juwMK1aLkjbBUoOu4FyjqReiY87CVcIevY6YwFMdA/A HauxEGtcz1p0N1flq55CCxW7SAaeU7zJOR+zmfINQYg7vvOpG5zEqffKuNv8OhXzZC0p 44duqtKyuNlhNwVpFXrarn/OY0rLJ1ss7iK0pLnEU4dSMWFgiJH15kRxzt85S6833iA9 yvOUMty/ZEdHXIbCKlugV6iG00Iay7uI+GRs6MpPVjpVrjMmypNyXj3hhOgHwzSUZhvE pUxi21PTxQEddlBIl0bn/dPFnIontaUY7e1vaYWVygkab9EqJF/GJo+fJL++W4wZieR0 pXQw== X-Gm-Message-State: AA+aEWZprqJ9sXox52aD7R9QENS6vSX9agLbPlQj4t7IPFJCR7gfWu8t gDbtTvXJ2aFz9+YHldmgGq5UbOtraEXL8UCZ7Vs= X-Received: by 2002:ac8:7451:: with SMTP id h17mr444076qtr.319.1542749996503; Tue, 20 Nov 2018 13:39:56 -0800 (PST) MIME-Version: 1.0 References: <20181120172000.15102-1-eric@anholt.net> <1299453058.112996.1542736171394@email.ionos.de> <87o9aj77sk.fsf@anholt.net> In-Reply-To: <87o9aj77sk.fsf@anholt.net> From: Arnd Bergmann Date: Tue, 20 Nov 2018 22:39:28 +0100 Message-ID: Subject: Re: [PATCH 0/8] BCM2835 PM driver To: Eric Anholt Cc: Stefan Wahren , Florian Fainelli , Rob Herring , Mark Rutland , Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, "moderated list:BROADCOM BCM2835 ARM ARCHITECTURE" , Linux ARM , Linux Kernel Mailing List 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 Tue, Nov 20, 2018 at 10:34 PM Eric Anholt wrote: > >> Eric Anholt hat am 20. November 2018 um 18:19 geschrieben: > >> > >> > >> This series moves the BCM2835 WDT driver that controls a fraction of > >> the PM block out to soc/ and adds most of the rest of its > >> functionality. My motivation has been to have V3D be functional > >> without firmware calls, probably improve its interactivity (since > >> we'll be able to power on/off without RPC to the firmware that may be > >> busy with other tasks), and (in a patch not submitted in this series) > >> extend its binding to use the reset controller instead of trying to > >> reset by toggling its power domain. > >> > >> I've tested V3D with a few hours of running a V3D test, sleep(1) (to > >> trigger PM domain off); running a GPU hang job (to trigger reset); > >> sleep(1). The non-hanging success-case job always passed, and dmesg > >> had no complaints from bcm2835-pm. The other power domains are not > >> tested, but I've done my best. > >> > >> This series will probably also be of interest to the > >> https://github.com/christinaa/rpi-open-firmware project for enabling USB. > >> > > > > apologize to give you my feedback after you send out the series. > > > > I know you won't be happy about it, but i think we need a little more > > complex but future proof solution for this power driver. According to > > the register definition of the PM block, we have multiple functions > > here (power domains, watchdog, pads/pinctrl, ...). Since this is > > common for ARM SoCs there is a subsystem called mfd (multi function > > device) [1] to abstract all resources of the IP block. > > > > This has the advantage that we don't need a monolithic driver which > > takes care of all functions. > > I consider your "advantage" to be a disadvantage. By forcing the split, > you end up having more driver files to manage, more platform devices, > and more error-prone code to get the resources from the parent down into > the client. It feels like writing software for the sake of writing > software, rather than solving a concrete problem. > > My original series: > > 10 files changed, 951 insertions(+), 273 deletions(-) > > The MFD series: > > 12 files changed, 882 insertions(+), 25 deletions(-) My preference in general is having less code in drivers/soc and more in subsystems of people that understand their stuff. Not every driver leans itself to being an MFD, but the more differnent functions it has, the better it is to have it split up. This was the original motivation of moving irqchip, clk, pinctrl, etc drivers out of arch/arm/mach-* into their own subsystems. Arnd