From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2C51C432BE for ; Thu, 19 Aug 2021 22:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD65D60FDA for ; Thu, 19 Aug 2021 22:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237218AbhHSWU2 (ORCPT ); Thu, 19 Aug 2021 18:20:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236881AbhHSWUL (ORCPT ); Thu, 19 Aug 2021 18:20:11 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97DD4C06175F for ; Thu, 19 Aug 2021 15:19:34 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id v2so7495251ilg.12 for ; Thu, 19 Aug 2021 15:19:34 -0700 (PDT) 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=bOryrdzD3qCC5WFsDKYio83PoI6w7fQiXhMMT5rIdTM=; b=O0YMdz8y55fYcCHLECiTAc5PuhOOg1smSjJ4C/IMgLibk8+DTlgv/qnjwqIMJwEt2U tqk6W5GEigGoJT4CkFhkT5LYSJ+BVf1Tr0BL4rrgm5ifITnVN3fCsBjaFB9sKrC5AoHt q8diyS/jL4RvOUkB8n+UbRQhdOMpkBSqlOCXv1q90S3ZTpNlzuKvJnfDcCT5wpRGi+Kb bvVqXzMiXh3kkrwoNWxRGLhYgt0jWaxJURQrGJcDeoF2teljuElbjRdEdNZ5iq/PL3py FoicmVQMKyepjbg9qcSETcPgUnozLIkayQz9oLNo8Oq74ZjI3DLjFd9E3syL40hgKph4 BY0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bOryrdzD3qCC5WFsDKYio83PoI6w7fQiXhMMT5rIdTM=; b=DnpfMtg62YBWRzT5GBeHFDwSpA+QwhJRkqWdgFtVV3fMKPNjtYUitQwpYeZgj3V880 w4jw8tAQmf8KrfaSafgvGykXh4KR+LLuwjxcm23jtQ23L9ggY/W9VplOI1SelFKX83KU 0PYIXpZQncALC82dOX8qX2y5tLxOlWOwItg/QhPwPcifBf4GUOwNNx6edMAF3poSU0X+ UQOia8NuZC2XS9Ei1JzTn6rRJPYl4KY4PKDdJ8QIyI57TR6IG4ZdiWLEPfFAxU3dhpkS g6EvuL1IesKelBfUGVbonwkGj/vVTX30NMnXDuxEwsW20bF5Ppehmf2DAJFip/+u/o2y Xh8g== X-Gm-Message-State: AOAM533XanRh0i0J3GzZPKMFZFmBJ2hWlYH3OYR7X9mMcJ/+jyupUHje Dna7lCpriCjj38jl1vvD8jtK6g== X-Google-Smtp-Source: ABdhPJzCUT2nFMM9/U4tP1sDyybeRJByki72pPXQJtcSi8ZIzGhKM+oIk2cobdLtv+69NdSRUedHBw== X-Received: by 2002:a92:b112:: with SMTP id t18mr11377156ilh.36.1629411573983; Thu, 19 Aug 2021 15:19:33 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id o15sm2245188ilo.73.2021.08.19.15.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 15:19:33 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/5] net: ipa: kill ipa_clock_get() Date: Thu, 19 Aug 2021 17:19:27 -0500 Message-Id: <20210819221927.3286267-6-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210819221927.3286267-1-elder@linaro.org> References: <20210819221927.3286267-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only remaining user of the ipa_clock_{get,put}() interface is ipa_isr_thread(). Replace calls to ipa_clock_get() there calling pm_runtime_get_sync() instead. And call pm_runtime_put() there rather than ipa_clock_put(). Warn if we ever get an error. With that, we can get rid of ipa_clock_get() and ipa_clock_put(). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_clock.c | 17 ----------------- drivers/net/ipa/ipa_clock.h | 24 ------------------------ drivers/net/ipa/ipa_interrupt.c | 14 +++++++------- 3 files changed, 7 insertions(+), 48 deletions(-) diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c index 8f25107c1f1e7..357be73a45834 100644 --- a/drivers/net/ipa/ipa_clock.c +++ b/drivers/net/ipa/ipa_clock.c @@ -266,23 +266,6 @@ static int ipa_runtime_idle(struct device *dev) return -EAGAIN; } -/* Get an IPA clock reference. If the reference count is non-zero, it is - * incremented and return is immediate. Otherwise the IPA clock is - * enabled. - */ -int ipa_clock_get(struct ipa *ipa) -{ - return pm_runtime_get_sync(&ipa->pdev->dev); -} - -/* Attempt to remove an IPA clock reference. If this represents the - * last reference, disable the IPA clock. - */ -int ipa_clock_put(struct ipa *ipa) -{ - return pm_runtime_put(&ipa->pdev->dev); -} - static int ipa_suspend(struct device *dev) { struct ipa *ipa = dev_get_drvdata(dev); diff --git a/drivers/net/ipa/ipa_clock.h b/drivers/net/ipa/ipa_clock.h index 5c53241336a1a..8c21a007c4375 100644 --- a/drivers/net/ipa/ipa_clock.h +++ b/drivers/net/ipa/ipa_clock.h @@ -52,28 +52,4 @@ struct ipa_clock *ipa_clock_init(struct device *dev, */ void ipa_clock_exit(struct ipa_clock *clock); -/** - * ipa_clock_get() - Get an IPA clock reference - * @ipa: IPA pointer - * - * Return: 0 if clock started, 1 if clock already running, or a negative - * error code - * - * This call blocks if this is the first reference. A reference is - * taken even if an error occurs starting the IPA clock. - */ -int ipa_clock_get(struct ipa *ipa); - -/** - * ipa_clock_put() - Drop an IPA clock reference - * @ipa: IPA pointer - * - * Return: 0 if successful, or a negative error code - * - * This drops a clock reference. If the last reference is being dropped, - * the clock is stopped and RX endpoints are suspended. This call will - * not block unless the last reference is dropped. - */ -int ipa_clock_put(struct ipa *ipa); - #endif /* _IPA_CLOCK_H_ */ diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 934c14e066a0a..3fecaadb4a37e 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -21,9 +21,9 @@ #include #include +#include #include "ipa.h" -#include "ipa_clock.h" #include "ipa_reg.h" #include "ipa_endpoint.h" #include "ipa_interrupt.h" @@ -80,14 +80,16 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id) struct ipa_interrupt *interrupt = dev_id; struct ipa *ipa = interrupt->ipa; u32 enabled = interrupt->enabled; + struct device *dev; u32 pending; u32 offset; u32 mask; int ret; - ret = ipa_clock_get(ipa); + dev = &ipa->pdev->dev; + ret = pm_runtime_get_sync(dev); if (WARN_ON(ret < 0)) - goto out_clock_put; + goto out_power_put; /* The status register indicates which conditions are present, * including conditions whose interrupt is not enabled. Handle @@ -108,15 +110,13 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id) /* If any disabled interrupts are pending, clear them */ if (pending) { - struct device *dev = &ipa->pdev->dev; - dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n", pending); offset = ipa_reg_irq_clr_offset(ipa->version); iowrite32(pending, ipa->reg_virt + offset); } -out_clock_put: - (void)ipa_clock_put(ipa); +out_power_put: + (void)pm_runtime_put(dev); return IRQ_HANDLED; } -- 2.27.0