Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4007157pxj; Mon, 21 Jun 2021 11:17:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcHAzlNrlQj9LN56MOIiGsXaqwXJok8CmmmD67nwUCDF6dXa72lvSmO1c9Nt1fqE/lmsgk X-Received: by 2002:a92:7a11:: with SMTP id v17mr8874073ilc.103.1624299459018; Mon, 21 Jun 2021 11:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624299459; cv=none; d=google.com; s=arc-20160816; b=UrEBcMXdn+sn0L6Xd0Cjg1uhdpfva++7XvVvG1WX93eexIXckX3e8cmlT8crh6J+9V bK3LmnLEV1aE4pyP24KR4brXnFvvn+zOHH5WBkBA1396I+Tx5wo+qsiNLAfC8A1Ou1rJ +BcX2E5xasPsnCdHwELYaESk+TBGgWuIxidtOxVT1NY1k9ORPcs41axjNOM0qq3dAYVE Y74hBngiyUo/rjNAGmo36UtFyZtoFcPMxMdixA+obCXCwrnKoCVq088l5fi743HxVd+h q4gMO6UC5UG+VZTN5Vi7KSYbDWirnn6kwNKVNatMO+nBQB9u5b+PPLc6XqlG4MCKIzlh D4QQ== 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 :dkim-signature; bh=PTTHSOVXexKSxKQpfvVOtl3Ci56/avUWgDl+NfjQ6/4=; b=QMTgjMJLAIOeXtTBwaG7Zj2Vr9xyH4aogURW8ESdqqo0WzRq/D+Ovrw+j6pLw9CqP4 XlxGlMon5CEgk1mzHgMiaEXansxY3ycy8dGdGodiG1YKJvyxG4Hn5yJioz/5pl1lL3No dz6JjrmcY9qeL1+hftl6mQdcsZQCFR9si4WNQkCLn1RWsvR3kh6cU/VsyBeyNwdu8d3V d2MfGU5ll46aGoExLpvXbzmtTBAwG46NQQkrnVmoI7fL0TMzzoSILRjRlL5GPvnxMDbR CvCv6SWY7p+lOYhwBw8hQJzWklwiAgj8LcXSgCnVNVHCfAwA/bw2sCyfiR/HirGqA0Lr aYJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AnONkDWe; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si8257680ilj.152.2021.06.21.11.17.27; Mon, 21 Jun 2021 11:17:39 -0700 (PDT) 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=@linaro.org header.s=google header.b=AnONkDWe; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232215AbhFUSRy (ORCPT + 99 others); Mon, 21 Jun 2021 14:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbhFUSRB (ORCPT ); Mon, 21 Jun 2021 14:17:01 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA89C08ED86 for ; Mon, 21 Jun 2021 10:56:35 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id v3so11085241ioq.9 for ; Mon, 21 Jun 2021 10:56:35 -0700 (PDT) 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=PTTHSOVXexKSxKQpfvVOtl3Ci56/avUWgDl+NfjQ6/4=; b=AnONkDWeZBMGQEzfvUxpc1lVInHZ3+vSW5gveECtFKuFlcdfqt0jbk9SQeaJoz9v0o 0cuIGhSLtNOHYRhBVf3mCzcbC1xHUnp7LYVeBfqYRkrbH4QJBGqs6E1DlNDOOGzM/j8H 2Ijo4eMZaD3UAc8+xvtXhOgtFOOTU54txVbZIcLCK/nTcU5fpCd25Mo8RIpMWha8PRFj gfWBHS+g+th+kLQB2aydqEJuL8oy72JueINRpEZmb2it9S1AynWDDc+2XgRALtzuvpk3 H0Z0TU9OqHIMVcvm/b/TlBbbSsbx42+mrLqgEy7JFsIXvZ4KJ0Kte7zt9ENn3VIK3pwO jkyg== 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=PTTHSOVXexKSxKQpfvVOtl3Ci56/avUWgDl+NfjQ6/4=; b=RqgDoQaUJHzHMyd+udR1gisJEWIEnkEKle6GtH6mUMIY7esCAZuv86kcacnYne5kJE AcgTGyyUV+17U7cxQ/3I5805gmOJHl6KPFf+82CCblSGlR47T40wTZsD5FAHXGtTnpQF uSMCg57Y2ft1uPpl3AcII1599GmbP7+ErENDHqZ2ohul3WjHrrB2W0B2dBsCUAJnZ1V6 LL8n/dlYrXmS4BDaO/f2SUeBUYu1SVHyhMS2Q0DegOLSUu9r2qEaSLGZq4XRhc4xjhq6 XBQgRtJw/fMtBKmBKLNJ8cjJIUshjgDC0yhlAcUVxjd83s9PqFEOSN9wF1i/byOsGd0b yoXQ== X-Gm-Message-State: AOAM532Fnwfqy6HIf4VgUL04bI4Aq3i0Mo+IxmqgA570IDLOra+tXRE+ fcdwDGmiMtiGNM42IxhYhtnspA== X-Received: by 2002:a6b:6813:: with SMTP id d19mr7034410ioc.35.1624298195034; Mon, 21 Jun 2021 10:56:35 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id m13sm6259264iob.35.2021.06.21.10.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 10:56:34 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: robh+dt@kernel.org, angelogioacchino.delregno@somainline.org, jamipkettunen@gmail.com, bjorn.andersson@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/6] net: ipa: FLAVOR_0 register doesn't exist until IPA v3.5 Date: Mon, 21 Jun 2021 12:56:25 -0500 Message-Id: <20210621175627.238474-5-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210621175627.238474-1-elder@linaro.org> References: <20210621175627.238474-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The FLAVOR_0 version first appears in IPA v3.5, so avoid attempting to read it for versions prior to that. This register contains a concise definition of the number and direction of endpoints supported by the hardware, and without it we can't verify endpoint configuration in ipa_endpoint_config(). In this case, just indicate that any endpoint number is available for use. Originally proposed by AngeloGioacchino Del Regno. Link: https://lore.kernel.org/netdev/20210211175015.200772-3-angelogioacchino.delregno@somainline.org Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 3520852936ed1..ab02669bae4e6 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1731,6 +1731,21 @@ int ipa_endpoint_config(struct ipa *ipa) u32 max; u32 val; + /* Prior to IPAv3.5, the FLAVOR_0 register was not supported. + * Furthermore, the endpoints were not grouped such that TX + * endpoint numbers started with 0 and RX endpoints had numbers + * higher than all TX endpoints, so we can't do the simple + * direction check used for newer hardware below. + * + * For hardware that doesn't support the FLAVOR_0 register, + * just set the available mask to support any endpoint, and + * assume the configuration is valid. + */ + if (ipa->version < IPA_VERSION_3_5) { + ipa->available = ~0; + return 0; + } + /* Find out about the endpoints supplied by the hardware, and ensure * the highest one doesn't exceed the number we support. */ -- 2.27.0