From patchwork Mon May 6 07:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BE5F1395 for ; Mon, 6 May 2019 07:29:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 645CB27E01 for ; Mon, 6 May 2019 07:29:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58B0828632; Mon, 6 May 2019 07:29:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0726F27E01 for ; Mon, 6 May 2019 07:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbfEFH2y (ORCPT ); Mon, 6 May 2019 03:28:54 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34904 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbfEFH2x (ORCPT ); Mon, 6 May 2019 03:28:53 -0400 Received: by mail-pg1-f193.google.com with SMTP id h1so6040137pgs.2 for ; Mon, 06 May 2019 00:28:53 -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 :in-reply-to:references; bh=yZiVOrjB2GkVNwkAlHEh8RFkK/dk9IRsTM24Q28H3wk=; b=BIbUM15mdf5AnhdYErzvP660w8KBiAQdvle7iP059JvrT4k+uzyqvT//ZxuanToIjD 1Kb9X+z0JegAGTabVvBbhp740j9+Izw32tIaWryq1OWoDktcb7SFTJXvkSBBS7XIy5BS w/TZVda78BdDeIrOpWMJpPJlAeW2kdDO0hhjnbpr4wjtjYlJEebf+aTL7fDHI9F84eWI b+hqqNP3fOdVK/ZGwIf6/bOjKzgQR1ABGO4qaoTi/1KjD7SJ2JO9i/V7XHK+JE2/5OOZ sqZ+h030Cbc/0UU7plh6j9v/Vf5ktuW4KK9cnoS69oR0f4KFJGhBgsbgaYtwMB8gc300 CBPQ== 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:in-reply-to:references; bh=yZiVOrjB2GkVNwkAlHEh8RFkK/dk9IRsTM24Q28H3wk=; b=POWrgnfYzGlztIClBxoV6Yul8VNXw6TA3cmSkl4ewcqbB5fXcxeumKMhUFu1exN8Y2 ISjFz1P+8mapVzTFeo9jGWTspyBpE3iVUJ9cv2OWEY2bsinTMnCyeQWYvBOmGDcDaza9 nLMP3TFK9ypBdTK0j634wIPewu99JX4BQ+mCHaLMv8XrkEJGH/GpQKJu/2gdZpriSfQe s9AHD2BPX1XPKRH0PFtCTguwZnacCEbbr1Yq9XyPA9nfQAftHO82ueccbzxJ4exIQinA 1khdUtZwrSNP+mYIZO1OuDkEOPcac98MJAUecTXibvtLe6Gw4OsbffYXlTV7FeWrJRTH lOhw== X-Gm-Message-State: APjAAAXsTn/4tUatuI0TuoQAXKxeU3UDbvvfS10IIBcLFq0obMnI6xnS 3KVyGaP2fArbm26LLvzl7GOpgVsJUo+AyQ== X-Google-Smtp-Source: APXvYqzHzKI5EXvMMXIj3Xf2ZtcA2DXEhYvat7pS5eMq/YjxE0hsjieqQIDbWkY7srVfcJRNFsGL6g== X-Received: by 2002:a63:5c24:: with SMTP id q36mr30268665pgb.314.1557127732915; Mon, 06 May 2019 00:28:52 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.28.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:28:52 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] dmaengine: sprd: Fix the possible crash when getting descriptor status Date: Mon, 6 May 2019 15:28:28 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We will get a NULL virtual descriptor by vchan_find_desc() when the descriptor has been submitted, that will crash the kernel when getting the descriptor status. In this case, since the descriptor has been submitted to process, but it is not completed now, which means the descriptor is listed into the 'vc->desc_submitted' list now. So we can not get current processing descriptor by vchan_find_desc(), but the pointer 'schan->cur_desc' will point to the current processing descriptor, then we can use 'schan->cur_desc' to get current processing descriptor's status to avoid this issue. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 48431e2..e29342a 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -625,7 +625,7 @@ static enum dma_status sprd_dma_tx_status(struct dma_chan *chan, else pos = 0; } else if (schan->cur_desc && schan->cur_desc->vd.tx.cookie == cookie) { - struct sprd_dma_desc *sdesc = to_sprd_dma_desc(vd); + struct sprd_dma_desc *sdesc = schan->cur_desc; if (sdesc->dir == DMA_DEV_TO_MEM) pos = sprd_dma_get_dst_addr(schan); From patchwork Mon May 6 07:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC5EF15A6 for ; Mon, 6 May 2019 07:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93BD327E01 for ; Mon, 6 May 2019 07:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8805428632; Mon, 6 May 2019 07:29:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AA192847B for ; Mon, 6 May 2019 07:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbfEFH26 (ORCPT ); Mon, 6 May 2019 03:28:58 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40269 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfEFH25 (ORCPT ); Mon, 6 May 2019 03:28:57 -0400 Received: by mail-pl1-f193.google.com with SMTP id b3so5917229plr.7 for ; Mon, 06 May 2019 00:28:57 -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 :in-reply-to:references; bh=XiE8oaht+rMtBmlWqUkyAiRGtKqurxER2iPBNv/AZyQ=; b=QM6C/+CxMNKnMh006FzIBzR75xV6ddm6r2gjuSGSnBTOuDfQ0qvMZAiep9jBsBelyX teqGh33rlt74rnloK7VIXqKkie8/XG90UQlY9PEUqS5i6oYPFe1u9h3hNCHny+nnwi01 sqd4g8X8ILX5QLXgsR+H16BiiIRX3xekPo/+zeuPEtWO8CBbs1UhDfu7RtPcFiwhRs+s xl5tF5Punv/vtUbqy/LiKvRqzGspIdKQN8b6+bHCzCbWHN+D+1W4fnyPKnGz1w98WLXf AXbuaK9LrIvC7nQKLYh/0PJxEvCq+BkYvRi/lRTtC5YWoagquPmnnPC/pTgi4/ky7SnV p3cQ== 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:in-reply-to:references; bh=XiE8oaht+rMtBmlWqUkyAiRGtKqurxER2iPBNv/AZyQ=; b=TRMcHm8EQIixku5unr+rJUSgGohiXZ3PPve3HRzjkDQK1/cMhbgEK5u4JdrkrXsauP YRkliQMJxg5QRQc2erntRo4P7RMNU6LJK/mrho4pthfg/Z0hFoqsQyO+tLT4ve6u56OE pmQ8kj3a8QWp5sAZuxNDeK3PfSdFcsbMmvBmdS0y+YX/AS7ZI53SOxZwBfJIUqigRujk pJKrIo4Yrr23fCHPJduN0Xj7Dh+Aa1DuE/icxZ3GPO4AxGmbVidATF+V9ibNyN3s3fbd zo8t8NwDJZXzpY2J8v1Z6epJqoBJpD9/iOvO7OdSkcs/5/LKO32nctqTvY2pYkrv3R4w Sonw== X-Gm-Message-State: APjAAAUAQum5vLrwj12OStEMDTCHGDSyy/TchYBLEIV7/OBRREuz/VEs zFppPmEE4CRR8VYj0RRD/YlwJdKKw5no3w== X-Google-Smtp-Source: APXvYqyBQXCG2IHBXGY3XWmAbAAHiq6tcvTP9kRhpMo9V9eQzxxH1EXyIhGDtVHdER/iEPX7+cT3qQ== X-Received: by 2002:a17:902:7883:: with SMTP id q3mr30341452pll.60.1557127736687; Mon, 06 May 2019 00:28:56 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.28.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:28:56 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] dmaengine: sprd: Add validation of current descriptor in irq handler Date: Mon, 6 May 2019 15:28:29 +0800 Message-Id: <6eee7d5ad68d60ebedf443e24678e5b467fcf0e6.1557127239.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When user terminates one DMA channel to free all its descriptors, but at the same time one transaction interrupt was triggered possibly, now we should not handle this interrupt by validating if the 'schan->cur_desc' was set as NULL to avoid crashing the kernel. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index e29342a..431e289 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -552,12 +552,17 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) schan = &sdev->channels[i]; spin_lock(&schan->vc.lock); + + sdesc = schan->cur_desc; + if (!sdesc) { + spin_unlock(&schan->vc.lock); + return IRQ_HANDLED; + } + int_type = sprd_dma_get_int_type(schan); req_type = sprd_dma_get_req_type(schan); sprd_dma_clear_int(schan); - sdesc = schan->cur_desc; - /* cyclic mode schedule callback */ cyclic = schan->linklist.phy_addr ? true : false; if (cyclic == true) { From patchwork Mon May 6 07:28:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77474933 for ; Mon, 6 May 2019 07:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF7F27E01 for ; Mon, 6 May 2019 07:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 545562863C; Mon, 6 May 2019 07:29:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B3A27E01 for ; Mon, 6 May 2019 07:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbfEFH3A (ORCPT ); Mon, 6 May 2019 03:29:00 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36853 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726402AbfEFH3A (ORCPT ); Mon, 6 May 2019 03:29:00 -0400 Received: by mail-pl1-f196.google.com with SMTP id cb4so1999891plb.3 for ; Mon, 06 May 2019 00:29:00 -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 :in-reply-to:references; bh=l9ir60nNJwBbII3Z7YfygeQjey9MNonvD8+mCs5l+c4=; b=n2PSKrwdQj4XW6hHAVV1KikTlODEKZzE2pd01SXQRpdWNe17PsxQpsoO8+rpMrDU4+ gjX+fvva0GM0YwQOAlkH3bQ0L3gN6CvjXX8LKTjcLnJ8JfIYMAaJMJ0Rt/HGr9KwWi3q sno8NGTlrG+7pdn6+ZSh+MtYL71LgwDH70MupbV4iBGbY+dgGqLU2A9QmIc30OtJC3eJ SJhoBXHge6hQ8fZ34sSO0YDLThB5T70SfFYgmEPtROCObtK38067TZ1Y6vyWKBJCgwfe vOc7avrYdgMQdfGTpjGs7b/OBoQXeMno7vWPv2+VHoI3Vw5np1I8CNc5t2EOAR9dYB59 a1xQ== 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:in-reply-to:references; bh=l9ir60nNJwBbII3Z7YfygeQjey9MNonvD8+mCs5l+c4=; b=Wte/1lE/Z1svuQA6IsmEHcouAhe3M1Bc8jdce8Qm42FFPABSiYEVUWMkVkziw0R/rR Rb5OmuJ4aK8wOWy+GzqdtbRCtAlyP6EL1+lIOk588pJogu34yXsvtNQEfirhLZ4dqTcv 0B8c3/AS0EJ4eTzkIvBBW1/hWAoKMWKMxzQBkYn2voBxddS6965DK1N9hII57/CkazDL 43O2W7DOK1G/z3xCy1AOysbwv4W5Dkcsi8SlW2n7XaVObKAyX3efD+I7Sphx0m5lwulY Lp4YjCDcLRX5F0B60OcBGgKEjBwzaBGQxOyjp9KwHXQiiY/l8QDO9wIs/XPsJOk/iaw7 XBkg== X-Gm-Message-State: APjAAAWlzT0muHs1cfBDkBP4p2rbo3H/W/ra6GtFnsTWJOhClSupVRkd rYjQ4BSaMJTMrdPDrMFCuOLmCA== X-Google-Smtp-Source: APXvYqzDakPzBV2yCvqDzE+c+yTPMnu+jdQfQeYEh/K2/WSAjZD3Nyf1PYODBQn9UQlykVynV2T3PQ== X-Received: by 2002:a17:902:141:: with SMTP id 59mr30356662plb.132.1557127740096; Mon, 06 May 2019 00:29:00 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.28.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:28:59 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] dmaengine: sprd: Fix the incorrect start for 2-stage destination channels Date: Mon, 6 May 2019 15:28:30 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Long The 2-stage destination channel will be triggered by source channel automatically, which means we should not trigger it by software request. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 431e289..0f92e60 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -510,7 +510,9 @@ static void sprd_dma_start(struct sprd_dma_chn *schan) sprd_dma_set_uid(schan); sprd_dma_enable_chn(schan); - if (schan->dev_id == SPRD_DMA_SOFTWARE_UID) + if (schan->dev_id == SPRD_DMA_SOFTWARE_UID && + schan->chn_mode != SPRD_DMA_DST_CHN0 && + schan->chn_mode != SPRD_DMA_DST_CHN1) sprd_dma_soft_request(schan); } From patchwork Mon May 6 07:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 140DA1395 for ; Mon, 6 May 2019 07:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F06B227E01 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49E328632; Mon, 6 May 2019 07:29:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92AB42847B for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbfEFH3E (ORCPT ); Mon, 6 May 2019 03:29:04 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44306 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfEFH3E (ORCPT ); Mon, 6 May 2019 03:29:04 -0400 Received: by mail-pf1-f195.google.com with SMTP id y13so6272920pfm.11 for ; Mon, 06 May 2019 00:29:03 -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 :in-reply-to:references; bh=+ZQ7qGOLCohxzfhci4Colal/Wo1QqAxCtZ4JkQsFwsU=; b=m2MNCVwUhd8v/6Vi+YLmIm4RORKUiK2+BdHKTpNvCPAn0wxJbDla+fHvLPcWFxF24t T84EOuE6HFY1fWHQmAWxAqsqCJE28N/Q0G7KNTmeQMle8HgYrJSPmR5KWP3wr/cLnM1j /c0f7R2vJZshddyoxk2SyPRQECINjDxmV9fqQncGVl/QA9GvfeiJszqIDU4dgDaaIQaI WQrX8pw24wULbhMr1vlYfJW2Et9TjSTQaAOJsfn6a/mZ/NWRPupVVl3sEhHeRAs3cufW Ifjyz6nHqboVfhQov7y4HniXpqwS8tdMWA3pnpWPwTtmvsy43maQ5kGmZOYGwavkSJLB ta6g== 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:in-reply-to:references; bh=+ZQ7qGOLCohxzfhci4Colal/Wo1QqAxCtZ4JkQsFwsU=; b=ieaYHqbIkSSMj+QBs+uOphDMAv8Var1HUjOR6GhYilCwaaUeQ+7CT4O+coAKdz1VfT Y3cSLKMzVZVyO65CP8iAWUudBNQOgcEeVACJtxqW27RdG3xMP8iZRImgImM/ZkLbwiml ELrOofUMFWk0f8LTZVobQEsfbdTNqQdaQEeNAnT1MdFLC8MPpOWn9BWCJO8GPsjc7XUt 0j9/K8FXPnFLxfxmGAssSFdz2YTsU2gBEJmuvMqe9iK5teHC+fbpCi4DPrLAx/2UqoEM Bp9AKPdY/b35+nhjdTuOafk+jmRDjpdD8/aO1HQu8Mm13yTGFlg2/e2Vqo6pbScrwUFX 0FvQ== X-Gm-Message-State: APjAAAXTnfgt3OddJVeCpabkZw/AJC6vFwfNqPwj3SRgXx22TBlNIDPI r3gE24aWP4VkMPzZLwYe4AOBhw== X-Google-Smtp-Source: APXvYqwWb4P6O7/nv5TFfuz5VLxhEIjbuhhBJ23cJf8CsXjlTK7gH97n3xhYJyCDvh9Jbr5aDD8xSA== X-Received: by 2002:a63:1a03:: with SMTP id a3mr1369341pga.412.1557127743650; Mon, 06 May 2019 00:29:03 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.29.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:29:03 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] dmaengine: sprd: Fix block length overflow Date: Mon, 6 May 2019 15:28:31 +0800 Message-Id: <8f9a1748488e9d890995c158375482285253cc46.1557127239.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Long The maximum value of block length is 0xffff, so if the configured transfer length is more than 0xffff, that will cause block length overflow to lead a configuration error. Thus we can set block length as the maximum burst length to avoid this issue, since the maximum burst length will not be a big value which is more than 0xffff. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 0f92e60..a01c232 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -778,7 +778,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK; hw->frg_len = temp; - hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK; + hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK; hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK; temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET; From patchwork Mon May 6 07:28:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEBE4933 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B849927E01 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC5702863C; Mon, 6 May 2019 07:29:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 564E027E01 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726449AbfEFH3I (ORCPT ); Mon, 6 May 2019 03:29:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37160 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbfEFH3H (ORCPT ); Mon, 6 May 2019 03:29:07 -0400 Received: by mail-pg1-f194.google.com with SMTP id e6so6035901pgc.4 for ; Mon, 06 May 2019 00:29:07 -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 :in-reply-to:references; bh=f7WxjUUjnOPlZM9+bRj5MrZBRrYrZS5QSjQsKajsB4c=; b=fczeMukFRjRRR+1aDX01a1Sr2mHi7DtR4Gtz1E36ZgvfNGRxI7VHRp63sJWk5xuUVd o0Wb7seFcinpcZpharAZaaHr5ZZGvvzOMV9ME0H6FOdjrsnB9mbgM93u5eeuFSKsbI6j NYjZlaRe0WtRif1binGpkerwbW13qWMjK1tvAo/3YmkGInyZMpD9Y32gNvCyAB646HIy Z6vrWTbuSTDgmZ2BDBFp/TwHbNsDAHuQJYFoyyKd2YCECrvm4levP/dICyXtI8vJfDDQ OxWW8Ms0qtuB4MaRHjZs4uGlgrQRnwXpWURKM/IG96X4PBlpNiPvTTlbvE622E9RtDPk X/YA== 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:in-reply-to:references; bh=f7WxjUUjnOPlZM9+bRj5MrZBRrYrZS5QSjQsKajsB4c=; b=Ht/y4OCC6Urqt3tCJb8grPPwYP4ntIsKrcdmrGM/SpaeYZ+OyGXkDb0mLsJ0fjboNN 3pYINdGsiaaCjya3qnQHvcRGFgaYG0yMbJ87ewCnabBJj/z9+c7p1aV97lKZp8rGI8J6 mo/K700wbIis3I9HXy6U7Xi28RsFMB0Un/WFI9XkxLhxP1/ruS+ALLDBvId0Ibly0ivz t9T7RYwTXrYh96bR6M/DBG8efU5NxiyGpZuIwc8HshnTayWcIaJnfwiLqiAAt5+3zJvR 8/RDO7Me6pOQ5bjQRP4A35BzWfu5IulE6Y6puFNpyedrGK6BCYhPLTijuZCP+m94G0ye nYEw== X-Gm-Message-State: APjAAAVZsnwrvWH1PQoEtFBptw8j90fGuj+lVoAOrd2KvSxoC5zq9oaU 9cyuRhkB3gc1vPkiC9cnVi59cg== X-Google-Smtp-Source: APXvYqw0/jP7NTJPqlt/wBZcCyCNPM0vzi6zk1f3mzoj6y3qOVMIOC7nx5Jf7rPfTEARDSVfB5uhLQ== X-Received: by 2002:a63:e451:: with SMTP id i17mr30530636pgk.312.1557127746838; Mon, 06 May 2019 00:29:06 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.29.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:29:06 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] dmaengine: sprd: Fix the right place to configure 2-stage transfer Date: Mon, 6 May 2019 15:28:32 +0800 Message-Id: <7eb64b3319cfa1859f2912398700d4204553c028.1557127239.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Long Move the 2-stage configuration before configuring the link-list mode, since we will use some 2-stage configuration to fill the link-list configuration. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index a01c232..01abed5 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -911,6 +911,12 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan, schan->linklist.virt_addr = 0; } + /* Set channel mode and trigger mode for 2-stage transfer */ + schan->chn_mode = + (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK; + schan->trg_mode = + (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; + sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT); if (!sdesc) return NULL; @@ -944,12 +950,6 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan, } } - /* Set channel mode and trigger mode for 2-stage transfer */ - schan->chn_mode = - (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK; - schan->trg_mode = - (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; - ret = sprd_dma_fill_desc(chan, &sdesc->chn_hw, 0, 0, src, dst, len, dir, flags, slave_cfg); if (ret) { From patchwork Mon May 6 07:28:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10930653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38FB91395 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D46727E01 for ; Mon, 6 May 2019 07:29:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E70E28632; Mon, 6 May 2019 07:29:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9560227E01 for ; Mon, 6 May 2019 07:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbfEFH3Q (ORCPT ); Mon, 6 May 2019 03:29:16 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40607 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726468AbfEFH3L (ORCPT ); Mon, 6 May 2019 03:29:11 -0400 Received: by mail-pf1-f195.google.com with SMTP id u17so6280963pfn.7 for ; Mon, 06 May 2019 00:29:10 -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 :in-reply-to:references; bh=211d8ZTQI3btAur7YnSUlr/RUpH4zvR8vL+Saj1rS5o=; b=jo3K4Scdrs1k7OvhlUC3Vu6KN+wS+aF0U3qudxCeN/Ts9VlRxCjFMr46/su1MGI9mX B0I01reNOOD0ZaHGwco7gr4FJEycBmyHjrgjB07y+GEf+NVM1lLsbzAl3Qr5gulmikdj uXIBABZq+91UQZ8NFVIO/bkfFlr7jv0PgZvAemLVWFjoH+9+a3KT7mH1nQuyqXXcZ4w6 zie4wrpqjqHhXytnykFQHis0Y/66Wq3JVD0ZIiRXGfxkWnCKzWH00MK5kQA4RQ6LQu6t 8Gj30YLpIu1qPXyFyhtZWQ/cgOeplpaBP5FvMx6XM4wIqI9yM91uhnJjppwLhjkU/a0q 5bCg== 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:in-reply-to:references; bh=211d8ZTQI3btAur7YnSUlr/RUpH4zvR8vL+Saj1rS5o=; b=ezaTgpldTBLC2bxRAzDIdqBdxCjmWcITp4IcI+h0/PAyk1yA9lYc6zPeNH7YpjSk5u Icwez9hk6TISEJ65ECWrPLJaI8Mh1bK/gPH5w72icaxCARBFzNbwFVk/g7GRUAR+OZE8 u7EHtj5dDOKLcg2bY7SBEkM5cdC+QONXOaKlfwVdHdQfmqoHOR7whlPDlaQkOuANbZYX RijlECsWm/Ax4kr4OBcxM9Mt/JSWw8YDZXcZsTmeiCTYKyEMLZ5TUOutpw+vRHh/c72z CfV58Jrxt2LWX7qb6/1qecMKs+st1cBkFJnqpDlLQ1xr777eaX9FLzNIaR3SvM53HGsm wl4Q== X-Gm-Message-State: APjAAAVbXcXtyuAHRBkForsKxjf5Zeg6q1ayL1voQnvRdDbVSdpGYoxT BkgUUmMffhurfSGDRJyopC2IEA== X-Google-Smtp-Source: APXvYqxuZVpXjI9hNU1TBDdPuWhKxlPJ1PqiM3uimd5q/iX+ojTZItgChQGwubcXQg5brQKglhy9Rw== X-Received: by 2002:a63:1cf:: with SMTP id 198mr22124192pgb.155.1557127750187; Mon, 06 May 2019 00:29:10 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.29.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:29:09 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] dmaengine: sprd: Add interrupt support for 2-stage transfer Date: Mon, 6 May 2019 15:28:33 +0800 Message-Id: <23f960d05bc30a93fb128cde53ad798cc6c7c19d.1557127239.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For 2-stage transfer, some users like Audio still need transaction interrupt to notify when the 2-stage transfer is completed. Thus we should enable 2-stage transfer interrupt to support this feature. Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 01abed5..baac476 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -62,6 +62,8 @@ /* SPRD_DMA_GLB_2STAGE_GRP register definition */ #define SPRD_DMA_GLB_2STAGE_EN BIT(24) #define SPRD_DMA_GLB_CHN_INT_MASK GENMASK(23, 20) +#define SPRD_DMA_GLB_DEST_INT BIT(22) +#define SPRD_DMA_GLB_SRC_INT BIT(20) #define SPRD_DMA_GLB_LIST_DONE_TRG BIT(19) #define SPRD_DMA_GLB_TRANS_DONE_TRG BIT(18) #define SPRD_DMA_GLB_BLOCK_DONE_TRG BIT(17) @@ -135,6 +137,7 @@ /* define DMA channel mode & trigger mode mask */ #define SPRD_DMA_CHN_MODE_MASK GENMASK(7, 0) #define SPRD_DMA_TRG_MODE_MASK GENMASK(7, 0) +#define SPRD_DMA_INT_TYPE_MASK GENMASK(7, 0) /* define the DMA transfer step type */ #define SPRD_DMA_NONE_STEP 0 @@ -190,6 +193,7 @@ struct sprd_dma_chn { u32 dev_id; enum sprd_dma_chn_mode chn_mode; enum sprd_dma_trg_mode trg_mode; + enum sprd_dma_int_type int_type; struct sprd_dma_desc *cur_desc; }; @@ -429,6 +433,9 @@ static int sprd_dma_set_2stage_config(struct sprd_dma_chn *schan) val = chn & SPRD_DMA_GLB_SRC_CHN_MASK; val |= BIT(schan->trg_mode - 1) << SPRD_DMA_GLB_TRG_OFFSET; val |= SPRD_DMA_GLB_2STAGE_EN; + if (schan->int_type != SPRD_DMA_NO_INT) + val |= SPRD_DMA_GLB_SRC_INT; + sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP1, val, val); break; @@ -436,6 +443,9 @@ static int sprd_dma_set_2stage_config(struct sprd_dma_chn *schan) val = chn & SPRD_DMA_GLB_SRC_CHN_MASK; val |= BIT(schan->trg_mode - 1) << SPRD_DMA_GLB_TRG_OFFSET; val |= SPRD_DMA_GLB_2STAGE_EN; + if (schan->int_type != SPRD_DMA_NO_INT) + val |= SPRD_DMA_GLB_SRC_INT; + sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP2, val, val); break; @@ -443,6 +453,9 @@ static int sprd_dma_set_2stage_config(struct sprd_dma_chn *schan) val = (chn << SPRD_DMA_GLB_DEST_CHN_OFFSET) & SPRD_DMA_GLB_DEST_CHN_MASK; val |= SPRD_DMA_GLB_2STAGE_EN; + if (schan->int_type != SPRD_DMA_NO_INT) + val |= SPRD_DMA_GLB_DEST_INT; + sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP1, val, val); break; @@ -450,6 +463,9 @@ static int sprd_dma_set_2stage_config(struct sprd_dma_chn *schan) val = (chn << SPRD_DMA_GLB_DEST_CHN_OFFSET) & SPRD_DMA_GLB_DEST_CHN_MASK; val |= SPRD_DMA_GLB_2STAGE_EN; + if (schan->int_type != SPRD_DMA_NO_INT) + val |= SPRD_DMA_GLB_DEST_INT; + sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP2, val, val); break; @@ -911,11 +927,15 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan, schan->linklist.virt_addr = 0; } - /* Set channel mode and trigger mode for 2-stage transfer */ + /* + * Set channel mode, interrupt mode and trigger mode for 2-stage + * transfer. + */ schan->chn_mode = (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK; schan->trg_mode = (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; + schan->int_type = flags & SPRD_DMA_INT_TYPE_MASK; sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT); if (!sdesc)