From patchwork Sat Mar 20 15:57:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 405449 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2267459jai; Sat, 20 Mar 2021 08:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjrDHMmOF8cEDbpTgT42IwEEGOiR56G7azQb/ytcCzZ5lxKK+wyEdbAuwwA8QotJrzOcBm X-Received: by 2002:aa7:da14:: with SMTP id r20mr15970233eds.181.1616255955331; Sat, 20 Mar 2021 08:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616255955; cv=none; d=google.com; s=arc-20160816; b=zLY9cibeY7Wv/ZM+ySwZE9a84eCUb3YNZ3vSkZRDQXFiQBy+I395arhm70ZyhMrX8d dBXrLxRPstKkNd6IxRQ6z0GyGJkQj2wv/1ESgnPM0c9VO1/V5e/8ywq1iDMANXQwyu06 RnnKufXYXHqyDJ8Ovu78o3BNO/jeAUpaxM7r5K5/vYI5J/n8+FJe8mze8t0If405x9vU beEmeT1+CuwzhqYuvthRXRijQXgbqPiRtr6raAw2Rcmbjw0Hh/g/t8b9DclU5SAIm5vv LA57JN4ASGghFJqCxc+lkx3lmG6mhjq8sNHsNWqH98cdbMyJ44cOaHzH3UiWAcxL5sa4 okDw== 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=JhdFcchuQBPn7JgNfClVq2sxbKjMlI0nSg0rBIySRpM=; b=MuYgDx4gL2Fm1i1eVDIJi5wqtO5lAVzKRVVsYFGLwaEM/hGQCtOggrbaKokFTE6SvX i+XZZinbJOO2YTx8QNPcuhAqmXzSGexCkN3yCZSNFfqDtegslw+pxB9DDUKM045el/SF ND6fZ1ypQwsvVKtDNtNXU3HS3AtLiPVkG77DDjELD8kPgeMdgSQ7Y562jrELDELAw+gv mEti/G9O64c/oZ/wyJyxB55viHx5fHoQwktmJWjb9eNRrMJdSbHKXOGa6B384y7/gh7L qeexzk311Q7XURihpXFaSRsxnqiGJu5V4OstuP9fGALaray+WWa4AKWW8b5dX1a+l9SH +27g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxDCVYWR; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 v5si7262729edc.166.2021.03.20.08.59.15; Sat, 20 Mar 2021 08:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=RxDCVYWR; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S229894AbhCTP5d (ORCPT + 8 others); Sat, 20 Mar 2021 11:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbhCTP5N (ORCPT ); Sat, 20 Mar 2021 11:57:13 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0B7CC061764 for ; Sat, 20 Mar 2021 08:57:12 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id j11so10839136ilu.13 for ; Sat, 20 Mar 2021 08:57:12 -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=JhdFcchuQBPn7JgNfClVq2sxbKjMlI0nSg0rBIySRpM=; b=RxDCVYWR0JpZLmlxHNEHDiAVyEPbw4lRR74XpQVXdlGNM3D1BAgHcsXYQh88Jg5aMm gAimnTtcYbB5vWOCJ54B42zxcBGKte/eVBFHsylydigT5eBjX/zwb3fpmoda/qrSB8bL Lf4NvUbf9xADjXGQ8qyCfbL7m3yM2bTwtaeb5+d6PwJYxUgeFMocMPkvHQ1yOhTW7pyb /lFPtMgmt/cBjGgq484GqaRuKCOrhUu5cBVFoLkyu4LBjzVrm8Rjb5i2EehLDhqxl46I pGxWJ4kWIKouEdoIIdLt1/TbEGuCVfc11qRL1xbaX4gfwWNWoYadNb8UlNdW9zaSzYWc fWTA== 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=JhdFcchuQBPn7JgNfClVq2sxbKjMlI0nSg0rBIySRpM=; b=PC55kuDlFEp3t6fMrG1N8JHxPOQjcTgU+2qyjlqZN9C/A0GtvoiuyR99u7xsKFBFaJ 1YkNIgdFFg5uEFj8fkBp6i4b1VOqO1sljmM0hectSNEQEZm9OMv41r1BR3mNY/R28qft 6DmR+8hw8xkuCsR+Ya4NJDhWnHSlZB/8zS00RxY5Kqxk18xlYYqLX2r/imH5V0Z7V5A7 KBw1bewe4GPRaewHgTyVqanlq5LLensSZrGDSVNWdOTUWJUSNj7NW6sgJ+du3YNT9Kr4 KDuInlZcohQjh1cGMIK1VD/Dw6qnPrgk74jaFL45Z3b/NS4DI0qZdvaAOAtI7XiXhDnZ liTw== X-Gm-Message-State: AOAM532CDs1yQsa1zadTkXXOn1282fygydBOwb1qmXO4ZzVOg7lQMCe8 4LzS5VtBQzuQWuWzu96SFPrDNF6fQ/d7YMiE X-Received: by 2002:a92:c6d0:: with SMTP id v16mr6034829ilm.289.1616255832385; Sat, 20 Mar 2021 08:57:12 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id n16sm4501698ilq.71.2021.03.20.08.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 08:57:12 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/5] net: ipa: implement MAX_READS_BEATS QSB data Date: Sat, 20 Mar 2021 10:57:04 -0500 Message-Id: <20210320155707.2009962-3-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210320155707.2009962-1-elder@linaro.org> References: <20210320155707.2009962-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Starting with IPA v4.0, a limit is placed on the number of bytes outstanding in a transaction, to reduce latency. The limit is imposed only if this value is non-zero. We don't use a non-zero value for SC7180, but newer versions of IPA do. Prepare for that by allowing a programmed value to be specified in the platform configuration data. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-sc7180.c | 1 + drivers/net/ipa/ipa_data.h | 2 ++ drivers/net/ipa/ipa_main.c | 10 ++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index 216f790b22b66..8fa10d0d9a4e7 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -14,6 +14,7 @@ static const struct ipa_qsb_data ipa_qsb_data[] = { [IPA_QSB_MASTER_DDR] = { .max_writes = 8, .max_reads = 12, + /* no outstanding read byte (beat) limit */ }, }; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index d50cd5ae7714f..4162c4722c00c 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -59,10 +59,12 @@ enum ipa_qsb_master_id { * struct ipa_qsb_data - Qualcomm System Bus configuration data * @max_writes: Maximum outstanding write requests for this master * @max_reads: Maximum outstanding read requests for this master + * @max_reads_beats: Max outstanding read bytes in 8-byte "beats" (if non-zero) */ struct ipa_qsb_data { u8 max_writes; u8 max_reads; + u8 max_reads_beats; /* Not present for IPA v3.5.1 */ }; /** diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 1ce593b46b04c..64b92dfdd3f5c 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -274,10 +274,16 @@ ipa_hardware_config_qsb(struct ipa *ipa, const struct ipa_data *data) /* Max outstanding read accesses for QSB masters */ val = u32_encode_bits(data0->max_reads, GEN_QMB_0_MAX_READS_FMASK); - /* GEN_QMB_0_MAX_READS_BEATS is 0 (IPA v4.0 and above) */ - if (data->qsb_count > 1) + if (ipa->version >= IPA_VERSION_4_0) + val |= u32_encode_bits(data0->max_reads_beats, + GEN_QMB_0_MAX_READS_BEATS_FMASK); + if (data->qsb_count > 1) { val |= u32_encode_bits(data1->max_reads, GEN_QMB_1_MAX_READS_FMASK); + if (ipa->version >= IPA_VERSION_4_0) + val |= u32_encode_bits(data1->max_reads_beats, + GEN_QMB_1_MAX_READS_BEATS_FMASK); + } iowrite32(val, ipa->reg_virt + IPA_REG_QSB_MAX_READS_OFFSET); }