Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752953AbdLMDSV (ORCPT ); Tue, 12 Dec 2017 22:18:21 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41446 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbdLMDSS (ORCPT ); Tue, 12 Dec 2017 22:18:18 -0500 X-Google-Smtp-Source: ACJfBosFeFbgyAazOsIKGk6vWo1jXEL2J8W/BoMeU/pYoyp4/miICQ7ken5mVNViR+FGbT3T6xqoSA== From: Jia-Ju Bai Subject: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag To: qla2xxx-upstream@qlogic.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Linux Kernel Mailing List Message-ID: <0363371c-db1c-169f-df5f-ca15b3839e41@gmail.com> Date: Wed, 13 Dec 2017 11:18:07 +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: 936 Lines: 33 The driver may sleep under a spinlock. The function call paths are: qlt_handle_abts_recv_work (acquire the spinlock) qlt_response_pkt_all_vps qlt_response_pkt qlt_handle_cmd_for_atio qlt_get_tag percpu_ida_alloc --> may sleep qla82xx_msix_rsp_q (acquire the spinlock) qla24xx_process_response_queue qlt_handle_abts_recv qlt_response_pkt_all_vps qlt_response_pkt qlt_handle_cmd_for_atio qlt_get_tag percpu_ida_alloc --> may sleep-in-atomic qla24xx_intr_handler (acquire the spinlock) qla24xx_process_response_queue qlt_handle_abts_recv qlt_response_pkt qlt_handle_cmd_for_atio qlt_get_tag percpu_ida_alloc --> 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