Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp60220pxu; Wed, 25 Nov 2020 13:05:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQ9cG0bMes7lvYjgo6spR1AmdAiizH1YQn0jmGrqJoHlM+37UVS9RsxhcdGKNo6FoNwm0a X-Received: by 2002:a17:906:1b09:: with SMTP id o9mr5061475ejg.79.1606338325079; Wed, 25 Nov 2020 13:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606338325; cv=none; d=google.com; s=arc-20160816; b=ySLzmPdi2ImwTl5UDwz3sqefWD+dLtygcPrkJV7MOyzOb07PXzpbyvbfJ219ZNU9Sd umhZsNIc0qJDm6l/AKwgiT3G1Dh7Kou1JeYdPKmMyTuY/uyzh1oE/S2tv0e6eSpGbVXD 7vJDQhaCxTN2C30yRGNLm4GTx72w1RoB0H3J1ARKPu0TUy66H2wMKXw9H0TVBP2uCAUL QVaH6wKCOUBYVbJ/hcnfSolGa2plJ7frdH6xD2kC5yc4EDxeZgbwW0NVnHKcs/Ps7URR uCJ7jFSpYWX2Y+QaiKomRfT12ESVPAbkjnQX6jbBtC/P1clqqdCzLN9qSjazCW2ymWYd aYFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eAuXwpBdS/JjUO7qcexKMImXRzelfRnoZ0qNW4H1WMU=; b=sUN1Vt5JrjQoaEAnxbU4J3KSjx6wgHovaMeiEQ1HSHRjILCkZTivaSLBnh7gBbmrIB iOqjFPwUafh9EHT2gGr5L5JktGzTZZwetSlAuO1/647dWUJ32D/FruAlY/48sFidzET7 q0+rT0v2M3Cauy3ZGYXtfm99uhHMhOUJh/QPfiFeizS0E+Hwsm+v0/qXdhZjMDm7vPpa lMQHNllgGgzV/xxTPMAQd6KzluKsuOwrBr/CLBbeub+6lmTsvQLBIdpASKZujyVORpYT RqpsUO8iByYao3DpB6JFa4TmSMBQNlNDKQKdSN1LEVkuotfrkAp7lbvBEZ8OBBCQJefm HqgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ACEdiyJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk7si1938011ejb.600.2020.11.25.13.04.58; Wed, 25 Nov 2020 13:05:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ACEdiyJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730325AbgKYPc7 (ORCPT + 99 others); Wed, 25 Nov 2020 10:32:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730308AbgKYPc7 (ORCPT ); Wed, 25 Nov 2020 10:32:59 -0500 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D05E7C0613D4; Wed, 25 Nov 2020 07:32:58 -0800 (PST) Received: by mail-yb1-xb44.google.com with SMTP id e81so111478ybc.1; Wed, 25 Nov 2020 07:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eAuXwpBdS/JjUO7qcexKMImXRzelfRnoZ0qNW4H1WMU=; b=ACEdiyJ3cqIrtVHqzdxs4l1WSVZrfWwchaiEt11W/TCuygiIfdX4xPQnZnWzYcJjzK kOWpEw4J1ATkaKN+TKG/VsFDHpqHkf86VOZGgqfYieK+8cXX5EFqfGWPzLu6UIIUQMR5 51DjnwRwsIIykw5QynNfOdbEeoDuq7oipZjiNHH+6hhlyXGBQW2rWX15DR9j0R37ueY0 04aKxerOjP1lWJ/aD0Fqva/5h3Oj7bD6DS8jn2rucG5QDncstsoofxqVZNINe9GhJ3dc sZkMboxQq+z4gaeuSTHdd6CdqW0P6LXVPaVyfEPo5GdSve7nBp+M5Efd5lQ8X7wDBzo+ 2dvg== 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=eAuXwpBdS/JjUO7qcexKMImXRzelfRnoZ0qNW4H1WMU=; b=MZpkQM5OxkbnVqMLO5L5dg+BD+0KKdtrpMl7PH1KlCORemfYLhX72q3Svh4hRcw56M TAnkpbcnI8olXLDr1zFlbgQU9sIxRtx2GmY8cPy5NPyI0fzn/xfZ+rZcKwqmFxIUe5Vx n7A6nsq23FYUTQg/6foLeDdBkKp8rV37Ab9EpHjMVVrYCyuPqNFJOz496MvlbA3AzX1e wDfheIptDXqus+94sEzrXpOrYGnWUTWYrwh6+VC/7lZ0rJMFRG82YqkK/yx76uROlOf8 FEOyiC9FjTkXhwb/XdHvb+1rHzMMD0RysFpUzrfi7wSIFWyvNuL2uTTwZRMUaZ35dFM1 kb6w== X-Gm-Message-State: AOAM531vHhtDgF6hypUXNSL9CFQewxLl5Rt4RIoRhq6M0kIZ/FC/Z634 hLswWLlnxxASdIponYsdvIJwP4qWjIXTCWQQe3A= X-Received: by 2002:a25:aa6b:: with SMTP id s98mr4568353ybi.214.1606318377703; Wed, 25 Nov 2020 07:32:57 -0800 (PST) MIME-Version: 1.0 References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20201124112552.26377-3-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Wed, 25 Nov 2020 15:32:31 +0000 Message-ID: Subject: Re: [PATCH 2/5] memory: renesas-rpc-if: Make rpcif_enable/disable_rpm() as static inline To: Geert Uytterhoeven , Sergei Shtylyov Cc: Lad Prabhakar , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown , Linux Kernel Mailing List , Linux-Renesas , Biju Das Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thank you for the review. On Tue, Nov 24, 2020 at 3:43 PM Geert Uytterhoeven wrote: > > Hi Prabhakar, > > On Tue, Nov 24, 2020 at 12:27 PM Lad Prabhakar > wrote: > > Define rpcif_enable_rpm() and rpcif_disable_rpm() as static > > inline in the header instead of exporting it. > > > > Suggested-by: Pavel Machek > > Signed-off-by: Lad Prabhakar > > Thanks for your patch, which is an improvement. > > > --- a/include/memory/renesas-rpc-if.h > > +++ b/include/memory/renesas-rpc-if.h > > @@ -10,6 +10,7 @@ > > #ifndef __RENESAS_RPC_IF_H > > #define __RENESAS_RPC_IF_H > > > > +#include > > #include > > > > enum rpcif_data_dir { > > @@ -77,11 +78,19 @@ struct rpcif { > > > > int rpcif_sw_init(struct rpcif *rpc, struct device *dev); > > void rpcif_hw_init(struct rpcif *rpc, bool hyperflash); > > -void rpcif_enable_rpm(struct rpcif *rpc); > > -void rpcif_disable_rpm(struct rpcif *rpc); > > void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs, > > size_t *len); > > int rpcif_manual_xfer(struct rpcif *rpc); > > ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf); > > > > +static inline void rpcif_enable_rpm(struct rpcif *rpc) > > +{ > > + pm_runtime_enable(rpc->dev); > > +} > > + > > +static inline void rpcif_disable_rpm(struct rpcif *rpc) > > +{ > > + pm_runtime_put_sync(rpc->dev); > > Looking at how this is used, this should call pm_runtime_disable() > instead. > > And probably this should be moved inside the core RPC-IF driver: > 1. pm_runtime_enable() could be called from rpcif_sw_init(), > 2. pm_runtime_put_sync() can be called from a new rpc_sw_deinit() > function, to be called by the SPI and MTD drivers on probe failure > and on remove. > Totally agree. Sergei are you OK with the above suggestions ? Cheers, Prabhakar