Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbdFEB5Z (ORCPT ); Sun, 4 Jun 2017 21:57:25 -0400 Received: from m12-17.163.com ([220.181.12.17]:50474 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751224AbdFEB5S (ORCPT ); Sun, 4 Jun 2017 21:57:18 -0400 Message-ID: <5934BB0B.6030409@163.com> Date: Mon, 05 Jun 2017 09:59:39 +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 free_zone Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: EcCowACXpw94ujRZVwMOIg--.4874S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUy8wIDUUUU X-Originating-IP: [166.111.70.19] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiGBftelXlZ4YLmAAAsa Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 508 Lines: 17 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 free_zone vfree --> 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