From patchwork Fri Apr 9 18:07:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418182 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1787969jai; Fri, 9 Apr 2021 11:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxso1SyMaoaQqgA1jsrfPIIUa6C7x/c6fOfujPS2M0U7sQFaR2oyEHJPdhBBeo+FmtyGLnC X-Received: by 2002:aa7:d5c9:: with SMTP id d9mr18511079eds.335.1617991651733; Fri, 09 Apr 2021 11:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991651; cv=none; d=google.com; s=arc-20160816; b=b2g1A4ujIHyU1Y69kG2dInljAM7XN4wrP+mozAaTE/9ljdVY7pOfcyJ42jz3yhMm28 /3Cio25mswVR0KHcOWhldIPacBOPvZAb35BXorr3i1Gy8+5e280oo3N2Fc3s1BClOG9Q 5s4vcb6VhDlQY4Sb9XYuosl5TADjP2aLQTW9OIIjYn7wfdR4XfAbfthDFOp/moOgnTG7 hXIyVrGCXLlWUGhm5B6rzFoT+Z9RgrEz9sOIC5DHMoT4imo0SMVIL5kc8bsqWhOX2O1I f+z0iihID+AQM7cdVCwJV0EIXNlZxiI5QHKHW+mcf0Edpw/ofEZxQ1+EDU4I6iCJtSO4 lR4g== 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=JnilhBvwTKFOB8eP45oHTw3WFpUuibOH2Z94szBsA0s=; b=LyzqbAtRbbG8zmVWMlBENRJpNi9VCTz1zvhacPePy9swRBi2dPgmVvO4EOzeovYynX o41nohKotN3sqUdEizT/0imsIsgA/HNEoI6d4eZ88y6NsfpYWtpKohBysmR97fSQeNGU Blv74ElwbdW78ryg11dNq4HyjtpnK/eJf2fA3wj9BqQiSDDtw7V7uoBAjM7XFKVlzYcq +swhfn4fOwSOUdvx2BLSF2WqD0Mbq3jwfOOnNyQJrHTD/U4jZp0jLp+GnLjfcstZufpA cqfH3UmE/upfo6bPEJsyfw61lM1misp1y0XoTuL0z74wRREvp0wYCO1WSaOYGQELu3oO nTZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MeUbvvCi; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 b18si2409680ejb.189.2021.04.09.11.07.31; Fri, 09 Apr 2021 11:07:31 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=MeUbvvCi; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234499AbhDISHm (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234273AbhDISHk (ORCPT ); Fri, 9 Apr 2021 14:07:40 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9D5C061761 for ; Fri, 9 Apr 2021 11:07:27 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id z3so6810703ioc.8 for ; Fri, 09 Apr 2021 11:07:27 -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=JnilhBvwTKFOB8eP45oHTw3WFpUuibOH2Z94szBsA0s=; b=MeUbvvCi/wa25GZoZsYd289FvDyW0YKqubUv0JrufJTn7ovGBXVgC3YPF0osP/UOYC 5hKBW+2STVkl3JynCZjgU7xBDH2rXRSyM5nWyzGmtXOJ7BIr5UKycBZTGdCbMLw2xvZ4 iG7vBLd6B8ylhItCdXUNd3VwufqJoHGjAo1O6z0zooeou1hzSiqDgit4LiEzeTwEGSAe Ond5i4E7TtzvFqK2jvEIWQHzVKdShwLiZbNFSrq7E0iRWKvVYDBUQriybUAqt7zRhoM3 9/jf9qtUrfrtW8iZCFeN9rCjolzrMMTWwuYywz6rXzvK4D2E6CavNjqsAqw6xxEbQwLh FY3A== 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=JnilhBvwTKFOB8eP45oHTw3WFpUuibOH2Z94szBsA0s=; b=uD8jEhLMlRolZQRNbI+5QbeXK+WO0YpYvk1CbAHz39MVYZ2F2fciZ8PU6qM8HiBe3D 5+SvyLmqKaRn2TYwT/SKkQ1ZTpsf1Ze+ojOnfb77/wlMFt9v5AUE0WwP0KZAzqFtXy2A 7rX4Ej4ZlcMiks0BAdKsTPm4DAKDrwm4+pEjW4Tro4RC9VpqrJ5Rp5SlBIQV3nOdRO8M y+FZTYnLeLW0dZyLcg+/9hu6FqicN97AKC85Y6dcDeYX/znBlMgh0n/oW8qofUfBaS9c tQzSKnsemwHJbE3fvO7xjU4mI5hCceLDcabTnU2NLQ9pPgBWWZWaazbnpCZAm753dmmz x4LQ== X-Gm-Message-State: AOAM533sjg4OZUq9E/l6SpIKPM5WlvVEwGrZ+ZkydGkUF3o086jtx8v1 xzuhX34QiGmdzOI8aWAkjwme0Q== X-Received: by 2002:a5e:c809:: with SMTP id y9mr12770689iol.192.1617991646747; Fri, 09 Apr 2021 11:07:26 -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 g12sm1412786ile.71.2021.04.09.11.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:26 -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/7] net: ipa: relax pool entry size requirement Date: Fri, 9 Apr 2021 13:07:16 -0500 Message-Id: <20210409180722.1176868-2-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I no longer know why a validation check ensured the size of an entry passed to gsi_trans_pool_init() was restricted to be a multiple of 8. For 32-bit builds, this condition doesn't always hold, and for DMA pools, the size is rounded up to a power of 2 anyway. Remove this restriction. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 70c2b585f98d6..8c795a6a85986 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -91,7 +91,7 @@ int gsi_trans_pool_init(struct gsi_trans_pool *pool, size_t size, u32 count, void *virt; #ifdef IPA_VALIDATE - if (!size || size % 8) + if (!size) return -EINVAL; if (count < max_alloc) return -EINVAL; @@ -141,7 +141,7 @@ int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool, void *virt; #ifdef IPA_VALIDATE - if (!size || size % 8) + if (!size) return -EINVAL; if (count < max_alloc) return -EINVAL; From patchwork Fri Apr 9 18:07:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418184 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788060jai; Fri, 9 Apr 2021 11:07:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF6U+SCltDScIX6uKUX2EFK/DOfGhsAGmjHDoXtywh+NWKLHYKA4bH/+7nJDNiW1sq+p8L X-Received: by 2002:a17:906:3c07:: with SMTP id h7mr17415239ejg.446.1617991657713; Fri, 09 Apr 2021 11:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991657; cv=none; d=google.com; s=arc-20160816; b=e+Vk5VUuo/tRUFFZUac0kVO9WIIp5KQskTRu96CZoO6DOYhP02/eZJhcmQm9yscBV1 cuaoHSY0pihD00Ktx/rKiHsNZ5aavs7KKzFXEkOo8f3ZjdssRuapTFFdu9rNuSiJyDtv SdX5I/BYbatAKD08wn8lxfdU8npA0KdtCgGvb4GSw4cUiqEyo44s8WMwUswqF1jjpDNk dq1N/hBXFA5FhlCawvv8ugOeOAHJQZO6BFOZEVUKPwR9SqfJ7vse+exeDZxPn0bJsMLX DwoN6UDzXKtJ9qVxzzYZv1lNAHhjIJjAfPJ1txY64IOdHlUBtPpIzqSJ4MyWGp9ClmCy vPlg== 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=ubko48yj8KRHx5tRsMu+2ZVBEaAtK4PcXtBKhVOgg0E=; b=c8lkd+L+2DMEPLoFofCg/xHmVrgaYpQOabURdh1nMV+lvYHq24n/CDPVFApGVxeikd NAHyU8+I3xdWeUfQm6zLcGV2S+a5jMHVHXda/Py9p0rhKlz4Yz9hN3NAhA7UycLeq4Ve hYUoSazD7na/61ODVu8tGQC1ftppS+eimqX96FbxOWHSPBPdrhC6pKXhXpXNiqMM7228 gqykcYbVbpHc19wVzJyyyheH84zSTixuh4gaTMXUboo6Lt+2q4HfOmqVRH87SAWs2a8Q f0Zkvx+VL7nJub+xNV5GHk3SIjNqr9iLGAFlTuE4t/kwTF5jSBSzkF9nHTRJ0VPK+iAt sZ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L7Ykcs6m; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 b18si2409680ejb.189.2021.04.09.11.07.37; Fri, 09 Apr 2021 11:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=L7Ykcs6m; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234529AbhDISHs (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234487AbhDISHl (ORCPT ); Fri, 9 Apr 2021 14:07:41 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D80C061763 for ; Fri, 9 Apr 2021 11:07:28 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id e186so6795397iof.7 for ; Fri, 09 Apr 2021 11:07:28 -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=ubko48yj8KRHx5tRsMu+2ZVBEaAtK4PcXtBKhVOgg0E=; b=L7Ykcs6mEYms5zQ44NxC8mbiJdbu568EeBATs0/Zo1V1/Xzz4rDZoDcbJaOnXS1fYh afowk8L+jkevw+lYa88h0e370tc60W0rEjrDp0lpACZXzsO7z8LFp95IQI54ZTUKTxyo zdIFpblI87fw77FfuP1DbPznqQRe0fquE/kADvhUgmKDMxKwnb6UWn8cU2EdHdwhuxCC tileHzbktqlmNNWMY4K2qpA7rKWSXJ5xhZY39lMb2+44IW9mgjiFXIu0ozocTBURThEn 73ZYnFdBli4KWPEs+OfXJShrKXDFJ3sDjiwJQWEmT7F5fdLwFe+Tf9Dvq3dTlDf2WUVj 6i9A== 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=ubko48yj8KRHx5tRsMu+2ZVBEaAtK4PcXtBKhVOgg0E=; b=HDmZI+RxEQkoLbTcjR9joGu8iQL32BYl0q9KLfdsvzV4UdpwtRjpMhGDydR2FHK9f+ 3rgqwpV/FbYwIIdjLvrExO5al6DFG2vJzCObqCu/tA1yRJqkVhMfdPguvMwBMExmKvOg jS9sb47YJqu+YeF2m2OeOg8puYKokbHXta3xOc8CP27SNIz3Utl2ATMUzNm2bVtaU7od gcWW8DRE3gNANjbbw5Q6oLqFaBQMhFJqJ0ZVCeXaNqoHur2BsRMnrrsGT7svAwYH2vTP W1UCwXm4hfsfyeL4jonSCsyNvQRqa2yGV/daj/yYa3KV/HWkqP+rv9FvobUfjoWLfW2K M1Iw== X-Gm-Message-State: AOAM533GtH4Erik6ouRoZxQcJH9W8BeQHhyo/B5iFBj33rbCj6XSY4on I+TDIbSQqtJBeEVHlJa1f5Fz/Q== X-Received: by 2002:a6b:f802:: with SMTP id o2mr12429860ioh.197.1617991647707; Fri, 09 Apr 2021 11:07:27 -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 g12sm1412786ile.71.2021.04.09.11.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:27 -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 2/7] net: ipa: update sequence type for modem TX endpoint Date: Fri, 9 Apr 2021 13:07:17 -0500 Message-Id: <20210409180722.1176868-3-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On IPA v3.5.1, the sequencer type for the modem TX endpoint does not define the replication portion in the same way the downstream code does. This difference doesn't affect the behavior of the upstream code, but I'd prefer the two code bases use the same configuration value here. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-v3.5.1.c | 1 + 1 file changed, 1 insertion(+) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data-v3.5.1.c b/drivers/net/ipa/ipa_data-v3.5.1.c index 57703e95a3f9c..ead1a82f32f5c 100644 --- a/drivers/net/ipa/ipa_data-v3.5.1.c +++ b/drivers/net/ipa/ipa_data-v3.5.1.c @@ -116,6 +116,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { .status_enable = true, .tx = { .seq_type = IPA_SEQ_2_PASS_SKIP_LAST_UC, + .seq_rep_type = IPA_SEQ_REP_DMA_PARSER, .status_endpoint = IPA_ENDPOINT_MODEM_AP_RX, }, From patchwork Fri Apr 9 18:07:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418185 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788095jai; Fri, 9 Apr 2021 11:07:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7S03bZkrH34hBlJ1SdOPiEps4yJKaSkrwDEG0DwGaFD/c/2V8i1wno8Xi17aNcUO6WBZE X-Received: by 2002:a17:907:3a98:: with SMTP id fh24mr7391140ejc.371.1617991659950; Fri, 09 Apr 2021 11:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991659; cv=none; d=google.com; s=arc-20160816; b=RI8jlHV153O+8QQButcd1YrizUWsagQSLiOWSHfxoCDP7tIEcpvi0ed/BowrSqH7FO te1A7VV4YtYSFZ8leNQ1H+PCqQYIveK3TkmONXoj31oqfymwBgFN2D/WVbMUihHLyZ+S fnOKmObmB22qTdMh9q8LAm/NUePy9pyE+z5eXBdPELU0ZDEd8HbxtB/6nXw9AZnk5WKr fqA4SVMXh6oWa2kRwdOZ3ZxMylwN0MNBQZUqOZ8r05d0HcaxEl+T7pPNqOI/XW/4MsSj Wam0VKvt56woZmf7dA+SqLSPbMFyy7130RbCILzEerT8kn1GIX+tUPf8EAjtSk1HZSSu OKOg== 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=TXhHFiYFF9iWch/VwVE0yX0wx2RhwOIfVPloQrSS3Fw=; b=JjjQPVd7lX8qQpORqKCjVvFcoM4kiAl/geQFyD5tIfLE328SlAV0dhC6lS1jI2n7nU JMmY7NC6orqtD8Twzivxl9mtfuE/lyvQj8xOy6Vm+d9pwqvdMcTigp8wkWxHMdaz4ilK hVdlWfZDO4bX5cc/LUWBoobnWo0WGzIbPBuG/VwD5HmLRg5skOID+2FO6Uzj+h/7dGvb 7cSD3PFl0lJqzRR4M7aUfVwW0Dg/Zd2LS1yJfAajsEdsSLckWb8KUugLgIp1mUkJJYgl 8ZbYOYDXKDWJd+rfI0DgtbwkcIGhg0nXKkJe6Vr3Paqm3s1MT0MmsMjKvCLqqv202MzH AvyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mbNLrHib; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 b18si2409680ejb.189.2021.04.09.11.07.39; Fri, 09 Apr 2021 11:07:39 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=mbNLrHib; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234536AbhDISHt (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234492AbhDISHm (ORCPT ); Fri, 9 Apr 2021 14:07:42 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 304B2C061761 for ; Fri, 9 Apr 2021 11:07:29 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id z9so5445981ilb.4 for ; Fri, 09 Apr 2021 11:07:29 -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=TXhHFiYFF9iWch/VwVE0yX0wx2RhwOIfVPloQrSS3Fw=; b=mbNLrHibsxMliMZoSJFoQ2UV3n6ebW6uxI8EsiRIxq1T8yEoj2tw2lr/F+dmsCJf9q MaZX2mEMWvID+8xCF1gM8pVf4CZWcW3twZur3Bio1wBIH1pk0jcKm4IfGdGkrjMAAYsh SCObZJ+PCmRCwEtG06u2UK3wfRPQUlqV1BpNIvmCMhS9bxQ97rFZc2p69tjKUGUXvxdj I/HIsCb9V7hFyWb81WRsbCEfrSIr+dZ7dMR7D/SGRb3VAVOgd4207OEphPQnQMB95pbP zHtNrv+Ju3CUpEaNUUGCR+TPbfasSykxI3Fybk2IqS5LxyddmSi+hLIKG9tUyvXmlVO0 wf/Q== 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=TXhHFiYFF9iWch/VwVE0yX0wx2RhwOIfVPloQrSS3Fw=; b=AZS4ggH7otrqSGE83cluL1YM5Vy6ndj2JK64JxHekFqxSW/J65YLstYLvfE8yPvUjN lqwmAIJsFYp1mz4RXdrilY7hml7KjjyFHgiuPwRTUmJ3SX5Amu2Ju73deX6wT4qvyjuv WYq0evvpG6L/Ndg4zuzyYfNzFuPLUIRBXsxjqmEyBvrgTbd7+waJdxJk37sGdO0d0wqq FYuSMTnpYTtl8I5ba2dVXuNJL9cBgxSVk7MY+A24O68iY7Yf/ngbdpD77Hd2zoNjf+ZM UnvO1qwSRgaqDheK7rGxFzhF6h51pRiCfReAKmh69gRDxZXx7Omk65rxZgmVCru+C0it g84g== X-Gm-Message-State: AOAM532b/UsftxVDcD0JL5jYt4bjx7qdIEV/As/1Hd7nSK5BgDfJG6rW skZmL6DYpAymBqA7rB2O0+yHog== X-Received: by 2002:a05:6e02:1a06:: with SMTP id s6mr11782812ild.289.1617991648619; Fri, 09 Apr 2021 11:07:28 -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 g12sm1412786ile.71.2021.04.09.11.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:28 -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 3/7] net: ipa: only set endpoint netdev pointer when in use Date: Fri, 9 Apr 2021 13:07:18 -0500 Message-Id: <20210409180722.1176868-4-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In ipa_modem_start(), we set endpoint netdev pointers before the network device is registered. If registration fails, we don't undo those assignments. Instead, wait to assign the netdev pointer until after registration succeeds. Set these endpoint netdev pointers to NULL in ipa_modem_stop() before unregistering the network device. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_modem.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index 9b08eb8239846..8a6ccebde2889 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2018-2020 Linaro Ltd. + * Copyright (C) 2018-2021 Linaro Ltd. */ #include @@ -213,18 +213,18 @@ int ipa_modem_start(struct ipa *ipa) goto out_set_state; } - ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = netdev; - ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = netdev; - SET_NETDEV_DEV(netdev, &ipa->pdev->dev); priv = netdev_priv(netdev); priv->ipa = ipa; ret = register_netdev(netdev); - if (ret) - free_netdev(netdev); - else + if (!ret) { ipa->modem_netdev = netdev; + ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = netdev; + ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = netdev; + } else { + free_netdev(netdev); + } out_set_state: if (ret) @@ -263,6 +263,8 @@ int ipa_modem_stop(struct ipa *ipa) if (ret) goto out_set_state; + ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = NULL; + ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = NULL; ipa->modem_netdev = NULL; unregister_netdev(netdev); free_netdev(netdev); From patchwork Fri Apr 9 18:07:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418187 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788162jai; Fri, 9 Apr 2021 11:07:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuA3RQp0g3aozd42mFI92iRcBxF6PiaW3YCSp38xQz40bm9bfDpUOurTcWih7oCFih8+RM X-Received: by 2002:a17:906:9385:: with SMTP id l5mr8688517ejx.32.1617991665071; Fri, 09 Apr 2021 11:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991665; cv=none; d=google.com; s=arc-20160816; b=BqRFAV9hvrSx7zS5lRiJKkwhwiR1IA2Kx7Rn2t5dUWoCXFlx7bcHQSAwtjZ396ulEx /m8BmvkYN+k+cnrRUXW2EFeYflfR+Jlq+roS9bwnOZ+zpKbrhK2TKiR+YOsQSYs3/DGY f0NzEbr+vCPDPMpcj84oHCmPHDuSGkAgipB/xEjr/yjSPBsB37vLVq6PwP3E7RqlGUkY DZw90jAsTCgloBOZtC+cw8BuzZ66gMljbjhKewYeIYy0GCOtxNacjns1RIo5pFxeHsPT 5hoc66qCk9nocNk7mMNOHVq22Tg3yBf4NoN/eHQbcQiIDa4mz80qrERM6sx/xjW4pTVg lLtw== 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=M02HcZujpZ/J/h5ieItU4HENzz4/4ThjFxhYAjdjTos=; b=mf0vb4d/XfIsxTqBSMgOBSNe3DaAU1sge2NPzJMN+q+ACIKo6VkAKX/WxZGhVRO/Dj C4sOwKQZ+kBCnaOWT9QXayu/Um92g6cCqm+eUHUqXIvxfP7YehA6f/4KOxrUxbMAD33Q RyoiZ9Q7vWFGhttzYfBzugCYrBhL4Un89BimodLB5agHX4fZ6haQ1cTc/fmP1XlIOuBl XQ3iAsX7s8ch6uOECTprrUxyD1tlnf3WEg8T9+7DkKqo1TTDTk8nhMglxf+FDwH+cW83 zJvCH6T3wD82moCk1M7kSudey5dXVWHepwd8ichmPw3v3Bs2/8em5+Texickenv/JHwk c2EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o1NsykK0; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 ce25si2620684ejb.93.2021.04.09.11.07.44; Fri, 09 Apr 2021 11:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=o1NsykK0; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234551AbhDISHv (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234501AbhDISHn (ORCPT ); Fri, 9 Apr 2021 14:07:43 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CE4FC061765 for ; Fri, 9 Apr 2021 11:07:30 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id c18so5436303iln.7 for ; Fri, 09 Apr 2021 11:07:30 -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=M02HcZujpZ/J/h5ieItU4HENzz4/4ThjFxhYAjdjTos=; b=o1NsykK06oGHfrPp8sbmPR0E2noKbbC6+m22RUf8G7xP+9K879owrt1IiRZEwLAcxm uKhx5XXFzCPDVHgLqm7P6dh7zYR5Z0w8D26voQ6LFHC6nHjo9vQQvdDSXMSNIy4TzYy/ 2lV47wv1nN2quRJ8ZhqBZrGvJr4yJpHTtdYxVjaGnKDn3qjeHKuZNv2Y72fFWNBTo5+p iu1VIHv+R3AI9sCIN+3ColckgwWlbcPbzbU38Q3fasf83HrLOXGXGBtyBk7IuBC0A6Nj 1LhZcguacfNkijZ8v8RPRq6evcpn/YxtrksN6VIr6lJ2DQV8x/YVbG3nYNTp3iUGitKr va+Q== 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=M02HcZujpZ/J/h5ieItU4HENzz4/4ThjFxhYAjdjTos=; b=KV/urMPbyD7pQt+qv5O8/aDL2MShc1+TfzMiKH+8u4fxFMe/a8xoX28rylNev93l+p lDlOJlngtg6m2vbqjE7qzsD+wAlzWzQPkupyTJ0bFRiT+A02GLpey1d5RVhloK2p2T0N 1yYrQdlVJUqYFViwRjbgbdVr9/wX1T8IaPpMdH5NPKd01eW4PhskFFADdC23KgIZQl2H wSOem1eJb+Juu3RTVBuw45syedrBine71TwzaqnqKhAAB28heHW0kUESFHr2f4My6drm jXmJ1oy4RKhbawBGiOvweEQLd74b/UnPJ2mEk1+sRvfLqYAHs215HS+dgqRS7bnlnY1z EuAQ== X-Gm-Message-State: AOAM5334U/DRav2QGIQM7vZ9G6SCPNEbmKp/sbT2SUfM2TZlIwQec3SF NM9CjB91NlZqFrH7upirgtrswA== X-Received: by 2002:a05:6e02:1311:: with SMTP id g17mr12465813ilr.14.1617991649583; Fri, 09 Apr 2021 11:07:29 -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 g12sm1412786ile.71.2021.04.09.11.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:29 -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 4/7] net: ipa: ipa_stop() does not return an error Date: Fri, 9 Apr 2021 13:07:19 -0500 Message-Id: <20210409180722.1176868-5-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In ipa_modem_stop(), if the modem netdev pointer is non-null we call ipa_stop(). We check for an error and if one is returned we handle it. But ipa_stop() never returns an error, so this extra handling is unnecessary. Simplify the code in ipa_modem_stop() based on the knowledge no error handling is needed at this spot. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_modem.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index 8a6ccebde2889..af9aedbde717a 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -240,7 +240,6 @@ int ipa_modem_stop(struct ipa *ipa) { struct net_device *netdev = ipa->modem_netdev; enum ipa_modem_state state; - int ret; /* Only attempt to stop the modem if it's running */ state = atomic_cmpxchg(&ipa->modem_state, IPA_MODEM_STATE_RUNNING, @@ -257,29 +256,20 @@ int ipa_modem_stop(struct ipa *ipa) /* Prevent the modem from triggering a call to ipa_setup() */ ipa_smp2p_disable(ipa); + /* Stop the queue and disable the endpoints if it's open */ if (netdev) { - /* Stop the queue and disable the endpoints if it's open */ - ret = ipa_stop(netdev); - if (ret) - goto out_set_state; - + (void)ipa_stop(netdev); ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = NULL; ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = NULL; ipa->modem_netdev = NULL; unregister_netdev(netdev); free_netdev(netdev); - } else { - ret = 0; } -out_set_state: - if (ret) - atomic_set(&ipa->modem_state, IPA_MODEM_STATE_RUNNING); - else - atomic_set(&ipa->modem_state, IPA_MODEM_STATE_STOPPED); + atomic_set(&ipa->modem_state, IPA_MODEM_STATE_STOPPED); smp_mb__after_atomic(); - return ret; + return 0; } /* Treat a "clean" modem stop the same as a crash */ From patchwork Fri Apr 9 18:07:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418186 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788155jai; Fri, 9 Apr 2021 11:07:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiCNqnBf+B4amWTKskc1NDzyM0zh22eYh5Fon8+OzjRLpLHugivAonQTXzDWbsTw3D4OEQ X-Received: by 2002:a05:6402:22f9:: with SMTP id dn25mr4338510edb.171.1617991664658; Fri, 09 Apr 2021 11:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991664; cv=none; d=google.com; s=arc-20160816; b=yMtWCgG887DCz++F90tliTQD8MMr9Hi60rYn30NJPHBtziUrcUiUAYzbVBBTnI9zbe Ifw1dXPMzd9MhceMBtXvjX8RZ2rqf+99cPDM6lq3+Dth0YQtqHJl37v6+E3Swl7WPY2M SGbwQphRxfSYxzd8zccBCQR8+Db4AvFjgMaOmlL4K6B5X+KlmRyb9KxrUGwxqR0rSB5j zCaF/u9AVwYoYygXYFagh/catr+W+/Y3Q3eRNGdLwQs78XQ6i9L2oznlAlBI1zFLpEcv 5KRkSc9lJJMGs98SGPkRARtPCpKLgqOxRxckcDqDhGa6bmuYnBXcTMa7F9Lzf3zcXIof vzMA== 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=txa2iok90+y/pvPIZBlzCT/IEohPrGV3y36Mz3PtV64=; b=WLhQBUdXtdqu+9JlnbogW9WgoTcfZTYkgR1zGj4fc/GRhgYLwDrkLz2Hqs3TqbXMjw 3Hfag+JiVfw9ifthCaSgDnkEJLV5NCEdGC1NFQWLsfkmaeiFXBTf+vjydta6+sf7uehi n7LCZ0fx3Yy9M4sZYLmnxdglwaDDFGJzcYqePkpLKmWhh1qgaNqKXWKXobEYQBW3u16A Z7VWfueusMUUlPTKHN4P0FeSbeDy21o4WBvy7ORKyGGNvDbxd8JS8CO8TirXxTzSN8iF ExiLaWKF/t6lmzQYeY7CFugT+bx31hcphAx2UwRyq24MarzAf2d0dpqntjQxrTXzuCRx 5NZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aUv8EWTz; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 ce25si2620684ejb.93.2021.04.09.11.07.44; Fri, 09 Apr 2021 11:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=aUv8EWTz; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234550AbhDISHy (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234510AbhDISHo (ORCPT ); Fri, 9 Apr 2021 14:07:44 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15946C061762 for ; Fri, 9 Apr 2021 11:07:31 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id e186so6795544iof.7 for ; Fri, 09 Apr 2021 11:07:31 -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=txa2iok90+y/pvPIZBlzCT/IEohPrGV3y36Mz3PtV64=; b=aUv8EWTzIsjPL4rqCmm9cuSj8dZK6mnibC+lCQ4zx0lHTGkZnVLhOclHsC23P3KSQO ULnOsw2UX7aDYH70sggtqawxxEtp0pvWqNtr0ecJaufTdeA+fuISu92hEGBcyhyani5F QLjprdtVi1NlkxosnPQr5/JK/mBU/HhPoJCQUFCfBeBODBP8bBhqYpJY6BwyQRbrgI8c CU7+kB2fx/FEG12IL8AC8l7/FSDsxlmT9LSETaUYiRv5lMyZDAk4fhXIyg/jGHtjwRN/ vrkwgqDl7+H+qxgYEWZUeevqF1Srs43kBFAvjqpuQw7bUWUz68WeNk1VXvSBW8O/Z3Ca 91rg== 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=txa2iok90+y/pvPIZBlzCT/IEohPrGV3y36Mz3PtV64=; b=bsVOjR6Nu7qlvTsB3y4MLNBPPsubXvp/ORwVNJ6ao2ew/eJEEFwf3VWn/wcN7D4SZP cszDZjwjmmVD9c4Npe6MJQPQlPv1ep2LYixCUXk9FWZrUSGzpv9XdQL9uKiwny9MWluq xK347CTLxFNjaDGNHOVvNDPFy4X81bZh/q2w5ky7A0/sbeDAIk85OKWLOw9z5XkyGDvD 28mWPQWkqesMleoQ/Cc0jIws5wOY3D7J9WGmOYs1oa5l4i/jdmlhvsfFMsCzjTTLWq4w n3VxqVEzTyHHIx+mxF+sCZbx5fxk9up/PRJIJpq0IVJXEIvFgpphLYUJtEUtJWD9eSct NvpA== X-Gm-Message-State: AOAM5330L8oEP4mDLJl6iq+gSsHmVKj14vERs2E1fxj6HZjXm/8K0kY1 NXSCd+c3stEhgmQF6dtHKfDwJQ== X-Received: by 2002:a05:6638:3a8:: with SMTP id z8mr15834642jap.111.1617991650507; Fri, 09 Apr 2021 11:07:30 -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 g12sm1412786ile.71.2021.04.09.11.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:30 -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/7] net: ipa: get rid of empty IPA functions Date: Fri, 9 Apr 2021 13:07:20 -0500 Message-Id: <20210409180722.1176868-6-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are place holder functions in the IPA code that do nothing. For the most part these are inverse functions, for example, once the routing or filter tables are set up there is no need to perform any matching teardown activity at shutdown, or in the case of an error. These can be safely removed, resulting in some code simplification. Add comments in these spots making it explicit that there is no inverse. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 29 +++++++++-------------------- drivers/net/ipa/ipa_mem.c | 9 +++------ drivers/net/ipa/ipa_mem.h | 5 ++--- drivers/net/ipa/ipa_resource.c | 8 +------- drivers/net/ipa/ipa_resource.h | 8 ++------ drivers/net/ipa/ipa_table.c | 26 +++----------------------- drivers/net/ipa/ipa_table.h | 16 ++++------------ 7 files changed, 24 insertions(+), 77 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index a970d10e650ef..bfed151f5d6dc 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -147,13 +147,13 @@ int ipa_setup(struct ipa *ipa) if (ret) goto err_endpoint_teardown; - ret = ipa_mem_setup(ipa); + ret = ipa_mem_setup(ipa); /* No matching teardown required */ if (ret) goto err_command_disable; - ret = ipa_table_setup(ipa); + ret = ipa_table_setup(ipa); /* No matching teardown required */ if (ret) - goto err_mem_teardown; + goto err_command_disable; /* Enable the exception handling endpoint, and tell the hardware * to use it by default. @@ -161,7 +161,7 @@ int ipa_setup(struct ipa *ipa) exception_endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ret = ipa_endpoint_enable_one(exception_endpoint); if (ret) - goto err_table_teardown; + goto err_command_disable; ipa_endpoint_default_route_set(ipa, exception_endpoint->endpoint_id); @@ -179,10 +179,6 @@ int ipa_setup(struct ipa *ipa) err_default_route_clear: ipa_endpoint_default_route_clear(ipa); ipa_endpoint_disable_one(exception_endpoint); -err_table_teardown: - ipa_table_teardown(ipa); -err_mem_teardown: - ipa_mem_teardown(ipa); err_command_disable: ipa_endpoint_disable_one(command_endpoint); err_endpoint_teardown: @@ -211,8 +207,6 @@ static void ipa_teardown(struct ipa *ipa) ipa_endpoint_default_route_clear(ipa); exception_endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ipa_endpoint_disable_one(exception_endpoint); - ipa_table_teardown(ipa); - ipa_mem_teardown(ipa); command_endpoint = ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]; ipa_endpoint_disable_one(command_endpoint); ipa_endpoint_teardown(ipa); @@ -480,23 +474,20 @@ static int ipa_config(struct ipa *ipa, const struct ipa_data *data) if (ret) goto err_endpoint_deconfig; - ipa_table_config(ipa); + ipa_table_config(ipa); /* No deconfig required */ - /* Assign resource limitation to each group */ + /* Assign resource limitation to each group; no deconfig required */ ret = ipa_resource_config(ipa, data->resource_data); if (ret) - goto err_table_deconfig; + goto err_mem_deconfig; ret = ipa_modem_config(ipa); if (ret) - goto err_resource_deconfig; + goto err_mem_deconfig; return 0; -err_resource_deconfig: - ipa_resource_deconfig(ipa); -err_table_deconfig: - ipa_table_deconfig(ipa); +err_mem_deconfig: ipa_mem_deconfig(ipa); err_endpoint_deconfig: ipa_endpoint_deconfig(ipa); @@ -514,8 +505,6 @@ static int ipa_config(struct ipa *ipa, const struct ipa_data *data) static void ipa_deconfig(struct ipa *ipa) { ipa_modem_deconfig(ipa); - ipa_resource_deconfig(ipa); - ipa_table_deconfig(ipa); ipa_mem_deconfig(ipa); ipa_endpoint_deconfig(ipa); ipa_hardware_deconfig(ipa); diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 32907dde5dc6a..c5c3b1b7e67d5 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019-2020 Linaro Ltd. + * Copyright (C) 2019-2021 Linaro Ltd. */ #include @@ -53,6 +53,8 @@ ipa_mem_zero_region_add(struct gsi_trans *trans, const struct ipa_mem *mem) * The AP informs the modem where its portions of memory are located * in a QMI exchange that occurs at modem startup. * + * There is no need for a matching ipa_mem_teardown() function. + * * Return: 0 if successful, or a negative error code */ int ipa_mem_setup(struct ipa *ipa) @@ -97,11 +99,6 @@ int ipa_mem_setup(struct ipa *ipa) return 0; } -void ipa_mem_teardown(struct ipa *ipa) -{ - /* Nothing to do */ -} - #ifdef IPA_VALIDATE static bool ipa_mem_valid(struct ipa *ipa, enum ipa_mem_id mem_id) diff --git a/drivers/net/ipa/ipa_mem.h b/drivers/net/ipa/ipa_mem.h index df61ef48df365..9ca8a47bd4afd 100644 --- a/drivers/net/ipa/ipa_mem.h +++ b/drivers/net/ipa/ipa_mem.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019-2020 Linaro Ltd. + * Copyright (C) 2019-2021 Linaro Ltd. */ #ifndef _IPA_MEM_H_ #define _IPA_MEM_H_ @@ -88,8 +88,7 @@ struct ipa_mem { int ipa_mem_config(struct ipa *ipa); void ipa_mem_deconfig(struct ipa *ipa); -int ipa_mem_setup(struct ipa *ipa); -void ipa_mem_teardown(struct ipa *ipa); +int ipa_mem_setup(struct ipa *ipa); /* No ipa_mem_teardown() needed */ int ipa_mem_zero_modem(struct ipa *ipa); diff --git a/drivers/net/ipa/ipa_resource.c b/drivers/net/ipa/ipa_resource.c index 85f922d6f222f..3b2dc216d3a68 100644 --- a/drivers/net/ipa/ipa_resource.c +++ b/drivers/net/ipa/ipa_resource.c @@ -158,7 +158,7 @@ static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type, ipa_resource_config_common(ipa, offset, &resource->limits[6], ylimits); } -/* Configure resources */ +/* Configure resources; there is no ipa_resource_deconfig() */ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data) { u32 i; @@ -174,9 +174,3 @@ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data) return 0; } - -/* Inverse of ipa_resource_config() */ -void ipa_resource_deconfig(struct ipa *ipa) -{ - /* Nothing to do */ -} diff --git a/drivers/net/ipa/ipa_resource.h b/drivers/net/ipa/ipa_resource.h index 9f74036fb95c5..ef5818bff180d 100644 --- a/drivers/net/ipa/ipa_resource.h +++ b/drivers/net/ipa/ipa_resource.h @@ -14,14 +14,10 @@ struct ipa_resource_data; * @ipa: IPA pointer * @data: IPA resource configuration data * + * There is no need for a matching ipa_resource_deconfig() function. + * * Return: true if all regions are valid, false otherwise */ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data); -/** - * ipa_resource_deconfig() - Inverse of ipa_resource_config() - * @ipa: IPA pointer - */ -void ipa_resource_deconfig(struct ipa *ipa); - #endif /* _IPA_RESOURCE_H_ */ diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index 401b568df6a34..3168d72f42450 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -497,11 +497,6 @@ int ipa_table_setup(struct ipa *ipa) return 0; } -void ipa_table_teardown(struct ipa *ipa) -{ - /* Nothing to do */ /* XXX Maybe reset the tables? */ -} - /** * ipa_filter_tuple_zero() - Zero an endpoint's hashed filter tuple * @endpoint: Endpoint whose filter hash tuple should be zeroed @@ -525,6 +520,7 @@ static void ipa_filter_tuple_zero(struct ipa_endpoint *endpoint) iowrite32(val, endpoint->ipa->reg_virt + offset); } +/* Configure a hashed filter table; there is no ipa_filter_deconfig() */ static void ipa_filter_config(struct ipa *ipa, bool modem) { enum gsi_ee_id ee_id = modem ? GSI_EE_MODEM : GSI_EE_AP; @@ -545,11 +541,6 @@ static void ipa_filter_config(struct ipa *ipa, bool modem) } } -static void ipa_filter_deconfig(struct ipa *ipa, bool modem) -{ - /* Nothing to do */ -} - static bool ipa_route_id_modem(u32 route_id) { return route_id >= IPA_ROUTE_MODEM_MIN && @@ -576,6 +567,7 @@ static void ipa_route_tuple_zero(struct ipa *ipa, u32 route_id) iowrite32(val, ipa->reg_virt + offset); } +/* Configure a hashed route table; there is no ipa_route_deconfig() */ static void ipa_route_config(struct ipa *ipa, bool modem) { u32 route_id; @@ -588,11 +580,7 @@ static void ipa_route_config(struct ipa *ipa, bool modem) ipa_route_tuple_zero(ipa, route_id); } -static void ipa_route_deconfig(struct ipa *ipa, bool modem) -{ - /* Nothing to do */ -} - +/* Configure a filter and route tables; there is no ipa_table_deconfig() */ void ipa_table_config(struct ipa *ipa) { ipa_filter_config(ipa, false); @@ -601,14 +589,6 @@ void ipa_table_config(struct ipa *ipa) ipa_route_config(ipa, true); } -void ipa_table_deconfig(struct ipa *ipa) -{ - ipa_route_deconfig(ipa, true); - ipa_route_deconfig(ipa, false); - ipa_filter_deconfig(ipa, true); - ipa_filter_deconfig(ipa, false); -} - /* * Initialize a coherent DMA allocation containing initialized filter and * route table data. This is used when initializing or resetting the IPA diff --git a/drivers/net/ipa/ipa_table.h b/drivers/net/ipa/ipa_table.h index 018045b95aad8..1e2be9fce2f81 100644 --- a/drivers/net/ipa/ipa_table.h +++ b/drivers/net/ipa/ipa_table.h @@ -74,27 +74,19 @@ int ipa_table_hash_flush(struct ipa *ipa); /** * ipa_table_setup() - Set up filter and route tables * @ipa: IPA pointer + * + * There is no need for a matching ipa_table_teardown() function. */ int ipa_table_setup(struct ipa *ipa); -/** - * ipa_table_teardown() - Inverse of ipa_table_setup() - * @ipa: IPA pointer - */ -void ipa_table_teardown(struct ipa *ipa); - /** * ipa_table_config() - Configure filter and route tables * @ipa: IPA pointer + * + * There is no need for a matching ipa_table_deconfig() function. */ void ipa_table_config(struct ipa *ipa); -/** - * ipa_table_deconfig() - Inverse of ipa_table_config() - * @ipa: IPA pointer - */ -void ipa_table_deconfig(struct ipa *ipa); - /** * ipa_table_init() - Do early initialization of filter and route tables * @ipa: IPA pointer From patchwork Fri Apr 9 18:07:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418188 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788179jai; Fri, 9 Apr 2021 11:07:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/u5Ka0p/Drh34NlHTs0T0+roUri7vJ5EtO9EH+ru2kivz0VID4sDEXIrGhWOST4+QQWpy X-Received: by 2002:aa7:de8b:: with SMTP id j11mr18867274edv.363.1617991666141; Fri, 09 Apr 2021 11:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991666; cv=none; d=google.com; s=arc-20160816; b=zvlv9HzPFfQqYArYNj1KAjYPd7kBb4gemjnmjDBXDSFqmlcHSdLnBv4TxSdt+Du27D j2+VH2MJIH5NZsOpeiRxFUlavekqXn3u5su3CmeZDOVk3ww1ghNilyM91NQG3fQZzUC8 osdvrv+fukHMBI/qxJOm/gZOKu8ESd5KEkhXnqQGYoayG2IfEZOy481KmY2rhNjCiO9d mMI1CP2BL70/YB9RMqG6PgaAroxbDf4MDvAV6IZkTLncsQpk6bqDAqqJU8yefOmlrPZu WE4C1HgLIAQmURsqF803rREBZqv3qwCKa6B+ys1hItZguYQRdC76TvvktB5rsRrVuDkx Z+KA== 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=sHzvGlbUFXBWwssGYe1pEFogW44sTlKM1YL3uj6aQc4=; b=w8VFS6SLYM4ElYLfDQj8Ijwz0phC2N0qj+FEq3d6wl0P9U1FdlRQJh2JQzsHrKiSPK emj2/Mv4Tv6EBOeJ1qUo6TlME/3MosL6/6h++U0IDCkQV9mjZswdX3UK8lZDpM1r9sLN 7h0p2kztJzxRiLHZRFLA8RyR0Ur8tHNOkTxXy5/uPdJxZz6xZEeTtqfpyD7LLOxh8UTB gJw3U1c4Q7sZvzGLv0c9lZUcrFTDA21YRAs7yBPnRG2dO5wqJj4XRAUX9cwBXMz0yezU Cp36ZpBK2lhBU8P7hQFJED63IYlhxuusCVwWtJchbelUEo3toPYk0Vfi0+MYDUcbZnso hVjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XjGc3ald; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 ce25si2620684ejb.93.2021.04.09.11.07.45; Fri, 09 Apr 2021 11:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=XjGc3ald; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234367AbhDISHz (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234517AbhDISHp (ORCPT ); Fri, 9 Apr 2021 14:07:45 -0400 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 12881C061762 for ; Fri, 9 Apr 2021 11:07:32 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id x12so2585239ilm.2 for ; Fri, 09 Apr 2021 11:07:32 -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=sHzvGlbUFXBWwssGYe1pEFogW44sTlKM1YL3uj6aQc4=; b=XjGc3ald4VGom04aNWVGY4iCpi8QkGiJVvQuhe0xs/RapYnViYhgFuEEGdvZ6G8W64 RXxQygFTdfoNmYeyReTZHBAoqsuZsRz4ccZao0OeWS0Fs/mowd873+Wz8Ag+gh7NNbXi 0D3q9vM2caHs7WnH13OHP44OSKJVXlezVwo6oKmKAONaB3pc4j61PHz2RbDIfnezftgr GTqZSmESi+DFtXB+tT6GsaCtoaMh8SjQSFUmi8OvOqEB+iXydaj1opg1+HocYf1pn8jO ZyzSbcJ//c4WPY9/8RmGY/onx6afL5otiSa3QYvnXoUEU2PFBb2x9/jlKj0wSioTIu8p wkdw== 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=sHzvGlbUFXBWwssGYe1pEFogW44sTlKM1YL3uj6aQc4=; b=iP0dc+Ey4cOlkb+Dtg2SVU2Pv2xfiqy8rp3Fg8+ws0rpdpCA0Odh4T5ZreZ2bGMbMe rluzOc+0MZkp7uZgdF3UWogbXlxqCXhtMNY2t/61Wu5INtb7yeOzByinCax67xYAW4GA sPX8h5RWpYc40HUgIpdwH9OtI4dw9hV+3fKkj2BrgGFNyhulYeZLfLrHvQgtBCfQQX7c PgeWgygLCbZnFcu32w/u3Z9mNqI1JfDAkbijUiXrRSfRAE98Z+X0TN7d+qJwZLLOR1LI MgOdiRAgr1UcyoW8pXAUnv+ZWhCQBi0JgNivGGFh5GEmFevmsniJmgVM/udwvzY5rNMC QgUQ== X-Gm-Message-State: AOAM532EUo1eZch/P1vZgQxUHa5XThBne1ywRDU6pEaUKoFfbhQtpw43 VbqwM1fqdEKZcW+hw9MTeQt/Cw== X-Received: by 2002:a05:6e02:12ad:: with SMTP id f13mr12278147ilr.44.1617991651474; Fri, 09 Apr 2021 11:07:31 -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 g12sm1412786ile.71.2021.04.09.11.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:31 -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 6/7] net: ipa: get rid of empty GSI functions Date: Fri, 9 Apr 2021 13:07:21 -0500 Message-Id: <20210409180722.1176868-7-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are place holder functions in the GSI code that do nothing. Remove these, knowing we can add something back in their place if they're really needed someday. Some of these are inverse functions (such as teardown to match setup). Explicitly comment that there is no inverse in these cases. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 54 +++++-------------------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 1c835b3e1a437..9f06663cef263 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -198,7 +198,7 @@ static void gsi_irq_type_disable(struct gsi *gsi, enum gsi_irq_type_id type_id) gsi_irq_type_update(gsi, gsi->type_enabled_bitmap & ~BIT(type_id)); } -/* Turn off all GSI interrupts initially */ +/* Turn off all GSI interrupts initially; there is no gsi_irq_teardown() */ static void gsi_irq_setup(struct gsi *gsi) { /* Disable all interrupt types */ @@ -217,12 +217,6 @@ static void gsi_irq_setup(struct gsi *gsi) iowrite32(0, gsi->virt + GSI_CNTXT_GSI_IRQ_EN_OFFSET); } -/* Turn off all GSI interrupts when we're all done */ -static void gsi_irq_teardown(struct gsi *gsi) -{ - /* Nothing to do */ -} - /* Event ring commands are performed one at a time. Their completion * is signaled by the event ring control GSI interrupt type, which is * only enabled when we issue an event ring command. Only the event @@ -786,7 +780,7 @@ static void gsi_channel_trans_quiesce(struct gsi_channel *channel) } } -/* Program a channel for use */ +/* Program a channel for use; there is no gsi_channel_deprogram() */ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell) { size_t size = channel->tre_ring.count * GSI_RING_ELEMENT_SIZE; @@ -874,11 +868,6 @@ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell) /* All done! */ } -static void gsi_channel_deprogram(struct gsi_channel *channel) -{ - /* Nothing to do */ -} - static int __gsi_channel_start(struct gsi_channel *channel, bool start) { struct gsi *gsi = channel->gsi; @@ -1623,18 +1612,6 @@ static u32 gsi_event_bitmap_init(u32 evt_ring_max) return event_bitmap; } -/* Setup function for event rings */ -static void gsi_evt_ring_setup(struct gsi *gsi) -{ - /* Nothing to do */ -} - -/* Inverse of gsi_evt_ring_setup() */ -static void gsi_evt_ring_teardown(struct gsi *gsi) -{ - /* Nothing to do */ -} - /* Setup function for a single channel */ static int gsi_channel_setup_one(struct gsi *gsi, u32 channel_id) { @@ -1684,7 +1661,6 @@ static void gsi_channel_teardown_one(struct gsi *gsi, u32 channel_id) netif_napi_del(&channel->napi); - gsi_channel_deprogram(channel); gsi_channel_de_alloc_command(gsi, channel_id); gsi_evt_ring_reset_command(gsi, evt_ring_id); gsi_evt_ring_de_alloc_command(gsi, evt_ring_id); @@ -1759,7 +1735,6 @@ static int gsi_channel_setup(struct gsi *gsi) u32 mask; int ret; - gsi_evt_ring_setup(gsi); gsi_irq_enable(gsi); mutex_lock(&gsi->mutex); @@ -1819,7 +1794,6 @@ static int gsi_channel_setup(struct gsi *gsi) mutex_unlock(&gsi->mutex); gsi_irq_disable(gsi); - gsi_evt_ring_teardown(gsi); return ret; } @@ -1848,7 +1822,6 @@ static void gsi_channel_teardown(struct gsi *gsi) mutex_unlock(&gsi->mutex); gsi_irq_disable(gsi); - gsi_evt_ring_teardown(gsi); } /* Setup function for GSI. GSI firmware must be loaded and initialized */ @@ -1856,7 +1829,6 @@ int gsi_setup(struct gsi *gsi) { struct device *dev = gsi->dev; u32 val; - int ret; /* Here is where we first touch the GSI hardware */ val = ioread32(gsi->virt + GSI_GSI_STATUS_OFFSET); @@ -1865,7 +1837,7 @@ int gsi_setup(struct gsi *gsi) return -EIO; } - gsi_irq_setup(gsi); + gsi_irq_setup(gsi); /* No matching teardown required */ val = ioread32(gsi->virt + GSI_GSI_HW_PARAM_2_OFFSET); @@ -1899,18 +1871,13 @@ int gsi_setup(struct gsi *gsi) /* Writing 1 indicates IRQ interrupts; 0 would be MSI */ iowrite32(1, gsi->virt + GSI_CNTXT_INTSET_OFFSET); - ret = gsi_channel_setup(gsi); - if (ret) - gsi_irq_teardown(gsi); - - return ret; + return gsi_channel_setup(gsi); } /* Inverse of gsi_setup() */ void gsi_teardown(struct gsi *gsi) { gsi_channel_teardown(gsi); - gsi_irq_teardown(gsi); } /* Initialize a channel's event ring */ @@ -1952,7 +1919,7 @@ static void gsi_channel_evt_ring_exit(struct gsi_channel *channel) gsi_evt_ring_id_free(gsi, evt_ring_id); } -/* Init function for event rings */ +/* Init function for event rings; there is no gsi_evt_ring_exit() */ static void gsi_evt_ring_init(struct gsi *gsi) { u32 evt_ring_id = 0; @@ -1964,12 +1931,6 @@ static void gsi_evt_ring_init(struct gsi *gsi) while (++evt_ring_id < GSI_EVT_RING_COUNT_MAX); } -/* Inverse of gsi_evt_ring_init() */ -static void gsi_evt_ring_exit(struct gsi *gsi) -{ - /* Nothing to do */ -} - static bool gsi_channel_data_valid(struct gsi *gsi, const struct ipa_gsi_endpoint_data *data) { @@ -2114,7 +2075,7 @@ static int gsi_channel_init(struct gsi *gsi, u32 count, /* IPA v4.2 requires the AP to allocate channels for the modem */ modem_alloc = gsi->version == IPA_VERSION_4_2; - gsi_evt_ring_init(gsi); + gsi_evt_ring_init(gsi); /* No matching exit required */ /* The endpoint data array is indexed by endpoint name */ for (i = 0; i < count; i++) { @@ -2148,7 +2109,6 @@ static int gsi_channel_init(struct gsi *gsi, u32 count, } gsi_channel_exit_one(&gsi->channel[data->channel_id]); } - gsi_evt_ring_exit(gsi); return ret; } @@ -2162,8 +2122,6 @@ static void gsi_channel_exit(struct gsi *gsi) gsi_channel_exit_one(&gsi->channel[channel_id]); while (channel_id--); gsi->modem_channel_bitmap = 0; - - gsi_evt_ring_exit(gsi); } /* Init function for GSI. GSI hardware does not need to be "ready" */ From patchwork Fri Apr 9 18:07:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 418189 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1788191jai; Fri, 9 Apr 2021 11:07:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztxMrAKyPQuOiScc235PI1BqRIrBO125yFqO/8Rtn8aTUpaYbUct5JEmr05EYQlVluvqMo X-Received: by 2002:a17:906:704a:: with SMTP id r10mr17377355ejj.312.1617991666954; Fri, 09 Apr 2021 11:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617991666; cv=none; d=google.com; s=arc-20160816; b=EQNmwk1zejTmWTWUW0SkOtTS6o11ulwGPJxSUmRwjWKyYbiT2GgsMxaZC70u55LhIM LVHV3wqWwAll2rpwYtA+aUwxpzCeRN1qCAn4eO2Diw1YL7Np+fccdgFi/gpfhMDV9hi+ qa9j0OhUuDyQnVykJc9HTc5/U0RI59HAO8XNJUg8OgJ5CmdJsIm2B+bbsgnYNMYc7wcZ x+G0mZFt61VamfZHKPP1HP223saZztV35Q+q3qcCsGec/OicPHvY10SJzSc2SssT9Y4k rtsQ1Q94uO6j49JHCDMhYIViA5d8uBlmDyPBjUFbMzzB1412sNnWJGZGxZy7RyFfGauP ns8A== 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=TOH3l++0jw4JADgwzNPOO7zYc7PdMPjbZGsmYctkn9E=; b=vbOqBsu9dCi/vlybgkhbYUHyeXGEyY9ehCjoEtQpVEYs8ZP2R1VuWMcOkbkQmyynji OX0tQX38hCg2J8tqSCHHQXJWDyXxB3gM1GipDNqzKRMNqFVgh+TQXKqLGRSf09rYwBHt HVK22tpYRhgwXpQUgxT8qOhsBHg8Z4amXQgW3ICXpN1hD+ulE/cLi2NJnfMCdhynYfsy zYkh/bUCmiHbOnFnPQraimPOdLK93cgaMeRHn7I4eP2IjSDIVYzr6QG2mwyT9NLsZoez tIxqBdX7vAgPPUpxqLTxahIEWDmojHalocXunS2MbnTBkixErq54MgoQS+MkuU+cl1kT Oa0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zd10W9BN; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 ce25si2620684ejb.93.2021.04.09.11.07.46; Fri, 09 Apr 2021 11:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=zd10W9BN; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234591AbhDISH5 (ORCPT + 8 others); Fri, 9 Apr 2021 14:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234523AbhDISHr (ORCPT ); Fri, 9 Apr 2021 14:07:47 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6FBDC061765 for ; Fri, 9 Apr 2021 11:07:32 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id y4so6835113ioy.3 for ; Fri, 09 Apr 2021 11:07:32 -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=TOH3l++0jw4JADgwzNPOO7zYc7PdMPjbZGsmYctkn9E=; b=zd10W9BN0tLyMuoOeWEg/iNO635zlwEZtexPDtav7TzSKX3z8C0IU7JispTTfNNliB XQ2+Ksd4W642woc1RJR01vkK2ajrZ2yIzsXfP6gY/DOI0SvWRHNBDcvUzmqGyMeU+K+4 zW4jT0UpP6Bpzjvc99ACO05ydGO3eoosQ9NX3xyfRi42B0EN5Dqcqv6I4HSKkkojL1HM GGQ/lm9QsojPBE0dpLwAnmrBhoOIz/h7cVVNLlsBbeaoexDAY9R/09WrOlZyCkj8DUC4 AldwkRyqn1HE2YQgkFzjhDM+YDrysN1RhdEc1CMt2T76E++HCczhwk5j4SS8bVNSedtf VikQ== 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=TOH3l++0jw4JADgwzNPOO7zYc7PdMPjbZGsmYctkn9E=; b=JYjvJBnRDkMtLmRjMfRaHxeqU3NMNUuYjq3j+SICB1nQA9sJffeX3kgV0VMEAl0j+H /SRpQ5Km/8sT/jLgjUC0fLqjK+Byx0h7MlA5L+MzB4NyXJglenBtLAMOzcJrUe3jTE9D 1ZQ9yL+8V0Dv/69TLOYMxMOc4O6EhdjdYF5zH5J8EFOCkvWeZUDk31EA6MhNL8PcQ9fG fCgkFrvDl0/N5nqyB6NF30tkzTcLQxX63KydGc+t3GMUvSUYsLE7wNhaQDhCVQj9fui5 wTcW0v0XqSHocM4TlRYZb3tuxJqanjSQjVIKM4P7NPXlCV2t1n11JP5Ug8zfWp0zhSWN 0D7w== X-Gm-Message-State: AOAM532OwRyVcSQDVREMjqBOglLMC9M4hPgTI6JguNSREwulwNCTBAmh luYqmlm2vQP9EvhhYRYVTmc9dw== X-Received: by 2002:a05:6638:140e:: with SMTP id k14mr15429481jad.31.1617991652431; Fri, 09 Apr 2021 11:07:32 -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 g12sm1412786ile.71.2021.04.09.11.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 11:07:32 -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 7/7] net: ipa: three small fixes Date: Fri, 9 Apr 2021 13:07:22 -0500 Message-Id: <20210409180722.1176868-8-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210409180722.1176868-1-elder@linaro.org> References: <20210409180722.1176868-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some time ago changes were made to stop referring to clearing the hardware pipeline as a "tag process." Fix a comment to use the newer terminology. Get rid of a pointless double-negation of the Boolean toward_ipa flag in ipa_endpoint_config(). make ipa_endpoint_exit_one() private; it's only referenced inside "ipa_endpoint.c". Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 6 +++--- drivers/net/ipa/ipa_endpoint.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index dd24179383c1c..72751843b2e48 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -397,7 +397,7 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa) /* We need one command per modem TX endpoint. We can get an upper * bound on that by assuming all initialized endpoints are modem->IPA. * That won't happen, and we could be more precise, but this is fine - * for now. We need to end the transaction with a "tag process." + * for now. End the transaction with commands to clear the pipeline. */ count = hweight32(initialized) + ipa_cmd_pipeline_clear_count(); trans = ipa_cmd_trans_alloc(ipa, count); @@ -1755,7 +1755,7 @@ int ipa_endpoint_config(struct ipa *ipa) /* Make sure it's pointing in the right direction */ endpoint = &ipa->endpoint[endpoint_id]; - if ((endpoint_id < rx_base) != !!endpoint->toward_ipa) { + if ((endpoint_id < rx_base) != endpoint->toward_ipa) { dev_err(dev, "endpoint id %u wrong direction\n", endpoint_id); ret = -EINVAL; @@ -1791,7 +1791,7 @@ static void ipa_endpoint_init_one(struct ipa *ipa, enum ipa_endpoint_name name, ipa->initialized |= BIT(endpoint->endpoint_id); } -void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint) +static void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint) { endpoint->ipa->initialized &= ~BIT(endpoint->endpoint_id); diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index f034a9e6ef215..0a859d10312dc 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -87,8 +87,6 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa); int ipa_endpoint_skb_tx(struct ipa_endpoint *endpoint, struct sk_buff *skb); -void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint); - int ipa_endpoint_enable_one(struct ipa_endpoint *endpoint); void ipa_endpoint_disable_one(struct ipa_endpoint *endpoint);