From patchwork Sun Mar 28 17:31:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410593 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042413jai; Sun, 28 Mar 2021 10:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylsmZqwO2tHRxYvCcPApjjn4ZzL1dpjVRET210i+gVQ9HYFEJgpUvsvzCsLiK3ZEOBJk0K X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr25669988edd.212.1616952720701; Sun, 28 Mar 2021 10:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952720; cv=none; d=google.com; s=arc-20160816; b=tS7MjLIiCWBz83ouOtujonBZFg0+9ja+4s2XM6AWrMZwagKX6HXpymW+t+blo1Qc5E oGj/h5lCn6OMtgRAprUa8d91jJC0eYt8HJI9Ygcv63sAHHwZrMfJPeAkWB0b3Ag70rb8 wRYSCtLsp733PDeOKDeBiRCIDK7FcsEcZi391YZiLLG4iYPVkhknaj10BD8f6jOfPQCl fuSIL/htwiB4nxLulZ6wIp9phwiPxl40iBcGviZccaOMEykKCRRZ9k9/Hj9RfVU1uwFU Tpf0AKliCgzI0S6rh/uFYY8P0DU7dxLtHaljiEhKxTE09V4C8ee6Z2Lknu9VRr5E5wfe WvHg== 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=/iBlc7XULwydl69GlWkk2zwyP9UzVLKQKKpqET83DZA=; b=r0uFGQE4KR0hQlOUS5jHYZSx/NLLlnfFO8ivxNqBFpcEUqCFzhDIvID/T5NvVZfA34 4FJ/wwbVVi2W1BDtDHB0rZtiFxTjWCfgvUIuk1HQE2A2N3qi0yOEHzD97Kzo6UtTLlO9 PoVCmGxl4Ontc5DW9JcAT3Sp/1Vy8CNOurI0c8i8/R7Gn6C1lN17tFXS19NFB5GrTK8C hpWRHQDreXkY0t9AbL83YDvphd1wXxVQBYPNxjupFKkc0P2g+4KHtRPywFx5+r3Kmo3A 53xxuaDkgDIA78MJEbG++TwxxfucgPS+r3A3hXOH7foretMZTsyeY6AnrNnXdQ90XqTJ AWeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5rvBLvE; 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 h1si11289750edn.233.2021.03.28.10.32.00; Sun, 28 Mar 2021 10:32:00 -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=x5rvBLvE; 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 S231475AbhC1RbZ (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbhC1RbR (ORCPT ); Sun, 28 Mar 2021 13:31:17 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020A1C061762 for ; Sun, 28 Mar 2021 10:31:17 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id w2so8880088ilj.12 for ; Sun, 28 Mar 2021 10:31:16 -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=/iBlc7XULwydl69GlWkk2zwyP9UzVLKQKKpqET83DZA=; b=x5rvBLvExRPTwQzxQ3NhmCq4uTdUFO52pHfGpkQuLBRw2V9bA//4xuYRh6rkKbVLao XHJLbmhtTZVIz9Egufb6wS3BUxa3YRsKlwSIgitO5tZOTM3lRQvVOM13+XYjDFibcn6b GnDJntz9RhIaDBIVDE/PnSj7f+X3WgKqKjoGhuTzox1+dLI+cY9RTjyyK7/8hGRs9c2r VX0s2GKfLkRUBGQoDqfEYl43K4+T4uRZfBKStX7JLGg95Y+MXH5E7X9zAZNdLv5qgILv bf3BQOkgkXfNTHOaO6cHYzs+aQnwicI+bDPXJiB9DwZjUti8bEMo/WvQAuinS5TPA8NM +ioA== 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=/iBlc7XULwydl69GlWkk2zwyP9UzVLKQKKpqET83DZA=; b=lDljsbQEoXOZYsUnZ5x7PU+n9IWeIe8RQUmGTtwiNvul/NHRoErwBlx+F8maZdBC27 TZl724g+vBBh9i3HPp2g546IWrUzhhSMlt5EHYmXdGFP/YtkUgmw2+zIOb+8xppIv8pP oOiXzvIJBqw5xaa/P8pBl68uR6TkDeEYfMcrouAW6vUh37I03fUV3lf7qZyzaqnHrdj3 +9T+V52MTbtkLqqF6Pm9bFiIKrinZqX20ric7Kq/GcRXllAbg4vG79mwsBTBve4ZWAU6 1eTrFjpVyDCWUu5VcVVggijxCYnH0NBpJiQDdQNGGCmyZ4MZZA0CP4L7s1mUGFL7tnXe ruoA== X-Gm-Message-State: AOAM530dxzejotREGj+wP5lwFbHfOpZGA0nRPrhMgOrod6b8bygk4TZ6 7EIr+Ghtie4EYEuXJDr1as7chbr6IcaZhham X-Received: by 2002:a92:1a4b:: with SMTP id z11mr17969039ill.261.1616952676376; Sun, 28 Mar 2021 10:31:16 -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 d22sm8014422iof.48.2021.03.28.10.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:16 -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 1/7] net: ipa: fix all kernel-doc warnings Date: Sun, 28 Mar 2021 12:31:05 -0500 Message-Id: <20210328173111.3399063-2-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix all warnings produced when running: scripts/kernel-doc -none drivers/net/ipa/*.[ch] Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_private.h | 2 +- drivers/net/ipa/gsi_trans.h | 5 +++-- drivers/net/ipa/ipa.h | 7 ++++--- drivers/net/ipa/ipa_cmd.h | 19 +++++++++++++------ drivers/net/ipa/ipa_endpoint.h | 18 +++++++++++++++--- drivers/net/ipa/ipa_interrupt.h | 1 + drivers/net/ipa/ipa_mem.h | 2 +- drivers/net/ipa/ipa_qmi.h | 14 +++++++++----- drivers/net/ipa/ipa_smp2p.h | 2 +- drivers/net/ipa/ipa_table.h | 3 ++- 10 files changed, 50 insertions(+), 23 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi_private.h b/drivers/net/ipa/gsi_private.h index 1785c9d3344d1..ed7bc26f85e9a 100644 --- a/drivers/net/ipa/gsi_private.h +++ b/drivers/net/ipa/gsi_private.h @@ -100,7 +100,7 @@ void gsi_channel_doorbell(struct gsi_channel *channel); /** * gsi_ring_virt() - Return virtual address for a ring entry * @ring: Ring whose address is to be translated - * @addr: Index (slot number) of entry + * @index: Index (slot number) of entry */ void *gsi_ring_virt(struct gsi_ring *ring, u32 index); diff --git a/drivers/net/ipa/gsi_trans.h b/drivers/net/ipa/gsi_trans.h index 3a4ab8a94d827..17fd1822d8a9f 100644 --- a/drivers/net/ipa/gsi_trans.h +++ b/drivers/net/ipa/gsi_trans.h @@ -71,7 +71,7 @@ struct gsi_trans { /** * gsi_trans_pool_init() - Initialize a pool of structures for transactions - * @gsi: GSI pointer + * @pool: GSI transaction poll pointer * @size: Size of elements in the pool * @count: Minimum number of elements in the pool * @max_alloc: Maximum number of elements allocated at a time from pool @@ -123,7 +123,8 @@ int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool, void *gsi_trans_pool_alloc_dma(struct gsi_trans_pool *pool, dma_addr_t *addr); /** - * gsi_trans_pool_exit() - Inverse of gsi_trans_pool_init() + * gsi_trans_pool_exit_dma() - Inverse of gsi_trans_pool_init_dma() + * @dev: Device used for DMA * @pool: Pool pointer */ void gsi_trans_pool_exit_dma(struct device *dev, struct gsi_trans_pool *pool); diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index 8020776313716..e7ff376cb5b7d 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -44,6 +44,8 @@ enum ipa_flag { * @version: IPA hardware version * @pdev: Platform device * @completion: Used to signal pipeline clear transfer complete + * @nb: Notifier block used for remoteproc SSR + * @notifier: Remoteproc SSR notifier * @smp2p: SMP2P information * @clock: IPA clocking information * @table_addr: DMA address of filter/route table content @@ -58,13 +60,12 @@ enum ipa_flag { * @mem_size: Total size (bytes) of memory at @mem_virt * @mem: Array of IPA-local memory region descriptors * @imem_iova: I/O virtual address of IPA region in IMEM - * @imem_size; Size of IMEM region + * @imem_size: Size of IMEM region * @smem_iova: I/O virtual address of IPA region in SMEM - * @smem_size; Size of SMEM region + * @smem_size: Size of SMEM region * @zero_addr: DMA address of preallocated zero-filled memory * @zero_virt: Virtual address of preallocated zero-filled memory * @zero_size: Size (bytes) of preallocated zero-filled memory - * @wakeup_source: Wakeup source information * @available: Bit mask indicating endpoints hardware supports * @filter_map: Bit mask indicating endpoints that support filtering * @initialized: Bit mask indicating endpoints initialized diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index 6dd3d35cf315d..b99262281f41c 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -20,11 +20,18 @@ struct gsi_channel; /** * enum ipa_cmd_opcode: IPA immediate commands * + * @IPA_CMD_IP_V4_FILTER_INIT: Initialize IPv4 filter table + * @IPA_CMD_IP_V6_FILTER_INIT: Initialize IPv6 filter table + * @IPA_CMD_IP_V4_ROUTING_INIT: Initialize IPv4 routing table + * @IPA_CMD_IP_V6_ROUTING_INIT: Initialize IPv6 routing table + * @IPA_CMD_HDR_INIT_LOCAL: Initialize IPA-local header memory + * @IPA_CMD_REGISTER_WRITE: Register write performed by IPA + * @IPA_CMD_IP_PACKET_INIT: Set up next packet's destination endpoint + * @IPA_CMD_DMA_SHARED_MEM: DMA command performed by IPA + * @IPA_CMD_IP_PACKET_TAG_STATUS: Have next packet generate tag * status + * @IPA_CMD_NONE: Special (invalid) "not a command" value + * * All immediate commands are issued using the AP command TX endpoint. - * The numeric values here are the opcodes for IPA v3.5.1 hardware. - * - * IPA_CMD_NONE is a special (invalid) value that's used to indicate - * a request is *not* an immediate command. */ enum ipa_cmd_opcode { IPA_CMD_NONE = 0x0, @@ -96,7 +103,7 @@ static inline bool ipa_cmd_data_valid(struct ipa *ipa) * * Return: 0 if successful, or a negative error code */ -int ipa_cmd_pool_init(struct gsi_channel *gsi_channel, u32 tre_count); +int ipa_cmd_pool_init(struct gsi_channel *channel, u32 tre_count); /** * ipa_cmd_pool_exit() - Inverse of ipa_cmd_pool_init() @@ -124,7 +131,7 @@ void ipa_cmd_table_init_add(struct gsi_trans *trans, enum ipa_cmd_opcode opcode, /** * ipa_cmd_hdr_init_local_add() - Add a header init command to a transaction - * @ipa: IPA structure + * @trans: GSI transaction * @offset: Offset of header memory in IPA local space * @size: Size of header memory * @addr: DMA address of buffer to be written from diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index c6c55ea35394f..0d410b0504562 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -41,8 +41,20 @@ enum ipa_endpoint_name { /** * struct ipa_endpoint - IPA endpoint information - * @channel_id: EP's GSI channel - * @evt_ring_id: EP's GSI channel event ring + * @ipa: IPA pointer + * @ee_id: Execution environmnent endpoint is associated with + * @channel_id: GSI channel used by the endpoint + * @endpoint_id: IPA endpoint number + * @toward_ipa: Endpoint direction (true = TX, false = RX) + * @data: Endpoint configuration data + * @trans_tre_max: Maximum number of TRE descriptors per transaction + * @evt_ring_id: GSI event ring used by the endpoint + * @netdev: Network device pointer, if endpoint uses one + * @replenish_enabled: Whether receive buffer replenishing is enabled + * @replenish_ready: Number of replenish transactions without doorbell + * @replenish_saved: Replenish requests held while disabled + * @replenish_backlog: Number of buffers needed to fill hardware queue + * @replenish_work: Work item used for repeated replenish failures */ struct ipa_endpoint { struct ipa *ipa; @@ -52,7 +64,7 @@ struct ipa_endpoint { bool toward_ipa; const struct ipa_endpoint_config_data *data; - u32 trans_tre_max; /* maximum descriptors per transaction */ + u32 trans_tre_max; u32 evt_ring_id; /* Net device this endpoint is associated with, if any */ diff --git a/drivers/net/ipa/ipa_interrupt.h b/drivers/net/ipa/ipa_interrupt.h index b5d63a0cd19e4..d5c486a6800d9 100644 --- a/drivers/net/ipa/ipa_interrupt.h +++ b/drivers/net/ipa/ipa_interrupt.h @@ -24,6 +24,7 @@ typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id); /** * ipa_interrupt_add() - Register a handler for an IPA interrupt type + * @interrupt: IPA interrupt structure * @irq_id: IPA interrupt type * @handler: Handler function for the interrupt * diff --git a/drivers/net/ipa/ipa_mem.h b/drivers/net/ipa/ipa_mem.h index f82e8939622bb..df61ef48df365 100644 --- a/drivers/net/ipa/ipa_mem.h +++ b/drivers/net/ipa/ipa_mem.h @@ -77,7 +77,7 @@ enum ipa_mem_id { * struct ipa_mem - IPA local memory region description * @offset: offset in IPA memory space to base of the region * @size: size in bytes base of the region - * @canary_count # 32-bit "canary" values that precede region + * @canary_count: Number of 32-bit "canary" values that precede region */ struct ipa_mem { u32 offset; diff --git a/drivers/net/ipa/ipa_qmi.h b/drivers/net/ipa/ipa_qmi.h index 3993687593d0c..b6f2055d35a68 100644 --- a/drivers/net/ipa/ipa_qmi.h +++ b/drivers/net/ipa/ipa_qmi.h @@ -13,11 +13,15 @@ struct ipa; /** * struct ipa_qmi - QMI state associated with an IPA - * @client_handle - used to send an QMI requests to the modem - * @server_handle - used to handle QMI requests from the modem - * @initialized - whether QMI initialization has completed - * @indication_register_received - tracks modem request receipt - * @init_driver_response_received - tracks modem response receipt + * @client_handle: Used to send an QMI requests to the modem + * @server_handle: Used to handle QMI requests from the modem + * @modem_sq: QMAP socket address for the modem QMI server + * @init_driver_work: Work structure used for INIT_DRIVER message handling + * @initial_boot: True if first boot has not yet completed + * @uc_ready: True once DRIVER_INIT_COMPLETE request received + * @modem_ready: True when INIT_DRIVER response received + * @indication_requested: True when INDICATION_REGISTER request received + * @indication_sent: True when INIT_COMPLETE indication sent */ struct ipa_qmi { struct qmi_handle client_handle; diff --git a/drivers/net/ipa/ipa_smp2p.h b/drivers/net/ipa/ipa_smp2p.h index bf0e4063cfd96..20319438a8419 100644 --- a/drivers/net/ipa/ipa_smp2p.h +++ b/drivers/net/ipa/ipa_smp2p.h @@ -28,7 +28,7 @@ void ipa_smp2p_exit(struct ipa *ipa); /** * ipa_smp2p_disable() - Prevent "ipa-setup-ready" interrupt handling - * @IPA: IPA pointer + * @ipa: IPA pointer * * Prevent handling of the "setup ready" interrupt from the modem. * This is used before initiating shutdown of the driver. diff --git a/drivers/net/ipa/ipa_table.h b/drivers/net/ipa/ipa_table.h index 889c2e93b1223..e14108ed62bdd 100644 --- a/drivers/net/ipa/ipa_table.h +++ b/drivers/net/ipa/ipa_table.h @@ -24,7 +24,7 @@ struct ipa; /** * ipa_table_valid() - Validate route and filter table memory regions * @ipa: IPA pointer - + * * Return: true if all regions are valid, false otherwise */ bool ipa_table_valid(struct ipa *ipa); @@ -32,6 +32,7 @@ bool ipa_table_valid(struct ipa *ipa); /** * ipa_filter_map_valid() - Validate a filter table endpoint bitmap * @ipa: IPA pointer + * @filter_mask: Filter table endpoint bitmap to check * * Return: true if all regions are valid, false otherwise */ From patchwork Sun Mar 28 17:31:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410594 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042420jai; Sun, 28 Mar 2021 10:32:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQrNgpW8qTc8P56GFZSfinlttW6eV7vIl/Pgc5UyHXDEHf4FD35IaWqJE2Hjq+ZLIWEHhI X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr25294860ejb.399.1616952721560; Sun, 28 Mar 2021 10:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952721; cv=none; d=google.com; s=arc-20160816; b=wr30fE/M/4Addysx3vttYt8s/H+O8Ir33gk6NleZ0HwiL0aZdJfZI+WR3p5kXKkN76 mUxrZKOR+T2A10q5qCYmj5OZzs8JbMHIpnP2mzT0hhHnU8mqY4LEm4DwUbIW2fB9weFZ tyHc+dirocCebNUdgdD5SOwN81J80ee9A2bICHyXfHYMQvAx2JQ/OwDStK+QfBy2XFVN g0mxglbGxGuTNHY/ObCYCQiMg7Ize4sIjlKB8AIpMtAsUptCh/bkFad4R77n6hOpIJfE iH+hLC1UUsJ80iRXmUusG+E4J9Mpz4rxm33Q9ZoiAkfOWX70aiZ2Sbm1571dEwmSMtoD L9eA== 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=yyjEhsQuVjegTsG/OXDUJjA1PIxhUXIU8zVC7etU+X0=; b=lropugXBQoCCF/a1dBH3dENskg4qZB/+vU4ZJrY7wTVQX2opgJGkQNsvyEOxuQdUpK WjpI/g9oJlaMBqqyIUOfsjlTE/5ZJ8Kb5L+dENn3qOpscNF/6hHDGlwBYQDBWS//YIIA 0CyaB3F9TmZ+su9PhS/hKX2v46q7PvKEKxMdGqkqBc4PGO0jH9Lcoeib6cn9A0kGLD1G nhwvkpkOu3xKlY6YmFJy/J0P+NwnMsGZiNsXW9idQzDEVlvJ+Wx8GrNscjH33Kd4s8UO 1Kd+0/QOcq7z0WS6zywZCfZKuzhk0Z55Olp+Mjuqb/zcnTGNeorT9Djw5wmr7LOZkvyB v9eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h1J2y671; 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 h1si11289750edn.233.2021.03.28.10.32.01; Sun, 28 Mar 2021 10:32:01 -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=h1J2y671; 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 S231485AbhC1Rb0 (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231191AbhC1RbS (ORCPT ); Sun, 28 Mar 2021 13:31:18 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAC40C061756 for ; Sun, 28 Mar 2021 10:31:17 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id u2so9372887ilk.1 for ; Sun, 28 Mar 2021 10:31:17 -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=yyjEhsQuVjegTsG/OXDUJjA1PIxhUXIU8zVC7etU+X0=; b=h1J2y671XUWPpHh2PmZjX9zHbeVkUYvf8upgjPoUelpAZlVqDoIsYt5L3BI5wYCQdz Wi+lt3hcbrSwJFuvgMivsfKGnuLaSrQO9NfO5n5eQl0gg2SdY+a8sRiTxvX0ihCAZBM8 GI8WUSqJfUqhl5jYYt/dZNZe0q98lX94PH1WYEHz58pBpukwft8mTMTwgJANXSoDGStx 2Gia7IMNu2zdpIu0AHyp3Wk8SYhw1BlukyCt9OGf6iO4436EUeETvo2cwzpYvMBCiTux FUVgDGoH+6Ba/+WliXHMZRrVT8PnNqvD8nzn//KZF8aflArtkoE0SQTXHJzuq1yFPg1V LWpA== 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=yyjEhsQuVjegTsG/OXDUJjA1PIxhUXIU8zVC7etU+X0=; b=bVAANRhCHblhNtwZfCK/+HBKE2TYHQy47B/gcyqSpY8valtb9huDafTyRb86EPImP2 jWOu7znZO0AAJNs0iAE1lFBKyMpHcUHShVkEEFV39seJLRbJ3/L3khEpVUQJuQWduLBZ O0bRX5ZeLQ0/OfuCWUb8Td7wpxL7rADhRkceQEGQOo+jy+UpoDROjHsk311tLQXYQ/3o iu8O93hZz96jIe2XW1sxrlTy84KmrRWdSjpd/4NO90xf2gNKl3jO6CFnPQdyv3sXYjah YsaUuQU00VxEIcI5M/e0tADfdDmt/AsjPpJMVUzask2H7ovd9rp/0PVnPvl3RPJeVyHE S5Hg== X-Gm-Message-State: AOAM533sf2E6wlawKU/NeahqO91hdFiTVbW/xkdvAiUUJSm0vHYy/pH4 wxn0stXkwi9CusckHimSVQc7ag== X-Received: by 2002:a05:6e02:15c6:: with SMTP id q6mr17677389ilu.17.1616952677326; Sun, 28 Mar 2021 10:31:17 -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 d22sm8014422iof.48.2021.03.28.10.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:17 -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/7] net: ipa: store BCR register values in config data Date: Sun, 28 Mar 2021 12:31:06 -0500 Message-Id: <20210328173111.3399063-3-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The backward compatibility register value is a platform-specific property that is not stored in the platform data. Create a data field where this can be represented, and get rid ipa_reg_bcr_val(). This register is not present starting with IPA v4.5. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-sc7180.c | 1 + drivers/net/ipa/ipa_data-sdm845.c | 5 +++++ drivers/net/ipa/ipa_data.h | 2 ++ drivers/net/ipa/ipa_main.c | 4 ++-- drivers/net/ipa/ipa_reg.h | 21 --------------------- 5 files changed, 10 insertions(+), 23 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index c9b6a6aaadacc..810c673be56ee 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -349,6 +349,7 @@ static const struct ipa_clock_data ipa_clock_data = { /* Configuration data for the SC7180 SoC. */ const struct ipa_data ipa_data_sc7180 = { .version = IPA_VERSION_4_2, + /* backward_compat value is 0 */ .qsb_count = ARRAY_SIZE(ipa_qsb_data), .qsb_data = ipa_qsb_data, .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data), diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index e14e3fb1d9700..49a18b1047c58 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -397,6 +397,11 @@ static const struct ipa_clock_data ipa_clock_data = { /* Configuration data for the SDM845 SoC. */ const struct ipa_data ipa_data_sdm845 = { .version = IPA_VERSION_3_5_1, + .backward_compat = BCR_CMDQ_L_LACK_ONE_ENTRY_FMASK | + BCR_TX_NOT_USING_BRESP_FMASK | + BCR_SUSPEND_L2_IRQ_FMASK | + BCR_HOLB_DROP_L2_IRQ_FMASK | + BCR_DUAL_TX_FMASK, .qsb_count = ARRAY_SIZE(ipa_qsb_data), .qsb_data = ipa_qsb_data, .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data), diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index ea8f99286228e..843d818f78e18 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -279,6 +279,7 @@ struct ipa_clock_data { /** * struct ipa_data - combined IPA/GSI configuration data * @version: IPA hardware version + * @backward_compat: BCR register value (prior to IPA v4.5 only) * @qsb_count: number of entries in the qsb_data array * @qsb_data: Qualcomm System Bus configuration data * @endpoint_count: number of entries in the endpoint_data array @@ -289,6 +290,7 @@ struct ipa_clock_data { */ struct ipa_data { enum ipa_version version; + u32 backward_compat; u32 qsb_count; /* number of entries in qsb_data[] */ const struct ipa_qsb_data *qsb_data; u32 endpoint_count; /* number of entries in endpoint_data[] */ diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index e18029152d780..afb8eb5618f73 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -397,9 +397,9 @@ static void ipa_hardware_config(struct ipa *ipa, const struct ipa_data *data) u32 granularity; u32 val; - /* IPA v4.5 has no backward compatibility register */ + /* IPA v4.5+ has no backward compatibility register */ if (version < IPA_VERSION_4_5) { - val = ipa_reg_bcr_val(version); + val = data->backward_compat; iowrite32(val, ipa->reg_virt + IPA_REG_BCR_OFFSET); } diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h index de2a944bad86b..286ea9634c49d 100644 --- a/drivers/net/ipa/ipa_reg.h +++ b/drivers/net/ipa/ipa_reg.h @@ -235,27 +235,6 @@ static inline u32 ipa_reg_state_aggr_active_offset(enum ipa_version version) #define BCR_FILTER_PREFETCH_EN_FMASK GENMASK(8, 8) #define BCR_ROUTER_PREFETCH_EN_FMASK GENMASK(9, 9) -/* Backward compatibility register value to use for each version */ -static inline u32 ipa_reg_bcr_val(enum ipa_version version) -{ - if (version == IPA_VERSION_3_5_1) - return BCR_CMDQ_L_LACK_ONE_ENTRY_FMASK | - BCR_TX_NOT_USING_BRESP_FMASK | - BCR_SUSPEND_L2_IRQ_FMASK | - BCR_HOLB_DROP_L2_IRQ_FMASK | - BCR_DUAL_TX_FMASK; - - if (version == IPA_VERSION_4_0 || version == IPA_VERSION_4_1) - return BCR_CMDQ_L_LACK_ONE_ENTRY_FMASK | - BCR_SUSPEND_L2_IRQ_FMASK | - BCR_HOLB_DROP_L2_IRQ_FMASK | - BCR_DUAL_TX_FMASK; - - /* assert(version != IPA_VERSION_4_5); */ - - return 0x00000000; -} - /* The value of the next register must be a multiple of 8 (bottom 3 bits 0) */ #define IPA_REG_LOCAL_PKT_PROC_CNTXT_OFFSET 0x000001e8 From patchwork Sun Mar 28 17:31:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410596 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042430jai; Sun, 28 Mar 2021 10:32:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiFu/lUY3tkJVJE47qvzxZpxtx6gtZOXloU1QcSJnANIKrVZqsWIaWHviU0Fnf77wB+vMF X-Received: by 2002:aa7:dc56:: with SMTP id g22mr25378449edu.219.1616952722741; Sun, 28 Mar 2021 10:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952722; cv=none; d=google.com; s=arc-20160816; b=aj4lnT5w9lk+70VZh06+881Qp/qKtrsds9uMwbCVjVB8biCimWOwYQmfO082++NLGP Xq4tbkVJPqkKkfn5K7DLTgryaUKogABOxwRJ7+YOASLU6YFVmnsTgpgPdz7mt3YD+CyE YnMT79aZVtzobGy6XbdAs2PNbXkeopMHA09l7O/kALr1WUT/B6o9XGYzthNqZeLTi3R6 tftWMhA4/0COPqd16MuFh3ilQfE9d1Y/rzyngjOWqUTyshnZY/sSHWSyzBZ1ss0EDBHf xnIKAyv4GT6vc5wNxgOuS4lPTImzoqxDRCS+cntc8Mx7mtQA6NL+bCIYMWwzCBXtbRjL 8qJw== 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=qv30pzI3zwmFw9Iia44xcHu7h1Qg2DXbxdalh98PfsI=; b=vd0M2SHRa15K8CNFN7J13ONAt1T+yQ/T3RJRkPnpSIsPu+VT/rZ5dbUoqN2ETi2u1C juS52OASsIvQvSmShxT9oc5o2HPAorc4hlD5tn+FasPMtQqF50kBXqo8ju+yA3G8oaaS gu4jRxVvM+Jhazxf6DRspBb7Dw0Dx440PNwIZTHTY7O7AusBD75Bw98zWhphZrUmzJeu bO+HPw5OKSbZ76B4F/2B+Fx872+GmVY19Ge9/2/NPEmaytf55+1pSVP3qz36MU+fWVGn OGkDIzhk/zX9jP2rdQ/s8lPoC3taD/H6KjskRuZCR4fpz7KMgfOBA3T6iqgitN6p7i54 YZXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ee1M7mbe; 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 h1si11289750edn.233.2021.03.28.10.32.02; Sun, 28 Mar 2021 10:32:02 -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=Ee1M7mbe; 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 S231512AbhC1Rba (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231214AbhC1RbS (ORCPT ); Sun, 28 Mar 2021 13:31:18 -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 B5809C061762 for ; Sun, 28 Mar 2021 10:31:18 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id z3so10459600ioc.8 for ; Sun, 28 Mar 2021 10:31:18 -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=qv30pzI3zwmFw9Iia44xcHu7h1Qg2DXbxdalh98PfsI=; b=Ee1M7mbekaNT7LhG4C/KiXAOx11189FcQDXokcoib8UB+YNmWOaD/9E9z80fjrDiIl fw496M5qPxQ7113cVh5VBC2sq/LPe43I9wq/RtQCtq27wA5m0ydKM2/vgEQ8YiT32Ibv UzeFz1+TYLylr66pMReHpimV2R+MfsXOCZYZpCfygSgxEyO9RCFoj7APXpJY5oh7isFh E/MqiJIVQrZ5m6FsI93f9VbciYKR21c/O1P3vl4LwRWEQ2+Q4wWZNOCgOSVny4ffjgij NWEr3yrMRoGxS07iKXhxVK/Ze0qDKWzTI4gRH77azm4wbdPJU/wmfJhFQvK6uTtjRd4U i1rQ== 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=qv30pzI3zwmFw9Iia44xcHu7h1Qg2DXbxdalh98PfsI=; b=chtrfBQYv54ZBBIFJ0RZ0VogQBw8VM2pZvIYq7XjfHlOAItyoe2lzgL9dzLP1EYZwj RrBGQSE7ydiVQx2aPYGe+mhKULVcMCWu6l6t/Iqp95/d5cizpYSst/9+1KSyRwCyg9No YCzYGvroF2cSXNajVPPoEphT8wCxX4xgUeEtwEL9td0U4KCVr7+Ufu3EstdE2PgcVrUM mXnN+KTUISnGQ+yMN7YSyOsNwXZiKMoBGPyiqrtIqKtRFOl/ERy+I8PJzWU2yBZ56EnU cKXazYo30rAYXrUHU7gWspQ3jvFYUlbHgjo9fhPJxqc7lrMbVawuK3OXpDhL7N3NKxT8 0m3A== X-Gm-Message-State: AOAM532fcuxEYx8RzL1MUc2DEANeLe/d9zwg7Vljvir/TDCk04BB8l17 az6Nqgsr80y11GWib0LVELvwTQ== X-Received: by 2002:a6b:d20e:: with SMTP id q14mr17513741iob.200.1616952678218; Sun, 28 Mar 2021 10:31:18 -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 d22sm8014422iof.48.2021.03.28.10.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:17 -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 3/7] net: ipa: don't define endpoints unnecessarily Date: Sun, 28 Mar 2021 12:31:07 -0500 Message-Id: <20210328173111.3399063-4-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We don't typically need much information about modem endpoints. Normally we need to specify information about modem endpoints in configuration data in only two cases: - When a modem TX endpoint supports filtering - When another endpoint's configuration refers to it For the first case, the AP initializes the filter table, and must know how many endpoints (AP and modem) support filtering. An example of the second case is the AP->modem TX endpoint, which defines the modem<-AP RX endpoint as its status endpoint. There is one exception to this, and it's due to a hardware quirk. For IPA v4.2 (only) there is a problem related to allocating GSI channels. And to work around this, the AP allocates *all* GSI channels at startup time--including those used by the modem. Get rid of the configuration information for two endpoints not required for the SDM845. SC7180 runs IPA v4.2, so we can't eliminate any modem endpoint definitions there. Two more minor changes: - Reorder the members defined for the ipa_endpoint_name enumerated type to match the order used in configuration data files when defining endpoints. - Add a new name, IPA_ENDPOINT_MODEM_DL_NLO_TX, which can be used for IPA v4.5+. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-sdm845.c | 12 ------------ drivers/net/ipa/ipa_endpoint.h | 11 ++++++----- 2 files changed, 6 insertions(+), 17 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index 49a18b1047c58..ed0bfe0634d98 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -144,12 +144,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { }, }, }, - [IPA_ENDPOINT_MODEM_COMMAND_TX] = { - .ee_id = GSI_EE_MODEM, - .channel_id = 1, - .endpoint_id = 4, - .toward_ipa = true, - }, [IPA_ENDPOINT_MODEM_LAN_TX] = { .ee_id = GSI_EE_MODEM, .channel_id = 0, @@ -159,12 +153,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { .filter_support = true, }, }, - [IPA_ENDPOINT_MODEM_LAN_RX] = { - .ee_id = GSI_EE_MODEM, - .channel_id = 3, - .endpoint_id = 13, - .toward_ipa = false, - }, [IPA_ENDPOINT_MODEM_AP_TX] = { .ee_id = GSI_EE_MODEM, .channel_id = 4, diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index 0d410b0504562..f034a9e6ef215 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -25,15 +25,16 @@ struct ipa_gsi_endpoint_data; #define IPA_MTU ETH_DATA_LEN enum ipa_endpoint_name { - IPA_ENDPOINT_AP_MODEM_TX, - IPA_ENDPOINT_MODEM_LAN_TX, - IPA_ENDPOINT_MODEM_COMMAND_TX, IPA_ENDPOINT_AP_COMMAND_TX, - IPA_ENDPOINT_MODEM_AP_TX, IPA_ENDPOINT_AP_LAN_RX, + IPA_ENDPOINT_AP_MODEM_TX, IPA_ENDPOINT_AP_MODEM_RX, - IPA_ENDPOINT_MODEM_AP_RX, + IPA_ENDPOINT_MODEM_COMMAND_TX, + IPA_ENDPOINT_MODEM_LAN_TX, IPA_ENDPOINT_MODEM_LAN_RX, + IPA_ENDPOINT_MODEM_AP_TX, + IPA_ENDPOINT_MODEM_AP_RX, + IPA_ENDPOINT_MODEM_DL_NLO_TX, IPA_ENDPOINT_COUNT, /* Number of names (not an index) */ }; From patchwork Sun Mar 28 17:31:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410595 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042423jai; Sun, 28 Mar 2021 10:32:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQJj2hylvZy03km1LJjg3w64SQ/unq5X1Jh4JMuW3jBQyUVA+YTfC4RoW9syts08wQ6Vsq X-Received: by 2002:a50:f314:: with SMTP id p20mr25078835edm.236.1616952721944; Sun, 28 Mar 2021 10:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952721; cv=none; d=google.com; s=arc-20160816; b=IVWSOupBB2PMS3yU0onyeI/t64JYJi94U3DoBIm6HcOVyasPK/kjnrhJ052J+1lSuz RuY20ZNI2TBI3vUwFeQl/kVVEHlItDVo9JwK/dL4a+OLVnCWbLUvvB4uCQ8dFSnVfz6J GkAVTsjBKAouQTLRbi47eCVxzyriSjoMWUyQAdE9j6CoFzq74OZ82KvE3xNCLCN1YsKJ X3M+ch+Xk07u04uc2osUTVnWv/ccYL1EAJ1ZRlb55isG0ui9/aJBH6AinyyHI31YOZYs sQG4tCbdMBMxYrQ67/N1bB5xU+HaZN/BSqwa3ZYjTU10BxcJ8h7BsCDR+qQnQ/HE0YFw pgLA== 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=NOQpwsJ3pCq24y+KN9P/Mdmm3B4GeGc1qXPHwPLD8JQ=; b=n18AQ8uW5LWwP1byILJclGA184eq7Vr6INLK+CnWooBIpH0Nt4z8PAz/QjE7+lqMKc B3CgACZkiNieF3SdiXUiRGRl5I0YCoA3Iq5jRQR72iRqR50C8ene9LxlA+7mjFHP9O1g H7/+pxvNsKUzPWOqLx6MvvaTN5mjq8vTu3UJ7BDfvgTBagSd1m7ulXxT6/eLIoc8USgX bnUaNorCZCE0lMB1iEyZGTdiYCy+tetyZlaOjWYsAIXrzwCL56PkAd5OT1Ofq682Ls8H 3g3VrATakA2izJLYcH9Vj6jUW6hAj617stasZ2471BPp2sQt5mSu8l4LR68TiL/XjRcs Pmxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWkMcaeD; 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 h1si11289750edn.233.2021.03.28.10.32.01; Sun, 28 Mar 2021 10:32:01 -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=RWkMcaeD; 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 S231499AbhC1Rb3 (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231243AbhC1RbT (ORCPT ); Sun, 28 Mar 2021 13:31:19 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BB46C061756 for ; Sun, 28 Mar 2021 10:31:19 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id j16so803378ilq.13 for ; Sun, 28 Mar 2021 10:31:19 -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=NOQpwsJ3pCq24y+KN9P/Mdmm3B4GeGc1qXPHwPLD8JQ=; b=RWkMcaeDlV57qIcQ0TbjQiYF5zK/vr9TeVdnqaORejk97yoinFtH1YGo3yQaxFmDDQ vLJqoapwy3NUW0/FaTHwaD7QRqaFykALnxKXA3/bS/XD7LYdV3PYX0WKHDzQ3UJANjr+ +maz0t3o9sjnTfQ9yTixuFDbc2WqokQl3RWfl9cM1CBQAPAAyG0Ked2RuR7sdb1BdN0r thztXMiMxirWszqS1KNgx7kj2w7QL2cgHR19gHZHcQhcAkLc3354EAvaF17myiBHgocL TE3XX91s+5JkTSO10WmV/dX4cwhR+OhXe36QDmS2tYWYuMD1dJRBbSY4bZxcsyzY+EJi DwJw== 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=NOQpwsJ3pCq24y+KN9P/Mdmm3B4GeGc1qXPHwPLD8JQ=; b=TTIW3kg/769eBR7io0satVg7LKSUt4mb9uj38u6SmGV+qdI90q/TzzcdFZUqTmUcFZ lnlPgfN6uWcveCNwgSJ9w8k1sjte4Eun0Sa/IauK51aFGI0l0Jmh2JlN64SlyFptv3DQ WEZw4vYzp5TPg2f+K3QiJ6kr2w3u89mErlov+4nyjavQVDeKiud3G5NHxaQZnYOcve7U ccGhFLbQQYvGDFqBFboM4RZCWeRVF4u99EdvIlIu7jOUsNPT7qejhtCLpdrEbHQubwu5 q7u5OzBG1SfNBtpERTqhVcVmGwfFYcN9hNhdViJppbl28m6Pk9mwfAEfw5Vyc+YhMhM5 7eQw== X-Gm-Message-State: AOAM530xfOOc8l/FhBTmsaPbGuJLqRgpaCC7dPiEUechJITzXRwtyu/I HUILFnvmneaHgPexvjlEOvzN3Q== X-Received: by 2002:a92:ddd0:: with SMTP id d16mr18097996ilr.52.1616952679093; Sun, 28 Mar 2021 10:31:19 -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 d22sm8014422iof.48.2021.03.28.10.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:18 -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 4/7] net: ipa: switch to version based configuration Date: Sun, 28 Mar 2021 12:31:08 -0500 Message-Id: <20210328173111.3399063-5-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rename the SDM845 configuration data file so that its name is derived from its IPA version. I am not aware of any special IPA behavior or handling that would be based on a specific SoC (as opposed to a specific version of the IPA it contains). Update a few other references to the code that talk about the SDM845 rather than just IPA v3.5.1. Signed-off-by: Alex Elder --- drivers/net/ipa/Kconfig | 3 +-- drivers/net/ipa/Makefile | 2 +- .../{ipa_data-sdm845.c => ipa_data-v3.5.1.c} | 22 ++++++++++--------- drivers/net/ipa/ipa_data.h | 2 +- drivers/net/ipa/ipa_main.c | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) rename drivers/net/ipa/{ipa_data-sdm845.c => ipa_data-v3.5.1.c} (92%) -- 2.27.0 diff --git a/drivers/net/ipa/Kconfig b/drivers/net/ipa/Kconfig index 90a90262e0d07..8f99cfa14680a 100644 --- a/drivers/net/ipa/Kconfig +++ b/drivers/net/ipa/Kconfig @@ -12,8 +12,7 @@ config QCOM_IPA that is capable of generic hardware handling of IP packets, including routing, filtering, and NAT. Currently the IPA driver supports only basic transport of network traffic - between the AP and modem, on the Qualcomm SDM845 and SC7180 - SoCs. + between the AP and modem. Note that if selected, the selection type must match that of QCOM_Q6V5_COMMON (Y or M). diff --git a/drivers/net/ipa/Makefile b/drivers/net/ipa/Makefile index 14a7d8429baa2..a4a42fc7b840e 100644 --- a/drivers/net/ipa/Makefile +++ b/drivers/net/ipa/Makefile @@ -9,4 +9,4 @@ ipa-y := ipa_main.o ipa_clock.o ipa_reg.o ipa_mem.o \ ipa_endpoint.o ipa_cmd.o ipa_modem.o \ ipa_resource.o ipa_qmi.o ipa_qmi_msg.o -ipa-y += ipa_data-sdm845.o ipa_data-sc7180.o +ipa-y += ipa_data-v3.5.1.o ipa_data-sc7180.o diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-v3.5.1.c similarity index 92% rename from drivers/net/ipa/ipa_data-sdm845.c rename to drivers/net/ipa/ipa_data-v3.5.1.c index ed0bfe0634d98..57703e95a3f9c 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-v3.5.1.c @@ -11,7 +11,7 @@ #include "ipa_endpoint.h" #include "ipa_mem.h" -/** enum ipa_resource_type - IPA resource types */ +/** enum ipa_resource_type - IPA resource types for an SoC having IPA v3.5.1 */ enum ipa_resource_type { /* Source resource types; first must have value 0 */ IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS = 0, @@ -25,7 +25,7 @@ enum ipa_resource_type { IPA_RESOURCE_TYPE_DST_DPS_DMARS, }; -/* Resource groups used for the SDM845 SoC */ +/* Resource groups used for an SoC having IPA v3.5.1 */ enum ipa_rsrc_group_id { /* Source resource group identifiers */ IPA_RSRC_GROUP_SRC_LWA_DL = 0, @@ -41,7 +41,7 @@ enum ipa_rsrc_group_id { IPA_RSRC_GROUP_DST_COUNT, /* Last; not a destination group */ }; -/* QSB configuration for the SDM845 SoC. */ +/* QSB configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_qsb_data ipa_qsb_data[] = { [IPA_QSB_MASTER_DDR] = { .max_writes = 8, @@ -53,7 +53,7 @@ static const struct ipa_qsb_data ipa_qsb_data[] = { }, }; -/* Endpoint configuration for the SDM845 SoC. */ +/* Endpoint datdata for an SoC having IPA v3.5.1 */ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { [IPA_ENDPOINT_AP_COMMAND_TX] = { .ee_id = GSI_EE_AP, @@ -170,7 +170,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { }, }; -/* Source resource configuration data for the SDM845 SoC */ +/* Source resource configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_resource ipa_resource_src[] = { [IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = { .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { @@ -232,7 +232,7 @@ static const struct ipa_resource ipa_resource_src[] = { }, }; -/* Destination resource configuration data for the SDM845 SoC */ +/* Destination resource configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_resource ipa_resource_dst[] = { [IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = { .limits[IPA_RSRC_GROUP_DST_LWA_DL] = { @@ -258,7 +258,7 @@ static const struct ipa_resource ipa_resource_dst[] = { }, }; -/* Resource configuration for the SDM845 SoC. */ +/* Resource configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_resource_data ipa_resource_data = { .rsrc_group_src_count = IPA_RSRC_GROUP_SRC_COUNT, .rsrc_group_dst_count = IPA_RSRC_GROUP_DST_COUNT, @@ -268,7 +268,7 @@ static const struct ipa_resource_data ipa_resource_data = { .resource_dst = ipa_resource_dst, }; -/* IPA-resident memory region configuration for the SDM845 SoC. */ +/* IPA-resident memory region data for an SoC having IPA v3.5.1 */ static const struct ipa_mem ipa_mem_local_data[] = { [IPA_MEM_UC_SHARED] = { .offset = 0x0000, @@ -347,6 +347,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { }, }; +/* Memory configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_mem_data ipa_mem_data = { .local_count = ARRAY_SIZE(ipa_mem_local_data), .local = ipa_mem_local_data, @@ -376,14 +377,15 @@ static const struct ipa_interconnect_data ipa_interconnect_data[] = { }, }; +/* Clock and interconnect configuration data for an SoC having IPA v3.5.1 */ static const struct ipa_clock_data ipa_clock_data = { .core_clock_rate = 75 * 1000 * 1000, /* Hz */ .interconnect_count = ARRAY_SIZE(ipa_interconnect_data), .interconnect_data = ipa_interconnect_data, }; -/* Configuration data for the SDM845 SoC. */ -const struct ipa_data ipa_data_sdm845 = { +/* Configuration data for an SoC having IPA v3.5.1 */ +const struct ipa_data ipa_data_v3_5_1 = { .version = IPA_VERSION_3_5_1, .backward_compat = BCR_CMDQ_L_LACK_ONE_ENTRY_FMASK | BCR_TX_NOT_USING_BRESP_FMASK | diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 843d818f78e18..17cdc376e95f3 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -300,7 +300,7 @@ struct ipa_data { const struct ipa_clock_data *clock_data; }; -extern const struct ipa_data ipa_data_sdm845; +extern const struct ipa_data ipa_data_v3_5_1; extern const struct ipa_data ipa_data_sc7180; #endif /* _IPA_DATA_H_ */ diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index afb8eb5618f73..37e85a5ab75cf 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -578,7 +578,7 @@ static int ipa_firmware_load(struct device *dev) static const struct of_device_id ipa_match[] = { { .compatible = "qcom,sdm845-ipa", - .data = &ipa_data_sdm845, + .data = &ipa_data_v3_5_1, }, { .compatible = "qcom,sc7180-ipa", From patchwork Sun Mar 28 17:31:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410597 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042436jai; Sun, 28 Mar 2021 10:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymWRikGYyuOw/sFGHfMNPdoxc5fXjeDbXFTZKjZZ4XqQ6QxVQqdX/C5L/ayFSJFsHNXBGK X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr24511890edx.192.1616952723161; Sun, 28 Mar 2021 10:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952723; cv=none; d=google.com; s=arc-20160816; b=RoIcfvahPX2dW2+NpWuLeXJzugck3anL6xvTWE/bkbGHP8wH2XF8RuHsh7dMkTzxId 2n1K0sYaPelrjwZc65TIGexbAh1+X0ghvS6kmKJjsLlxP9FpaegNiqpAwT1vn0BEuFAx hMM4u+MshG3vSKGkAhO1DZO+Wgs6/dQHjUTK8dfiFWauc5YrbwJzE9+gRE2pZLnbjwGn qKzg8uzIn0M/UshvUNC43MmPjlbwsExwfd7b+yuYj8het4HZ6LvK4OiInlUa3QFfZ3in r1atTZaPygkKxcu7Kxqn1meF543e9B5Hzf7aUpWoLLJ/UTIWlUSBPxcBUZI1rYcOxpIw GAEA== 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=RJlB7tgkYTkIGLXxRrL2DthLYTanDKiXH10wP/0FvSQ=; b=0aXRjnBYQ6/JsWdH1dXCRiubDSPytE1VacQ1229VnUinF6A3s72nY/4CYuQxVYwCEx +TA/0ns3RrTIcEWDYFYdDLZ3R81DQcXvj5LKQCCi684WfGFRO6Zq1v6JG6W4j5uUzBpE Gfqe7WPTTqnH61PMi4K/Nv8B5EnJAPGfom19huu5mmhsLtjyUGiGx2MBxTJrSjL0N3XZ X2CdsYqiqw4Rt4Jm6weKzgoAIkdTPBcLpAUieSODBgbml3i72CvigM+RCysLvOJXn+vr aQ5QuV0BTatjA/SGCV/kfpbp6obIHrSx2/9CB9mV5pZ21p8WwinrJudHN99b2fRQO4F4 /QZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jBf2ve82; 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 h1si11289750edn.233.2021.03.28.10.32.02; Sun, 28 Mar 2021 10:32:03 -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=jBf2ve82; 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 S231526AbhC1Rbb (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbhC1RbU (ORCPT ); Sun, 28 Mar 2021 13:31:20 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DFC5C061762 for ; Sun, 28 Mar 2021 10:31:20 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id j26so10435418iog.13 for ; Sun, 28 Mar 2021 10:31:20 -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=RJlB7tgkYTkIGLXxRrL2DthLYTanDKiXH10wP/0FvSQ=; b=jBf2ve822qHmgJnO41QSGrnUaUkhYfYLT/qtY2pz9TTpipRZq8+eSPAwhsItQSVwF6 5yK7S14tnT7gDi7PmSUorUuojJEjyq4aBip570/0GcSxyPG5/EnGhq4GFPX2no3Sewjv IbomohZ0vB8HBK3GPoGNRe3ULQA10enmLJCDvQWiAvk4hy/B1olNvJwGWhXEsnC9bgAa bp6OuEGlq0ngmD8oTmGem9Bkfh5DyJ5RQ65nH79inTJWJrhSxUAYt2JsjuusOFI0saQ8 iVLHercNUmhlnBlvmuFF2dZvV2QewzbKXmKuSEh7m9Ts3+BsDFVuaHrQG5jeKSEn80cp 6vVw== 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=RJlB7tgkYTkIGLXxRrL2DthLYTanDKiXH10wP/0FvSQ=; b=ncEWIHVku/Dnx1OjOn5G5X/aHTpH3eO/RcQlGtajIlXe9+zQA5MGAR9Gk8sUCZoz58 vvlNmuQKgZJ1zJl4HPfUbzKJ/F3J3Ty0Z+XaTaZ1ME7nOssgTEXqe1QfYGutQTQx8fGA xJvUn8lmDNSieiCvMOJxNaV8GJUUMyMYwkmEFvW3AlT9cGkc+sEvfEBdNxuUa4wC5DWf Ft77OAjq4R9RtpaplV47XxckfWM9+09aOZ2hR3kX8s6Qu6AG5qixGWncPWKX5ZxOu7da MHuL3e8cTroV4CzOMdzx7wLyQ1RX069b7GZF9UCXZAibRh5VbfokmMXWCbmqrLcg084v 5DeA== X-Gm-Message-State: AOAM533qC4OhRKgxOKXG6HUwZs9C/+CcbnX6lVrg9ZOp5teb03mtB0nG /ntkR2fHhGN+eBPmp2lQSc3QrA== X-Received: by 2002:a02:6654:: with SMTP id l20mr20617712jaf.55.1616952679947; Sun, 28 Mar 2021 10:31:19 -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 d22sm8014422iof.48.2021.03.28.10.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:19 -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 5/7] net: ipa: use version based configuration for SC7180 Date: Sun, 28 Mar 2021 12:31:09 -0500 Message-Id: <20210328173111.3399063-6-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rename the SC7180 configuration data file so that its name is derived from its IPA version. Update a few other references to the code that talk about the SC7180 rather than just IPA v4.2. Signed-off-by: Alex Elder --- drivers/net/ipa/Makefile | 2 +- .../{ipa_data-sc7180.c => ipa_data-v4.2.c} | 24 ++++++++++--------- drivers/net/ipa/ipa_data.h | 2 +- drivers/net/ipa/ipa_main.c | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) rename drivers/net/ipa/{ipa_data-sc7180.c => ipa_data-v4.2.c} (90%) -- 2.27.0 diff --git a/drivers/net/ipa/Makefile b/drivers/net/ipa/Makefile index a4a42fc7b840e..6abd1db9fe330 100644 --- a/drivers/net/ipa/Makefile +++ b/drivers/net/ipa/Makefile @@ -9,4 +9,4 @@ ipa-y := ipa_main.o ipa_clock.o ipa_reg.o ipa_mem.o \ ipa_endpoint.o ipa_cmd.o ipa_modem.o \ ipa_resource.o ipa_qmi.o ipa_qmi_msg.o -ipa-y += ipa_data-v3.5.1.o ipa_data-sc7180.o +ipa-y += ipa_data-v3.5.1.o ipa_data-v4.2.o diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-v4.2.c similarity index 90% rename from drivers/net/ipa/ipa_data-sc7180.c rename to drivers/net/ipa/ipa_data-v4.2.c index 810c673be56ee..8744f19c64011 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-v4.2.c @@ -9,7 +9,7 @@ #include "ipa_endpoint.h" #include "ipa_mem.h" -/** enum ipa_resource_type - IPA resource types */ +/** enum ipa_resource_type - IPA resource types for an SoC having IPA v4.2 */ enum ipa_resource_type { /* Source resource types; first must have value 0 */ IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS = 0, @@ -23,7 +23,7 @@ enum ipa_resource_type { IPA_RESOURCE_TYPE_DST_DPS_DMARS, }; -/* Resource groups used for the SC7180 SoC */ +/* Resource groups used for an SoC having IPA v4.2 */ enum ipa_rsrc_group_id { /* Source resource group identifiers */ IPA_RSRC_GROUP_SRC_UL_DL = 0, @@ -34,7 +34,7 @@ enum ipa_rsrc_group_id { IPA_RSRC_GROUP_DST_COUNT, /* Last; not a destination group */ }; -/* QSB configuration for the SC7180 SoC. */ +/* QSB configuration data for an SoC having IPA v4.2 */ static const struct ipa_qsb_data ipa_qsb_data[] = { [IPA_QSB_MASTER_DDR] = { .max_writes = 8, @@ -43,7 +43,7 @@ static const struct ipa_qsb_data ipa_qsb_data[] = { }, }; -/* Endpoint configuration for the SC7180 SoC. */ +/* Endpoint configuration data for an SoC having IPA v4.2 */ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { [IPA_ENDPOINT_AP_COMMAND_TX] = { .ee_id = GSI_EE_AP, @@ -164,7 +164,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { }, }; -/* Source resource configuration data for the SC7180 SoC */ +/* Source resource configuration data for an SoC having IPA v4.2 */ static const struct ipa_resource ipa_resource_src[] = { [IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = { .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { @@ -193,7 +193,7 @@ static const struct ipa_resource ipa_resource_src[] = { }, }; -/* Destination resource configuration data for the SC7180 SoC */ +/* Destination resource configuration data for an SoC having IPA v4.2 */ static const struct ipa_resource ipa_resource_dst[] = { [IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = { .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = { @@ -207,7 +207,7 @@ static const struct ipa_resource ipa_resource_dst[] = { }, }; -/* Resource configuration for the SC7180 SoC. */ +/* Resource configuration data for an SoC having IPA v4.2 */ static const struct ipa_resource_data ipa_resource_data = { .rsrc_group_src_count = IPA_RSRC_GROUP_SRC_COUNT, .rsrc_group_dst_count = IPA_RSRC_GROUP_DST_COUNT, @@ -217,7 +217,7 @@ static const struct ipa_resource_data ipa_resource_data = { .resource_dst = ipa_resource_dst, }; -/* IPA-resident memory region configuration for the SC7180 SoC. */ +/* IPA-resident memory region data for an SoC having IPA v4.2 */ static const struct ipa_mem ipa_mem_local_data[] = { [IPA_MEM_UC_SHARED] = { .offset = 0x0000, @@ -311,6 +311,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { }, }; +/* Memory configuration data for an SoC having IPA v4.2 */ static const struct ipa_mem_data ipa_mem_data = { .local_count = ARRAY_SIZE(ipa_mem_local_data), .local = ipa_mem_local_data, @@ -320,7 +321,7 @@ static const struct ipa_mem_data ipa_mem_data = { .smem_size = 0x00002000, }; -/* Interconnect bandwidths are in 1000 byte/second units */ +/* Interconnect rates are in 1000 byte/second units */ static const struct ipa_interconnect_data ipa_interconnect_data[] = { { .name = "memory", @@ -340,14 +341,15 @@ static const struct ipa_interconnect_data ipa_interconnect_data[] = { }, }; +/* Clock and interconnect configuration data for an SoC having IPA v4.2 */ static const struct ipa_clock_data ipa_clock_data = { .core_clock_rate = 100 * 1000 * 1000, /* Hz */ .interconnect_count = ARRAY_SIZE(ipa_interconnect_data), .interconnect_data = ipa_interconnect_data, }; -/* Configuration data for the SC7180 SoC. */ -const struct ipa_data ipa_data_sc7180 = { +/* Configuration data for an SoC having IPA v4.2 */ +const struct ipa_data ipa_data_v4_2 = { .version = IPA_VERSION_4_2, /* backward_compat value is 0 */ .qsb_count = ARRAY_SIZE(ipa_qsb_data), diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 17cdc376e95f3..e97342e80d537 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -301,6 +301,6 @@ struct ipa_data { }; extern const struct ipa_data ipa_data_v3_5_1; -extern const struct ipa_data ipa_data_sc7180; +extern const struct ipa_data ipa_data_v4_2; #endif /* _IPA_DATA_H_ */ diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 37e85a5ab75cf..a970d10e650ef 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -582,7 +582,7 @@ static const struct of_device_id ipa_match[] = { }, { .compatible = "qcom,sc7180-ipa", - .data = &ipa_data_sc7180, + .data = &ipa_data_v4_2, }, { }, }; From patchwork Sun Mar 28 17:31:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410598 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042441jai; Sun, 28 Mar 2021 10:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2VeAQep7xisVclenKw9wyv2Bo3AaZIgHyd+F6VQkdr9IuFbf/R74yS03zX6Uzqv6b8FnQ X-Received: by 2002:aa7:d9c8:: with SMTP id v8mr24585248eds.9.1616952724000; Sun, 28 Mar 2021 10:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952723; cv=none; d=google.com; s=arc-20160816; b=Bzk2fpzCSLmeJyEj2ylTvQi9FaW3M8H9R/4aEUAa8HqY1VkGk2HwWepdwuNyDvUCg9 XAB5ga03N691LhV8sK0ln0Y/nt7KVr6s/1+lH2DxJ6vfxLeGjI4xjkA4J7qXZsbAoUGR df1oiOCRzW34ocu4OQ+KxwYbm/tkOCoRTbR6ZW941wi/t8hSdiBJfVMS5F23n6X3m/nQ Ff3lLrvN4XHyGvv/h0UWX8OnU0am8hkTk68r3wepaJBGQ6PGqEl8lZUmHH692uTArGop hqL6SVgVNta9lVLmm/axcwcuYO4FNdN0McRmVQFza+38k9RB/Y/v90bZQnYzhCqI1WsK 9m3w== 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=uEomFwGOriI2mXIXsdnZpwgRECmnsgSqNPpeNfLZcsc=; b=iGHLVCuAC+TiZCik99jL94hVphuLVxzli/0I+yMDS8Y/R4i0o5sTMR4asYK8fsXtls 9euYWNksGw6BgjQkOROle2ra87hTegFv3LBAm2E/awBw8DXU9it9ey9jKjFJK6XYC2Tb p4M4Agu0ite0zNB5GsvRK8M3KdlHLk5oAH7Q5PiBlzW/AZgHAw0bCh62m7Hn5DgeMqKg cAgh1JLIurdlyehIfOz/i5daEZRWjsfDsamve7v7DdtqamyyPTqijo0MZwMh/dw6zHrg mWztvhonDUu1wCZf3ebO55mVIqIk1ffW5Rf+87bKol1jIhREkJLhWdS7yFHMq4f2iemz feiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MbfdzYF9; 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 h1si11289750edn.233.2021.03.28.10.32.03; Sun, 28 Mar 2021 10:32:03 -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=MbfdzYF9; 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 S231535AbhC1Rbd (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231380AbhC1RbV (ORCPT ); Sun, 28 Mar 2021 13:31:21 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79447C061756 for ; Sun, 28 Mar 2021 10:31:21 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id y17so9345920ila.6 for ; Sun, 28 Mar 2021 10:31:21 -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=uEomFwGOriI2mXIXsdnZpwgRECmnsgSqNPpeNfLZcsc=; b=MbfdzYF9DKwBGZ4uh5K08EWewPAPi/UVMMlwalE05xNaQsxSOQoS6iAchVlpUeZ+SN tN6cl5mkxdgJAbhqUq9Kawjqy/bIkFuiOKb+x3RlYwDqNn1CYNPx2Ta0GLW9r3QLdx5v zxJEYHuUcb8b8+W89FDXzwAZp4g3hlcXJDrO0F+5j2nk9yHHsjLiFrx6cD6UoY1HtAvD /p0h4TSarVdENxzdaCEvlCQEYfdTRoYGpsqEH1h3+2JoMrHL+ttw21hY0Y4kOrxlptO6 0PWQVzhChqjak24gACNw7I0c5x4ImlPZp71pQ7a2uE/T+beXXKIK1sR0u791Ezwf8UVF xefw== 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=uEomFwGOriI2mXIXsdnZpwgRECmnsgSqNPpeNfLZcsc=; b=BseAwAVLGjkOyrDlO3h7Gn0F50CUTmwSo2JBHSlbTQ31RBjHHFrDRvng/tmtCiIO/Y EHlYwkRhYoaUfpj6NsF8t8exnOLCiJ/uwP6S6bxwI4BBhEA4Q9DWJVlgLOR51Q7KbzpH mV1MT40DkYPDOTr3Zdy9gAtFSmdl/in2iU6J3MKe+qc4NEAj9uMUC4INbmYKyiwmsQco yVrCzxXDnQBhUfdG+hI/4i/l/lsvuuH+QaV2fE7cuQlBCF2NJH/yFdrAFZ43drLpxwoI SLRjlqG1Z44GWFXgSooCEARs6eBHvHeTTbYY700j7IKWqEyFMQYoIYE9SkIfXJPexIWy ++eQ== X-Gm-Message-State: AOAM533XUtJiEpL4XgiX++RCu9hNpob7cUoYQQTDsIM7GAzB4zOFKe// Tq+xLxnjGSCXlXls24KsYUugvA== X-Received: by 2002:a05:6e02:20cd:: with SMTP id 13mr1454112ilq.126.1616952680864; Sun, 28 Mar 2021 10:31:20 -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 d22sm8014422iof.48.2021.03.28.10.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:20 -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, David Laight Subject: [PATCH net-next 6/7] net: ipa: DMA addresses are nicely aligned Date: Sun, 28 Mar 2021 12:31:10 -0500 Message-Id: <20210328173111.3399063-7-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A recent patch avoided doing 64-bit modulo operations by checking the alignment of some DMA allocations using only the lower 32 bits of the address. David Laight pointed out (after the fix was committed) that DMA allocations might already satisfy the alignment requirements. And he was right. Remove the alignment checks that occur after DMA allocation requests, and update comments to explain why the constraint is satisfied. The only place IPA_TABLE_ALIGN was used was to check the alignment; it is therefore no longer needed, so get rid of it. Add comments where GSI_RING_ELEMENT_SIZE and the tre_count and event_count channel data fields are defined to make explicit they are required to be powers of 2. Revise a comment in gsi_trans_pool_init_dma(), taking into account that dma_alloc_coherent() guarantees its result is aligned to a page size (or order thereof). Don't bother printing an error if a DMA allocation fails. Suggested-by: David Laight Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 13 ++++--------- drivers/net/ipa/gsi_private.h | 2 +- drivers/net/ipa/gsi_trans.c | 9 ++++----- drivers/net/ipa/ipa_data.h | 4 ++-- drivers/net/ipa/ipa_table.c | 24 ++++++------------------ 5 files changed, 17 insertions(+), 35 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 585574af36ecd..1c835b3e1a437 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1444,18 +1444,13 @@ static int gsi_ring_alloc(struct gsi *gsi, struct gsi_ring *ring, u32 count) dma_addr_t addr; /* Hardware requires a 2^n ring size, with alignment equal to size. - * The size is a power of 2, so we can check alignment using just - * the bottom 32 bits for a DMA address of any size. + * The DMA address returned by dma_alloc_coherent() is guaranteed to + * be a power-of-2 number of pages, which satisfies the requirement. */ ring->virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL); - if (ring->virt && lower_32_bits(addr) % size) { - dma_free_coherent(dev, size, ring->virt, addr); - dev_err(dev, "unable to alloc 0x%x-aligned ring buffer\n", - size); - return -EINVAL; /* Not a good error value, but distinct */ - } else if (!ring->virt) { + if (!ring->virt) return -ENOMEM; - } + ring->addr = addr; ring->count = count; diff --git a/drivers/net/ipa/gsi_private.h b/drivers/net/ipa/gsi_private.h index ed7bc26f85e9a..ea333a244cf5e 100644 --- a/drivers/net/ipa/gsi_private.h +++ b/drivers/net/ipa/gsi_private.h @@ -14,7 +14,7 @@ struct gsi_trans; struct gsi_ring; struct gsi_channel; -#define GSI_RING_ELEMENT_SIZE 16 /* bytes */ +#define GSI_RING_ELEMENT_SIZE 16 /* bytes; must be a power of 2 */ /* Return the entry that follows one provided in a transaction pool */ void *gsi_trans_pool_next(struct gsi_trans_pool *pool, void *element); diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 6c3ed5b17b80c..70c2b585f98d6 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -153,11 +153,10 @@ int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool, size = __roundup_pow_of_two(size); total_size = (count + max_alloc - 1) * size; - /* The allocator will give us a power-of-2 number of pages. But we - * can't guarantee that, so request it. That way we won't waste any - * memory that would be available beyond the required space. - * - * Note that gsi_trans_pool_exit_dma() assumes the total allocated + /* The allocator will give us a power-of-2 number of pages + * sufficient to satisfy our request. Round up our requested + * size to avoid any unused space in the allocation. This way + * gsi_trans_pool_exit_dma() can assume the total allocated * size is exactly (count * size). */ total_size = get_order(total_size) << PAGE_SHIFT; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index e97342e80d537..769f68923527f 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -90,8 +90,8 @@ struct ipa_qsb_data { * that can be included in a single transaction. */ struct gsi_channel_data { - u16 tre_count; - u16 event_count; + u16 tre_count; /* must be a power of 2 */ + u16 event_count; /* must be a power of 2 */ u8 tlv_count; }; diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index 4236a50ff03ae..d9538661755f4 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -96,9 +96,6 @@ * ---------------------- */ -/* IPA hardware constrains filter and route tables alignment */ -#define IPA_TABLE_ALIGN 128 /* Minimum table alignment */ - /* Assignment of route table entries to the modem and AP */ #define IPA_ROUTE_MODEM_MIN 0 #define IPA_ROUTE_MODEM_COUNT 8 @@ -652,26 +649,17 @@ int ipa_table_init(struct ipa *ipa) ipa_table_validate_build(); + /* The IPA hardware requires route and filter table rules to be + * aligned on a 128-byte boundary. We put the "zero rule" at the + * base of the table area allocated here. The DMA address returned + * by dma_alloc_coherent() is guaranteed to be a power-of-2 number + * of pages, which satisfies the rule alignment requirement. + */ size = IPA_ZERO_RULE_SIZE + (1 + count) * IPA_TABLE_ENTRY_SIZE; virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL); if (!virt) return -ENOMEM; - /* We put the "zero rule" at the base of our table area. The IPA - * hardware requires route and filter table rules to be aligned - * on a 128-byte boundary. As long as the alignment constraint - * is a power of 2, we can check alignment using just the bottom - * 32 bits for a DMA address of any size. - */ - BUILD_BUG_ON(!is_power_of_2(IPA_TABLE_ALIGN)); - if (lower_32_bits(addr) % IPA_TABLE_ALIGN) { - dev_err(dev, "table address %pad not %u-byte aligned\n", - &addr, IPA_TABLE_ALIGN); - dma_free_coherent(dev, size, virt, addr); - - return -ERANGE; - } - ipa->table_virt = virt; ipa->table_addr = addr; From patchwork Sun Mar 28 17:31:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 410599 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3042630jai; Sun, 28 Mar 2021 10:32:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoO9AhyV73FTlRdyw/LfX5yhCWeoeVAsbqkjRsG1P+vyk47AoK0S0FlhnVjCPakGM8Npu3 X-Received: by 2002:a17:906:3c46:: with SMTP id i6mr25601570ejg.80.1616952748002; Sun, 28 Mar 2021 10:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616952747; cv=none; d=google.com; s=arc-20160816; b=V+9kRYVmKEUN+zgR7htU+XZ3+DMc9mYCaJhWFlD0MEu5qbMA2qG7aJ7vproD/nXiEU PM9+eVwOAYJT6Xgm0BasOF0kF+7jFg0UGJ6skF4rHro3UtRwwHmrSqGmBH87mbUk9yOW pRsziYJCd/hKc7NrltbioL7MURT26TO1iW3A8ebpaLpJNbAGBPPnkVET5jJkJupw61zb jbQrY5AfVlhF6y/XQHlZcSt63teYH6d+UNrVbIIKAqBU4F/sor9mn4ynranjU2S6mtKd l86QMsIkYm9aK1Ae71dZlHwyrBnvbv7CZ/ZpjHFAiINNCuYYq/W+Be/5NSWSR6pBD6/f 37OQ== 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=SNiUzqwIGoJ8Lmz4c1CZDsu491SmbNxBdZwDX7gQyfE=; b=ELVmNr4MArFPP9vWpoeGDe8i7xakjwwKT+uJAdfmpI3hfAOVYckVKCcJAacfHQ7raa nqCr/2BNVe+XygsaogD/PWIYTZIqp5weKKMP+OJGPagiY/IO5LjWOBNWcfTjZRdkOmok GM3VNni2Q4awhRTl3lgCvOf9YDdF1s3FiBtI+xL/dhU1UV+4Cj2yKwNxqmLxzcP/iTnc tS7fil/Gc9VzYCN9EpdFnB01Ogjfl2EFuwOS7BC/sXKnycO8SP+n+W+Xrn1A/OTa+Vyd S8oXShMOUIIFNarcZLC83u/BkXyHbQ6eoEHFgqXNqHyNWdR6nUN96G+5mCu/ADX4qyTm CwUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B+L802KG; 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 hd8si11195679ejc.78.2021.03.28.10.32.27; Sun, 28 Mar 2021 10:32:27 -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=B+L802KG; 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 S231570AbhC1Rbz (ORCPT + 8 others); Sun, 28 Mar 2021 13:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbhC1RbW (ORCPT ); Sun, 28 Mar 2021 13:31:22 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F87C061762 for ; Sun, 28 Mar 2021 10:31:22 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id k25so10470461iob.6 for ; Sun, 28 Mar 2021 10:31:22 -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=SNiUzqwIGoJ8Lmz4c1CZDsu491SmbNxBdZwDX7gQyfE=; b=B+L802KGDYd9n4sIfhgP3o8NraIvIStaKhExGlvIr+TuyVfaZARHGqFZ78fA67OzUQ 3IVqqja3LM0tmT4QlWrYh9zWBfFKDt9aw42Htsa9Ai3czUGtAJn4dkFmuNJrf7yODgBX v/ArR5IvQmnUjd5OG2RU1zYkPNUT/bSVsJ8InFJWoFROpmEZt1c8tTRu/vkhyVQPWgF5 TQ9PXfBGd8OslUZi+YQ+atTdAQCX4R+wF62SXP7lgpEd+bNpSfFA7l4D9I5ESyZVSVRt FY3UBujr4dynHRisEqPt+HzAJ7jYc7DKX6dU0eGnRrFg6QEgwZUrW4kJcEmL+k05Qsil BSrg== 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=SNiUzqwIGoJ8Lmz4c1CZDsu491SmbNxBdZwDX7gQyfE=; b=ibVlzD/abzYOY/NtrAlh516I2vOaNDYPbkJXGgnAE4NrH8BHkrdtdkETLQGyoncVIJ E1JezMBzk7Bv5DRa9wQjYg4P2QAEt0BPMY/nQ58v/9heV/grS2cfwqjCsVPYsQI9L+mw u1Jt5hIunvjBQA5wVyob/rQmjU5MJtXMYLgi+e19hxTI75IjmGl6ouBBm75MSAXQ2eUD ZLtYJ3sQ/ak1qglwHWxuPaYYSyHcEWBPMOouNha37zFGUwwGy0srUP2sZDWtUaqC9FgB 6C5eTuT4QiMo9CQRGSaB+ngP7a6JsTCFCakIXHn/MDGg6E5Ac6jmDVb+m351B/Vc3hxl gkaA== X-Gm-Message-State: AOAM530aIt7OJqAMUsdQ+8BO0IScbL+lbu8SyE+q1LWHLOc5AwANSQrY P0t8oUyLiWwuSy2pcAUQBpbv7A== X-Received: by 2002:a6b:bf07:: with SMTP id p7mr5739440iof.15.1616952681770; Sun, 28 Mar 2021 10:31:21 -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 d22sm8014422iof.48.2021.03.28.10.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 10:31:21 -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 7/7] net: ipa: kill IPA_TABLE_ENTRY_SIZE Date: Sun, 28 Mar 2021 12:31:11 -0500 Message-Id: <20210328173111.3399063-8-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210328173111.3399063-1-elder@linaro.org> References: <20210328173111.3399063-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Entries in an IPA route or filter table are 64-bit little-endian addresses, each of which refers to a routing or filtering rule. The format of these table slots are fixed, but IPA_TABLE_ENTRY_SIZE is used to define their size. This symbol doesn't really add value, and I think it unnecessarily obscures what a table entry *is*. So get rid of IPA_TABLE_ENTRY_SIZE, and just use sizeof(__le64) in its place throughout the code. Update the comments in "ipa_table.c" to provide a little better explanation of these table slots. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 2 +- drivers/net/ipa/ipa_qmi.c | 10 +++---- drivers/net/ipa/ipa_table.c | 59 +++++++++++++++++++++---------------- drivers/net/ipa/ipa_table.h | 3 -- 4 files changed, 39 insertions(+), 35 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index 2ac6dd8413dee..525cdf28d9ea7 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -153,7 +153,7 @@ static void ipa_cmd_validate_build(void) * of entries, as and IPv4 and IPv6 route tables have the same number * of entries. */ -#define TABLE_SIZE (TABLE_COUNT_MAX * IPA_TABLE_ENTRY_SIZE) +#define TABLE_SIZE (TABLE_COUNT_MAX * sizeof(__le64)) #define TABLE_COUNT_MAX max_t(u32, IPA_ROUTE_COUNT_MAX, IPA_FILTER_COUNT_MAX) BUILD_BUG_ON(TABLE_SIZE > field_max(IP_FLTRT_FLAGS_HASH_SIZE_FMASK)); BUILD_BUG_ON(TABLE_SIZE > field_max(IP_FLTRT_FLAGS_NHASH_SIZE_FMASK)); diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c index ccdb4a6a4c75b..593665efbcf99 100644 --- a/drivers/net/ipa/ipa_qmi.c +++ b/drivers/net/ipa/ipa_qmi.c @@ -308,12 +308,12 @@ init_modem_driver_req(struct ipa_qmi *ipa_qmi) mem = &ipa->mem[IPA_MEM_V4_ROUTE]; req.v4_route_tbl_info_valid = 1; req.v4_route_tbl_info.start = ipa->mem_offset + mem->offset; - req.v4_route_tbl_info.count = mem->size / IPA_TABLE_ENTRY_SIZE; + req.v4_route_tbl_info.count = mem->size / sizeof(__le64); mem = &ipa->mem[IPA_MEM_V6_ROUTE]; req.v6_route_tbl_info_valid = 1; req.v6_route_tbl_info.start = ipa->mem_offset + mem->offset; - req.v6_route_tbl_info.count = mem->size / IPA_TABLE_ENTRY_SIZE; + req.v6_route_tbl_info.count = mem->size / sizeof(__le64); mem = &ipa->mem[IPA_MEM_V4_FILTER]; req.v4_filter_tbl_start_valid = 1; @@ -352,8 +352,7 @@ init_modem_driver_req(struct ipa_qmi *ipa_qmi) req.v4_hash_route_tbl_info_valid = 1; req.v4_hash_route_tbl_info.start = ipa->mem_offset + mem->offset; - req.v4_hash_route_tbl_info.count = - mem->size / IPA_TABLE_ENTRY_SIZE; + req.v4_hash_route_tbl_info.count = mem->size / sizeof(__le64); } mem = &ipa->mem[IPA_MEM_V6_ROUTE_HASHED]; @@ -361,8 +360,7 @@ init_modem_driver_req(struct ipa_qmi *ipa_qmi) req.v6_hash_route_tbl_info_valid = 1; req.v6_hash_route_tbl_info.start = ipa->mem_offset + mem->offset; - req.v6_hash_route_tbl_info.count = - mem->size / IPA_TABLE_ENTRY_SIZE; + req.v6_hash_route_tbl_info.count = mem->size / sizeof(__le64); } mem = &ipa->mem[IPA_MEM_V4_FILTER_HASHED]; diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index d9538661755f4..401b568df6a34 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -27,28 +27,38 @@ /** * DOC: IPA Filter and Route Tables * - * The IPA has tables defined in its local shared memory that define filter - * and routing rules. Each entry in these tables contains a 64-bit DMA - * address that refers to DRAM (system memory) containing a rule definition. + * The IPA has tables defined in its local (IPA-resident) memory that define + * filter and routing rules. An entry in either of these tables is a little + * endian 64-bit "slot" that holds the address of a rule definition. (The + * size of these slots is 64 bits regardless of the host DMA address size.) + * + * Separate tables (both filter and route) used for IPv4 and IPv6. There + * are normally another set of "hashed" filter and route tables, which are + * used with a hash of message metadata. Hashed operation is not supported + * by all IPA hardware (IPA v4.2 doesn't support hashed tables). + * + * Rules can be in local memory or in DRAM (system memory). The offset of + * an object (such as a route or filter table) in IPA-resident memory must + * 128-byte aligned. An object in system memory (such as a route or filter + * rule) must be at an 8-byte aligned address. We currently only place + * route or filter rules in system memory. + * * A rule consists of a contiguous block of 32-bit values terminated with * 32 zero bits. A special "zero entry" rule consisting of 64 zero bits * represents "no filtering" or "no routing," and is the reset value for - * filter or route table rules. Separate tables (both filter and route) - * used for IPv4 and IPv6. Additionally, there can be hashed filter or - * route tables, which are used when a hash of message metadata matches. - * Hashed operation is not supported by all IPA hardware. + * filter or route table rules. * * Each filter rule is associated with an AP or modem TX endpoint, though - * not all TX endpoints support filtering. The first 64-bit entry in a + * not all TX endpoints support filtering. The first 64-bit slot in a * filter table is a bitmap indicating which endpoints have entries in * the table. The low-order bit (bit 0) in this bitmap represents a * special global filter, which applies to all traffic. This is not * used in the current code. Bit 1, if set, indicates that there is an - * entry (i.e. a DMA address referring to a rule) for endpoint 0 in the - * table. Bit 2, if set, indicates there is an entry for endpoint 1, - * and so on. Space is set aside in IPA local memory to hold as many - * filter table entries as might be required, but typically they are not - * all used. + * entry (i.e. slot containing a system address referring to a rule) for + * endpoint 0 in the table. Bit 3, if set, indicates there is an entry + * for endpoint 2, and so on. Space is set aside in IPA local memory to + * hold as many filter table entries as might be required, but typically + * they are not all used. * * The AP initializes all entries in a filter table to refer to a "zero" * entry. Once initialized the modem and AP update the entries for @@ -122,8 +132,7 @@ static void ipa_table_validate_build(void) * code in ipa_table_init() uses a pointer to __le64 to * initialize tables. */ - BUILD_BUG_ON(sizeof(dma_addr_t) > IPA_TABLE_ENTRY_SIZE); - BUILD_BUG_ON(sizeof(__le64) != IPA_TABLE_ENTRY_SIZE); + BUILD_BUG_ON(sizeof(dma_addr_t) > sizeof(__le64)); /* A "zero rule" is used to represent no filtering or no routing. * It is a 64-bit block of zeroed memory. Code in ipa_table_init() @@ -154,7 +163,7 @@ ipa_table_valid_one(struct ipa *ipa, bool route, bool ipv6, bool hashed) else mem = hashed ? &ipa->mem[IPA_MEM_V4_ROUTE_HASHED] : &ipa->mem[IPA_MEM_V4_ROUTE]; - size = IPA_ROUTE_COUNT_MAX * IPA_TABLE_ENTRY_SIZE; + size = IPA_ROUTE_COUNT_MAX * sizeof(__le64); } else { if (ipv6) mem = hashed ? &ipa->mem[IPA_MEM_V6_FILTER_HASHED] @@ -162,7 +171,7 @@ ipa_table_valid_one(struct ipa *ipa, bool route, bool ipv6, bool hashed) else mem = hashed ? &ipa->mem[IPA_MEM_V4_FILTER_HASHED] : &ipa->mem[IPA_MEM_V4_FILTER]; - size = (1 + IPA_FILTER_COUNT_MAX) * IPA_TABLE_ENTRY_SIZE; + size = (1 + IPA_FILTER_COUNT_MAX) * sizeof(__le64); } if (!ipa_cmd_table_valid(ipa, mem, route, ipv6, hashed)) @@ -261,8 +270,8 @@ static void ipa_table_reset_add(struct gsi_trans *trans, bool filter, if (filter) first++; /* skip over bitmap */ - offset = mem->offset + first * IPA_TABLE_ENTRY_SIZE; - size = count * IPA_TABLE_ENTRY_SIZE; + offset = mem->offset + first * sizeof(__le64); + size = count * sizeof(__le64); addr = ipa_table_addr(ipa, false, count); ipa_cmd_dma_shared_mem_add(trans, offset, size, addr, true); @@ -444,11 +453,11 @@ static void ipa_table_init_add(struct gsi_trans *trans, bool filter, count = hweight32(ipa->filter_map); hash_count = hash_mem->size ? count : 0; } else { - count = mem->size / IPA_TABLE_ENTRY_SIZE; - hash_count = hash_mem->size / IPA_TABLE_ENTRY_SIZE; + count = mem->size / sizeof(__le64); + hash_count = hash_mem->size / sizeof(__le64); } - size = count * IPA_TABLE_ENTRY_SIZE; - hash_size = hash_count * IPA_TABLE_ENTRY_SIZE; + size = count * sizeof(__le64); + hash_size = hash_count * sizeof(__le64); addr = ipa_table_addr(ipa, filter, count); hash_addr = ipa_table_addr(ipa, filter, hash_count); @@ -655,7 +664,7 @@ int ipa_table_init(struct ipa *ipa) * by dma_alloc_coherent() is guaranteed to be a power-of-2 number * of pages, which satisfies the rule alignment requirement. */ - size = IPA_ZERO_RULE_SIZE + (1 + count) * IPA_TABLE_ENTRY_SIZE; + size = IPA_ZERO_RULE_SIZE + (1 + count) * sizeof(__le64); virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL); if (!virt) return -ENOMEM; @@ -687,7 +696,7 @@ void ipa_table_exit(struct ipa *ipa) struct device *dev = &ipa->pdev->dev; size_t size; - size = IPA_ZERO_RULE_SIZE + (1 + count) * IPA_TABLE_ENTRY_SIZE; + size = IPA_ZERO_RULE_SIZE + (1 + count) * sizeof(__le64); dma_free_coherent(dev, size, ipa->table_virt, ipa->table_addr); ipa->table_addr = 0; diff --git a/drivers/net/ipa/ipa_table.h b/drivers/net/ipa/ipa_table.h index e14108ed62bdd..018045b95aad8 100644 --- a/drivers/net/ipa/ipa_table.h +++ b/drivers/net/ipa/ipa_table.h @@ -10,9 +10,6 @@ struct ipa; -/* The size of a filter or route table entry */ -#define IPA_TABLE_ENTRY_SIZE sizeof(__le64) /* Holds a physical address */ - /* The maximum number of filter table entries (IPv4, IPv6; hashed or not) */ #define IPA_FILTER_COUNT_MAX 14