From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 107F6C433E0 for ; Wed, 13 Jan 2021 17:17:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0B3F2343B for ; Wed, 13 Jan 2021 17:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728206AbhAMRRO (ORCPT ); Wed, 13 Jan 2021 12:17:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728143AbhAMRRI (ORCPT ); Wed, 13 Jan 2021 12:17:08 -0500 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 348E5C0617B1 for ; Wed, 13 Jan 2021 09:15:44 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id r9so5614395ioo.7 for ; Wed, 13 Jan 2021 09:15:44 -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=cya1YllzUew1Cz7aOjwGwTo+phSDuV7y8gvGZ//U/9Q=; b=mU/mNVI1DbIGzLDbFVMDvJokTzluyxYOZ835J5gSBXl9SNgJli/wh4cNdHzIkBHYdH b3dr+Gphw383vAAc1jzu4Ry+RMtAVkVT96qLS9S9dJ9sDXyCQIRf9w4lh4QHDBNaWHSr fcy1W8pHyz+lOKDFGkUma55jl5L9zqZVgHcK1plyCaOhBxUbqRlvGx0Cl0mA6llTaHLI ZNFS6agCjJpko710CEz1QhKyonVyzVprbrcxDwicKFQ+UktUiiRNW1DvpOE3MoaNIYeD qlp9v7mDHhdjEvbUmoiYh37CDW0s7hBG3tK5Ja1f4b3fe7LKBigxGSt7L2XGMnJKZsWC fgag== 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=cya1YllzUew1Cz7aOjwGwTo+phSDuV7y8gvGZ//U/9Q=; b=YnD7UmgHAuJwUynVXvt48Ag1OXoM63hn09L6aTShpH8KEISmfOQLKBNNjsNmaMZ1aq uq/TDFqiUf0y/9/iH+rpwSNLMrL9H5KqHVjWEZTK8FUg9Cm75QNK9NqRIgxYMhSXwy5x tcZ1dGOEL3yegDr229Oll3ImMmqFKXtgR2Cy1t1P53Aohh5mY1jq/M4ci78ydjRNuniN BvOH7t2M2E6//PhVCTWVUl+/ttNFFhKq1f6bXSPEri0EiuOq4VqGJ+5/WcEsDeDfmgZJ IdhD8l3f8U2XPAG3gyAfUD6TkixfecGb3uy3SrSeeYvKw8ShsDWnjSYjZjza5EN44OSk BzJg== X-Gm-Message-State: AOAM531g5o5UaM6ejC362XVkDQMJo6Yja4K5681uU+NxUsVmfjD61j0A eB37QhdRTvcif5m034iHNmshsg== X-Google-Smtp-Source: ABdhPJwMS0K6oCxdHlBm9fgUOW23pCifG3ouH/c8/rfeYPNFtkVcq24RoUabju6o4jccQq/x07ZxvQ== X-Received: by 2002:a02:cf9a:: with SMTP id w26mr3268797jar.25.1610558143520; Wed, 13 Jan 2021 09:15:43 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id h9sm1120579ili.43.2021.01.13.09.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 09:15:42 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 6/6] net: ipa: retry TX channel stop commands Date: Wed, 13 Jan 2021 11:15:32 -0600 Message-Id: <20210113171532.19248-7-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210113171532.19248-1-elder@linaro.org> References: <20210113171532.19248-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For RX channels we issue a stop command more than once if necessary to allow it to stop. It turns out that TX channels could also require retries. Retry channel stop commands if necessary regardless of the channel direction. Rename the symbol defining the retry count so it's not RX-specific. Fixes: 650d1603825d8 ("soc: qcom: ipa: the generic software interface") Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 5c163f9c0ea7b..5b29f7d9d6ac1 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -91,7 +91,7 @@ #define GSI_CMD_TIMEOUT 50 /* milliseconds */ -#define GSI_CHANNEL_STOP_RX_RETRIES 10 +#define GSI_CHANNEL_STOP_RETRIES 10 #define GSI_CHANNEL_MODEM_HALT_RETRIES 10 #define GSI_MHI_EVENT_ID_START 10 /* 1st reserved event id */ @@ -889,14 +889,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id) int gsi_channel_stop(struct gsi *gsi, u32 channel_id) { struct gsi_channel *channel = &gsi->channel[channel_id]; - u32 retries; + u32 retries = GSI_CHANNEL_STOP_RETRIES; int ret; gsi_channel_freeze(channel); - /* RX channels might require a little time to enter STOPPED state */ - retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES; - mutex_lock(&gsi->mutex); do { -- 2.20.1