Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1712951imm; Sat, 15 Sep 2018 01:30:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYiUkfR6xOkbNF/+KwbbcOeUrPoHFz7GQwHOEr6HzgoT7fSm38kUhMUS8U1qCLJtBYpzEI9 X-Received: by 2002:a62:198e:: with SMTP id 136-v6mr16358625pfz.103.1537000246236; Sat, 15 Sep 2018 01:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537000246; cv=none; d=google.com; s=arc-20160816; b=lFJF2+uy7dhSkDDg9FjzflkOjA43KFtXXo1nbubdBOSIhF1ZBvZLqUbWA3TP2632dQ yj4wMsfpMYrid8EL8ck/cy+BuE0s+/eiim5hSqfzhSUn416o46WH3QvPxDcZ+EW8hY0D z5/1rGywg47tqIvTJ/PwqWltrElnA0Ap8xqLemwcf8y+KBqkcD7AKbImdd7MMmKDfY8m K786K3r2cRzuOBuFlOeiKwPvxk01HY5HhGaW//AVG0VakSh+iqD1dmUIfCzPJ1mHT0tX 0v3cKjNKI90MWRBDPqR4LUnlC9O5JVFNxh8soT8OXkHmr39k48pSQBWuuTc84bgi28j7 poIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :cc:to:subject:from:dkim-signature; bh=g9G0LCjIhEqqOgc/LH49pCBf+8Zu5XhNdM9Rks8TeSk=; b=vNBTl0hrBa5dljVbdFVypEjY8lPbt3pUxbUB8QucZ87CLKYWY/lfaSMvK6++/8utNw LiueOciC7KCXt+Z7FLDOAVAvDKhJqqM1s+vjynNjHknKZYfgXs8CdIOYwxkWfHRFIKhB jXWp0AClVQT73wW1G5B9LmtRI0IqNx3Eo2rhcUoBDU+9nbVAHmj4+2WaJn37XenyUl+I oXgGWntjz6YSyQFaYhxPhZzMdfUTGIYr7BFJRA1JRrecDjaCEjto8l/0HVoiy+d3yMBV RRCrrmf0O7dQTa0Bv+aDQ41wot3doRL0nxWca5sd1W0Po+KcAA3h8ph19vxTeqaSNT6/ kIAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jCcvA0R4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si9479377pgg.538.2018.09.15.01.30.30; Sat, 15 Sep 2018 01:30:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jCcvA0R4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbeIONsU (ORCPT + 99 others); Sat, 15 Sep 2018 09:48:20 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:41143 "EHLO mail-pl1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbeIONsT (ORCPT ); Sat, 15 Sep 2018 09:48:19 -0400 Received: by mail-pl1-f179.google.com with SMTP id b12-v6so5215115plr.8; Sat, 15 Sep 2018 01:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=g9G0LCjIhEqqOgc/LH49pCBf+8Zu5XhNdM9Rks8TeSk=; b=jCcvA0R4z7nxEQ4RByqMuVJVi+xmD7AqvqGDtezWMyvUCbCbgIMPqFy3U0RQU5FwjX 0bAlkapYr38nzjS7ckCCYFfUVCEO6WOUW+dPOW5r1L4zxS4ClxFdxwqVxrWD+n5Hg+s+ 3OZgiUdwwWQeexhH7sMdk3qaxN1HoeK3Mo+4VGmSdT+izH/4/CqxzRzIkqi1x9A8NOCP 7uhPlCBDGZwhskPYTFJoYP9IuJ1hr5+2bVTRA6N7sXaToFDLQKEy7qBOtIKPTBAytd9O wA8WZQCDq47TRy/wRYkysKkdqsbkpaTXOBr7TSxbr63xE+77aX8t0/3MUOWxFEiF21SI B29A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=g9G0LCjIhEqqOgc/LH49pCBf+8Zu5XhNdM9Rks8TeSk=; b=uZcTEYFVadUs0z4MUu6c2vk35KYZpIisoDKIJ0R4zZfPI1RIkAeADDvwkb7LZU7emE QX93duMTNYsNuVse/Yf7OV8yxvzhUSJN/BwfQp8w1foKzUZiZzlYVwpaOtHzVfBI+vCA uOJTKvDdgScjmhcZ5Djx8J55FWzCtIRy7Tn1c2+6HqxJcGPRr7qYnT6nfHuYfoBH+nDL Z9cXKaLedrp6gwfUWOlDVwT6S3gNApEFGFPh2Cd/nAyMGeIAKv5X+4BRE+HuZ1xALfA2 JKY0nUbZGFO6RFYClvOsfr7hLmDgzdCtDUOkDT/2yRzwetwGdy1ktPsX5wlNKmUiz/tj 0u9Q== X-Gm-Message-State: APzg51B8Ueq6p5OxvDaVTBlXjFp8XRopTowJdCqRck3TOw+UGXlqlimP CtBJCIlZQuPM3xc1aMj6cM2/Zrbb X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr15959894plt.128.1537000209547; Sat, 15 Sep 2018 01:30:09 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.71.58? ([2402:f000:1:1501:200:5efe:a66f:473a]) by smtp.gmail.com with ESMTPSA id b126-v6sm13118115pga.49.2018.09.15.01.30.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Sep 2018 01:30:09 -0700 (PDT) From: Jia-Ju Bai Subject: [BUG] net: wireless: ath9k: Possible sleep-in-atomic-context bugs To: ath9k-devel@qca.qualcomm.com, Kalle Valo Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Linux Kernel Mailing List Message-ID: <9cb1a877-f62b-c70b-d537-6552323de8ae@gmail.com> Date: Sat, 15 Sep 2018 16:30:04 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org My static analysis tool DSAC reports some bugs caused by mutex_lock() in ath9k_regwrite_buffer() and ath9k_reg_rmw_buffer(). Here are the related function call paths (from bottom to top) in Linux-4.17: [FUNC] mutex_lock_nested drivers/net/wireless/ath/ath9k/htc_drv_init.c, 329: mutex_lock_nested in ath9k_regwrite_buffer drivers/net/wireless/ath/ath9k/htc_drv_init.c, 353: ath9k_regwrite_buffer in ath9k_regwrite drivers/net/wireless/ath/ath9k/mac.c, 146: [FUNC_PTR]ath9k_regwrite in ath9k_hw_abort_tx_dma drivers/net/wireless/ath/ath9k/xmit.c, 1911: ath9k_hw_abort_tx_dma in ath_drain_all_txq drivers/net/wireless/ath/ath9k/main.c, 225: ath_drain_all_txq in ath_prepare_reset drivers/net/wireless/ath/ath9k/main.c, 307: ath_prepare_reset in ath_reset_internal drivers/net/wireless/ath/ath9k/main.c, 295: spin_lock_bh in ath_reset_internal [FUNC] mutex_lock_nested drivers/net/wireless/ath/ath9k/htc_drv_init.c, 392: mutex_lock_nested in ath9k_reg_rmw_buffer drivers/net/wireless/ath/ath9k/htc_drv_init.c, 509: ath9k_reg_rmw_buffer in ath9k_reg_rmw drivers/net/wireless/ath/ath9k/mac.c, 148: [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_abort_tx_dma drivers/net/wireless/ath/ath9k/xmit.c, 1911: ath9k_hw_abort_tx_dma in ath_drain_all_txq drivers/net/wireless/ath/ath9k/main.c, 225: ath_drain_all_txq in ath_prepare_reset drivers/net/wireless/ath/ath9k/main.c, 307: ath_prepare_reset in ath_reset_internal drivers/net/wireless/ath/ath9k/main.c, 295: spin_lock_bh in ath_reset_internal [FUNC] mutex_lock_nested drivers/net/wireless/ath/ath9k/htc_drv_init.c, 392: mutex_lock_nested in ath9k_reg_rmw_buffer drivers/net/wireless/ath/ath9k/htc_drv_init.c, 509: ath9k_reg_rmw_buffer in ath9k_reg_rmw drivers/net/wireless/ath/ath9k/hw.c, 2188: [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_set_power_awake drivers/net/wireless/ath/ath9k/hw.c, 2237: ath9k_hw_set_power_awake in ath9k_hw_setpower drivers/net/wireless/ath/ath9k/main.c, 125: ath9k_hw_setpower in ath9k_ps_wakeup drivers/net/wireless/ath/ath9k/main.c, 386: ath9k_ps_wakeup in ath9k_tasklet (tasklet handler) [FUNC] mutex_lock_nested drivers/net/wireless/ath/ath9k/htc_drv_init.c, 329: mutex_lock_nested in ath9k_regwrite_buffer drivers/net/wireless/ath/ath9k/htc_drv_init.c, 353: ath9k_regwrite_buffer in ath9k_regwrite drivers/net/wireless/ath/ath9k/htc_drv_init.c, 503: [FUNC_PTR]ath9k_regwrite in ath9k_reg_rmw drivers/net/wireless/ath/ath9k/hw.c, 2188: [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_set_power_awake drivers/net/wireless/ath/ath9k/hw.c, 2237: ath9k_hw_set_power_awake in ath9k_hw_setpower drivers/net/wireless/ath/ath9k/main.c, 125: ath9k_hw_setpower in ath9k_ps_wakeup drivers/net/wireless/ath/ath9k/main.c, 386: ath9k_ps_wakeup in ath9k_tasklet (tasklet handler) Note that [FUNC_PTR] means a function pointer call is used. I am not sure how to well fix these bugs if they are real. Best wishes, Jia-Ju Bai