Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2716490pxb; Thu, 3 Feb 2022 12:37:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4XrJbHmKl3QpfocWyRy1mWBFtIrml6N4RTfChXprGIF5JRckKO4MYVIeXz1Bg4G76nv94 X-Received: by 2002:a05:6a00:1892:: with SMTP id x18mr35407892pfh.20.1643920627174; Thu, 03 Feb 2022 12:37:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920627; cv=none; d=google.com; s=arc-20160816; b=kmTjVy4H26EKsHmpNXjgYRblO1Xuf1yAPGIu2n8tEoZQDUH4A5aOToWd+xLB5xmKLh g0e/2dVq/IKL8SMadYd0qXFvwu9dhf5hPg/8BA3uCnhxSlwbeIXamDCV9dUXM6NGmSJf +UIyCARUXbD7C2Ef01jseQk+2IIEhTYHvSonWd6ayKi0L4JOxSPnEUqsDg+4xaXLYcxC 1O5Y+ljXkaZYwL+JXevCSmku2uN/pg14NvM1nNybhXXbxjxifMSnU+sZx5uAVMY8m8ae L/Br4/z6bWLjMHrduoRzQ1FbpFWIW/in6I87f3q/LjC6+srZmctFWVC7sj35/piy5Qa6 wcrg== 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=lgsdnCvj6CM3pv7GIi7Q7qxhb/rwEQOt/gAxMz7ESwo=; b=z44ZVGhp3+ScqFqUe2kCgJvGhY9G5OhUW6+q0eEMwXRNk4yNRtYOBGBd88/a+p63hP ehZi8CNzytc9ZmWWVxawCnyNnmZIbPRBwzPOsfrXyywNuBc8lqBgUifG6+TTWIdGjKxq QJcifudq5+eLu9xeCdjn4EIt5as69uS8m9mIwGwZXaLs/9BPsV8fxkODZigX0hYNY82A Jd1pMNq1FIyQrSkHfqqMA5EPF77+3ph/VMKziA59c01y+ZoA+biXB+hocS/f12mzrzB1 PxOzZth9r+ZYyBcPD3d3OEo3Gokr7IBhnXbfVcGaEnYdvvQ/1Dcm3CqoxtDzTCJK+CdU 2DVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CV9xhfZ4; 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 b12si7999682pfv.68.2022.02.03.12.36.56; Thu, 03 Feb 2022 12:37:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CV9xhfZ4; 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 S1352580AbiBCRKD (ORCPT + 99 others); Thu, 3 Feb 2022 12:10:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352553AbiBCRJp (ORCPT ); Thu, 3 Feb 2022 12:09:45 -0500 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 81134C061757 for ; Thu, 3 Feb 2022 09:09:41 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id m2so2625135ilg.11 for ; Thu, 03 Feb 2022 09:09:41 -0800 (PST) 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=lgsdnCvj6CM3pv7GIi7Q7qxhb/rwEQOt/gAxMz7ESwo=; b=CV9xhfZ4p0xRwN3tI5jIW7vkfasMn89uQPYfbgfEIRzmhSKWGFDIibcLrUd/XAE3LZ 9lFBSDFl0HyFQ+r4NXc0NEMLC5cCgKDBQGtn3cM5IOwKhQuc2JSmeKxGagNlE4aB3u2T PrhktKmmbfJVOJAVYd2p8dyo9PwwgWdtRq5T7KFMFaFotAiOlBySMnyG7pMF0Nku1WtA 4aKtoEYGT3s49glN2KXpPDtnWNe5E0+B0h/lripFYoNBWssVkWBZjwfYUmTdDvquEsKe PDqu8waRlxXthYp99P9TfH+I350rX0bJujYbjqOjnysdEcf6CaKeKAzBqMvD34eohO94 RGWA== 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=lgsdnCvj6CM3pv7GIi7Q7qxhb/rwEQOt/gAxMz7ESwo=; b=HOX3X5Aaingih6ZSyCtVeUT6hBROWWJvH1tHAkHHk7cjUIIgX13cRY8NGfvm5osOXr hJrM8cSnDqiY2yc0Mj83XLMIFrbNlmc20+Wt7uOoi7R5WN/NpKE4+mbAzhCymsJ0Gcrh zdRyF7W4d93sNMojOosCMnrr40uq+86TusRzs0/753k2oJ7ZLJkhPN4Gr+jVppYS63hh JgUPcBmAsBE4kc0hCxuHFJ1pKd39ntXnN5Y1pXj2AWPjzebFIoP3/V/NBMqQbKO4/Rar V2e/vcTfYsAEwP6sPEe7V3Bbrj4qu9B14yaI0pOUkHRp3XAyge4H8j2/bCByuUZ6bCze UpOA== X-Gm-Message-State: AOAM530CH6mx+lVSp5BKvhANOQiNqSaQqyojbG6Q/ncYgy3mErvaWnuV J7JpF2Jetk0PgHxs80ysv8gI+w== X-Received: by 2002:a05:6e02:1946:: with SMTP id x6mr5642505ilu.236.1643908180968; Thu, 03 Feb 2022 09:09:40 -0800 (PST) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id m12sm21869671iow.54.2022.02.03.09.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 09:09:40 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, mka@chromium.org, evgreen@chromium.org, cpratapa@codeaurora.org, avuyyuru@codeaurora.org, jponduru@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 06/10] net: ipa: don't use replenish_backlog Date: Thu, 3 Feb 2022 11:09:23 -0600 Message-Id: <20220203170927.770572-7-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220203170927.770572-1-elder@linaro.org> References: <20220203170927.770572-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rather than determining when to stop replenishing using the replenish backlog, just stop when we have exhausted all available transactions. 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 f5367b902c27c..fba8728ce12e3 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1087,11 +1087,8 @@ static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint) if (test_and_set_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags)) return; - while (atomic_dec_not_zero(&endpoint->replenish_backlog)) { - trans = ipa_endpoint_trans_alloc(endpoint, 1); - if (!trans) - break; - + while ((trans = ipa_endpoint_trans_alloc(endpoint, 1))) { + WARN_ON(!atomic_dec_not_zero(&endpoint->replenish_backlog)); if (ipa_endpoint_replenish_one(endpoint, trans)) goto try_again_later; -- 2.32.0