Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5486479ybe; Tue, 17 Sep 2019 08:41:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlAvAAe0bQcvKKyAfCHBIKr9uCBA6E+z8uM7keKcWqEU8yMPyni3cFba4C2IA3YozEe3ZX X-Received: by 2002:a17:906:3449:: with SMTP id d9mr5282635ejb.111.1568734910478; Tue, 17 Sep 2019 08:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568734910; cv=none; d=google.com; s=arc-20160816; b=er2p8p4ffleQPRiE7mtd32xfWCMrmGDx1uKM2699B4mJpHMpzrYo/g+frKCTUamPQk SdW0As2OOMyBoIDM10wpOpJT7fFj7oKRfJC8NOZSluvt5VkSxyep0rKZRVarim9LYOAG yDK/gztFuqmTFIpfsFXigiE+UFUZy48ehaNEU2WivvFPUF+7ifI0cihMmVdbRGtRy57m +iTtpbih8lAwql1sgT2MkB0inFpCQh3VMe6rAXq4MWOm4RTJVbQo+ytlNjYy2qCSL7Vn 9KRe58l/2RpQm0GCW/wfel/zzsbsGQJWkyeINf7ZmHo3V+jfISjve18j/a27AN0FDQHG /3dQ== 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=VA/5M2S2lqIzcsMp1DPf/Sv28rPk2HKwJRxSgrZ6sG0=; b=jf29MRhyEW4pd9P/G3oZkdSW+cfj73IroLtZ6khynFjivA/sGZyNDNtxv/M5Jnp2dv ytgAY68Km48GHMBo+IplxF9GH+qdtFxRcv+Bt3FOZEgBkerbGZy3BUVCjEwScq+N3CnD aIjE45guGeR0S+EvWgunUSVuP/ESitkoZr14PyCtVTa7WFsQajTOcMWuVUqmi0+Zxvwx geb/dggdw7SWNDgZZywCLv+Q0IJ9DzbVQ8/5Oz0wKT4xTWDhX8kQnGWKRaDwDCjaP8Q6 gak55ooWSvdWUnNoHOdPe1/FPohfBVpjjmnUkCN2xO31X/b6V4W6R+sqP+ML7rEdJD0b xGQQ== 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 d17si1557655eda.213.2019.09.17.08.41.25; Tue, 17 Sep 2019 08:41:50 -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 S2404270AbfIQGgO (ORCPT + 99 others); Tue, 17 Sep 2019 02:36:14 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:37441 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729094AbfIQGgN (ORCPT ); Tue, 17 Sep 2019 02:36:13 -0400 Received: by mail-ot1-f68.google.com with SMTP id s28so2062185otd.4; Mon, 16 Sep 2019 23:36:13 -0700 (PDT) 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=VA/5M2S2lqIzcsMp1DPf/Sv28rPk2HKwJRxSgrZ6sG0=; b=nm7ZFOvF7l2OnsjPSy7l28t10rId/mSWGcjP8M6h/x5CLjNRq3JSZ7LpCkOS1scS1f /dKKENIJsM1pm3WNC3SF9JhOoEdYda29YrszQ3uC88/C0d5qJP7uaD2UxrGx+5gDNv4q YO/robCU6ZRwuF2xxptdWR3pFHPzkRETnfchB/WbdzFSDpLUM/oxog3GMHs/KFCxxNhQ SLuCrXiSvAGj2IjbbhjhRnsBvYDx6A2PW4E38u2wqOaEvRqiVES8m5vYey+2cVdNQPmE sWGCH5afJ4oURlTqlxkpiN1iX/2o91sfHC1XtFFkfYSnbLby9Tl9uWMsSnOhY/JxmAGh QV3w== X-Gm-Message-State: APjAAAXL5VSh0wI2H5AziHCksKBs7rxkUMmeg9nH3RaITru6AWqPVcPi MPIM+vNqXqC7QUu39ST0MdH6tCBgKWEQNhPEm90= X-Received: by 2002:a9d:12ca:: with SMTP id g68mr1489740otg.145.1568702172994; Mon, 16 Sep 2019 23:36:12 -0700 (PDT) MIME-Version: 1.0 References: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> <1568376720-7402-3-git-send-email-gareth.williams.jx@renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 17 Sep 2019 08:36:01 +0200 Message-ID: Subject: Re: [PATCH 2/3] spi: dw: Add basic runtime PM support To: Gareth Williams Cc: Mark Brown , Phil Edworthy , linux-spi , 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 Hi Gareth, On Mon, Sep 16, 2019 at 6:14 PM Gareth Williams wrote: > > On Mon, Sep 16, 2019 at 15:36 PM Geert Uytterhoeven > > wrote: > > On Fri, Sep 13, 2019 at 2:13 PM Gareth Williams > > wrote: > > > From: Phil Edworthy > > > > > > Enable runtime PM so that the clock used to access the registers in > > > the peripheral is turned on using a clock domain. > > > > > > Signed-off-by: Phil Edworthy > > > Signed-off-by: Gareth Williams > > > > Thanks for your patch! > > > > > --- a/drivers/spi/spi-dw.c > > > +++ b/drivers/spi/spi-dw.c > > > @@ -10,6 +10,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > > > > @@ -497,6 +498,9 @@ int dw_spi_add_host(struct device *dev, struct > > dw_spi *dws) > > > if (dws->set_cs) > > > master->set_cs = dws->set_cs; > > > > > > + pm_runtime_enable(dev); > > > + pm_runtime_get_sync(dev); > > > > The second line keeps the device powered all the time. > > What about setting spi_controller.auto_runtime_pm = true, so the SPI code > > can manage its Runtime PM status? > > That makes sense and works on target, I will change this for V2. > > I assume this will be called from drivers/spi/spi-dw-mmio.c, which already > > enables the clock explicitly all the timer? > Yes, spi-dw-mmio.c already enables the bus clock, however we want to use clock > > domain to enable the clock and not explicitly provide pclk in the dts. If there are > no other uses of that pclk, we can remove that later on. IC, that's useful sideband information. "pclk" is indeed an optional clock. "ssi_clk" must be first. However, to make use of the clock domain code, you still have to list "pclk" in DT, but use a different name, to avoid spi-dw-mmio.c enabling it all the time? Or do you plan to modify spi-dw-mmio.c for that? In the former case, you should document that in your bindings, which currently build on top of snps,dw-apb-ssi.txt, thus include "pclk". Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds