From mboxrd@z Thu Jan 1 00:00:00 1970 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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 54CE1C433FE for ; Mon, 13 Sep 2021 22:35:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40DB96127A for ; Mon, 13 Sep 2021 22:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245246AbhIMWgR (ORCPT ); Mon, 13 Sep 2021 18:36:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348575AbhIMWfj (ORCPT ); Mon, 13 Sep 2021 18:35:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA2A361108; Mon, 13 Sep 2021 22:34:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631572462; bh=DyJ6Rx33sxAmbKetNDXQ4Ae+kiVCSg4Y1eBB9sdXNH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZKf76B+c4GYEow1I/DVf5BVztqxzON0lyD+htaQ5mcpM6QJU6rE37hWUqWeMj+gKu iZZYdK8jo4kQU+dX0+FueOE37T9gBRxqpAEAixPWRpvPccUGY4aEyGgYkIc2kH5ZMm w1piD3siydRqVvyu211/gjdTZJCvLGxAp+ZQTHHWz6BBDL3Q0JXTv54BJpmI/3dU0D LzAQ3URmeqgIcm6QUWJp/UPmxd7E+swgY0UKD6BxFq4IJhepOIU4q5Rtrax4DNQoYz pEamRB6Ien0QNHJnk5gA3b4w+/7mM6VNTwdFbDEmRuV76OckEq/MJzjRgI1oA0O+M6 qwPOZBxxLW5wQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Radhey Shyam Pandey , Harini Katakam , Vinod Koul , Sasha Levin , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.13 05/19] dmaengine: xilinx_dma: Set DMA mask for coherent APIs Date: Mon, 13 Sep 2021 18:34:01 -0400 Message-Id: <20210913223415.435654-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210913223415.435654-1-sashal@kernel.org> References: <20210913223415.435654-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Radhey Shyam Pandey [ Upstream commit aac6c0f90799d66b8989be1e056408f33fd99fe6 ] The xilinx dma driver uses the consistent allocations, so for correct operation also set the DMA mask for coherent APIs. It fixes the below kernel crash with dmatest client when DMA IP is configured with 64-bit address width and linux is booted from high (>4GB) memory. Call trace: [ 489.531257] dma_alloc_from_pool+0x8c/0x1c0 [ 489.535431] dma_direct_alloc+0x284/0x330 [ 489.539432] dma_alloc_attrs+0x80/0xf0 [ 489.543174] dma_pool_alloc+0x160/0x2c0 [ 489.547003] xilinx_cdma_prep_memcpy+0xa4/0x180 [ 489.551524] dmatest_func+0x3cc/0x114c [ 489.555266] kthread+0x124/0x130 [ 489.558486] ret_from_fork+0x10/0x3c [ 489.562051] ---[ end trace 248625b2d596a90a ]--- Signed-off-by: Radhey Shyam Pandey Reviewed-by: Harini Katakam Link: https://lore.kernel.org/r/1629363528-30347-1-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 4b9530a7bf65..434b1ff22e31 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -3077,7 +3077,7 @@ static int xilinx_dma_probe(struct platform_device *pdev) xdev->ext_addr = false; /* Set the dma mask bits */ - dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width)); + dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width)); /* Initialize the DMA engine */ xdev->common.dev = &pdev->dev; -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 B1BCDC433F5 for ; Mon, 13 Sep 2021 22:35:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B50461216 for ; Mon, 13 Sep 2021 22:35:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6B50461216 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gI06EwdwTomEI3xzWtMUxp0dzBVSDf1+Q/qNO4DKAng=; b=idkegaPQcCHB02 wQjhdH8ocvESKRHVbzYfUiiTYxw8sUPSReBbE/MikjxFL8JbkGZOZxCDX0JfT+HsXxeKo5SENZQPQ 2KDeEalFH0fDifMZR90AUQL6joZ28cBfV5b0kMBTIKnMrdQ2X6SZ/vUt2eZ383+HhZRETH2F/uZqL XqG/N7iYLgwIzyuoA86NPl3hD4AJFoiU9/vsQeO+T4QtAP7ganifEQypsOHz7SRSZQ7LzfA3SphXH bab7EgK8IT38FXcdVgombz4tvjDPlHniNcki0oue2V4AFAMgQXzIpnvFwy//CerAWs5RsL3PNUwLy 3BHsv/PrwXFAHVI9pS2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPuWx-003QRR-3d; Mon, 13 Sep 2021 22:34:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPuWt-003QQV-5Y for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 22:34:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA2A361108; Mon, 13 Sep 2021 22:34:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631572462; bh=DyJ6Rx33sxAmbKetNDXQ4Ae+kiVCSg4Y1eBB9sdXNH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZKf76B+c4GYEow1I/DVf5BVztqxzON0lyD+htaQ5mcpM6QJU6rE37hWUqWeMj+gKu iZZYdK8jo4kQU+dX0+FueOE37T9gBRxqpAEAixPWRpvPccUGY4aEyGgYkIc2kH5ZMm w1piD3siydRqVvyu211/gjdTZJCvLGxAp+ZQTHHWz6BBDL3Q0JXTv54BJpmI/3dU0D LzAQ3URmeqgIcm6QUWJp/UPmxd7E+swgY0UKD6BxFq4IJhepOIU4q5Rtrax4DNQoYz pEamRB6Ien0QNHJnk5gA3b4w+/7mM6VNTwdFbDEmRuV76OckEq/MJzjRgI1oA0O+M6 qwPOZBxxLW5wQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Radhey Shyam Pandey , Harini Katakam , Vinod Koul , Sasha Levin , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.13 05/19] dmaengine: xilinx_dma: Set DMA mask for coherent APIs Date: Mon, 13 Sep 2021 18:34:01 -0400 Message-Id: <20210913223415.435654-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210913223415.435654-1-sashal@kernel.org> References: <20210913223415.435654-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_153423_275664_8B75920B X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Radhey Shyam Pandey [ Upstream commit aac6c0f90799d66b8989be1e056408f33fd99fe6 ] The xilinx dma driver uses the consistent allocations, so for correct operation also set the DMA mask for coherent APIs. It fixes the below kernel crash with dmatest client when DMA IP is configured with 64-bit address width and linux is booted from high (>4GB) memory. Call trace: [ 489.531257] dma_alloc_from_pool+0x8c/0x1c0 [ 489.535431] dma_direct_alloc+0x284/0x330 [ 489.539432] dma_alloc_attrs+0x80/0xf0 [ 489.543174] dma_pool_alloc+0x160/0x2c0 [ 489.547003] xilinx_cdma_prep_memcpy+0xa4/0x180 [ 489.551524] dmatest_func+0x3cc/0x114c [ 489.555266] kthread+0x124/0x130 [ 489.558486] ret_from_fork+0x10/0x3c [ 489.562051] ---[ end trace 248625b2d596a90a ]--- Signed-off-by: Radhey Shyam Pandey Reviewed-by: Harini Katakam Link: https://lore.kernel.org/r/1629363528-30347-1-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 4b9530a7bf65..434b1ff22e31 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -3077,7 +3077,7 @@ static int xilinx_dma_probe(struct platform_device *pdev) xdev->ext_addr = false; /* Set the dma mask bits */ - dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width)); + dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width)); /* Initialize the DMA engine */ xdev->common.dev = &pdev->dev; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel