From patchwork Thu May 13 19:26:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 12256379 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=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 548EFC433ED for ; Thu, 13 May 2021 19:35:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 0314D61404 for ; Thu, 13 May 2021 19:35:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0314D61404 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=/lIx9b53f6J5nu18sUzfJNd05zbhtCFz2MJ+8VuYc48=; b=Ppu9CdFP8xwRNuneeXCkDjv0Z3 ejERHn5TUyG7vRv3n+7yC12eKdRYozLZ8w+jovBL1911wxUeOfEmt27PsEQ+qXfwr2/Qv1OxQM2qg AMRc4C2xVh2miQbopiYYBMwQXtSIWwgjLcX+VJ3zZD2YB7CkRnyhibPE8cVDD+lHYhOV+pcUJImOR U74Qlgk/oJJIafNHDSHUsSp716IDwDmOW0mFs2rDU4OBldoUIlfFlGEUuQOUca3uhjDzSzdTfZBJw WgssJ2q2ezUH++maFeoUr1vRg53okQ3nfiilSdUOPSb4yZElnxGHaQ/NgWqE6/dAjqcmLFnW6s187 RtnS0lIw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhH3o-006H3s-St; Thu, 13 May 2021 19:31:53 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhGzE-006GVP-OZ for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 19:27:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=PqbwR4L945w2uSfsL/kb8dhVuFB8CH0RH4aZW5kJJIk=; b=lbMMcuXtxxzcqOljIH6AaM6p55 FaDcVr/biBPfoElUeBiROCLRTGsLXrbD3lrhYHnd/wCGNektRIl21EjIvRlpCqIMFb26kaqFvxrW/ h9EPcFvVFNBWCfSV0G9mxssX+Lv8xge8kmmU45eAsmGIqqHovRMmwChabxGDwDdROgawOucoynCuF OKaT1h/d3sBkRvr+Z/uzBxZYwseNQzx8XTOhm9qKdOvSoUKthLGyry/7NRpfAAedf5RXW4elQcKv0 PNI1aev/sEGsuPIa/svDuSd0U3tGnMYfz9HW55klgPICI4BW2fMMLdbcfb4n/71MaWcZdQ+2z2Sv8 QWYTfclA==; Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhGzB-00BTXj-Gc for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 19:27:07 +0000 Received: by mail-wm1-x335.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso1423484wmc.1 for ; Thu, 13 May 2021 12:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PqbwR4L945w2uSfsL/kb8dhVuFB8CH0RH4aZW5kJJIk=; b=qheDlMFs9657HZlMSTPtCq60kx8JJ9r33kg5wCbbtaI+SqpJ6ABKQZPil5sA7vFvi1 uKNhcbNdm/w5QlXLie5rnaol59/E5eehkpLGde/QLp+Ap8osnZ57CYSQSl8WY1/AohTz q11NE/A9P7jYwrSfaspW8G2np4r1bOcq1wVoUzdi/f8V3MQUCsc1dZd5ZkGcwII4auvD zaOSKwokGQwTC4MmweTKn8vzWxbRS8xk1HGOG3NYR3id4/qDwvv4ouuR9v0NIKkkRVj6 DjuzfXhlFNU48YeC3dUAbOaxAt+I+iUh/CAhEc2s7cPqTf34k2vyuyRou9sgqy7t0oWg QOVA== 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:mime-version :content-transfer-encoding; bh=PqbwR4L945w2uSfsL/kb8dhVuFB8CH0RH4aZW5kJJIk=; b=oIXyr61kr6Y8eipYEKZm7HDdFXUtirxNc6LkCFC98hnaSNRApVdY7ICA6JQuGfgndd SqS8Ae0kyEYE2SsazsCOBOjyb+KXx+4vVw/OwWbN0Ha8LCJZkmAbQMBwkyk5+/sNx6F5 yq5FLunkQNJn9ZpiarpPubQKpBDro0Bb9x7fnxnJVAoTANmvzt3y8NShii7x0vT6kCP3 azwuyk9tY7nUAzmXax3C+6gwNpNeNoPC7JH4o/yR/Sx/CyZ/fo8Fs9EsMYzbYmZosbdi /KB6Nz/mlWyHwrTkp2aATRkCnUKaCGWZjfxQQPLYOYmwuoSyDqh6PgaDvL6uc0RHviIv pzzg== X-Gm-Message-State: AOAM531GQKVpYU/YvdXxkaLeduwzSiP8p+zxIVfZjsS6Z/J1bUiEE9Ly B11ZEQqpi/xluBNocvwGfDzDkA== X-Google-Smtp-Source: ABdhPJzCQlePs8w6v253FGGV68DYI4RKl5BD7B4i7n53vRV8poZuELeUjHXg5qpISOprpoYFeSUkSg== X-Received: by 2002:a1c:1d55:: with SMTP id d82mr5162172wmd.12.1620934022866; Thu, 13 May 2021 12:27:02 -0700 (PDT) Received: from localhost.localdomain (2a02-8440-6341-d842-3074-96af-9642-0002.rev.sfr.net. [2a02:8440:6341:d842:3074:96af:9642:2]) by smtp.gmail.com with ESMTPSA id h9sm3053621wmb.35.2021.05.13.12.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 12:27:02 -0700 (PDT) From: Guillaume Ranquet To: Cc: Sean Wang , Vinod Koul , Matthias Brugger , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] fix mediatek UART APDMA desc logic Date: Thu, 13 May 2021 21:26:39 +0200 Message-Id: <20210513192642.29446-1-granquet@baylibre.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_122705_644984_7497DBB9 X-CRM114-Status: GOOD ( 10.93 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The logic used in the apdma driver to handle the virt_dma_desc caused panics and various memory corruption. This is an attempt at sanitizing the logic a bit. Sending a v2 as the previous mails were ill formatted and not threaded properly. I'm also removing the last patch from the series as the fix is alread on mainline. Guillaume Ranquet (3): dmaengine: mediatek: free the proper desc in desc_free handler dmaengine: mediatek: do not issue a new desc if one is still current dmaengine: mediatek: use GFP_NOWAIT instead of GFP_ATOMIC in prep_dma drivers/dma/mediatek/mtk-uart-apdma.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)