Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1124952ioo; Fri, 27 May 2022 01:57:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvLjug/qFyxqQW/Jn/ajbsaog7qoLVUY08LrRIPE6/UO9q0Z0aeMjqpohKOcyTd+T/Ptzd X-Received: by 2002:a05:6402:51c9:b0:42b:63c2:6657 with SMTP id r9-20020a05640251c900b0042b63c26657mr26414924edd.255.1653641822555; Fri, 27 May 2022 01:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653641822; cv=none; d=google.com; s=arc-20160816; b=X8FF6qdJFigPJYNsDt+ys2DyBVZx8XF8Rzl9LcIbNPBKzq82xX4nnUOkP4vVBBWObp qfwKsvuDQh20Y5yJqYJJXfiPn3LhCXDj69tS2GbZIB+tvrXY6DXLCIfzQIa6Ek2Auew/ 8Q5jK+slFYcXPQXLA/EOhOGSokw8hmEwRxv/ZfGBejg4xHbIvp2LfVFcDX3vzMPGQVFX 7r93peBpIJEIcEsFbwR/IZxN9CfpyStRJI+150bI93xniXCkbimbQ+eHDt5w52oiH3/3 8+cNZ47u4YnO6dFWzhSazxynDhswoCMQpceWdyYV5NwPkqhfuVJlB0myNwnVtm/zGBct Or2Q== 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=3FuYWZH+FiljKJENkWoPtISQbamYnIl3gQFtl722jiA=; b=bbTeFEhy2XRveyWeqzpwvrUZBgEyIVZSUp52ZLtHKU9TqhHDI6wcTbm3TxsVlSnjmV yUJ6PSJ12R6ucNVgFIMxG+yX1OChkEzhm4DgQ0cwsdKX7ksKuhH7NNP0nWnx7OlNWVK8 RB2aGQm4chgMbo+WoUaU4lG0LltkEns3Q1jYLuxeG/ZQJErtkhKiuk97d0glcaUn5jzd BihwLjkqQfh3L7eZje6kMSOFoG2iJ+EwJ1d4JZwPC6fGOM3vf9kLJu/XWVVzHPbAmchJ LF7k668j/DafyMho3Xc0y5E30aqmG8GrXTRixJ1PoFooC9E4KXH02WBIOWX+TITfjBTk Xejw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JCJ0wcVF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb10-20020a0564020d0a00b0042aabf64903si2827994edb.80.2022.05.27.01.56.36; Fri, 27 May 2022 01:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JCJ0wcVF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345147AbiEZPX3 (ORCPT + 99 others); Thu, 26 May 2022 11:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244817AbiEZPXV (ORCPT ); Thu, 26 May 2022 11:23:21 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 009CFC038A for ; Thu, 26 May 2022 08:23:20 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id e3so1876314ios.6 for ; Thu, 26 May 2022 08:23:20 -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=3FuYWZH+FiljKJENkWoPtISQbamYnIl3gQFtl722jiA=; b=JCJ0wcVFz30z7mdJYRQ1SjWB5/cxg52tEnaNUcX7dIplxUVCw74CoRRZS/xOVFVUM7 s/pzcO+MNm62J5nT943NsEYQvJ2z0BFhGyoa2dY7cHIRIQBh9R7iQEDQ5imoZ6BoWAOn 4dKll3g71P1z/ZtXyzCupQsqBu0IVVoTpUcHnjwl0SRFloc+vFfi6Q1GQxK83xLHe8Oa 4eQCfBWb6k5lhYRT5CJ6jB8kRlwa0gRRzHyEOd6rxQkqwERcfaiGesZm9OBFBmtT3g4G z9kSZydtVvp0j7tHFaXPU+w5tR9xTiZxL15tp0/tfHC9D0TK2JG+5f6h9QbNvaTRu6in lFRA== 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=3FuYWZH+FiljKJENkWoPtISQbamYnIl3gQFtl722jiA=; b=a8ComKm/RRYmCr5bVSR6g87vPOrw+CbpCcuz2kYzuFWe4qBZ8msaYzZ/i8EoLHKy3s rPZakc/5+1DxPtWzjQIYwRZpOY5hPVCnopFj/oNDb7ImAeVJ8mk7PVkDArxq1gzFI8vb YzR0t6jcjFshUtOBhjfMEF/AIeR7acndzFSZHyqGl6AaGyZK1hb+v9w60If1dUcLt97q IjSizfnVZl+u/WtShhn02nCRVzN6df/DvCzuojuv35kzMD8lwXFZKVpGApyzBm50F2Re neQPFxBPRCDpL1MPjN0wQktHPP0GZwtwKF4c+Dgk3rBk0Gf+I2h4u1S176aefFVqINai 9bmw== X-Gm-Message-State: AOAM531xnrq9WKTUsLG0qWFAIrcgfgAxskO34jXmB0FMNj0y7VO/rDIu W6v4o1jwBkxtxrUh9JTLu44L6Q== X-Received: by 2002:a05:6638:3490:b0:32e:ec1f:b923 with SMTP id t16-20020a056638349000b0032eec1fb923mr6394074jal.20.1653578600375; Thu, 26 May 2022 08:23:20 -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 b59-20020a0295c1000000b0032b3a78176fsm466847jai.51.2022.05.26.08.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 08:23:20 -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 v2 1/2] net: ipa: fix page free in ipa_endpoint_trans_release() Date: Thu, 26 May 2022 10:23:13 -0500 Message-Id: <20220526152314.1405629-2-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220526152314.1405629-1-elder@linaro.org> References: <20220526152314.1405629-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the (possibly compound) page used for receive buffers are freed using __free_pages(). But according to this comment above the definition of that function, that's wrong: If you want to use the page's reference count to decide when to free the allocation, you should allocate a compound page, and use put_page() instead of __free_pages(). Convert the call to __free_pages() in ipa_endpoint_trans_release() to use put_page() instead. Fixes: ed23f02680caa ("net: ipa: define per-endpoint receive buffer size") Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 385aa63ab4bbc..e92aa9447f6e7 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1418,11 +1418,8 @@ void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint, } else { struct page *page = trans->data; - if (page) { - u32 buffer_size = endpoint->config.rx.buffer_size; - - __free_pages(page, get_order(buffer_size)); - } + if (page) + put_page(page); } } -- 2.32.0