From patchwork Mon Apr 1 18:38:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10880493 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 49120139A for ; Mon, 1 Apr 2019 18:39:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35BB8280CF for ; Mon, 1 Apr 2019 18:39:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2995228514; Mon, 1 Apr 2019 18:39:53 +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=-7.9 required=2.0 tests=BAYES_00,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 B609D280CF for ; Mon, 1 Apr 2019 18:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728756AbfDASjw (ORCPT ); Mon, 1 Apr 2019 14:39:52 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:49717 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728007AbfDASjw (ORCPT ); Mon, 1 Apr 2019 14:39:52 -0400 Received: from localhost.localdomain ([37.4.249.100]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MowT0-1gaKRn3DRO-00qSeG; Mon, 01 Apr 2019 20:39:17 +0200 From: Stefan Wahren To: Dan Williams , Vinod Koul , Florian Fainelli , Ray Jui , Scott Branden , Eric Anholt Cc: bcm-kernel-feedback-list@broadcom.com, Aaro Koskinen , Lukas Wunner , Florian Kauer , Martin Sperl , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH RFC] dmaengine: bcm2835: Avoid GFP_KERNEL in device_prep_slave_sg Date: Mon, 1 Apr 2019 20:38:19 +0200 Message-Id: <1554143899-4124-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:mPuCPaOFlRK9emN6HYhMhq/RXZiWSniPzHtXMLTwXmTOCAp9fX/ 5sNqVZ4TWNArj7g/VUv8qbqWmsbgySEa1rkAinniLkHZyorWO3aDLJAcagkJMiM88KTAai/ ONlu2vc999fNNKlttb1BRxVvJ10o15kLHvFB5OHTjbC6VXeMniM+S1vbT0/sClaYZRcofHm QUah5vXeCXNPU0mtJQ1wA== X-UI-Out-Filterresults: notjunk:1;V03:K0:zJtCSSXmp20=:Y+dRedSRaE8NRxxN+1t33D mmgMhEgw31CL8E7iLZPzhXuEprVhTEf8DgNL+huh5gHuz5guiTwRv2CJOC1MauU2rxSPxxRmt ldEhNKez/P2cNxtLbiFC9+kkQLgUOrtdcM/Q3mk9t2L8zhs9Uf2lBaShynCUoXswm7qKAXNJw 10ee4AE3N6CDyEOjolr5jeeoFktT8uoAal0kP1l8+X3Guq6brT7Ws6OZwAgQG9PJCZr+Bw9YK GIEa0O27wXQAYlicx78fY/y3YoG3Ao5xj/BgA2NxNuXoOxneU7u8p445fW+DXRxMu/KDkkxcz fUZuu0E6434EAkih+gnzBJ6x53Nhnb7Q7OMdJubCT4oZCp6BQAn7xCNxK6sndNeEx+OxVT0Ou k+C/P73oGn5t7bx08JZMcmeGHv5trHivybIHS34F4fFgsVpz8RxirenOHUI/F9r9VkPRuyJW0 AONCDdTF1GtXMwIKZPinbg7ILwlMeAmMgeXBJMOWatChuWYaO5rnm03ghgUf7YNBxl4CrgvXK mKfcDT9PWLI84g7WVEK1cIx+27dBETuZcKkq1gvSG4Lszs/l0CMgfEHQ6P3RZTRJjp/bfkMh5 lV+tZ3j7tmEUKtjzhDUjYkgul7V8KZ/Zft5O94R9fkC9qQ6g21BOo4vrI5c27GJZH5zJrKFP9 XU3C4HDQemF9picIuWeyXzLwMwnFsxJCvkzw8L3N8DeO+DSFCDcwjzaAT4U0dor1zQhsrcjUn 8MhW7A6bKHlXnh0Bxqn4lL93cHUXQVQ8Gzao+L8lF/ch8smk15whLQN9SWw= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit af19b7ce76ba ("mmc: bcm2835: Avoid possible races on data requests") introduces a possible circular locking dependency, which is triggered by swapping to the sdhost interface. So instead of reintroduce the race condition again, we could also avoid this situation by using GFP_NOWAIT for the allocation of the DMA buffer descriptors. Reported-by: Aaro Koskinen Signed-off-by: Stefan Wahren Fixes: af19b7ce76ba ("mmc: bcm2835: Avoid possible races on data requests") Link: http://lists.infradead.org/pipermail/linux-rpi-kernel/2019-March/008615.html --- drivers/dma/bcm2835-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index ec8a291..54093ff 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -671,7 +671,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( d = bcm2835_dma_create_cb_chain(chan, direction, false, info, extra, frames, src, dst, 0, 0, - GFP_KERNEL); + GFP_NOWAIT); if (!d) return NULL;