From patchwork Tue Jul 19 14:35:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12922627 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C006CCA47F for ; Tue, 19 Jul 2022 14:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239535AbiGSOkY (ORCPT ); Tue, 19 Jul 2022 10:40:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239338AbiGSOj6 (ORCPT ); Tue, 19 Jul 2022 10:39:58 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14CC654AD1 for ; Tue, 19 Jul 2022 07:35:58 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id h14so531959ilq.12 for ; Tue, 19 Jul 2022 07:35:58 -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=xzUp16TsQa3JipHhgAlv6J/Xx8dlsb3ilhBhSisObpk=; b=NHP7zdBWXkjeJbTso42Mfy3WczpsvYvgt2g0BtRjbaDuzK7gAp4tTNO/KfRwMLHfXK oCWc/97TA933XwvT7jeL6qgY3jVrsbnWtwQilJtx2FFR4vJrqmBgyOf5xj0xat6dmoMn 47JTIS9l9YAMm4WnJVH1Qm9Ko8UspQ4/+hH1uy6AjeDP5wi/dCPzK05Ix/UQAQBPGHnd vfqXnx1pERL3UZRnuoQCPHCpZlabG56bJMCfbpPze9Kw6XnPZ5lcGs/NrSCM28buLEKL KDJgHgbvywytGVtRxMos3k+Mr2aTOLqQBLz9PYVQVCd+tly+rr8z/rGqYnzRXZH3+KhV 8qzQ== 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=xzUp16TsQa3JipHhgAlv6J/Xx8dlsb3ilhBhSisObpk=; b=ZgHYXPLNo5nuJp3rzxtZkc2g/tyaKJR0U2cbU0EM79yJndaVpdjGxE2L8xFMNOSTD8 T4rpmHGIhNzVmwMqzPAwx11Hy51W9hZWzNr7+S7kp5XC1TmzqzqRpI2SV39pgDq6h6dt aSXzzzZNFgqkmuBBh29/Y5XxnJ6Q0y12PJfQZrroziBOulg+P44Peu0NaTXUe+HHjq9f LwzVoFhR3Et6bwIbvQG1kxhgwWr3sKWqHM58MFIztwvxg9RVLVMdNGQQawQyUZKfRPjY hMzQtltgkfU9ZO0z2Ob6k76kyEvrdszmKs2lVMaKp9Kd/CjU8ryENpHCze4p33+FUXob 6nOA== X-Gm-Message-State: AJIora+JQ836UGfXupUOK4Pm5oJSH42twz/kWssAxNiJWN/2g5xn0cIj i51elmBq0pi18XKJ1YjvQozmSQ== X-Google-Smtp-Source: AGRyM1tEqutqSPSRY0g9Km97DNuoMzKB13fGREF6wrXyd+UMVywqUlXmZ3GUf5fudnDZ8+Y3cIJ5hg== X-Received: by 2002:a05:6e02:1bad:b0:2da:d6d0:a58 with SMTP id n13-20020a056e021bad00b002dad6d00a58mr16080808ili.19.1658241358253; Tue, 19 Jul 2022 07:35:58 -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 t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:35:57 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 1/5] net: ipa: add a transaction committed list Date: Tue, 19 Jul 2022 09:35:49 -0500 Message-Id: <20220719143553.280908-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We currently put a transaction on the pending list when it has been committed. But until the channel's doorbell rings, these transactions aren't actually "owned" by the hardware yet. Add a new "committed" state (and list), to represent transactions that have been committed but not yet sent to hardware. Define "pending" to mean committed transactions that have been sent to hardware but have not yet completed. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 5 ++++- drivers/net/ipa/gsi.h | 3 ++- drivers/net/ipa/gsi_trans.c | 24 +++++++++++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 4e46974a69ecd..c70fd4bab1d68 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -718,6 +718,9 @@ static struct gsi_trans *gsi_channel_trans_last(struct gsi_channel *channel) */ if (channel->toward_ipa) { list = &trans_info->alloc; + if (!list_empty(list)) + goto done; + list = &trans_info->committed; if (!list_empty(list)) goto done; list = &trans_info->pending; @@ -1363,7 +1366,7 @@ gsi_event_trans(struct gsi *gsi, struct gsi_event *event) * first *unfilled* event in the ring (following the last filled one). * * Events are sequential within the event ring, and transactions are - * sequential within the transaction pool. + * sequential within the transaction array. * * Note that @index always refers to an element *within* the event ring. */ diff --git a/drivers/net/ipa/gsi.h b/drivers/net/ipa/gsi.h index bad1a78a96ede..d06fc46431d5b 100644 --- a/drivers/net/ipa/gsi.h +++ b/drivers/net/ipa/gsi.h @@ -88,7 +88,8 @@ struct gsi_trans_info { spinlock_t spinlock; /* protects updates to the lists */ struct list_head alloc; /* allocated, not committed */ - struct list_head pending; /* committed, awaiting completion */ + struct list_head committed; /* committed, awaiting doorbell */ + struct list_head pending; /* pending, awaiting completion */ struct list_head complete; /* completed, awaiting poll */ struct list_head polled; /* returned by gsi_channel_poll_one() */ }; diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 29496ca15825f..1db7497a64745 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -241,15 +241,31 @@ struct gsi_trans *gsi_channel_trans_complete(struct gsi_channel *channel) struct gsi_trans, links); } -/* Move a transaction from the allocated list to the pending list */ +/* Move a transaction from the allocated list to the committed list */ +static void gsi_trans_move_committed(struct gsi_trans *trans) +{ + struct gsi_channel *channel = &trans->gsi->channel[trans->channel_id]; + struct gsi_trans_info *trans_info = &channel->trans_info; + + spin_lock_bh(&trans_info->spinlock); + + list_move_tail(&trans->links, &trans_info->committed); + + spin_unlock_bh(&trans_info->spinlock); +} + +/* Move transactions from the committed list to the pending list */ static void gsi_trans_move_pending(struct gsi_trans *trans) { struct gsi_channel *channel = &trans->gsi->channel[trans->channel_id]; struct gsi_trans_info *trans_info = &channel->trans_info; + struct list_head list; spin_lock_bh(&trans_info->spinlock); - list_move_tail(&trans->links, &trans_info->pending); + /* Move this transaction and all predecessors to the pending list */ + list_cut_position(&list, &trans_info->committed, &trans->links); + list_splice_tail(&list, &trans_info->pending); spin_unlock_bh(&trans_info->spinlock); } @@ -581,13 +597,14 @@ static void __gsi_trans_commit(struct gsi_trans *trans, bool ring_db) if (channel->toward_ipa) gsi_trans_tx_committed(trans); - gsi_trans_move_pending(trans); + gsi_trans_move_committed(trans); /* Ring doorbell if requested, or if all TREs are allocated */ if (ring_db || !atomic_read(&channel->trans_info.tre_avail)) { /* Report what we're handing off to hardware for TX channels */ if (channel->toward_ipa) gsi_trans_tx_queued(trans); + gsi_trans_move_pending(trans); gsi_channel_doorbell(channel); } } @@ -747,6 +764,7 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) spin_lock_init(&trans_info->spinlock); INIT_LIST_HEAD(&trans_info->alloc); + INIT_LIST_HEAD(&trans_info->committed); INIT_LIST_HEAD(&trans_info->pending); INIT_LIST_HEAD(&trans_info->complete); INIT_LIST_HEAD(&trans_info->polled); From patchwork Tue Jul 19 14:35:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12922628 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCCA4CCA483 for ; Tue, 19 Jul 2022 14:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239360AbiGSOkZ (ORCPT ); Tue, 19 Jul 2022 10:40:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239349AbiGSOj7 (ORCPT ); Tue, 19 Jul 2022 10:39:59 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDFCD54AD5 for ; Tue, 19 Jul 2022 07:35:59 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id c17so6735198ilq.5 for ; Tue, 19 Jul 2022 07:35:59 -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=Cj8uxIhpugu8STWvVDJnIKL94YZQlOGZj9xNEZp00WI=; b=mZ7jRAYaonM68F+sHfRyTzo0O640deU6APgrKozUzeRSlwFDw+WjfqI/gi5+V19iO6 L/YT5FeVHPjMzqzBtgZFpJshlDCf+Y02bC4pY9yWr/bTYq0ffyQwYbAj/PPcHvCx1VtX dcBdmRcqtz3x+vSHax4OpCMNQJwRkRN0nrRGNFrry/ItunxOV1eZjpmVEXSIkEvqMckM 6NGQEne9vFsEk+gbq2G9ypvEXWOqUsH1qfuKmNC1A1TiuGpv8W8aNZqhmoPE72IzB5Gv C+Xv0JbVlTasQpJV4fHeeaS4BXhV94sDr94cmsGA6BxVE5CuHe6kpz2lkwFtnk+BLGBt 4PkQ== 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=Cj8uxIhpugu8STWvVDJnIKL94YZQlOGZj9xNEZp00WI=; b=kG/UK9RhaDpCqlOsYtO4Q/fYTQA1Pu9iIjroyRXk0FabOFS+3QRXQ/LOBr7ec3SdPF 6SiVP7OCURVH8mnZz90naQqpSng3/1MSuXIvjjc0qRxVQYC8AuzPMexGHhbthVdMD9GN QRwNpcR3jRWjIIGrLM4AvRLwp8txVGH2IcRjYtRec96+N5RGsf+wpxGkw7ek2+Wgc8eW Zi5E1s31FAGeTWO4DlXRyv70+kPZtCFnaozzAnyJRxUZYZpDilPm4fKpjgj1EInhH+2U 9hi1n0NL4fxZ7x/HCh/47TVJFSWXTvV45HNAODs794ewyp2URKB07rSC9oianipGMp4p z98w== X-Gm-Message-State: AJIora90nwLWPSE1nAHtZuIJdDNFMh+x2T4itQY4pgOxG+ynSu7cPGGH 5BHtf0gZwR9YMyhTjuMkZvIHmwwK2tmOtw== X-Google-Smtp-Source: AGRyM1tFOW+TfFfDeVlvuHOfS6ym43Do/9ICPUquZpRo5oIHvzFNgp2oXhtx5ghe6Ixo8BD6v5IY4g== X-Received: by 2002:a05:6e02:1c2d:b0:2dc:ec92:6ef2 with SMTP id m13-20020a056e021c2d00b002dcec926ef2mr5043157ilh.179.1658241359290; Tue, 19 Jul 2022 07:35:59 -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 t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:35:58 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 2/5] net: ipa: rearrange transaction initialization Date: Tue, 19 Jul 2022 09:35:50 -0500 Message-Id: <20220719143553.280908-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The transaction map is really associated with the transaction pool; move its definition earlier in the gsi_trans_info structure. Rearrange initialization in gsi_channel_trans_init() so it sets the tre_avail value first, then initializes the transaction pool, and finally allocating the transaction map. Update comments. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.h | 3 +- drivers/net/ipa/gsi_trans.c | 60 +++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/drivers/net/ipa/gsi.h b/drivers/net/ipa/gsi.h index d06fc46431d5b..13bf4327b70eb 100644 --- a/drivers/net/ipa/gsi.h +++ b/drivers/net/ipa/gsi.h @@ -82,9 +82,10 @@ struct gsi_trans_pool { struct gsi_trans_info { atomic_t tre_avail; /* TREs available for allocation */ struct gsi_trans_pool pool; /* transaction pool */ + struct gsi_trans **map; /* TRE -> transaction map */ + struct gsi_trans_pool sg_pool; /* scatterlist pool */ struct gsi_trans_pool cmd_pool; /* command payload DMA pool */ - struct gsi_trans **map; /* TRE -> transaction map */ spinlock_t spinlock; /* protects updates to the lists */ struct list_head alloc; /* allocated, not committed */ diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 1db7497a64745..b17f7b5a498be 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -709,6 +709,7 @@ void gsi_trans_read_byte_done(struct gsi *gsi, u32 channel_id) int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) { struct gsi_channel *channel = &gsi->channel[channel_id]; + u32 tre_count = channel->tre_count; struct gsi_trans_info *trans_info; u32 tre_max; int ret; @@ -716,30 +717,40 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) /* Ensure the size of a channel element is what's expected */ BUILD_BUG_ON(sizeof(struct gsi_tre) != GSI_RING_ELEMENT_SIZE); - /* The map array is used to determine what transaction is associated - * with a TRE that the hardware reports has completed. We need one - * map entry per TRE. - */ trans_info = &channel->trans_info; - trans_info->map = kcalloc(channel->tre_count, sizeof(*trans_info->map), - GFP_KERNEL); - if (!trans_info->map) - return -ENOMEM; - /* We can't use more TREs than there are available in the ring. + /* The tre_avail field is what ultimately limits the number of + * outstanding transactions and their resources. A transaction + * allocation succeeds only if the TREs available are sufficient + * for what the transaction might need. + */ + tre_max = gsi_channel_tre_max(channel->gsi, channel_id); + atomic_set(&trans_info->tre_avail, tre_max); + + /* We can't use more TREs than the number available in the ring. * This limits the number of transactions that can be oustanding. * Worst case is one TRE per transaction (but we actually limit - * it to something a little less than that). We allocate resources - * for transactions (including transaction structures) based on - * this maximum number. + * it to something a little less than that). By allocating a + * power-of-two number of transactions we can use an index + * modulo that number to determine the next one that's free. + * Transactions are allocated one at a time. */ - tre_max = gsi_channel_tre_max(channel->gsi, channel_id); - - /* Transactions are allocated one at a time. */ ret = gsi_trans_pool_init(&trans_info->pool, sizeof(struct gsi_trans), tre_max, 1); if (ret) - goto err_kfree; + return -ENOMEM; + + /* A completion event contains a pointer to the TRE that caused + * the event (which will be the last one used by the transaction). + * Each entry in this map records the transaction associated + * with a corresponding completed TRE. + */ + trans_info->map = kcalloc(tre_count, sizeof(*trans_info->map), + GFP_KERNEL); + if (!trans_info->map) { + ret = -ENOMEM; + goto err_trans_free; + } /* A transaction uses a scatterlist array to represent the data * transfers implemented by the transaction. Each scatterlist @@ -751,16 +762,7 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) sizeof(struct scatterlist), tre_max, channel->trans_tre_max); if (ret) - goto err_trans_pool_exit; - - /* Finally, the tre_avail field is what ultimately limits the number - * of outstanding transactions and their resources. A transaction - * allocation succeeds only if the TREs available are sufficient for - * what the transaction might need. Transaction resource pools are - * sized based on the maximum number of outstanding TREs, so there - * will always be resources available if there are TREs available. - */ - atomic_set(&trans_info->tre_avail, tre_max); + goto err_map_free; spin_lock_init(&trans_info->spinlock); INIT_LIST_HEAD(&trans_info->alloc); @@ -771,10 +773,10 @@ int gsi_channel_trans_init(struct gsi *gsi, u32 channel_id) return 0; -err_trans_pool_exit: - gsi_trans_pool_exit(&trans_info->pool); -err_kfree: +err_map_free: kfree(trans_info->map); +err_trans_free: + gsi_trans_pool_exit(&trans_info->pool); dev_err(gsi->dev, "error %d initializing channel %u transactions\n", ret, channel_id); From patchwork Tue Jul 19 14:35:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12922629 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86732C43334 for ; Tue, 19 Jul 2022 14:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239567AbiGSOk1 (ORCPT ); Tue, 19 Jul 2022 10:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239374AbiGSOkA (ORCPT ); Tue, 19 Jul 2022 10:40:00 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E9654ADB for ; Tue, 19 Jul 2022 07:36:01 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id z132so11963337iof.0 for ; Tue, 19 Jul 2022 07:36:00 -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=zRHK405baFW2UdcNvF1Ri8j6v7h1hezBx9diOW60tXw=; b=EcNyCwlgGsDJIOtNW/Ss1NOraStXKkldrA+XkALRjahcB3N8Pn4slgW8OT1YUICsNb zAMUE0EQhGd08tsdqZWKWCG5Zl7dR322RIbUsHxVfRkGHA1qQ+eiJh91uusj59tOgQ9h 0sX/5MECKAwoyBmb0xUCwETEbwnEfnaUgSEgVPUcagNEQ3zKaUANvS4C3CGlPBvEVTUf opQ8DjxVkGm4lZTxQLoDqRdpqX8d131HraMlGKKf0V4oxwLbKoFm8N3l9iXCaz3N57xd tHlQ8SW8jrIT9d6zL6a5Ix58mAUu8T7W5D619gjQxL1N67CYV59zMWNSRQ4Zjjq/sgqw LpyA== 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=zRHK405baFW2UdcNvF1Ri8j6v7h1hezBx9diOW60tXw=; b=vOom1p5gciyd1QvqiNkSrPs8mn128n4iLo2YKq4/K5UkcjDEtC3CTZ3EN4KSfCRpn0 h/8DElV0QDWH4C8oYXQ+Et75lJaRhlUAuvZeAQ/YhE93N3gynDzeLA3LEh6ut210a4L3 deuCWB/M/QbxC6sKLSgZZhpQ6HSZnG6LhncWXUHxWagjzX/mRY+g5OwgGmcJuiKhHgnS RjUiBhzvNS3b3/l/B1wauzpM4CvvswQOKicRJqMbMvca9lv+CHq3xcLwM17OE7TJz0J9 lSaSEyjw3FP9MB9FHwgwIYxMJGuH26bwC2Y0cwtD2hRrkVX7A3LpLDnjYdV2jug2E21d 1sgA== X-Gm-Message-State: AJIora+LHf8/kZmCem1mhN/JtAm8D8q+mhBsE5bxp+ZMIug4zjYa55t+ PF/NKmYeuY6F7t2EJFQPlFoqmA== X-Google-Smtp-Source: AGRyM1vxDr8gJG9uMO8WLs45XDR00G3/awtshi9ngzhp9qVf7XyXJaFk6+Au25UO+/mHtTIWSkp8YQ== X-Received: by 2002:a6b:3fd6:0:b0:67b:d97f:47d3 with SMTP id m205-20020a6b3fd6000000b0067bd97f47d3mr11241017ioa.46.1658241360312; Tue, 19 Jul 2022 07:36:00 -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 t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:35:59 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 3/5] net: ipa: skip some cleanup for unused transactions Date: Tue, 19 Jul 2022 09:35:51 -0500 Message-Id: <20220719143553.280908-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if a transaction is unused. No used TREs means no IPA layer resources to clean up. So only call ipa_gsi_trans_release() if at least one TRE was used. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index b17f7b5a498be..b298ca7968907 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -404,7 +404,8 @@ void gsi_trans_free(struct gsi_trans *trans) if (!last) return; - ipa_gsi_trans_release(trans); + if (trans->used_count) + ipa_gsi_trans_release(trans); /* Releasing the reserved TREs implicitly frees the sgl[] and * (if present) info[] arrays, plus the transaction itself. From patchwork Tue Jul 19 14:35:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12922630 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DC6DCCA47F for ; Tue, 19 Jul 2022 14:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239071AbiGSOk3 (ORCPT ); Tue, 19 Jul 2022 10:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239021AbiGSOkB (ORCPT ); Tue, 19 Jul 2022 10:40:01 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0984454ADD for ; Tue, 19 Jul 2022 07:36:02 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id c16so6479849ils.7 for ; Tue, 19 Jul 2022 07:36:02 -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=g+HjSH1OT4ZSTM+eXDsDJSu3gPtVsd7iXr5tehMDAHk=; b=UVl5ZgQLGmxFULFa7NUHhaeZ2fz4c8pq9g4BFufL+0iUBbmDyK9e3n6HQWUumFARad 5ZltrdcLyVRosi7dx1A1pI6FIklKe0PkVClF53+JouXSsUQR0FKnCWKS5Q4YVp489Cow FXt7Z/GrVqyUwWVLuTS6jb+k88Z/BtYCtvuc5kz3ASHUOV4S1B4HGBjCVac5ieHhrKQG Cc3xpeH42FvQOpFYnKn5bqXCCv7ozEsRqNOHmxkjAhqKzoEsKXK9h9Xny3FFOENcjrB6 x31ANOLdamX9/DaJ0RfZ1D3lUcqhzbDML0y0r09Vmyt0liAzinGoU0evtmXS6Ik5Bryf moDg== 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=g+HjSH1OT4ZSTM+eXDsDJSu3gPtVsd7iXr5tehMDAHk=; b=sJV2xubBv0HQkL15fzpllh7G+9p47xiC1mreRQcw3rMx1FSLnmshnz2A8EtrILcjoq bLuB3C/kX4pHTGW0rQ2ONmLSVEQ6PQx8tCg8a1VHvwSlxy22VL1bgmYSWkvIJNeN2uOj pztD/LfdzKovOeUuchI9UPAXbDswcnJbmEb2c0e1Lf5iiumQAWb9LTnAfeb6M+3AHGns VhKYasNoAIFeZbe8A5r8F8hn9PUjHjL2dobHQ7KypyP0ITQ16rsTNc3kp10qbqm9DzLz ZjtTSQIik9Oj4IihlM6PxCNYu5kJo67V+qtYkUfMjcd/4ScKbjDFAdIQVlLeHODg7PHL q0yA== X-Gm-Message-State: AJIora+AlbdlO2bWxfAdFKy/qLGh22d9jHMCRMLKlcU8UzHBWg5rtQkq hoRfYd2coixXAdF7nb5bWg/aKQ== X-Google-Smtp-Source: AGRyM1sj0ex0FAXdt3pBqnlnyH9HM6+drp7gvBcpR7wLH5QwVYV6EWHcF0uQEucv+yluBk4Sc4VnAw== X-Received: by 2002:a92:6603:0:b0:2da:82b6:34a3 with SMTP id a3-20020a926603000000b002da82b634a3mr16275124ilc.250.1658241361376; Tue, 19 Jul 2022 07:36:01 -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 t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:36:01 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 4/5] net: ipa: report when the driver has been removed Date: Tue, 19 Jul 2022 09:35:52 -0500 Message-Id: <20220719143553.280908-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When the IPA driver has completed its initialization and setup stages, it emits a brief message to the log. Add a small message that reports when it has been removed. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 3757ce3de2c59..96c649d889a7c 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -836,6 +836,8 @@ static int ipa_remove(struct platform_device *pdev) kfree(ipa); ipa_power_exit(power); + dev_info(dev, "IPA driver removed"); + return 0; } From patchwork Tue Jul 19 14:35:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 12922631 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBDC5CCA486 for ; Tue, 19 Jul 2022 14:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237105AbiGSOkb (ORCPT ); Tue, 19 Jul 2022 10:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239406AbiGSOkE (ORCPT ); Tue, 19 Jul 2022 10:40:04 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A6C54AEA for ; Tue, 19 Jul 2022 07:36:03 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id y2so11927826ior.12 for ; Tue, 19 Jul 2022 07:36:03 -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=wk2czZHfKCNnzO8KQpU2wlKEqgQnnAKT3z+bj9HU5pA=; b=NcQSvw7Gb7qySkIMjDLseOccJuRspSwEBfpM8Wp2nKjABwffQqHD7FWib+EWERoRv3 Lcx4qq3k5nXxBqjeiIfEFNQsVd1k4Db1Q0nl8LkiGZHEb7L+AFAQTP4ruD2wMYWXg+lT KvG48Eeu1l/QQY2ubIns1KycpBaH72PmaViZxfK7YH4QffoYuOrZP8M8e+alTli04FnT 8lpmNgWGihFwumW4pgATYsvW9thPOG8MkDiyuRWjcfeGJ6zUQy5s7kKKhoNooZYSgqu1 WnX+/f/dbNWTHDk2rGOkEYgbqDN/5leGEtE2BapEBETLY7C4gZG7EvXqmwZRaTM7l3lV tylQ== 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=wk2czZHfKCNnzO8KQpU2wlKEqgQnnAKT3z+bj9HU5pA=; b=c/muXB6IkJ0msMqUI1wEEOLjItSyw0vhg0iYMYfQBqrehf7381z8te5tFE+j6rtENj aZ2yvYoJ11ikd6xgpovjf5H6nXStblHdLPFi1abCJtwQr5CI2owFdUKB/2npQzdQakOg geYQdWQ0ibBaaKxKGV25Z4Gk0+oL854qpcP7QRPwMhx7MhlG6Q/n3JvB55OWXsoVIIig HQlLYn7w1vpNpeLXSc4f01b2FyFJrGE2QmO+S9YCJQuwH5HOnHV4OU9mRVroYwVsQ9ez Xeve9zbEI+vYI5qS52hsgJhdBIysx1BgnpO8kxaxMVzdxzxUEmXRQSmLVz5ORa+JAWK6 FnWA== X-Gm-Message-State: AJIora8noj5odLXFccaYt/4CSZ0aZO5Axmarm1ledDPfTr7eq4HBgt9m asGd+S9MBa1x/DqfDbE9+ktvoA== X-Google-Smtp-Source: AGRyM1umkGAm0Fy8Nvn7mJsnFAGVW42OOmvuy4PoGRqz0pD7C9alR/0i4ymidJaA2pOYCgvnVhpWWA== X-Received: by 2002:a05:6638:3043:b0:335:ce04:2053 with SMTP id u3-20020a056638304300b00335ce042053mr17986644jak.294.1658241362460; Tue, 19 Jul 2022 07:36:02 -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 t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:36:02 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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/5] net: ipa: fix an outdated comment Date: Tue, 19 Jul 2022 09:35:53 -0500 Message-Id: <20220719143553.280908-6-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since commit 8797972afff3d ("net: ipa: remove command info pool"), we don't allocate "command info" entries for command channel transactions. Fix a comment that seems to suggest we still do. (Even before that commit, the comment was out of place.) Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index b298ca7968907..76c440cee2e60 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -362,7 +362,7 @@ struct gsi_trans *gsi_channel_trans_alloc(struct gsi *gsi, u32 channel_id, trans->rsvd_count = tre_count; init_completion(&trans->completion); - /* Allocate the scatterlist and (if requested) info entries. */ + /* Allocate the scatterlist */ trans->sgl = gsi_trans_pool_alloc(&trans_info->sg_pool, tre_count); sg_init_marker(trans->sgl, tre_count);