Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp942017pxb; Thu, 19 Aug 2021 15:25:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylXKsGTsw9ORi2viFpU6anvCMpTljemnb3/LLmv9Ezdb0Isf7tzooBAbwDSA73TJ9J85zm X-Received: by 2002:a17:906:30d8:: with SMTP id b24mr17962457ejb.358.1629411908494; Thu, 19 Aug 2021 15:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629411908; cv=none; d=google.com; s=arc-20160816; b=Mu+wd4VV7ChRcyYgmXotN20UuPFxS6jbe9muSkoHXu3yy4uxcL9bABSSEvVIbYi2rm 1wR1mQV+gglOE7MXf84NCbXfpwg1ySzBo91q+RaTdB/1ZGAdMMHKVpOYM8fFJFYVmVKI m2L3Q5WbGyRZbgx8qAV1gJV2EGNyxXIopsHkrdcFUufWxdmT9+dKB/Q4NE4HQt4oWJ9v 6m400DwR5nl6gvgcvEVx/eO4gxIlgJc7oHUES3WfqJVuLXM1xkUIyw+L0OQXdUwSEdMs q6cquTC1WgYkUsmvwJk1qfC82mAqzd3tMKCglz1mWZu4BcSczOHQ2spOMPb3cxo9CVJz vsvw== 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=bOryrdzD3qCC5WFsDKYio83PoI6w7fQiXhMMT5rIdTM=; b=ZBHoUoq2o8ZT6EnyjMi7wOunGrS4/FX6QiJj5/FGzHFvDe9lJkQa+jmqigAj94ZbjQ XriMl9w1l9Q7DE+P3oSfCYmYvI04ARm+ua1vV1Cz10BV34bNt7Q5q8J2xBYXpSoEd+UQ WzRqGEt+3bGeNDfblxxIHyVGpya2e2NSChxtxD/sGGNzg6EaMVxig1R041E6OBx3NAPo CNRCJfps/ddsf2SjsaWGJBLy7sP14kE9snUq11zmdzNnKHkkVaRgPjnjGgVmnnzjw0RN Ysi4Eph8kH9WE3VjfhFcKFKhwDGTm5++W1Ibzh+3voR+LzgjKvBq20sD1QXHBfl3Jk/2 fdyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O0YMdz8y; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si4256036ejc.215.2021.08.19.15.24.42; Thu, 19 Aug 2021 15:25:08 -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=@linaro.org header.s=google header.b=O0YMdz8y; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237339AbhHSWU1 (ORCPT + 99 others); Thu, 19 Aug 2021 18:20:27 -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-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