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.7 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,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 E6784C4338F for ; Mon, 26 Jul 2021 20:11:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDD0060F91 for ; Mon, 26 Jul 2021 20:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232862AbhGZTbP (ORCPT ); Mon, 26 Jul 2021 15:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbhGZTbM (ORCPT ); Mon, 26 Jul 2021 15:31:12 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0067BC061757 for ; Mon, 26 Jul 2021 13:11:40 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id q18so10139393ile.9 for ; Mon, 26 Jul 2021 13:11:40 -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=tgL3Uie/Qodtk8KimI/KjJUNL3yMSDvJaxriDsuLyK0=; b=cQF7DY0oNsgCjN5SXuOfOtTqGXx/ZwRX3G7x0ovIpW16FEMLLNWJRfWv/4qO4IVTBn U0ERKBCaBBN6ddwSJm+U1CqH+eq/IgjAKFH8ji0L9LSisD26l0CfYxEUNeBW7CKdqNxU Ssxd+Jw6wtZcudul6K35cOkw6RAZW6YwNgGDulFHaREEJBqoNshfIUMFPcbfaKhkPT4Q gNB1cQ3HhJABXAkvnKHws3o9PObrgGdcrbRYvVSwACjh5yu0iyhB9p8GdXkGo3ieD2AR TTpBGbEO2B6r/ojJOeZLpoOBikue/d2h/PVzISjSAYXlVfAOj+6uTa7a6s5bF8Uh80/W PRhA== 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=tgL3Uie/Qodtk8KimI/KjJUNL3yMSDvJaxriDsuLyK0=; b=qcQHHg4qXKcK/I+SLkkAjCE7wrkMoIANoxAaawiFN8IuqEe5NhNrfNWRC3uccWq7Z2 B0NfNymk40rlXid3OqL81gX2K6BVC7b1ovsLliS4dX/9n+cv2gLp+pFjTnBINsyPWfJK RhSrrKtNW61IS1SNRT0c6cScsWB12uPE+J09D7YtZU5ICn1PPORPr79mkGnzER+yImtL 4mrk9al6zx1QX5VnxLlGXwhfWnjvAWxcs407Y8nE+PJ+ldKmtQ9/DLQR6sfd1mQ0h2ZR zlrwkhj7YTxk792dsjLoQ3clAtvTRFLswdFLPD3rn9KJZWswhXPe4G/LXTuEugZtLyLC j0GA== X-Gm-Message-State: AOAM533KkW8dLmfN4DBp8ZhDh6F0Sgdttl3Vq8DfuEhB7RKEmfVKUO69 is1faoGUf9IXiOOYCs3zvSzUsQ== X-Google-Smtp-Source: ABdhPJyUsUg2PRSMaLEEojFEJUGSSLr9dZlv7A5mU7BduZlA6SdIsepLrF8AQH51HQLdEGBUhIFQQw== X-Received: by 2002:a05:6e02:5ad:: with SMTP id k13mr14042115ils.284.1627330300432; Mon, 26 Jul 2021 13:11:40 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id z10sm425964iln.8.2021.07.26.13.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 13:11:40 -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 1/5] net: ipa: kill ipa_modem_setup() Date: Mon, 26 Jul 2021 15:11:32 -0500 Message-Id: <20210726201136.502800-2-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210726201136.502800-1-elder@linaro.org> References: <20210726201136.502800-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 functions ipa_modem_setup() and ipa_modem_teardown() are trivial wrappers that call ipa_qmi_setup() and ipa_qmi_teardown(). Just call the QMI functions directly, and get rid of the wrappers. Improve the documentation of what setting up QMI does. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 4 ++-- drivers/net/ipa/ipa_modem.c | 10 ---------- drivers/net/ipa/ipa_modem.h | 4 ---- drivers/net/ipa/ipa_qmi.c | 6 ++---- drivers/net/ipa/ipa_qmi.h | 19 +++++++++++++++++++ 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 9810c61a03202..91e2ec3a0c133 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -167,7 +167,7 @@ int ipa_setup(struct ipa *ipa) ipa_endpoint_default_route_set(ipa, exception_endpoint->endpoint_id); /* We're all set. Now prepare for communication with the modem */ - ret = ipa_modem_setup(ipa); + ret = ipa_qmi_setup(ipa); if (ret) goto err_default_route_clear; @@ -204,7 +204,7 @@ static void ipa_teardown(struct ipa *ipa) struct ipa_endpoint *exception_endpoint; struct ipa_endpoint *command_endpoint; - ipa_modem_teardown(ipa); + ipa_qmi_teardown(ipa); ipa_endpoint_default_route_clear(ipa); exception_endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ipa_endpoint_disable_one(exception_endpoint); diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index af9aedbde717a..5cb60e2ea6042 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -377,13 +377,3 @@ void ipa_modem_deconfig(struct ipa *ipa) ipa->notifier = NULL; memset(&ipa->nb, 0, sizeof(ipa->nb)); } - -int ipa_modem_setup(struct ipa *ipa) -{ - return ipa_qmi_setup(ipa); -} - -void ipa_modem_teardown(struct ipa *ipa) -{ - ipa_qmi_teardown(ipa); -} diff --git a/drivers/net/ipa/ipa_modem.h b/drivers/net/ipa/ipa_modem.h index 2de3e216d1d43..5e6e3d234454a 100644 --- a/drivers/net/ipa/ipa_modem.h +++ b/drivers/net/ipa/ipa_modem.h @@ -7,7 +7,6 @@ #define _IPA_MODEM_H_ struct ipa; -struct ipa_endpoint; struct net_device; struct sk_buff; @@ -25,7 +24,4 @@ void ipa_modem_exit(struct ipa *ipa); int ipa_modem_config(struct ipa *ipa); void ipa_modem_deconfig(struct ipa *ipa); -int ipa_modem_setup(struct ipa *ipa); -void ipa_modem_teardown(struct ipa *ipa); - #endif /* _IPA_MODEM_H_ */ diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c index 4661105ce7ab2..90f3aec55b365 100644 --- a/drivers/net/ipa/ipa_qmi.c +++ b/drivers/net/ipa/ipa_qmi.c @@ -467,10 +467,7 @@ static const struct qmi_ops ipa_client_ops = { .new_server = ipa_client_new_server, }; -/* This is called by ipa_setup(). We can be informed via remoteproc that - * the modem has shut down, in which case this function will be called - * again to prepare for it coming back up again. - */ +/* Set up for QMI message exchange */ int ipa_qmi_setup(struct ipa *ipa) { struct ipa_qmi *ipa_qmi = &ipa->qmi; @@ -526,6 +523,7 @@ int ipa_qmi_setup(struct ipa *ipa) return ret; } +/* Tear down IPA QMI handles */ void ipa_qmi_teardown(struct ipa *ipa) { cancel_work_sync(&ipa->qmi.init_driver_work); diff --git a/drivers/net/ipa/ipa_qmi.h b/drivers/net/ipa/ipa_qmi.h index b6f2055d35a68..856ef629ccc8d 100644 --- a/drivers/net/ipa/ipa_qmi.h +++ b/drivers/net/ipa/ipa_qmi.h @@ -39,7 +39,26 @@ struct ipa_qmi { bool indication_sent; }; +/** + * ipa_qmi_setup() - Set up for QMI message exchange + * @ipa: IPA pointer + * + * This is called at the end of ipa_setup(), to prepare for the exchange + * of QMI messages that perform a "handshake" between the AP and modem. + * When the modem QMI server announces its presence, an AP request message + * supplies operating parameters to be used to the modem, and the modem + * acknowledges receipt of those parameters. The modem will not touch the + * IPA hardware until this handshake is complete. + * + * If the modem crashes (or shuts down) a new handshake begins when the + * modem's QMI server is started again. + */ int ipa_qmi_setup(struct ipa *ipa); + +/** + * ipa_qmi_teardown() - Tear down IPA QMI handles + * @ipa: IPA pointer + */ void ipa_qmi_teardown(struct ipa *ipa); #endif /* !_IPA_QMI_H_ */ -- 2.27.0