Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp240777pxf; Wed, 10 Mar 2021 05:27:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEogCjT+2mecwhZfjxH9dVimGRDnVOX/dltA2fK+6Bq2I/BDaVb7xMowAn54dhxGTQffDR X-Received: by 2002:a05:6402:1342:: with SMTP id y2mr3251004edw.285.1615382824726; Wed, 10 Mar 2021 05:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615382824; cv=none; d=google.com; s=arc-20160816; b=dQEKxT5+SedXYhLR88Z3XNAYsBKhlBrTOfUHCT3178T97ihgEqnNr4qNWZXt1tfJ03 CO7p0blW/9B91Ftf/LJQGwY1lBKyhWkjPf49Qo2zfYmd+l/2o63LkoO23lLwsshyBi1W ikumhBftoF4Z5bDXmqL5uwsTep+rs+UqLAR/51DWl6uf0rzN+Qfw+RkwGB2xIkOYabP2 3YAoeYjsnSct8sVryfYOMleKT/3PYWc8qBMP8S9aaWJv4GYDTFuJIhejGKv3qGB60TEY 6hxFLbAVD81Jmxsnmargju/eYuk9XWyT0WEOvNwA6C9h+BuFVOqAVsRxq1g0zUpwJAbA HPHQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e3Y0IjNEbRfk6XZMVElN1bt77k9NWZ9scWz0bXExiqg=; b=NNnw+gwRKeHnp3ZWc7ddp1SNanUJ1sjMkhel1ieTZxHlcGpnBc11/nSL9nKVIot4Nq cC6jHBmMWsnpMKgHqy+EFaY9zo5piCNYAX6PNYiGeHBjd4BmSw8qLUoTQ9AaztHOwdq7 PT1yEaoFs1VnHIiu6gAGXc0ix2SvhGd6Is51EJLXXfRK/TCP97hH1xbDtZCuAhyhIQAG mKCKkLjW0yqJnhMa1nBG1g+FN+putCdrRddiycfWxGDpROONBE7x0qpl7SlFOKaaA0Ie C3cv+dwjIBi7MEhS+atYc3oW6++vtl0N4q3ryycbwQY2SEpEJrM5zQvSYvRItTaYe1R+ 886A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ze2dN8wH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si11044501edb.134.2021.03.10.05.26.41; Wed, 10 Mar 2021 05:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=Ze2dN8wH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233374AbhCJNZ3 (ORCPT + 99 others); Wed, 10 Mar 2021 08:25:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:45680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232832AbhCJNYc (ORCPT ); Wed, 10 Mar 2021 08:24:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0369D64FEF; Wed, 10 Mar 2021 13:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382672; bh=SrpHNz+9s1NbwOcx1sv9lILKLb86ARnZkK3UFGGccyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ze2dN8wHr5y9WeVrxl3TCrcEhxoGB4uBTzTFS0G0jGvTs10tD2b9xohnhJ/Se1gfS pekZRWQuLeIasvUy2DNxeePc+X0UMKh9RoCMXFyQTGHv98fafnFyAxXrpyQOqpJxJ4 RSqdwgRbvdvlpQTcce9xR/Ln/H2Znl+wbq3S9nWg= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 14/49] net: ipa: ignore CHANNEL_NOT_RUNNING errors Date: Wed, 10 Mar 2021 14:23:25 +0100 Message-Id: <20210310132322.413240905@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132321.948258062@linuxfoundation.org> References: <20210310132321.948258062@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Alex Elder [ Upstream commit f849afcc8c3b27d7b50827e95b60557f24184df0 ] IPA v4.2 has a hardware quirk that requires the AP to allocate GSI channels for the modem to use. It is recommended that these modem channels get stopped (with a HALT generic command) by the AP when its IPA driver gets removed. The AP has no way of knowing the current state of a modem channel. So when the IPA driver issues a HALT command it's possible the channel is not running, and in that case we get an error indication. This error simply means we didn't need to stop the channel, so we can ignore it. This patch adds an explanation for this situation, and arranges for this condition to *not* report an error message. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ipa/gsi.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 2a65efd3e8da..48ee43b89fec 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1052,10 +1052,32 @@ static void gsi_isr_gp_int1(struct gsi *gsi) u32 result; u32 val; + /* This interrupt is used to handle completions of the two GENERIC + * GSI commands. We use these to allocate and halt channels on + * the modem's behalf due to a hardware quirk on IPA v4.2. Once + * allocated, the modem "owns" these channels, and as a result we + * have no way of knowing the channel's state at any given time. + * + * It is recommended that we halt the modem channels we allocated + * when shutting down, but it's possible the channel isn't running + * at the time we issue the HALT command. We'll get an error in + * that case, but it's harmless (the channel is already halted). + * + * For this reason, we silently ignore a CHANNEL_NOT_RUNNING error + * if we receive it. + */ val = ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET); result = u32_get_bits(val, GENERIC_EE_RESULT_FMASK); - if (result != GENERIC_EE_SUCCESS_FVAL) + + switch (result) { + case GENERIC_EE_SUCCESS_FVAL: + case GENERIC_EE_CHANNEL_NOT_RUNNING_FVAL: + break; + + default: dev_err(gsi->dev, "global INT1 generic result %u\n", result); + break; + } complete(&gsi->completion); } -- 2.30.1