Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5174705pxj; Wed, 9 Jun 2021 10:51:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM7+1murtILR7t2DU3a0uoC6u9TDjSgbxdS6RLnLyrrqthW9EjzDq2ds9qV6slif3rspsX X-Received: by 2002:aa7:d85a:: with SMTP id f26mr595708eds.332.1623261074845; Wed, 09 Jun 2021 10:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623261074; cv=none; d=google.com; s=arc-20160816; b=L9+4GQLfrQKEQYfGh+/KiOXQznluXK3GggjC15hodKiVKqnskBm+tFG3JUB7UzlCS1 VG73R/TVrdzfSTD5OTLKFZ9y35x9us3bb8EXP4oB9L3RoURxFSX4BCCWvETkuPw0+TKM LhDiquHqyS0Rv74eFJLFvrlGyy+SCksZKPrYupVmcdP+6J6dogzEaWLhSGbhO3h/pfY1 kzhl6t2wodWLL59/Sjbiaabo7ug9TVTtrjHoc67H+C7O0mdSMttFr1ZvGPCI51hgT07O SPZAhlI35Wo5DuKfjpsqFM/5aqrZDl5BeVA+n5ZGhXHlunipSyV+0wcqmJ5HtheaEs1I ZX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=IhyCu8H5WSS/E4CDjMhpArM4pXXOj0TlzCRvDB9JWNs=; b=gd6xYAtY8wpmRTVFi+l566mV90XAEfyRs3zNOkN2DygvFe8JMuVidWFE5akVH9RQhD mek2sOzHkfLpVY9bgjhHq+pbhUSpwNPU/E5A3tdfEot4XpMizrKezGXvE0uYuvKnov90 XexzRfI/gx9/AVMFmowqtgr3Z2e/dqJZuCV7OweBL25pK/g92H1cZPjQ4YrJTO+q2y1s 62h2KotGqI289OxVyPl3Bzl9cisvH+lGYMJcihxVXRtHKf2Ut2AG+84glCqMZJrMMElK tm/3yAZPpBMrk02nm6Ig2L/zobuQkMGO2kns3EJsMUhGtpoHEE4Tirf9xG5TCjBP8lRh y8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FylaupbF; 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 v12si305566edw.236.2021.06.09.10.50.49; Wed, 09 Jun 2021 10:51:14 -0700 (PDT) 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=FylaupbF; 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 S237195AbhFIOoH (ORCPT + 99 others); Wed, 9 Jun 2021 10:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbhFIOoH (ORCPT ); Wed, 9 Jun 2021 10:44:07 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E563C061574; Wed, 9 Jun 2021 07:42:12 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id y7so21137784wrh.7; Wed, 09 Jun 2021 07:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IhyCu8H5WSS/E4CDjMhpArM4pXXOj0TlzCRvDB9JWNs=; b=FylaupbFDFZrMhi3SvSNnIe8tPXxK9fI1FeBkscPkU7HbplyXTi5mjeQl4ajeZUMjF 3u9Y9nVjGb2t0Jl/1yP6vkekD7tk4+/juEZuLQPMu++PeIg4Rz0q+Y3HoLTPRvxlNgwm d/saSwDWPCECKQPpWi/mJ6GbyjOEuY9BOFCwwHxkr9bLFyuLqWhYP8LZvaPQ1YYCIL6s waetdHEa2R04ypG6be8Vd7k+j9eqjmmhbEldq2TdqRkoUscclY5BLVAkfx/5Dreyal2u gb5v7pguPCe4uVY8/JkG6lEj0nXgYj6jMz7m0CFQZbala5Oq81d+LQmqbKQOnnBaf50D O/XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IhyCu8H5WSS/E4CDjMhpArM4pXXOj0TlzCRvDB9JWNs=; b=iEJ5QtiqFzsVnmLrPPb9M/cBnZHWmToJzk8HZOg/dfSQo9VILMrQu9Xrccybxdzw+8 zcgKova2gcBxEoIJZftvs3LZfwMV7KLj0bQhKF24SOcaTw60zEM5pfoow2BHhD5xCVXi rHT+YYSvPBJVXV4waG27C/jBVD/LXyUt4+DO/jdokaldD7zxovH6wgSE6Cu4zCEBFQ1p 87jyVVCnMk+M7XEfotNd/4lwk9E7AQN1OIKCFA+eZ6gQN6wO1J82++UvVPu90cbnM1TC 1wJ36jHYGf/fU+xs4S9CLz/GTNncZWHyjOCfP/y6TRgJQdMH7xN+e0Ni+QpLrVOsZOix 84Zw== X-Gm-Message-State: AOAM531M/X+xIUC5fN0hRYDGf7wdetw8vwBnfsi93xwUeRIwDPSifHlM Pc/nvpjKg0/56LmoxObLwuQB2YWmXSb45nQb X-Received: by 2002:a5d:59af:: with SMTP id p15mr171709wrr.292.1623249731120; Wed, 09 Jun 2021 07:42:11 -0700 (PDT) Received: from ziggy.stardust (81.172.61.185.dyn.user.ono.com. [81.172.61.185]) by smtp.gmail.com with ESMTPSA id v7sm129321wru.66.2021.06.09.07.42.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 07:42:10 -0700 (PDT) Subject: Re: [PATCH v5 14/16] memory: mtk-smi: Get rid of mtk_smi_larb_get/put To: Yong Wu , Joerg Roedel , Rob Herring , Krzysztof Kozlowski Cc: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , Matthias Kaehlcke , anan.sun@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com, yi.kuo@mediatek.com, eizan@chromium.org, acourbot@chromium.org References: <20210410091128.31823-1-yong.wu@mediatek.com> <20210410091128.31823-15-yong.wu@mediatek.com> From: Matthias Brugger Message-ID: <1755fd87-a724-508f-92a8-d09b627d58ca@gmail.com> Date: Wed, 9 Jun 2021 16:42:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210410091128.31823-15-yong.wu@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2021 11:11, Yong Wu wrote: > After adding device_link between the iommu consumer and smi-larb, > the pm_runtime_get(_sync) of smi-larb and smi-common will be called > automatically. we can get rid of mtk_smi_larb_get/put. > > CC: Matthias Brugger > Signed-off-by: Yong Wu > Reviewed-by: Evan Green Acked-by: Matthias Brugger > --- > drivers/memory/mtk-smi.c | 14 -------------- > include/soc/mediatek/smi.h | 20 -------------------- > 2 files changed, 34 deletions(-) > > diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c > index c5fb51f73b34..7c61c924e220 100644 > --- a/drivers/memory/mtk-smi.c > +++ b/drivers/memory/mtk-smi.c > @@ -134,20 +134,6 @@ static void mtk_smi_clk_disable(const struct mtk_smi *smi) > clk_disable_unprepare(smi->clk_apb); > } > > -int mtk_smi_larb_get(struct device *larbdev) > -{ > - int ret = pm_runtime_resume_and_get(larbdev); > - > - return (ret < 0) ? ret : 0; > -} > -EXPORT_SYMBOL_GPL(mtk_smi_larb_get); > - > -void mtk_smi_larb_put(struct device *larbdev) > -{ > - pm_runtime_put_sync(larbdev); > -} > -EXPORT_SYMBOL_GPL(mtk_smi_larb_put); > - > static int > mtk_smi_larb_bind(struct device *dev, struct device *master, void *data) > { > diff --git a/include/soc/mediatek/smi.h b/include/soc/mediatek/smi.h > index 15e3397cec58..11f7d6b59642 100644 > --- a/include/soc/mediatek/smi.h > +++ b/include/soc/mediatek/smi.h > @@ -19,26 +19,6 @@ struct mtk_smi_larb_iommu { > unsigned char bank[32]; > }; > > -/* > - * mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter. > - * It also initialize some basic setting(like iommu). > - * mtk_smi_larb_put: Disable the power domain and clocks for this local arbiter. > - * Both should be called in non-atomic context. > - * > - * Returns 0 if successful, negative on failure. > - */ > -int mtk_smi_larb_get(struct device *larbdev); > -void mtk_smi_larb_put(struct device *larbdev); > - > -#else > - > -static inline int mtk_smi_larb_get(struct device *larbdev) > -{ > - return 0; > -} > - > -static inline void mtk_smi_larb_put(struct device *larbdev) { } > - > #endif > > #endif >