Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2358835pxb; Thu, 11 Feb 2021 10:17:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzU872DHWEIkNeR7KYTWYH7bCulPi6KpeRN5ZjE5gBHi4586OQK6WS2s0FjNYVI4hjBTT8i X-Received: by 2002:a17:906:3f96:: with SMTP id b22mr9560388ejj.478.1613067474855; Thu, 11 Feb 2021 10:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613067474; cv=none; d=google.com; s=arc-20160816; b=rSX6RnA2k0aP9kz6965GwN/sjWD6POx6LKnLEoTQ2kZqRTKoW9eHU/p+CY1hesn7Qz DdM6tjf9rRyRlXt0m4o/dVOp9c1XiwDNPDFof13NajjGz+ZPDbcpwHaYp0IooUKEGqzP 5uCjgrzdZBvt0d085gnu31O6n3Vdt5sruYDkWnZxzFuKel006eMIApnN0giiYBFOvu96 +dFKb2IC7d0pyHxVY6FjMTj2s6IB/vFPDG7IFl92Y175sRhHqMqg+hEo3L8F1mGAn0dZ qzLfo4fsgDH6DT2Okq9oSuDiP8bQjmvfT84shZQ8vrG3A6ViI/JvHa/J7JfQtptmMJk/ bOUA== 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; bh=yrpZ11XucxSaHTJTHcT2cGih3sTUi0nqUDqxXrgNeXo=; b=kk5XcfBHZuOZ+XJSUXBT0ryegByUZQUULovBDZ5+AaGqd8+oWFy44ZfkmaskCjdwhC p8vtUSAhv/azNyyfjDy6VkQQPoA2G3VFB1u/+anraU5kiCp7vjoLU1jrs0Ro8svVynkY 6Rv45FY6lOn9WTHNVuanE/ofRZeOeIAKDlsiXht55MkUwWJh9LvZdVZC2yPzDd8Dsirt rhgRgAS6detoFoDiLGl9bp7/2i5KBRNpIXJglMV8rK9uSHrGQPEbr/4V8zLva7SoVAQX dYCfMDxnSr/aqXE+dp5oTwIue6JCpCQkWlPooRywzauPZT3kHSwFnk4Nry442xOyf+V/ pXvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si4710862edi.139.2021.02.11.10.17.30; Thu, 11 Feb 2021 10:17:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbhBKSQj (ORCPT + 99 others); Thu, 11 Feb 2021 13:16:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbhBKRxL (ORCPT ); Thu, 11 Feb 2021 12:53:11 -0500 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [IPv6:2001:4b7a:2000:18::162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C732EC06121F for ; Thu, 11 Feb 2021 09:52:15 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (unknown [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id EFE811F881; Thu, 11 Feb 2021 18:50:17 +0100 (CET) From: AngeloGioacchino Del Regno To: elder@kernel.org Cc: bjorn.andersson@linaro.org, agross@kernel.org, davem@davemloft.net, kuba@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, konrad.dybcio@somainline.org, marijn.suijten@somainline.org, phone-devel@vger.kernel.org, AngeloGioacchino Del Regno Subject: [PATCH v1 2/7] net: ipa: endpoint: Don't read unexistant register on IPAv3.1 Date: Thu, 11 Feb 2021 18:50:10 +0100 Message-Id: <20210211175015.200772-3-angelogioacchino.delregno@somainline.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210211175015.200772-1-angelogioacchino.delregno@somainline.org> References: <20210211175015.200772-1-angelogioacchino.delregno@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On IPAv3.1 there is no such FLAVOR_0 register so it is impossible to read tx/rx channel masks and we have to rely on the correctness on the provided configuration. Signed-off-by: AngeloGioacchino Del Regno --- drivers/net/ipa/ipa_endpoint.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 06d8aa34276e..10c477e1bb90 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1659,6 +1659,15 @@ int ipa_endpoint_config(struct ipa *ipa) u32 max; u32 val; + /* Some IPA versions don't provide a FLAVOR register and we cannot + * check the rx/tx masks hence we have to rely on the correctness + * of the provided configuration. + */ + if (ipa->version == IPA_VERSION_3_1) { + ipa->available = U32_MAX; + return 0; + } + /* Find out about the endpoints supplied by the hardware, and ensure * the highest one doesn't exceed the number we support. */ -- 2.30.0