Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4524080ybe; Mon, 16 Sep 2019 13:48:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWv47EdtmoMo2WDnXZi4yxFEOh/3UYi3dyjqdDsk6jHUxSPrUROA+JMjtTeYZZd5kJpha8 X-Received: by 2002:a17:906:959:: with SMTP id j25mr1741640ejd.51.1568666930419; Mon, 16 Sep 2019 13:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568666930; cv=none; d=google.com; s=arc-20160816; b=PYqeABiDSkbodx3zh4Sqnu36fa+rPaSJP5BdYBj9C0qkgOyH0x6PdrrKZhe/5esrHD rouDviU+c+VS7/GhosPs48r1MHr0ZnDVDmt1uESAbsHSxVialwCL7BCyDpgwZGZc4fkv sCzgGdLudTBmyvTpBtLMKOVkUrL1kpiVUDO2D9U/tnaJ0hbYGoRVBl3I7JN9avYs1S3v AhWQDc7+3Fu3LbuqOdvZ60s8h8l9JhvKQEUZLlNvy4EPCt4O3fbHUKoZgF3wqNQ0Mcfe b74Dane0mWvHD7A8udW/W+aswOAplbrOD0tV51By8XuSIWvJkQGRvfTrcvJ/2jsI6FYd e33A== 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=768Sh8OVCZjBOZt3k89v4UrywpjMcpm5T6xe1BNm4rE=; b=e0YlJaElKli5jcVycDWqo8aGpXQhIoUKaxgjcy5XwPLkglnOr62b6EzURRAS52nV+1 mTI5Df0rS7NsiTfaJ9/smSyczMMjLcpyG6EHAk1LD8gHDLHKrO/JHs+CTW2wqL/0Ijo8 Dm8tZiYphnyUivG4wJ5/jfcGsQwrEwRS5pChwVUJ/0wbY99o5Fz1VSATvw+A4yZL4Uz4 ToZB33lO01ktdinIoJVC3DFqUC3N3LKp5nLsO+Hchjf2KKUvmPSMrKB5RT3QJcqNXH11 U8ZmZkMzOb9dpcvXzMjP6R3DCh9Mjs06j6DRIWpwFa2DaW+53mECCc9M3ag6KP5y+Y4N OrMQ== 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 l22si128933edq.174.2019.09.16.13.48.27; Mon, 16 Sep 2019 13:48: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 S2388736AbfIPOgP (ORCPT + 99 others); Mon, 16 Sep 2019 10:36:15 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41985 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388652AbfIPOgP (ORCPT ); Mon, 16 Sep 2019 10:36:15 -0400 Received: by mail-ot1-f65.google.com with SMTP id c10so11086otd.9; Mon, 16 Sep 2019 07:36:14 -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=768Sh8OVCZjBOZt3k89v4UrywpjMcpm5T6xe1BNm4rE=; b=ldsQdbMZb/kcnIKlUq+ylPdDFNQ0xq0vBPbXdKB4hxljQ9qaF0vhEd5JHNIeXT4mBn nq5f7W5nd7xgEKoOjjxTZ6DghV/+++AkoPt6VjmYPVn/74b4ohN+J3lNm6uDJ7+OZEtJ jD6AzgXH0GD44fABGxOnDAriw2mXxqpj/d354Abd1deOO4I94JIvpjAjpGdjcviH6xo2 NvhgFdEPzPryJe73vj7Y3sCT/Cb3f5mNRqwJL2i9+CuzhNxC5wMM4JHQpb2FU1ey62Nk ExRd7wJUaEZf9jbHTSGiJFp5FFGOebWV2fznfYLTFHS10YjvaYJqfXNxfxBpbeKq3yv3 +v6w== X-Gm-Message-State: APjAAAX0pYHS+D/LNQ1fO2mpEqA5bVWa2v9mf7x8Xp3CiBI4d3N1vqSP saGbx11z0wCcL1DoxqQsXVaZyavaaj4pJcz9cNU= X-Received: by 2002:a05:6830:1196:: with SMTP id u22mr11397406otq.39.1568644574252; Mon, 16 Sep 2019 07:36:14 -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: <1568376720-7402-3-git-send-email-gareth.williams.jx@renesas.com> From: Geert Uytterhoeven Date: Mon, 16 Sep 2019 16:36:03 +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 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? > + > /* Basic HW init */ > spi_hw_init(dev, dws); > What about the error path? Don't you need to disable Runtime PM again in dw_spi_remove_host()? I assume this will be called from drivers/spi/spi-dw-mmio.c, which already enables the clock explicitly all the timer? 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