From patchwork Mon Jul 20 15:34:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 237466 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2111729ilg; Mon, 20 Jul 2020 09:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfmebbi83ncp+twstAMFZ+oyuVCqOIwUmCAzJBMG6UZFAh8g42G13tpwfwirS2vS60HaUj X-Received: by 2002:a17:906:fac3:: with SMTP id lu3mr22455654ejb.374.1595261185890; Mon, 20 Jul 2020 09:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595261185; cv=none; d=google.com; s=arc-20160816; b=WzU1iphXjpuqsv560uJIUF6o7KT6xdRS6vKY4am+6yoKMjdx+HHdN8bJnhm9K2VTuk 8BZND5At7tk8b1n+HNZqTm4owE0EYdthc2RpJffyJ4n1ylL7d7JBGV6WkF7etWWYjZBp XvxFlgLeDsQp/tZMnjPd+S6a95SrRuWH1gZsWyYNgRMb0uHYcmxAPD/fdr7akbyDtwbO QUb12fh/QIplsfeQVu6MA70zKvUvNYRPzLggJ96UeqgytXqxt4t1UojjclWzdrzbMUcl DqlqvFt0AyNYj00JIYHZNw9f+NfRQK0FC3TGPnxHSERPvO4TzX2UzVqCKNNqzumiYEiL Q4zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ClavPhECUQJ4aq1tfcq1/Mro+pYRJsj1In3HbxRudME=; b=cwke0GG3NBwMJvh47V5D22ot/L0EwVVMk7SbR22W4QU7D8/C4QIJHDmXszdhg7e2sK GpSQswF65N3LWw9L29+msrAa14dAYGeIENqWmuv9Ud4VNAmtuD6QauSBtjed6xNK7V+J eb8ZHwer5NdxpNTso8YN8Q1YNpTbL8VDZCYIOsgL/x7dgKsNp7AwIr1zTjrz+JTg7gKb bTZKi/laSEbbmVElKxFoAx00mjhL8BwTvxXxFIk7nQSt47nj9sHGk/gXA5X/NYAN4IFv V25HL8LQ+l/J+SzS0GPo7rkuPp/eOr2B57PGXtmJSwWwHO/v6BAFFcwU9GQPEX2+xgqX DsXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BfAxDhSV; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si11067674edv.246.2020.07.20.09.06.25; Mon, 20 Jul 2020 09:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@kernel.org header.s=default header.b=BfAxDhSV; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732546AbgGTQGY (ORCPT + 15 others); Mon, 20 Jul 2020 12:06:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:42610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732326AbgGTQGW (ORCPT ); Mon, 20 Jul 2020 12:06:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71A9122CB1; Mon, 20 Jul 2020 16:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595261182; bh=UGRiLNW0JDahO8Xf3/NU6SppfpdGiTJJ7PsnPOcTj68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BfAxDhSVLPy/ralBBlMv+ydoZz2uSe6ePDMjxG7dveCBG1ZKcKF40HqTaGPSEE5G1 OhTFW+R4kkhM3ArjWZ0G/6JvybIxxPd2xcbZa1eKN+rYZ8FiHI4E9ZzGZ+Rbi/UFYR 9bfH6Qnj2CRZ80e1rOBJyMkSxQT/QV7gHrxsDB7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , "David S. Miller" Subject: [PATCH 5.7 023/244] net: ipa: always check for stopped channel Date: Mon, 20 Jul 2020 17:34:54 +0200 Message-Id: <20200720152826.970928166@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720152825.863040590@linuxfoundation.org> References: <20200720152825.863040590@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alex Elder [ Upstream commit 5468cbcddf47f674829c6ada190283108a63d7b5 ] In gsi_channel_stop(), there's a check to see if the channel might have entered STOPPED state since a previous call, which might have timed out before stopping completed. That check actually belongs in gsi_channel_stop_command(), which is called repeatedly by gsi_channel_stop() for RX channels. Fixes: 650d1603825d ("soc: qcom: ipa: the generic software interface") Signed-off-by: Alex Elder Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ipa/gsi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -490,6 +490,12 @@ static int gsi_channel_stop_command(stru enum gsi_channel_state state = channel->state; int ret; + /* Channel could have entered STOPPED state since last call + * if it timed out. If so, we're done. + */ + if (state == GSI_CHANNEL_STATE_STOPPED) + return 0; + if (state != GSI_CHANNEL_STATE_STARTED && state != GSI_CHANNEL_STATE_STOP_IN_PROC) return -EINVAL; @@ -773,13 +779,6 @@ int gsi_channel_stop(struct gsi *gsi, u3 gsi_channel_freeze(channel); - /* Channel could have entered STOPPED state since last call if the - * STOP command timed out. We won't stop a channel if stopping it - * was successful previously (so we still want the freeze above). - */ - if (channel->state == GSI_CHANNEL_STATE_STOPPED) - return 0; - /* RX channels might require a little time to enter STOPPED state */ retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;