From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA82C17445 for ; Mon, 11 Nov 2019 17:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7695620856 for ; Mon, 11 Nov 2019 17:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbfKKR1W (ORCPT ); Mon, 11 Nov 2019 12:27:22 -0500 Received: from utopia.booyaka.com ([74.50.51.50]:39270 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbfKKR1W (ORCPT ); Mon, 11 Nov 2019 12:27:22 -0500 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Nov 2019 12:27:22 EST Received: (qmail 588 invoked by uid 1019); 11 Nov 2019 17:20:41 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 11 Nov 2019 17:20:41 -0000 Date: Mon, 11 Nov 2019 17:20:41 +0000 (UTC) From: Paul Walmsley To: Christoph Hellwig cc: Anup Patel , Mark Rutland , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Sebastian Reichel , Rob Herring , Palmer Dabbelt , Paul Walmsley , linux-riscv Subject: Re: QEMU RISC-V virt machine poweroff driver In-Reply-To: <20191111161217.GA19157@lst.de> Message-ID: References: <20191107212408.11857-1-hch@lst.de> <20191111161217.GA19157@lst.de> User-Agent: Alpine 2.21.999 (DEB 260 2018-02-26) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, 11 Nov 2019, Christoph Hellwig wrote: > On Mon, Nov 11, 2019 at 05:06:24PM +0530, Anup Patel wrote: > > We really don't need this driver. Instead, we can simply re-use > > following drivers: > > mfd/syscon > > power/reset/syscon-reboot > > power/reset/syscon-poweroff > > > > Just enable following to your defconfig: > > CONFIG_POWER_RESET=y > > CONFIG_POWER_RESET_SYSCON=y > > CONFIG_POWER_RESET_SYSCON_POWEROFF=y > > CONFIG_SYSCON_REBOOT_MODE=y > > > > > > Once above drivers are enabled in your defconfig, make sure > > test device DT nodes are described in the following way for virt machine: > > Oh well, that is a lot more churn than a just works driver, and > will also pull it dependencies like regmap which quite blow up the > kernel size. But I guess that is where modern Linux drivers are > heading, so I'm not going to complain too loud.. The core issue is that putting random register writes in DT doesn't match the hardware. And the doctrine with DT has always been that it's supposed to represent the actual hardware. On FPGA bitstreams or ASICs that have the teststatus/testfinisher IP block, there really is an IP block out there - it's not just a bare register. If you update your driver to note that this is a SiFive IP block rather than a "RISC-V" IP block, I'll ack it. - Paul