Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbdFEBf7 (ORCPT ); Sun, 4 Jun 2017 21:35:59 -0400 Received: from m12-16.163.com ([220.181.12.16]:48448 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbdFEBfx (ORCPT ); Sun, 4 Jun 2017 21:35:53 -0400 Message-ID: <5934B606.7050105@163.com> Date: Mon, 05 Jun 2017 09:38:14 +0800 From: Jia-Ju Bai User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 To: Greg KH , wporter82@gmail.com, sergio.paracuellos@gmail.com, aquannie@gmail.com CC: devel@driverdev.osuosl.org, LKML Subject: [BUG] rts5208: Sleeping under a spin lock in xd_init_l2p_tbl Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: EMCowAD3sS5ytTRZUqQJIA--.39986S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUg_-PUUUUU X-Originating-IP: [166.111.70.19] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiYxLtelaDtNOy-QAAsb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 552 Lines: 18 According to rtsx_chip.c and xd.c, the driver may sleep under a spin lock. The function call path is: rtsx_exclusive_enter_ss (acquire the lock by spin_lock) rtsx_enter_ss rtsx_power_off_card xd_cleanup_work xd_delay_write xd_finish_write xd_set_unused_block xd_build_l2p_tbl xd_init_l2p_tbl vmalloc --> may sleep This bug is found by my static analysis tool and my code review. I hope to fix it, but I do not have a good solution. Thanks, Jia-Ju Bai