From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25648C433DF for ; Tue, 4 Aug 2020 10:46:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 052DD2070A for ; Tue, 4 Aug 2020 10:46:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Gqatqbi0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GOwIiWlf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 052DD2070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=WLwjks2UYTUh2+9s/etaNpSOW0BsTVMXt3DmNMZ5XwM=; b=Gqatqbi0H1dt5m26SUwzTOjoCW itBXJ4dBOy/3QueWpqMFntAHnYUBtNHl/reIglmXb0PHuFsZAR9dPfCSnFIpGmnzQlanzt+vIgt7k drL3J4U/oj3L+JSoy6VRYMrD3zlk8pEuH+2d1HQ2DI9v8kN5LvqSN4TPRdeKscnSHwkUrYkJqYcZZ pphQ05TjlBXzy8DEaKO3LG+HI6FjtFqNdJLu/2ywi5uSnGvlSJAp4+XMLidlfEvrYTbsafwZZbrQ8 nqB7EyJG0gSKhjbDLCezpvmjAUFbeUZKmBrD2FbQGA6c9pfci8mLigktCsc/MyWQ4J02K5tnJHeZM YnQ1lKJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2uS9-00019s-3Z; Tue, 04 Aug 2020 10:45:53 +0000 Received: from aserp2120.oracle.com ([141.146.126.78]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2uS7-000193-Lw for linux-mediatek@lists.infradead.org; Tue, 04 Aug 2020 10:45:52 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 074AfvB0061907; Tue, 4 Aug 2020 10:45:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=XzIUTpiHbaUP7Ep8zZtBldS+bK07BMIVeB9fyRRtjig=; b=GOwIiWlfm3NVavzvx1t5k6YSBgWgpIg0rqRKl+jChPeBEYd9VbwSpqe5lEVY5dTLZWWt 5PASePdbgz/acoOpUndAcnNLwL9B5F0osRR3EfTuHB+5VJWH3qJjnvFCmi9nrcSQSVBQ oOWzs/QMmWarE8cnUicqBmB9bfL8ef4Ky0ul99XX0RKPLPPDfEfon/8522nChLQK7KEI CNrxLi3FH7GDUog5afY8FJ2EIotKdEiuecPwMkdnpFsX2QTMGRHgWqkNi82p6cOi7DZQ W6ndcrGekHIXFYMoRQr6n5rjX0kxbc0qnvVrGH/mlGXahZUO6X+Esj3NIIPm6nkftkd9 FQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 32nc9yj4uj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 04 Aug 2020 10:45:46 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 074Agq3i002634; Tue, 4 Aug 2020 10:45:45 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 32pdnpvhgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Aug 2020 10:45:45 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 074AjfPD005043; Tue, 4 Aug 2020 10:45:41 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Aug 2020 03:45:40 -0700 Date: Tue, 4 Aug 2020 13:45:35 +0300 From: To: lorenzo@kernel.org Subject: [bug report] mt76: mt7615: wake device before accessing regmap in debugfs Message-ID: <20200804104535.GA398141@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9702 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040080 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9702 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 suspectscore=3 phishscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 adultscore=0 clxscore=1011 malwarescore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040080 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200804_064551_854301_D7CA0DB7 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hello Lorenzo Bianconi, The patch ea4906c4be49: "mt76: mt7615: wake device before accessing regmap in debugfs" from Jul 3, 2020, leads to the following static checker warning: drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179 mt7615_reset_test_set() warn: inconsistent returns 'dev->mt76.mutex'. drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c 159 static int 160 mt7615_reset_test_set(void *data, u64 val) 161 { 162 struct mt7615_dev *dev = data; 163 struct sk_buff *skb; 164 165 if (!mt7615_wait_for_mcu_init(dev)) 166 return 0; 167 168 mt7615_mutex_acquire(dev); 169 170 skb = alloc_skb(1, GFP_KERNEL); 171 if (!skb) 172 return -ENOMEM; ^^^^^^^^^^^^^^ This is returning with the mutex held. What is the mutex protecting? We could move the allocation and the skb_put() before the mt7615_mutex_acquire(). 173 174 skb_put(skb, 1); 175 mt76_tx_queue_skb_raw(dev, 0, skb, 0); 176 177 mt7615_mutex_release(dev); 178 179 return 0; 180 } regards, dan carpenter _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek