From patchwork Mon Aug 30 09:36:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12464795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51511C4320E for ; Mon, 30 Aug 2021 09:37:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 359B061058 for ; Mon, 30 Aug 2021 09:37:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235837AbhH3JiV (ORCPT ); Mon, 30 Aug 2021 05:38:21 -0400 Received: from mail-bn8nam08on2081.outbound.protection.outlook.com ([40.107.100.81]:50881 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235787AbhH3JiU (ORCPT ); Mon, 30 Aug 2021 05:38:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azr6HFkbYLUV6cknZNOt+TkdD/qrZxnsgK3CBgjyH2YTRENRbM1uoG/XnP6m5t0dv3yYqMzGreqR8OgP7Q1g6MH1odVcAPHW5kI0qYRLh5aKn7UcUhyu6tF8SL1f778CSSehtg7ZLdg2ebfG28wqgwqdfs0ihOb9HpSJSKtBsa6bNPmRw59Pl5DEegbBbv6Q2T3JJDVCLe+J8S5+Aj4CRpcWDJMJl+S+1OgEv55OQ4WumTARL8f0EsYRJ1NuCaDl25S949H4BqKabQZ5ajqHlTB+VvVjfoMdu7XoFVEi7OUvDvPAqXP3oyRtROICBf3jbSrHFy8WrasPPDUNCSF3UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrJWDe3XgY63qao6AujTjDS7YjQrF4de2NAWEp9lUYU=; b=CgBBUX0YktFDcUePYtKh63BpeGdGZZ8s/Wr6qRV/t90CGhnuDWeHYQnqyNdiHPX0TiphjGiFIGaRxz79f3g0cJpqSQqdt1xWAg5sN3zU6kDffjXn+prZlmMztZJhfzX9O4a8w4QtqHGwc+vLbiss4d8PtAPw7wQSpSBHphZwjz+U3zBPGcV4iaM2X4ZObPl0K0iFf4jl272FUftcEBjyBfu8O7soA9aaYRRXmdKKtsfFdOmJ3gqC9bpmfn9hzn4KYv2drid16FDTZIxdx7uY861lWns3XCOCPNEPcSAag/DF9R2eslDhwifEWzuVK6LWe24lcYPYAleN0lYQTqjq8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrJWDe3XgY63qao6AujTjDS7YjQrF4de2NAWEp9lUYU=; b=h0hwW2YI7nkruq+qGRu01cXxLgR0DUUHX4J25z7CS16FgdRbbhV48ycTzrWJ/RyDsfRRtcIjP7kLgnr+JDLZoe9lgQeDU1exa50Ey/CDZ5fW29NNitR1m61jraMargKvEhSke4Nc72kCLoLFEci9EjBQLr6oux281qxQBCBnP+lVD1FEHdHtYaevfxQWFtCNIBH42GWjuKHOa6Hlm4bLdonTlhzo9fKhuwe1Bfz3Gr5NKcsPe8354gPPUM/d6C7GtX3PkyH6i8qKOzpMGj2fCsa1RpuXbWYr3j53yRTUiKkgjUf0eIpsP7lZPor1QFwJqdcAZGcOSjnWhjpPo1oIkg== Received: from BN6PR12CA0035.namprd12.prod.outlook.com (2603:10b6:405:70::21) by BY5PR12MB4084.namprd12.prod.outlook.com (2603:10b6:a03:205::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 09:37:25 +0000 Received: from BN8NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:405:70:cafe::5c) by BN6PR12CA0035.outlook.office365.com (2603:10b6:405:70::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Mon, 30 Aug 2021 09:37:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT063.mail.protection.outlook.com (10.13.177.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4457.17 via Frontend Transport; Mon, 30 Aug 2021 09:37:24 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Aug 2021 09:37:23 +0000 Received: from audio.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.12) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 30 Aug 2021 09:37:21 +0000 From: Sameer Pujar To: , , , CC: , , , Sameer Pujar Subject: [PATCH 1/3] dmaengine: tegra210-adma: Re-order 'has_outstanding_reqs' member Date: Mon, 30 Aug 2021 15:06:59 +0530 Message-ID: <1630316221-9728-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1630316221-9728-1-git-send-email-spujar@nvidia.com> References: <1630316221-9728-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d6621db-6535-4cd6-916c-08d96b99c5ca X-MS-TrafficTypeDiagnostic: BY5PR12MB4084: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OT089bpbXQXTd1gW5EzVqDWuVLlQd05HraQR/KZX9WNSz2Nfc6Ikt9GiV7JS19FGAgMQUfeYAtWALMmowFciwwY+ly316MivKNmKDU7Gkc/1gzdaX3xSity9lg80EIECVwQxaGPIe1+Fieu8abxYKbNbrPjpv9LgQKxJDe1H5pMZ1DDYGQqStYX+w3JKsvkUlKEz+VfbIY0+ZZ9mA0v+rRMbiWnD1Czlqbx6lcj1WO2Wm6PN/yx5vTUpEFgDc7IXyFTYZQOQ1i5k2eSoU+dlEUJXKMBX6ws0T4DlnWBEy/FXxA+gM14ZiZXiXPUef4kaRjnGdiE78G/Mngm15yc8ejQbsApNt4GB4hmasHfvv3HdPP7b/681F66kvqwf8PgJnGZ2wyR8BxGPYYrbs5/2qVS5COQgGyDYSNl1c2rmwwhbV80k6mkZVZqaBJD+HND43muaCYEJFCYbDPmLev4veSgmCnDuh8m9ILg1oyuCKfSzFliv7fgAv4PmbKbpsHpVL6oJx62dCJmz9YiHta3sqzESIW61iLFpEMErVSFhIrHcOS+k+DsFOZOGsEQGIg89JGY7sd0ZSdH7kspy16+YTwUJCPzs1yUohw/UvO9Vu16VpyHcjR4cxx83q2XFmyKs29TFwK+RywL6ABDBYrLw7lCbWcDQ+09xTXcMn47pBzAGcQffahsESZtefuRHVG2DjErj6ibdD3xb7fcB5s3JtV+59GEi5KznMjymGZR0fzg= X-Forefront-Antispam-Report: CIP:216.228.112.35;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid04.nvidia.com;CAT:NONE;SFS:(4636009)(346002)(39860400002)(396003)(136003)(376002)(46966006)(36840700001)(36756003)(186003)(82310400003)(2616005)(26005)(2906002)(5660300002)(47076005)(82740400003)(8936002)(478600001)(426003)(6666004)(8676002)(336012)(356005)(316002)(4326008)(36906005)(7636003)(110136005)(36860700001)(83380400001)(54906003)(107886003)(70586007)(70206006)(7696005)(86362001)(169823001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 09:37:24.0582 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d6621db-6535-4cd6-916c-08d96b99c5ca X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.35];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4084 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org The 'has_outstanding_reqs' member description order in structure 'tegra_adma_chip_data' does not match with the corresponding member declaration. The same is true for member assignment in chip data structures declared for Tegra210 and Tegra186. This is a trivial fix to re-order the mentioned member for a better readability. Fixes: 9ec691f48b5e ("dmaengine: tegra210-adma: fix transfer failure") Signed-off-by: Sameer Pujar --- drivers/dma/tegra210-adma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index b1115a6..caf200e 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -78,12 +78,12 @@ struct tegra_adma; * @ch_req_tx_shift: Register offset for AHUB transmit channel select. * @ch_req_rx_shift: Register offset for AHUB receive channel select. * @ch_base_offset: Register offset of DMA channel registers. - * @has_outstanding_reqs: If DMA channel can have outstanding requests. * @ch_fifo_ctrl: Default value for channel FIFO CTRL register. * @ch_req_mask: Mask for Tx or Rx channel select. * @ch_req_max: Maximum number of Tx or Rx channels available. * @ch_reg_size: Size of DMA channel register space. * @nr_channels: Number of DMA channels available. + * @has_outstanding_reqs: If DMA channel can have outstanding requests. */ struct tegra_adma_chip_data { unsigned int (*adma_get_burst_config)(unsigned int burst_size); @@ -782,12 +782,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = { .ch_req_tx_shift = 28, .ch_req_rx_shift = 24, .ch_base_offset = 0, - .has_outstanding_reqs = false, .ch_fifo_ctrl = TEGRA210_FIFO_CTRL_DEFAULT, .ch_req_mask = 0xf, .ch_req_max = 10, .ch_reg_size = 0x80, .nr_channels = 22, + .has_outstanding_reqs = false, }; static const struct tegra_adma_chip_data tegra186_chip_data = { @@ -797,12 +797,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = { .ch_req_tx_shift = 27, .ch_req_rx_shift = 22, .ch_base_offset = 0x10000, - .has_outstanding_reqs = true, .ch_fifo_ctrl = TEGRA186_FIFO_CTRL_DEFAULT, .ch_req_mask = 0x1f, .ch_req_max = 20, .ch_reg_size = 0x100, .nr_channels = 32, + .has_outstanding_reqs = true, }; static const struct of_device_id tegra_adma_of_match[] = { From patchwork Mon Aug 30 09:37:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12464797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6756CC4320E for ; Mon, 30 Aug 2021 09:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EDF161039 for ; Mon, 30 Aug 2021 09:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235901AbhH3JiY (ORCPT ); Mon, 30 Aug 2021 05:38:24 -0400 Received: from mail-bn1nam07on2069.outbound.protection.outlook.com ([40.107.212.69]:10657 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235839AbhH3JiV (ORCPT ); Mon, 30 Aug 2021 05:38:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ANryIouSyn9kcN8DRjEYdkXfJY+WfTP+okktUO1rg4BAX+UsGlazYcDGwThA22pcpqJ/x7p1TGKtHIHq8Eu/SKwVcMh3KVTN9aVkDBQ0YSgFahau0fNCtDyLiGykGVz+7eVytBcjNaoR4V3bT/Zie0xHoWv52DBelbHDKE5pJxARiGw39Ut1FB3fp1KD3QLO7SilVFwafQ+1b+BJDDdQAsafMiqd9XUPYVmHNK6EFgtLcpL6ZLryYj22pC56c53wjmg+LREAXqvnNkXWOZVEj1jYuFwjrkWqwATP8Wzgm1D31LoHFbj+TTQShRu5uKeqvCYcEHhqzGGdkPK3z4/dfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=grzgjKM00vgz83vYDKMdbVU+EN9O8y0EHhQGjbrKRUo=; b=fmLPpcRUIPjXgpoSXdXQvxLkKDSKlHzw8LWRj/6QSDUtMqTH+QrwPzFfESjgA5okInVJEhNHpzK2BmQ/QKUj4x2Eq49gTqvkrxHQZ426nhWMYeMEqd0sOdrJMu0IUZlmwAeceHlaGgnytOnYvoSk/Fv3R/nqUmwn8NKPMRGiPe8SjWik6RU2LqAMoupisx4NYmEB1XhrDJNJp00yQTK8UsCq5Ens4xzVYKRk1/19DNbHFQ4eXo23meio+mVwBvp+NOkluzK8wHWd/OrQktvW1a9tfHFCBBrfbijUdz61AloWFeQshfTWzj4pgZnDWn9XkhEW30MYPv9QQ8ZoSKWqKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=grzgjKM00vgz83vYDKMdbVU+EN9O8y0EHhQGjbrKRUo=; b=PuLzDDUI/EnlHBxmDNkiVTSPNCFxVBjPi94zFuwFFX4pJK9qBbZ4DI6+cH91uGkAEXgNiU4VqzGn2WBuB6V1UnH/egFxjNxdN9Msl4u/TLfaG8ZIQjccvVXL5QlRalHvSwiQru6x3gEs2GupMKOzn4bgsta6cnZiSEEromfr+Br8FdcYEnbVVYh0w0OnlHgxrH4m1MyPlQMVrFTz+4NgiFELFKq9wdtR2kN5oBDnhL5o9hxmI7xfXyCdGexej7ys1SqpolIYQPrqkIIgG5qObzkUFNNv3IeZPUdikuoGEdph2FrvogEc76cxbIi8PyJoK1GlERep+eP1+XWwH2zgOA== Received: from BN9PR03CA0243.namprd03.prod.outlook.com (2603:10b6:408:ff::8) by SN6PR12MB2848.namprd12.prod.outlook.com (2603:10b6:805:77::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18; Mon, 30 Aug 2021 09:37:26 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ff:cafe::97) by BN9PR03CA0243.outlook.office365.com (2603:10b6:408:ff::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Mon, 30 Aug 2021 09:37:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4457.17 via Frontend Transport; Mon, 30 Aug 2021 09:37:26 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Aug 2021 09:37:25 +0000 Received: from audio.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.12) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 30 Aug 2021 09:37:23 +0000 From: Sameer Pujar To: , , , CC: , , , Sameer Pujar Subject: [PATCH 2/3] dmaengine: tegra210-adma: Add description for 'adma_get_burst_config' Date: Mon, 30 Aug 2021 15:07:00 +0530 Message-ID: <1630316221-9728-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1630316221-9728-1-git-send-email-spujar@nvidia.com> References: <1630316221-9728-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a692182-9e1c-4d65-c34e-08d96b99c760 X-MS-TrafficTypeDiagnostic: SN6PR12MB2848: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2+JsdvKTd/fpzJKAwccBGOlIjHAKrXrceR/luB9ZSz/GYIWRdmbDaWU3npzZ48lCsmh4oqrI4zmCwPfaeDwQYb5F8ZJwd2P22D1axT/HbQC6unZTpgMbCQ5DGo1HvPvJBdf+2u8aNTqKAnnkLOYHs35C3FElD1QSvj/GU4NUDH5AGfof+VjHrbOlDUkeYE9KMdRB7OALajqQ6cO0wI86sguU76sJ1RpJNRWxzyjbRS+z4CDYbB+yFvpEIt+SDtr2ELP7/gSfQBTIGTZwwaXEpg/zURBjSsZF3sfDtMM3UEwWFIhTpcWjYBX2t43Ehg5EjSEbRxqul+ukamV2TophLYgBskcObLy7+nat7MFAlxMJuv3ls8eSXiRJO/urNHCfcxTCrQHswZBKbD/e64pC+e98BrlIZap9HfG+P8q1FpFyvwGvJKOtmqCy/YG5oIS7cZQHyYloFpszRs0+OoU87WlD4OHXaYqg7QFatX5aRllAiJTRvadwjO+COBsm0VzJuLGAh8N1cWC38agh1fLvclqoQLmI4VShhVtGl1yrxU9gOiJINJZAqjGi26p8mC5gXCXjWe/QExDy9uCBEjjpPr8ZGU74gYE9VM2rmOj40xzyjptF/Il6AnVvoVGIIwrqQV2sd6e9zGGkBZAIfX+YvVZ1ptJuBZjlZzq7hqqaHqdxEUNjaDyJdTkFTvOuGUzxbJb5wN0q1lEk96iN+8TScg== X-Forefront-Antispam-Report: CIP:216.228.112.34;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid03.nvidia.com;CAT:NONE;SFS:(4636009)(136003)(346002)(376002)(39860400002)(396003)(46966006)(36840700001)(186003)(478600001)(8936002)(8676002)(356005)(7636003)(5660300002)(426003)(336012)(26005)(36756003)(6666004)(82740400003)(4744005)(2616005)(86362001)(4326008)(36906005)(82310400003)(47076005)(2906002)(54906003)(107886003)(7696005)(110136005)(70586007)(70206006)(36860700001)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 09:37:26.7062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a692182-9e1c-4d65-c34e-08d96b99c760 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.34];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2848 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Trivial change to add description for 'adma_get_burst_config' in chip data structure. Fixes: 433de642a76c ("dmaengine: tegra210-adma: add support for Tegra186/Tegra194") Signed-off-by: Sameer Pujar --- drivers/dma/tegra210-adma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index caf200e..03f9776 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -73,6 +73,7 @@ struct tegra_adma; /* * struct tegra_adma_chip_data - Tegra chip specific data + * @adma_get_burst_config: Function callback used to set DMA burst size. * @global_reg_offset: Register offset of DMA global register. * @global_int_clear: Register offset of DMA global interrupt clear. * @ch_req_tx_shift: Register offset for AHUB transmit channel select. From patchwork Mon Aug 30 09:37:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12464799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AEE5C43214 for ; Mon, 30 Aug 2021 09:37:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E738F61052 for ; Mon, 30 Aug 2021 09:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235971AbhH3JiZ (ORCPT ); Mon, 30 Aug 2021 05:38:25 -0400 Received: from mail-co1nam11on2081.outbound.protection.outlook.com ([40.107.220.81]:13729 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235621AbhH3JiY (ORCPT ); Mon, 30 Aug 2021 05:38:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WoyX4ElivVWroDtkUO0QaDkT6PAw2ekNubPaTbiSFMKCL1suqU4z3/GHI8gSK8EzXrZXBXTVSzrszkW56Hk1r0G1Dc7+s8djFniCeypGFczhuJAlIyOuNCpzmiibGMObfLlNZf+2ZUj/A82RVL3beB0CFw6SSizo0G5QeVU0Qfm0Q1Z1NIeZHN9jXhBc5aQ3fY9Zye44LuHeP7u1GQKvJ5SOKywUHFx/3uu6cU6r4Qlqc9QT4qrjorqZB3TB9LGR2NbwsHnbTf4HdiqjGCwFwlBKzlDzqMpAd7u7ctaSOD1a7oAxq1LH1wGP1gWENj5aHfuncpHCgKIRSjmx3Ylz0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=50tggsmfWGL+IBJSXElURIP/D3nTrIn2lLbT8PgEeuk=; b=GGJbLNEuCRo5gsDNADcboMeJ1c5kAes88cH84VjxRMJDXF1NIQcvPSvQl38Aohk53CaiIDpER9yIkBXSWtmps5VDEASkMl3RqomrgzPnDdcJl9TvoAE3SY7S9L1BuA6tZNLqiC3KxPgaO0+Wfyprso3PNKs67/60VrSPV6WAIDeXNMpM0WVJOkyspT3Lwr4Cc9doYoy+rUHOKMIWNRilIG/FybJgfxwhF+5x22FPpmuk7WUMLsFJc6LW5SD1IqbmY880I/rcRmJgA0++dbMrnqi6GAGrNrDvUFaz3+55cwB2Qlk94J14J5deaRVv3DX5INNquIFAsY4iimjrk3Z5zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=50tggsmfWGL+IBJSXElURIP/D3nTrIn2lLbT8PgEeuk=; b=NtymUOx8kkSFjdjk+mTwT3FkG/PsgR8034xh0QtuXBx6l49uO4wksdGYo+MhCuNJcC4+vmygKXd3ebnwnpd/NY8xEolbmWxWNdBwL+HVThzjG3cJo1X6y11x3Kxq9NuoZqSnf4Ues+TMIcgcHyPhdu9K4S/0qz3vIXkFfRTW9n9Kd8SqJiQJUqmfVW77ZGi6Fq8cLM2U4znsTnCKxMo7YH1ZtCnNb1JMsqUJMnsdJNMnaL863sdOmuDcDaiyQyo5WI8XbWZP8luvLl2aBTO/HjJ0T7MlnvNGJmIrpTYo2DiLIGFb1X+yLB/HnL6Ud/zfVhUi2Hxh8Bj5PSlEkQ1YQw== Received: from CO2PR04CA0129.namprd04.prod.outlook.com (2603:10b6:104:7::31) by MN2PR12MB3968.namprd12.prod.outlook.com (2603:10b6:208:16f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 09:37:29 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:104:7:cafe::2) by CO2PR04CA0129.outlook.office365.com (2603:10b6:104:7::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.21 via Frontend Transport; Mon, 30 Aug 2021 09:37:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4457.17 via Frontend Transport; Mon, 30 Aug 2021 09:37:29 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Aug 2021 09:37:28 +0000 Received: from audio.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.12) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 30 Aug 2021 09:37:26 +0000 From: Sameer Pujar To: , , , CC: , , , Sameer Pujar Subject: [PATCH 3/3] dmaengine: tegra210-adma: Override ADMA FIFO size Date: Mon, 30 Aug 2021 15:07:01 +0530 Message-ID: <1630316221-9728-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1630316221-9728-1-git-send-email-spujar@nvidia.com> References: <1630316221-9728-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7854255-eb05-4b38-69cb-08d96b99c8bf X-MS-TrafficTypeDiagnostic: MN2PR12MB3968: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wWLMo3F35iylvFYMaVgKz9chi4Qt1YMvFi2D0//T4Mzxh2dD/9jVEopCo0Wtka/WcVvU/donjeN1s/myfVFVyj6rs36tpoMNZX4lpvJ3lkofFMOB82K0MFn6y7Fixqs7BhkZEFh/ySFlo2BJc1H3sQhFJz4mSuty9nlyzFOihippqLJQtCHMSuXpb6JWh8Kw2DTjLJjIND8+kHStLACv2xPZmBb1lruPdkqzL/K+nxSIaPrQUWzT3z6kq0apejPFwei0I1xTQrlrrSV6ocJ2CeMEpyRiIF8Rppdl7HXYy5ka79mUql8bl8znan8AR1BEfbIYFReuMWRAzbIjuL4uZp1Q+X86VXlYAXYg0r9NWpuIIZ4r2uGCyzHrEMpOG1eCr2qBV9cZJ12mqDoBjQDDONI9PW09HhrQnJ2Kqq0XtKSXWB5Es0ygHdbp2PC7CC+VQTOnMLPzu8P+x1X/iQK/hR0PGVVKRQ0SCyZTt0IJBDGFhmcVAFWJfEek1nDtGF3tfCCkxHhL9mMCowetf7riqAyNzCtAeX6S9uuoNON4jgNnoUJycQMexfXL+9j0MHDwvYhgFDj0+Z2s8n58zyAtAjyuzYVaj0KtpBOZue6NSC3VfMj2vQ+k3aac6B7MXuWtT5LBJs/0D4pRfc1c4s6e42s2oD2cOfxAc/yBS69VK/Mrg2IikyxHBitaSeZLjLD6aY7uEAsn/uA9lFtrr6d7bQ== X-Forefront-Antispam-Report: CIP:216.228.112.36;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid05.nvidia.com;CAT:NONE;SFS:(4636009)(136003)(346002)(376002)(39860400002)(396003)(46966006)(36840700001)(8936002)(83380400001)(107886003)(82740400003)(70206006)(36860700001)(70586007)(110136005)(7696005)(5660300002)(36906005)(7636003)(86362001)(36756003)(478600001)(8676002)(2616005)(426003)(6666004)(2906002)(336012)(54906003)(4326008)(82310400003)(186003)(316002)(26005)(47076005)(356005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 09:37:29.0692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7854255-eb05-4b38-69cb-08d96b99c8bf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3968 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org ADMAIF FIFO uses a ring buffer and it is divided amongst the available channels. The default FIFO size (in multiples of 16 words) of ADMAIF TX/RX channels is as below: * On Tegra210, channel 1 to 2 : fifo_size = 3 channel 3 to 10: fifo_size = 2 * On Tegra186 and later, channel 1 to 4 : fifo_size = 3 channel 5 to 20: fifo_size = 2 As per recommendation from HW, FIFO size of ADMA channel should be same as the corresponding ADMAIF channel it maps to. FIFO corruption is observed if the sizes do not match. We are using the default FIFO sizes for ADMAIF and there is no plan to support any custom values. Thus at runtime, override the ADMA channel FIFO size value depending on the corresponding ADMAIF channel. Fixes: 9ab59bf5dd63 ("dmaengine: tegra210-adma: Fix channel FIFO configuration") Signed-off-by: Sameer Pujar --- drivers/dma/tegra210-adma.c | 48 ++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index 03f9776..911533c 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -43,10 +43,8 @@ #define TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(reqs) (reqs << 4) #define ADMA_CH_FIFO_CTRL 0x2c -#define TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(val) (((val) & 0xf) << 8) -#define TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(val) ((val) & 0xf) -#define TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(val) (((val) & 0x1f) << 8) -#define TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(val) ((val) & 0x1f) +#define ADMA_CH_TX_FIFO_SIZE_SHIFT 8 +#define ADMA_CH_RX_FIFO_SIZE_SHIFT 0 #define ADMA_CH_LOWER_SRC_ADDR 0x34 #define ADMA_CH_LOWER_TRG_ADDR 0x3c @@ -61,12 +59,6 @@ #define TEGRA_ADMA_BURST_COMPLETE_TIME 20 -#define TEGRA210_FIFO_CTRL_DEFAULT (TEGRA210_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \ - TEGRA210_ADMA_CH_FIFO_CTRL_RXSIZE(3)) - -#define TEGRA186_FIFO_CTRL_DEFAULT (TEGRA186_ADMA_CH_FIFO_CTRL_TXSIZE(3) | \ - TEGRA186_ADMA_CH_FIFO_CTRL_RXSIZE(3)) - #define ADMA_CH_REG_FIELD_VAL(val, mask, shift) (((val) & mask) << shift) struct tegra_adma; @@ -84,6 +76,8 @@ struct tegra_adma; * @ch_req_max: Maximum number of Tx or Rx channels available. * @ch_reg_size: Size of DMA channel register space. * @nr_channels: Number of DMA channels available. + * @ch_fifo_size_mask: Mask for FIFO size field. + * @sreq_index_offset: Slave channel index offset. * @has_outstanding_reqs: If DMA channel can have outstanding requests. */ struct tegra_adma_chip_data { @@ -98,6 +92,8 @@ struct tegra_adma_chip_data { unsigned int ch_req_max; unsigned int ch_reg_size; unsigned int nr_channels; + unsigned int ch_fifo_size_mask; + unsigned int sreq_index_offset; bool has_outstanding_reqs; }; @@ -561,13 +557,14 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc, { struct tegra_adma_chan_regs *ch_regs = &desc->ch_regs; const struct tegra_adma_chip_data *cdata = tdc->tdma->cdata; - unsigned int burst_size, adma_dir; + unsigned int burst_size, adma_dir, fifo_size_shift; if (desc->num_periods > ADMA_CH_CONFIG_MAX_BUFS) return -EINVAL; switch (direction) { case DMA_MEM_TO_DEV: + fifo_size_shift = ADMA_CH_TX_FIFO_SIZE_SHIFT; adma_dir = ADMA_CH_CTRL_DIR_MEM2AHUB; burst_size = tdc->sconfig.dst_maxburst; ch_regs->config = ADMA_CH_CONFIG_SRC_BUF(desc->num_periods - 1); @@ -578,6 +575,7 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc, break; case DMA_DEV_TO_MEM: + fifo_size_shift = ADMA_CH_RX_FIFO_SIZE_SHIFT; adma_dir = ADMA_CH_CTRL_DIR_AHUB2MEM; burst_size = tdc->sconfig.src_maxburst; ch_regs->config = ADMA_CH_CONFIG_TRG_BUF(desc->num_periods - 1); @@ -599,7 +597,27 @@ static int tegra_adma_set_xfer_params(struct tegra_adma_chan *tdc, ch_regs->config |= ADMA_CH_CONFIG_WEIGHT_FOR_WRR(1); if (cdata->has_outstanding_reqs) ch_regs->config |= TEGRA186_ADMA_CH_CONFIG_OUTSTANDING_REQS(8); - ch_regs->fifo_ctrl = cdata->ch_fifo_ctrl; + + /* + * 'sreq_index' represents the current ADMAIF channel number and as per + * HW recommendation its FIFO size should match with the corresponding + * ADMA channel. + * + * ADMA FIFO size is set as per below (based on default ADMAIF channel + * FIFO sizes): + * fifo_size = 0x2 (sreq_index > sreq_index_offset) + * fifo_size = 0x3 (sreq_index <= sreq_index_offset) + * + */ + if (tdc->sreq_index > cdata->sreq_index_offset) + ch_regs->fifo_ctrl = + ADMA_CH_REG_FIELD_VAL(2, cdata->ch_fifo_size_mask, + fifo_size_shift); + else + ch_regs->fifo_ctrl = + ADMA_CH_REG_FIELD_VAL(3, cdata->ch_fifo_size_mask, + fifo_size_shift); + ch_regs->tc = desc->period_len & ADMA_CH_TC_COUNT_MASK; return tegra_adma_request_alloc(tdc, direction); @@ -783,11 +801,12 @@ static const struct tegra_adma_chip_data tegra210_chip_data = { .ch_req_tx_shift = 28, .ch_req_rx_shift = 24, .ch_base_offset = 0, - .ch_fifo_ctrl = TEGRA210_FIFO_CTRL_DEFAULT, .ch_req_mask = 0xf, .ch_req_max = 10, .ch_reg_size = 0x80, .nr_channels = 22, + .ch_fifo_size_mask = 0xf, + .sreq_index_offset = 2, .has_outstanding_reqs = false, }; @@ -798,11 +817,12 @@ static const struct tegra_adma_chip_data tegra186_chip_data = { .ch_req_tx_shift = 27, .ch_req_rx_shift = 22, .ch_base_offset = 0x10000, - .ch_fifo_ctrl = TEGRA186_FIFO_CTRL_DEFAULT, .ch_req_mask = 0x1f, .ch_req_max = 20, .ch_reg_size = 0x100, .nr_channels = 32, + .ch_fifo_size_mask = 0x1f, + .sreq_index_offset = 4, .has_outstanding_reqs = true, };