Message ID | 20230505063557.3962220-1-xiaoning.wang@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp194611vqo; Thu, 4 May 2023 23:50:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VRvpqvmuJpJ+H/2coDMki48igspBnXgihrFDND7xf0mgP4BwvUdpAf99EDMNFwSWuMuc5 X-Received: by 2002:a05:6a00:16ca:b0:643:4d69:efb8 with SMTP id l10-20020a056a0016ca00b006434d69efb8mr1375544pfc.6.1683269417263; Thu, 04 May 2023 23:50:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683269417; cv=pass; d=google.com; s=arc-20160816; b=HNwh76NtePOwUxuH8PXYfc7trW/2sutHh0gB1cUC2NUmG+9kWQEak2QYI2jC3tFmq2 EwMBu+ZvS4Tr34FG/BjwOHIja/T7/IcAokdwiNxHEa5EdQreAXgXbIP3fQfSzb0nrtV0 VMBBOf0huW7HErMYRNRK/8T36g/fErik0asT/hkl/od8vu5DD9TniRXa6gjwuhJGsSDH NvQSCXKQ62hvZXD+qlbvdjos/0dy2WOYQdRzxU+6ME8MqoPQO4n0K4AtEW/ZJIMdEe9A HIcWCDEcNBlASn5mD/ItnMy9UqynrdYENpV52u1jQ8oLfoEl9hIcp55uH5LXt9OUIHmp E7nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=oT4/cNEYdhzglCURY7KL42hOCaBa1CD0zTuB17CkvcE=; b=Xv86ESloy9QDzVpBGHwTeAE6Ek24NFUjlAtdQ15P7LKIfT0EfxC3XiXyaKCHcecz1O eRSlJ5vDeqtyZXzN44Qk9ufmlX5oKpBmmxra1uPMPy6WzsKnAW0VCtqE3JKSYAFag1ee SUysZg9oTuAU8F9dzXQCTtUMOI3zb9JtrZTzd9+sR/EazTby8ut6J/GGk3ecdFaVffWf CqmaJKtn+0x7mrhGDkw9wB7ngfVbBs6T69b3VmtDcTd5BbstnDubX4XFVsNl8T1T5Bxf zMgrxXOFtUH/jBnYV9XgRhB9wNgswRUiWAW+N3lJWe04LCajbnIxCwni20cVEFbB208Y CWBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="OSBDLiM/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k64-20020a628443000000b0064387bc87cesi1440458pfd.22.2023.05.04.23.50.02; Thu, 04 May 2023 23:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="OSBDLiM/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230299AbjEEGgB (ORCPT <rfc822;b08248@gmail.com> + 99 others); Fri, 5 May 2023 02:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjEEGf7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 5 May 2023 02:35:59 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2076.outbound.protection.outlook.com [40.107.6.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D4D81569C; Thu, 4 May 2023 23:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OgrxPbX/TI/jbnULlinIdK40R4t5C5H4vlpSPfn6ig0vThXk8RpdtYEtZhiuBBP3N+fNZCqKR8pW/qY/TXiL8ZKNPxkc55OGQNSEcIcoj4tkfQ4OCJqa7jzyZ7wruc90rwrmgMWk/59asylfzW6tRhwgqPHBxbcSNtkqwR3CHQATarlThH9bZRZclNpqNwLqeLnlmSmRH1Mx/v1gbe77GeCthsl2NqH+06XWUmluUWlMIqMchKC9ycHZM1TGviARgQCOOnMUTvAp8/hCUptpxCwdC4fkt6o3+YOPSlj981sl/rXplyDzHhibU38goawUTb2HXb5PZ4IocGOW79Txow== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oT4/cNEYdhzglCURY7KL42hOCaBa1CD0zTuB17CkvcE=; b=koH65ej4DUGvHJ4OEaOZ2G7tXzWSHOdExTAuThU8p6cwnAGK1qT7tNBPRSTZ4ki1wAxJEBlzBei4t/n45EQgHyFlnm16tVieLrnyGKCT12dybTCxCBcOcFV8yJ4FyIDdi/q3umTiuirEENPKZjM4Hlpleu6EYkKnHtJJdQX3uv0LAGjT3kdu7JIQ598AfjWYdhvhNwyj/E7pOj2IpQ+GjDLOKmSWaLoTTFG4mmI7XyImvvGKfxSCAjCtalTFGe6FxZ74a7q+3pXkwQrJg+CD/m0A5GPh7ocE9PHa/CHtj6DSBhwj5pVUxgUvqNw6hIkkVb6IFDUnhrMgq4f0V9g10g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oT4/cNEYdhzglCURY7KL42hOCaBa1CD0zTuB17CkvcE=; b=OSBDLiM/b6VC9VobvU9G0GKneGuxT4ejbYFDSZCFIJV9bXHcmH3wCfZfJcmldlJneIPqdeQFN8sFbo9hY1IkPyyrbBtpmy30kSAqmTqhYz7q7p4ZBxipl0u7TjYe8F9LVAbEj3TMkZsr1wUe//4TXAs6gSZcLmuv8VHosarY7dg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB5098.eurprd04.prod.outlook.com (2603:10a6:10:1c::18) by DU2PR04MB9132.eurprd04.prod.outlook.com (2603:10a6:10:2f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.25; Fri, 5 May 2023 06:35:56 +0000 Received: from DB7PR04MB5098.eurprd04.prod.outlook.com ([fe80::6418:d0b1:6971:5da0]) by DB7PR04MB5098.eurprd04.prod.outlook.com ([fe80::6418:d0b1:6971:5da0%5]) with mapi id 15.20.6363.022; Fri, 5 May 2023 06:35:56 +0000 From: Clark Wang <xiaoning.wang@nxp.com> To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: lpspi: disable lpspi module irq in DMA mode Date: Fri, 5 May 2023 14:35:57 +0800 Message-Id: <20230505063557.3962220-1-xiaoning.wang@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGXP274CA0015.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::27) To DB7PR04MB5098.eurprd04.prod.outlook.com (2603:10a6:10:1c::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB5098:EE_|DU2PR04MB9132:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d95bc8f-6500-467b-9907-08db4d32faed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a40XweubFGWSsL2oF/MKXTqX/gMMeYXdn/EYCnzVlPI6mKErqQjVdCJM2P11ywvbh4IkRL7LZ0M33E7sbsXisFyc3Bp76NjMsY3kDv00i4FssSqu4eBz/ZvnUNm/qz3D6A7PVycEyVGwesClyhmQQ43+mqNFpzhdwcIfrVD04eJfMoVOw+XrhLhs5VQGmsLq44+ra3ZNrflbINZI4KA3JByxyHsn5U+Ut7Q+skq9OTG3xw81Is0Uwp4+vzsx493FcnhArHoOC5bUdtHSqognVXyL7sOysbXvkeUWF9oUESzoDbNjZswd4KsvdUwnA+vsNgKx+xjNXpHrNzAN0Y8KhDG1wR/M4OVZgnZSt1+v9aUgKilKFiu0UofgXB+ZK6TGgZxsMAPug8ltt8vaIUDM1fdO0EryeakxNdOxBxtLYuFu46phDycU70n8Yy7AixJWf1rJY7JwvCYK3vAcdgdCmVM/SmKZtI35ZdnJZWP7duWBRK8WrkVyhAyHPbqWWrOB6otVacsExieQYiaq+fDAu+itpbkLdZME4G/UqJnpYXOIhm77/i5XTHbNt8zrTIGzuD7KVSA+OsZP/qUG9DKoNLLzbCMPuiIclS0s5q4GaMPdqsQqQv1BoXBI+G2PlEfO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR04MB5098.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199021)(38100700002)(478600001)(38350700002)(8936002)(5660300002)(8676002)(86362001)(1076003)(26005)(6506007)(6916009)(66946007)(6486002)(66556008)(52116002)(6512007)(2906002)(83380400001)(4326008)(41300700001)(186003)(4744005)(66476007)(2616005)(36756003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a9pgBCE/Q6WE+xkqSw1J5/zXAVdEKP6ilgYzdvfO9koy3tdTCifbgVkjdiqqq6f2QM91VrYyByDI9zUPKj+/AvB/8xTBpyvNXAAJUkZdoPz387wveSWcEqZp0sbgOEnaatgLVLp5Sh+X1XfmKTvpwQ1nH080+OaB4HJYjMICSRyVC6JxayLCx1rTEnS2nfMetXkx2ENNhOtK2/NG38tMLw+mvHwvDE/WoHc1XBwLaA4NTsp2v6HBAVKVThAe4y76RIh90/W0oy98uEEWyV0rUGZx89sLWzjRHr/AsrqYji5CL/OR918Q5JrfLF/cWiafE/HeKalsxRFmtrkvQNvu6jyNNmHCfHFYhvsa/0+9SqUy7ot2C0zSQ6mIeve9jYheX5Z/3CSREYBI/G44bo5X/oaVxKG3XyyerOatbv0lUr8KLoueVgiQBsIfXz23oJPQzOoIlWGlL1cq5nXrTlbHc++Pzwi8cqRJJWQh3KIFLHciSOR1BGHVjsTBOucdWRpO7XiD3IUBF2fywJ02L8YhegYlHBTjraA3gFrVnmsckQMIYCfTdPUzDaje3e6ngOA1p8oU/70Y58WafuIR02+Jq69OgPa5nd618rySd6EPLAzoiI651stkHTx9tZMLt9g1+rZpWei2h+62/29pVvxvxApiw6OwnWGRLr6POHDoyC9ikfOOiieTq5zHHYDuRzJ+Zz5SXeKZsoG2wrP/AvkhlyK98oG8wG2RnlMl8S+lvtdg7OKSwL/egXueyLSzCNy+oJ6z+NgCRsvL3jAZZY1eMiAXq298l2Qh9UAF7Idjbx5p9Jdq9zpMLEZooxsR52Ac9lT8ht49CJIi6AKVjR7Kspg3OqljCaATfU+QcH1olLhzGuR47udWsRXQRuVarij8QzMqSBUaqd1ws4m+/LZWPqGG3bfPzlxBetGGcWm+uzrnlYvJLLE4xHoRVFTEx3CC9fSirnROjGtn3j0/Pgkcyv3TOeNmEdu9kYBuOBAVBSKpuL8SNca8hznlzkClljx+PpqyI0G/noGPk6fD3qgBrMqEL6e0xcSX85D72kWz9VG6BI/E4+8Yf0FSkN2I0U3vv6d+uFLbvbxRiGxhKp/H58hO6bbO6RA0mIgo8NAi+puj5MAaxahxCjCbyiPnuI8XaEWzhAIIN07TecG4yq1Wr/yvl7IPUk9VFCutR9XE/nIHzerwRYprYxmG9L6IC/SFQJiTBMYr3gdPrfjPJDudKtbjS3BTOI36BlRqT2JoCFyGQZF6HVoJHtaSGubaYrtzuU/5Ap3UsBBZPnj10JzAfJ9NCQUHRdOTAyjKfLvin80T9VyoXofan5x5POiTw94+g6YeJt1FWx2fnJxvpKZpoET3R2FlHfm4Vq58zngT5B93DtHa79gvHYkIyL0eICTLp+3fWbSmUYwacCur6AAMgN4YIcOtvPyAkV3zIPrf1/mWJAdhdXnAwt8K/r2s5BPc6UJp8i/2hzOO+hfObgtNfAV1Iu8R8iuTZmNcEoEYQnEqkuge0sm95/gwopJfFo213lyeG4twELlpKRZoBYUIzePgSniIn9fdTlldLi05THYLzejmx3XsZB9aROzSS02a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d95bc8f-6500-467b-9907-08db4d32faed X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB5098.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 06:35:56.0684 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hanv0/v+vlUg1yk+ov7T7x/A00vssKTJAdt35AnBqwpBNaPNFvnK0KHVWZH9X9ivR2BbKLYVCoKvDOSZk2SBkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9132 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765035912204262118?= X-GMAIL-MSGID: =?utf-8?q?1765035912204262118?= |
Series |
spi: lpspi: disable lpspi module irq in DMA mode
|
|
Commit Message
Clark Wang
May 5, 2023, 6:35 a.m. UTC
When all bits of IER are set to 0, we still can observe the lpspi irq events
when using DMA mode to transfer data.
So disable irq to avoid the too much irq events.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
drivers/spi/spi-fsl-lpspi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Comments
On 05/05/23 12:05, Clark Wang wrote: > When all bits of IER are set to 0, we still can observe the lpspi irq events > when using DMA mode to transfer data. > > So disable irq to avoid the too much irq events. > > Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> > --- > drivers/spi/spi-fsl-lpspi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c > index f2341ab99556..4b70038ceb6b 100644 > --- a/drivers/spi/spi-fsl-lpspi.c > +++ b/drivers/spi/spi-fsl-lpspi.c > @@ -910,9 +910,14 @@ static int fsl_lpspi_probe(struct platform_device *pdev) > ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller); > if (ret == -EPROBE_DEFER) > goto out_pm_get; > - Any reason to delete this line? > if (ret < 0) > dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret); > + else > + /* > + * disable LPSPI module IRQ when enable DMA mode successfully, > + * to prevent the unexpected LPSPI module IRQ events. > + */ > + disable_irq(irq); Just wondering, have you actually seen any unexpected LPSPI module IRQ events? If this was causing issues earlier then maybe add a fixes tag? > > ret = devm_spi_register_controller(&pdev->dev, controller); > if (ret < 0) {
Hi Dhruva, > -----Original Message----- > From: Dhruva Gole <d-gole@ti.com> > Sent: 2023年5月5日 17:16 > To: Clark Wang <xiaoning.wang@nxp.com>; broonie@kernel.org > Cc: linux-spi@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] spi: lpspi: disable lpspi module irq in DMA mode > > > > On 05/05/23 12:05, Clark Wang wrote: > > When all bits of IER are set to 0, we still can observe the lpspi irq > > events when using DMA mode to transfer data. > > > > So disable irq to avoid the too much irq events. > > > > Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> > > --- > > drivers/spi/spi-fsl-lpspi.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c > > index f2341ab99556..4b70038ceb6b 100644 > > --- a/drivers/spi/spi-fsl-lpspi.c > > +++ b/drivers/spi/spi-fsl-lpspi.c > > @@ -910,9 +910,14 @@ static int fsl_lpspi_probe(struct platform_device > *pdev) > > ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller); > > if (ret == -EPROBE_DEFER) > > goto out_pm_get; > > - > > Any reason to delete this line? Both of the if statements are used to determine the return value of fsl_lpspi_dma_init(), so I remove this line. > > > if (ret < 0) > > dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret); > > + else > > + /* > > + * disable LPSPI module IRQ when enable DMA mode successfully, > > + * to prevent the unexpected LPSPI module IRQ events. > > + */ > > + disable_irq(irq); > > Just wondering, have you actually seen any unexpected LPSPI module IRQ > events? If this was causing issues earlier then maybe add a fixes tag? Yes, I have observed this issue. The reason for this problem is that some older platforms are designed to combine LPSPI interrupt and LPSPI DMA channel interrupt into one shared interrupt number because the IRQ interrupt number is not enough. When the problem occurs, we can observe that if the interrupt comes too many times and too quickly, it will trigger the IRQ in the LPSPI driver while DMA is still processing the previous DMA request(through the shared dma channel interrupt), resulting in data messing. Best Regards, Clark Wang > > > > > ret = devm_spi_register_controller(&pdev->dev, controller); > > if (ret < 0) { > > -- > Thanks and Regards, > Dhruva Gole
On Fri, 05 May 2023 14:35:57 +0800, Clark Wang wrote: > When all bits of IER are set to 0, we still can observe the lpspi irq events > when using DMA mode to transfer data. > > So disable irq to avoid the too much irq events. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: lpspi: disable lpspi module irq in DMA mode commit: 9728fb3ce11729aa8c276825ddf504edeb00611d All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index f2341ab99556..4b70038ceb6b 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -910,9 +910,14 @@ static int fsl_lpspi_probe(struct platform_device *pdev) ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller); if (ret == -EPROBE_DEFER) goto out_pm_get; - if (ret < 0) dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret); + else + /* + * disable LPSPI module IRQ when enable DMA mode successfully, + * to prevent the unexpected LPSPI module IRQ events. + */ + disable_irq(irq); ret = devm_spi_register_controller(&pdev->dev, controller); if (ret < 0) {