Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp934150pxb; Wed, 3 Mar 2021 21:37:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXKXmJ88oPkpUM+d8UtvbufCEyWbFBNKC0INMFKRKoM0XLBWPQJo3Tk3OQRZOw9cZem5mm X-Received: by 2002:a17:907:94d4:: with SMTP id dn20mr2357876ejc.397.1614836264380; Wed, 03 Mar 2021 21:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614836264; cv=none; d=google.com; s=arc-20160816; b=T3RUHtkriR+yi7fBApzzO1LaqFcurCYABdVJOOLKSHWiYbVP2mPpVHZeTgoyqj6g0G Nea6End3KTuC7dfER3YuItOGLwbF8Q2TE3ib/ajc6aevaQbwEzeoBrozmzobeaZ4Ms1z h3cuFRuYH3x0Ilfc+X3qQRf+kJ0sJ97YCmXJjmIYXcGQdkG3jLGAc1ifBEVJiD+XO2Cd k4lQ80t0Z8TzJXVPzV8gHz/HlC6muEjl48hsy+VCD+STETlN9Nhu4B9rmW34wY/HD7s9 9RS1n9+eoCq+FOXicH9QzhFz7y9ApJMkQ29nMP2HyydgCmyPRh9xuOsqulK+mE1UDQpM vxCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=YuUOZilAPqtQ1SZQR/vTqn0A0mCysPgz4pmCeU7TVwA=; b=j+ySux/akEPEF5AKotXhrR2XwcFpAIuyvmj0+HGx6ubrybixUah7IQnxLZAPKBhyKE WMHARRIy0iTrqw8dh86bUlVIlmCz+GSCweGJgFWSz3nTtqpEJTwRfDwlf8Jq3/2hTGXW 00BSYmJbXDfQ/FFYHqhEjATLKKJFRvRkNi6RqY7HOcQVa2T2VbUT+NFNVQ7rVL/XwOhg m2e9CPptxdmq7mq/9sRlcINP0dDcfEK4eeqAMrJWG0zjLITmSQYPJF047juHbAgvWVAT 6J9hBJTugfUL+DNFVjJHMqO7jiSTMmEQOqps26tzx6mnuiAtX81w50c3KbBy/zH9EST0 qj8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=CSXUqM6r; 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=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a2si18982666eda.350.2021.03.03.21.37.22; Wed, 03 Mar 2021 21:37:44 -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=@ieee.org header.s=google header.b=CSXUqM6r; 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=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576552AbhCBEav (ORCPT + 99 others); Mon, 1 Mar 2021 23:30:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241548AbhCBCJS (ORCPT ); Mon, 1 Mar 2021 21:09:18 -0500 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A380C06121F for ; Mon, 1 Mar 2021 18:05:09 -0800 (PST) Received: by mail-io1-xd30.google.com with SMTP id g27so18713068iox.2 for ; Mon, 01 Mar 2021 18:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YuUOZilAPqtQ1SZQR/vTqn0A0mCysPgz4pmCeU7TVwA=; b=CSXUqM6rGhHKiQX2k8GL6zA4oMI4IxoVfDmGlYXBm2crqJfK0V5wqHl/US8WkpZ0Ak F++JeQlUo36xDmY1/EAjeu6lPL9vMzW2hsEAb23KK7C/VpVEsyVCQY3SPE6xXISgEtT7 Px/dEzdrPFrlgENwv+uq4DE/Soj11T57VRLnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YuUOZilAPqtQ1SZQR/vTqn0A0mCysPgz4pmCeU7TVwA=; b=O56KBTWsFx7Jk35MXj0CuraXsQyFSb3bU+GRS0+xvV5ta3nnx/NStTJIX9T7yL6mHu 81naxflcUrxNdZy4RtDhTy+34cgCcJ67hpSvbWTRf5gcUEl3rXCK4+edR2PFg8lhrOSF 8MbxJIFxfa0OW1sulLCj12gKO5OFle347thEF9JVG4Namto/ZSPXERJO92aZmyMesufN iw9gUMy4VTJExHTkdrRuWMcyRtHv52sGRbtbEmt/jPzRAzSjy4HRiMeqvaJOFJDlJuw+ /4/qpC0vuqI+1OjyU/Jsfino96ZFkp79hli7FBBuoIpL2Gez5nRnmKgf13w1NSUi8jGp okBw== X-Gm-Message-State: AOAM532g3fisaGVnpfCVVdnZjMRi7EFOSI9Yh9pgIb5drFSEA7m2W1T4 x/+oA+WbzaFUvObl147rO0VdTQvLDmNtR7uD X-Received: by 2002:a5e:cb4b:: with SMTP id h11mr16540014iok.108.1614650708781; Mon, 01 Mar 2021 18:05:08 -0800 (PST) Received: from [172.22.22.26] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id h13sm10921008ioe.40.2021.03.01.18.05.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 18:05:08 -0800 (PST) Subject: Re: [PATCH v1 2/7] net: ipa: endpoint: Don't read unexistant register on IPAv3.1 To: AngeloGioacchino Del Regno , 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 References: <20210211175015.200772-1-angelogioacchino.delregno@somainline.org> <20210211175015.200772-3-angelogioacchino.delregno@somainline.org> From: Alex Elder Message-ID: <73d19c5a-fddb-05d8-4787-de613091cbeb@ieee.org> Date: Mon, 1 Mar 2021 20:05:07 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210211175015.200772-3-angelogioacchino.delregno@somainline.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/21 11:50 AM, AngeloGioacchino Del Regno wrote: > 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. This works, and is simple. I think I would rather populate the available mask here with a mask containing the actual version-specific available endpoints. On the other hand, looking at the downstream code, it looks like almost any of these endpoints could be used. So, while I don't know for sure the all-1's value here is *correct*, it's more of a validation check anyway, so it's probably fine -Alex > 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. > */ >