Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbdLLHaP (ORCPT ); Tue, 12 Dec 2017 02:30:15 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:40488 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbdLLHaN (ORCPT ); Tue, 12 Dec 2017 02:30:13 -0500 X-Google-Smtp-Source: ACJfBosxopn65dKCLadg7JlEci7pgq9qIb6Y0UkgM00JMwFETULg3MgCf5IFUOIoa8iTYDujNcnA5g== From: Jia-Ju Bai Subject: [BUG] drivers/spi: a possible sleep-in-atomic bug in atmel_spi_remove To: nicolas.ferre@microchip.com, broonie@kernel.org, alexandre.belloni@free-electrons.com Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Message-ID: <229fd3a0-b88e-5b86-e26e-ec6b79d37a2c@gmail.com> Date: Tue, 12 Dec 2017 15:30:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 403 Lines: 15 According to drivers/spi/spi-atmel.c, the kernel module may sleep under a spinlock. The function call path is: atmel_spi_remove (acquire the spinlock) atmel_spi_release_dma dma_release_channel mutex_lock --> may sleep I do not find a good way to fix it, so I only report. This possible bug is found by my static analysis tool (DSAC) and checked by my code review. Thanks, Jia-Ju Bai