From patchwork Fri Dec 30 23:22:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 37785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3107707wrt; Fri, 30 Dec 2022 15:24:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXsyqqSK/+ORe6E3hG+w8Z37l9LId9abQeva3zK9Sv4UInY9UYi4GUM+UbCumUVjjOSZJj+k X-Received: by 2002:a05:6a20:8ba7:b0:b2:2719:8f12 with SMTP id m39-20020a056a208ba700b000b227198f12mr35074637pzh.16.1672442671445; Fri, 30 Dec 2022 15:24:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672442671; cv=none; d=google.com; s=arc-20160816; b=F++rbLdHPF1T3B48JCQlSIzDU4HnvZmpGesizIjBtq+Fk6M3oS3ROEkc383jnOnCXm psXTlXVpZgHqg2LTSIGXxZJeGMkvFm6PytNAGPKLGnrXk/8HRPGpy3Nek2GWUj9GKBMP BSBwfb3SOsV3Vd27l4zjtEKd2nqkgzWTuqNx9QeBGLAgJ0OSgzc4HIdx8p8NJPbXCBDU HHFa48q6Ab+NVcuXPMgFhGSqXIRLz1Y8er/NsPnXvCb9XAb533hiDbAch3IgP3uzyF+I tZiAF+l9oIrxhOYWDQ4TOgpOvbVD2hTSIAq20LAYx0zAssLq4EZj9IqxJwvpl4n8BcuF zu8w== 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=/5hYek3nB0dmId6hp5MbMyiFoPLMoLSONTQq8CabMoo=; b=OqYA9DTpA80SphYuQDT5bBVQrU2BtmcAeoii0V1lbQrRDFv/NfGnkOFbP7EokPdD/x gYJ+F+Jb+JMEei+Bt4g9CbPC7OVoz12k5GXZYZEWfrrr0nr82rXJMH6nttT/eBK3roQ9 JvH/AmXQ4yYVFtJAbP74D2rlF7YAE8FwuxO3pehg4XYVXo3GWgLKdDGmyXiUEtwhSijj 7LrdLM1ebgRbf0IGMtgsZ5a8a6SgEsKKmk7oTPYquIih8kY6Jf8oZZ0qGn/EyvFB9T32 x0P0BIeCxpedqS98+PMwhs23FOhYqyfq5/14lR5yPQaqaj8ZMlIMR8458CxtodN1J2D4 o2Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ThNXYLsE; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020a632502000000b00478bf137d96si23225299pgl.462.2022.12.30.15.24.19; Fri, 30 Dec 2022 15:24:31 -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=ThNXYLsE; 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 S235726AbiL3XW6 (ORCPT + 99 others); Fri, 30 Dec 2022 18:22:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235723AbiL3XWk (ORCPT ); Fri, 30 Dec 2022 18:22:40 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1D191DDC3 for ; Fri, 30 Dec 2022 15:22:39 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id m15so12098124ilq.2 for ; Fri, 30 Dec 2022 15:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/5hYek3nB0dmId6hp5MbMyiFoPLMoLSONTQq8CabMoo=; b=ThNXYLsEVsgBPhzs5Uq7WacMqSL5M7UajFCbfbhPx5wOLapYvV1osW5+VDozSkPYOI ut4z+T/fz4zFWaYz1P3w2cFBc3/Lq0jjU51J0i0A3IRAqy5PQqnp3nqDDzy6AZrGOkBx veXgFUdmpJga3FgDZuirF6OHbfubI+JD5QO2sOQMem17XO2kTdaIPhdozHZO0WHPrSfR ZXogBQQmks8srE/gDmd4kTfr2+BlHTi290JanaEKjiMsogBf5lSM0BJkMRqLqv2haFRG UE/spAzS9ccUc7FxoqvKYGwSUkn9UnsxaDnpgni686T8Wi+nem5Tc82WpF/kaLQxcZrb /jsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/5hYek3nB0dmId6hp5MbMyiFoPLMoLSONTQq8CabMoo=; b=LKbldGppa2BISnGmcknunLk3PyKkSSIA/9fE6fqtnRFMQrwfKk6oHLlNF5VfsSvAdG fPvktwASM7u+G+dxH2Np+o08odPCODEkeuluZbRe+uMAC8itHoF74Z5goas/20KDzN2b yogctJqCNxPsEROj8EVeEDQ8lxi+W9JpfCnf2rxSm/lqnN5xw8W3QDDJDv6oWZ27uR0f K0OkoY8ncCT3mqzC66vnVQbP8kC9DJ/kDl8Ko3yQ7/HXTJmkqWApq5MNbMDgzQPm4b8o CeT5RtTErHXpXeuxacmvOmSHryh0FlCZsK6LL2CS+2UI/POKC+5+yXoH9SgnNXhFEexK wH6g== X-Gm-Message-State: AFqh2kqF8Fe2vHD9F3inhgCyjWA4brbqYiBHlIUmiBlIeVC5hnfaq3bb XW+MiZxqzvVQPpOIc1xCnpiGNg== X-Received: by 2002:a05:6e02:68c:b0:300:60df:e13e with SMTP id o12-20020a056e02068c00b0030060dfe13emr20628795ils.25.1672442559371; Fri, 30 Dec 2022 15:22:39 -0800 (PST) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id co18-20020a0566383e1200b0038a53fb3911sm7170558jab.97.2022.12.30.15.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 15:22:39 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/6] net: ipa: kill ipa_interrupt_add() Date: Fri, 30 Dec 2022 17:22:29 -0600 Message-Id: <20221230232230.2348757-6-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221230232230.2348757-1-elder@linaro.org> References: <20221230232230.2348757-1-elder@linaro.org> MIME-Version: 1.0 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 autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753683246370035777?= X-GMAIL-MSGID: =?utf-8?q?1753683246370035777?= The dynamic assignment of IPA interrupt handlers isn't needed; we only handle three IPA interrupt types, and their handler functions are now assigned directly. We can get rid of ipa_interrupt_add() and ipa_interrupt_remove() now, because they serve no purpose. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 16 ++-------------- drivers/net/ipa/ipa_interrupt.h | 33 --------------------------------- drivers/net/ipa/ipa_power.c | 7 +------ drivers/net/ipa/ipa_uc.c | 6 ------ 4 files changed, 3 insertions(+), 59 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index f32ac40a79372..f0a68b0a242c1 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -30,6 +30,8 @@ #include "ipa_uc.h" #include "ipa_interrupt.h" +typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id); + /** * struct ipa_interrupt - IPA interrupt information * @ipa: IPA pointer @@ -226,20 +228,6 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt) ipa_interrupt_process(interrupt, IPA_IRQ_TX_SUSPEND); } -/* Add a handler for an IPA interrupt */ -void ipa_interrupt_add(struct ipa_interrupt *interrupt, - enum ipa_irq_id ipa_irq, ipa_irq_handler_t handler) -{ - WARN_ON(ipa_irq >= IPA_IRQ_COUNT); -} - -/* Remove the handler for an IPA interrupt type */ -void -ipa_interrupt_remove(struct ipa_interrupt *interrupt, enum ipa_irq_id ipa_irq) -{ - WARN_ON(ipa_irq >= IPA_IRQ_COUNT); -} - /* Configure the IPA interrupt framework */ struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) { diff --git a/drivers/net/ipa/ipa_interrupt.h b/drivers/net/ipa/ipa_interrupt.h index 5f7d2e90ea337..c1df054be8fab 100644 --- a/drivers/net/ipa/ipa_interrupt.h +++ b/drivers/net/ipa/ipa_interrupt.h @@ -12,39 +12,6 @@ struct ipa; struct ipa_interrupt; -/** - * typedef ipa_irq_handler_t - IPA interrupt handler function type - * @ipa: IPA pointer - * @irq_id: interrupt type - * - * Callback function registered by ipa_interrupt_add() to handle a specific - * IPA interrupt type - */ -typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id); - -/** - * ipa_interrupt_add() - Register a handler for an IPA interrupt type - * @interrupt: IPA interrupt structure - * @irq_id: IPA interrupt type - * @handler: Handler function for the interrupt - * - * Add a handler for an IPA interrupt and enable it. IPA interrupt - * handlers are run in threaded interrupt context, so are allowed to - * block. - */ -void ipa_interrupt_add(struct ipa_interrupt *interrupt, enum ipa_irq_id irq_id, - ipa_irq_handler_t handler); - -/** - * ipa_interrupt_remove() - Remove the handler for an IPA interrupt type - * @interrupt: IPA interrupt structure - * @irq_id: IPA interrupt type - * - * Remove an IPA interrupt handler and disable it. - */ -void ipa_interrupt_remove(struct ipa_interrupt *interrupt, - enum ipa_irq_id irq_id); - /** * ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint * @interrupt: IPA interrupt structure diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 4198f8e97e40b..a282512ebd2d8 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -325,15 +325,11 @@ int ipa_power_setup(struct ipa *ipa) { int ret; - ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND, - ipa_power_suspend_handler); ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND); ret = device_init_wakeup(&ipa->pdev->dev, true); - if (ret) { + if (ret) ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); - ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); - } return ret; } @@ -342,7 +338,6 @@ void ipa_power_teardown(struct ipa *ipa) { (void)device_init_wakeup(&ipa->pdev->dev, false); ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); - ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); } /* Initialize IPA power management */ diff --git a/drivers/net/ipa/ipa_uc.c b/drivers/net/ipa/ipa_uc.c index 6b7d289cfaffa..cb8a76a75f21d 100644 --- a/drivers/net/ipa/ipa_uc.c +++ b/drivers/net/ipa/ipa_uc.c @@ -182,13 +182,9 @@ void ipa_uc_interrupt_handler(struct ipa *ipa, enum ipa_irq_id irq_id) /* Configure the IPA microcontroller subsystem */ void ipa_uc_config(struct ipa *ipa) { - struct ipa_interrupt *interrupt = ipa->interrupt; - ipa->uc_powered = false; ipa->uc_loaded = false; - ipa_interrupt_add(interrupt, IPA_IRQ_UC_0, ipa_uc_interrupt_handler); ipa_interrupt_enable(ipa, IPA_IRQ_UC_0); - ipa_interrupt_add(interrupt, IPA_IRQ_UC_1, ipa_uc_interrupt_handler); ipa_interrupt_enable(ipa, IPA_IRQ_UC_1); } @@ -198,9 +194,7 @@ void ipa_uc_deconfig(struct ipa *ipa) struct device *dev = &ipa->pdev->dev; ipa_interrupt_disable(ipa, IPA_IRQ_UC_1); - ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1); ipa_interrupt_disable(ipa, IPA_IRQ_UC_0); - ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0); if (ipa->uc_loaded) ipa_power_retention(ipa, false);