Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1440205pxp; Thu, 10 Mar 2022 05:37:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTIX96DBgnMAt2oR3irzREqq/1NdrGjJ63qZ8aPL0t82NxwpY28lKvTL7f7uNRuStJJKSQ X-Received: by 2002:a17:907:91c8:b0:6d6:e98f:8342 with SMTP id h8-20020a17090791c800b006d6e98f8342mr4322242ejz.590.1646919449683; Thu, 10 Mar 2022 05:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646919449; cv=none; d=google.com; s=arc-20160816; b=n5SVPeQg6OsIjdYe3guxZNQ45olP5LPNWXZm9oI133sOcrB2IcSGJKk7B8Jlzh6Wop eq0KHHY/ydis+UamLjPA45uKEaZUhhdecbf8hAxvrXl2iVRelR2w9jrPQXJz31ZDkVf0 RIZK6h6Yq0rKfbO3qV+5j5y+xI4QeorlM7eoJDIpKyic6pPmFfEyPT29H5Gv/WZ++uv3 K4QRbL4fmAdABealiAfMblU/gtTpeFpDmSVtjfAp9HP+wAb6oXxncVjOyxw4cYj9MKze GunhUU6aUYx7mSfzywjvu2JEAOMZPotYQD+u3G7eHZCJGfr3m7tbCrqaxprKE6ZtHI8B yjPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5LJv5iPo5cfeDn7N9X9RNaWuiPsLPljE4VKtBlutQww=; b=DYmiHHL3fyh34ujhxsfDa8P+JJexcmd8/fWzKT79yjHkYCS40PtIPtDed6sFT+oP0X Ov/XoabIq4/dVbd9ghvN/5m3rHpSRwHL75xbAIkN2xDGj7oJEnAU6yzNV19FkMF5K298 eMIrItu5AGTjUL86NcuRRmEQX/+OK7VyCCgOy6k6809hA7svCnttHUdguqyb9FtkWPr5 eh7APrirLVziuH0+efz+IOX4WZ+02VwVamSFvaTwa9r/GTEYtT3PF4cx6RJKZ0/V6aAE 5Slvrq80Px+68V7RKBcPqWQnQAuDk662oZBOoYbA3YHDXy/5AG828uufGgOsHJRlvRon Ns5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUG4z67O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dk16-20020a0564021d9000b004163769a3f6si3069534edb.168.2022.03.10.05.37.06; Thu, 10 Mar 2022 05:37:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUG4z67O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237679AbiCITV4 (ORCPT + 99 others); Wed, 9 Mar 2022 14:21:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237633AbiCITVr (ORCPT ); Wed, 9 Mar 2022 14:21:47 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 862786CA76 for ; Wed, 9 Mar 2022 11:20:47 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id w7so3940658ioj.5 for ; Wed, 09 Mar 2022 11:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5LJv5iPo5cfeDn7N9X9RNaWuiPsLPljE4VKtBlutQww=; b=qUG4z67OgiA7yzlxO55VgCWHFSXjrPoIKNgGXxYJ/EVfCiZ/4lWOp2CUjfNf4WQp5S fXJM3hjdPwRo7p0Q0ZONBqdzmRzwOGSab1iSgR9OjqvGURMOX5x3uvC/UBGt+LknkkIN uTJ+63ldQRGqztu2jEaw6/mbfSy/bpnuKLulPjrjUCso/TveswO5jzLsyEh4iEHS+cbl DK36rdqE8XBQUUiiNROVraobvyxQ54lCaXvcFjW+1jYufM/atPgI3sU88ruYK1bYyDKe CbL+g0mWfiRk9I75XK0dOnOGbDLGsyQM9M9eOpSptMnoW1viVj+tTgcqdPppjpsWKbGC qjpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5LJv5iPo5cfeDn7N9X9RNaWuiPsLPljE4VKtBlutQww=; b=HcylSELCvy6hzp9SxrnmeZMEnRlz+FYJSaJ6LyXqZ79MqzeBBGZhe0fw0734Y0QxmZ 3DKlYYhS9qV0tSrMt5IkJWx0n/CNTzI7YSzPHI+KzYPezdPF8PnG4ivsSExiSyTWSff4 baGP5A/q43XdoDuKJQeOoBFIKDIrYfbazTbzYATOOVZY505fnuNgixeiRf3u0g6W/fe+ HCKqwJME1gtSm7gkWWchb/9Kv+kFsGqtgf2pX+IDLZe9t5XxT+05Vtll/2OTFjs7ZQaN n2nH+MGD8OQqoZGew+TNVctKkYfeNbkbUs5J9tJTCt5SiV50GKyakDHi2FOAFD3bQFOG Y8eg== X-Gm-Message-State: AOAM532DP2kDAYJw7l33kpmr49ZtJum95CaFPnFrigqDc8Z4of0vlAnf EfS7BEaEBCfWn7IwfBljiwDf2w== X-Received: by 2002:a02:cadb:0:b0:317:b785:8ab2 with SMTP id f27-20020a02cadb000000b00317b7858ab2mr894264jap.108.1646853646899; Wed, 09 Mar 2022 11:20:46 -0800 (PST) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id g8-20020a056602248800b006409fb2cbccsm1389182ioe.32.2022.03.09.11.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 11:20:46 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: djakov@kernel.org, bjorn.andersson@linaro.org, mka@chromium.org, evgreen@chromium.org, cpratapa@codeaurora.org, avuyyuru@codeaurora.org, jponduru@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 3/7] net: ipa: use interconnect bulk enable/disable operations Date: Wed, 9 Mar 2022 13:20:33 -0600 Message-Id: <20220309192037.667879-4-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220309192037.667879-1-elder@linaro.org> References: <20220309192037.667879-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The power interconnect array is now an array of icc_bulk_data structures, which is what the interconnect bulk enable and disable functions require. Get rid of ipa_interconnect_enable() and ipa_interconnect_disable(), and just call icc_bulk_enable() and icc_bulk_disable() instead. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_power.c | 76 +++++++------------------------------ 1 file changed, 13 insertions(+), 63 deletions(-) diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index ec2ebc74edb8b..67f76e6a6ae59 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -156,86 +156,34 @@ static void ipa_interconnect_exit(struct ipa_power *power) power->interconnect = NULL; } -/* Currently we only use one bandwidth level, so just "enable" interconnects */ -static int ipa_interconnect_enable(struct ipa *ipa) -{ - struct icc_bulk_data *interconnect; - struct ipa_power *power = ipa->power; - int ret; - u32 i; - - interconnect = power->interconnect; - for (i = 0; i < power->interconnect_count; i++) { - ret = icc_enable(interconnect->path); - if (ret) { - dev_err(&ipa->pdev->dev, - "error %d enabling %s interconnect\n", - ret, interconnect->name); - goto out_unwind; - } - interconnect++; - } - - return 0; - -out_unwind: - while (interconnect-- > power->interconnect) - (void)icc_disable(interconnect->path); - - return ret; -} - -/* To disable an interconnect, we just its bandwidth to 0 */ -static int ipa_interconnect_disable(struct ipa *ipa) -{ - struct ipa_power *power = ipa->power; - struct device *dev = &ipa->pdev->dev; - struct icc_bulk_data *interconnect; - int result = 0; - u32 count; - int ret; - - count = power->interconnect_count; - interconnect = power->interconnect + count; - while (count--) { - interconnect--; - ret = icc_disable(interconnect->path); - if (ret) { - dev_err(dev, "error %d disabling %s interconnect\n", - ret, interconnect->name); - /* Try to disable all; record only the first error */ - if (!result) - result = ret; - } - } - - return result; -} - /* Enable IPA power, enabling interconnects and the core clock */ static int ipa_power_enable(struct ipa *ipa) { + struct ipa_power *power = ipa->power; int ret; - ret = ipa_interconnect_enable(ipa); + ret = icc_bulk_enable(power->interconnect_count, power->interconnect); if (ret) return ret; - ret = clk_prepare_enable(ipa->power->core); + ret = clk_prepare_enable(power->core); if (ret) { dev_err(&ipa->pdev->dev, "error %d enabling core clock\n", ret); - (void)ipa_interconnect_disable(ipa); + icc_bulk_disable(power->interconnect_count, + power->interconnect); } return ret; } /* Inverse of ipa_power_enable() */ -static int ipa_power_disable(struct ipa *ipa) +static void ipa_power_disable(struct ipa *ipa) { - clk_disable_unprepare(ipa->power->core); + struct ipa_power *power = ipa->power; - return ipa_interconnect_disable(ipa); + clk_disable_unprepare(power->core); + + icc_bulk_disable(power->interconnect_count, power->interconnect); } static int ipa_runtime_suspend(struct device *dev) @@ -249,7 +197,9 @@ static int ipa_runtime_suspend(struct device *dev) gsi_suspend(&ipa->gsi); } - return ipa_power_disable(ipa); + ipa_power_disable(ipa); + + return 0; } static int ipa_runtime_resume(struct device *dev) -- 2.32.0