Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3380092pxb; Mon, 4 Apr 2022 15:10:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWnJnM+RWr/gkSE0iKyOIwI3UYRVEZuktitLHqzHkU5YT9ZjhWZGQh1AaVJwTxZXZtTvc+ X-Received: by 2002:a65:6cc8:0:b0:382:1b18:56a9 with SMTP id g8-20020a656cc8000000b003821b1856a9mr232142pgw.347.1649110203376; Mon, 04 Apr 2022 15:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649110203; cv=none; d=google.com; s=arc-20160816; b=VSIXmyN1eE0ws5PspWpziR7Uaml/87jGmFl0iOs2q06JEKoaeQYUD+59hDwsa5V0VO o6L+EevDp2c1KXgpzwxLYnFYHnO4t5A5+ylxax7leDsv5OMn4W0vTX+ZwIZr1KpfpNG7 +9joZjw+eEGc7foJiUZqztckFpKC0FDDcwueDF/umbqCrGHA3vRtlL2H6UXS30iS0dZc ZtIZ2hoC+QKodpBLwE8JGqlUxBbxcAz2kgHhmRDFew8M3ioPiDPhUXSj0du6QIS9qiPR mB0sWYGNz2F9t+0Tw3Q90yX+Qv75KT2oM2HsshX7aPcyNw5vz0Hxg1P43eCz//9VUMVH WbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=g31uGSPwPMWewxfQR13fcVJH7Aw4CAneBT6TuPz0pyw=; b=L6bEoYfWzqt6KitOs+TNoRLdeKiV7p28VbBjRttHbXH71qqgdciYIwrQxrvJDFf2OH VcvtSCY1wcDBJOsAQgfULa3M5f2IageofjQbaZAncUupLs4g663uAaMQ9q2VYo87IoNm ngE4FwslPcosUEvt4/DuLrOf/k3B4bga0KgyvEXi5Iq2T+u+Kn57yJLrz/dV8adIEPVW 5q0OTip66QArQdlKcf14lbEckZhUxM0rwuPGHXIG5Pnxeu4In47PHUJ95YP+uSSzdVPg IGhqMP61U/VUbwEui3FO1l6TFemZWPeee8lLmF3EgnV09jeqZ1XcH7nctDpcz/MgNwPc WLDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GkFVdk4C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ng12-20020a17090b1a8c00b001bd14e01fa6si189595pjb.148.2022.04.04.15.09.48; Mon, 04 Apr 2022 15:10:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GkFVdk4C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1354603AbiDBUtd (ORCPT + 99 others); Sat, 2 Apr 2022 16:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354329AbiDBUt2 (ORCPT ); Sat, 2 Apr 2022 16:49:28 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA02D8E1AF for ; Sat, 2 Apr 2022 13:47:30 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id u9so1624061edd.11 for ; Sat, 02 Apr 2022 13:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:cc:from :subject:content-transfer-encoding; bh=g31uGSPwPMWewxfQR13fcVJH7Aw4CAneBT6TuPz0pyw=; b=GkFVdk4CcIgbip16DYwzTk93slGlP4VxK4SjUKxFM+RSwqm+odkuGpwemzBxpL5e/d +k5bNxJU3h1RkY19XdzPABWBUop9L120f2EqmM8zbHC99RMheR2usvUpQght/mgURWga OcX+XsBuWOBBZTrCkmWk6xjRqb0cv5vhNkRLHZesnMwKTIE5lYC0dDKcMBZRVzBSWvEk ALLZ5RXpVEgU3VYoJmt5BaOON7BXqpM0H85FplGN3UjGvYxC4ygHc7CTx9TVsJh9Kvl4 uqfZRntJ+HDuNLzDxOT5luEaGd2AXjv46zUTAsdgU1Ka/c1UzonGHQKt8lz+KFPj1Rnz 14fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:from:subject:content-transfer-encoding; bh=g31uGSPwPMWewxfQR13fcVJH7Aw4CAneBT6TuPz0pyw=; b=qxUwGBm/uh6yCZRwfXMJhp5tjHDkA3E51p4AmSmmzAkrQyw9yulCFizYJ35jaLOS3q u6dZaCnGdw76pmDHZzk5HwklKzglYxGBYilH0FbLRrDRbUKcjJllsWwuVs0OAYUt1P+A zEFZkUm0HRncmicytPBL8RCW8P+Absz7FOiWmDHDFFIpQSq6yRaZ6GcTZxc8ndtCpzCb CIKqFFB3UTmeEH8LjV0COQYm597AeeONJ82kdJui2XBsT07kLMI/asUZfhAHOOpjBv3O y65sCN+e1tICNH+xPXy+VboQiIaXgcTRxbBSPsRB6nDAnSDOLVvMkFXw/fJxhkZlZ0wy V1GQ== X-Gm-Message-State: AOAM530ZceLXkbqmE0LecGOciecbwvHAw7vLow6oWv4bxN4D2cn/T+w2 Wi4yKQ5ZNX1CK7SizQatCoQ= X-Received: by 2002:a05:6402:1753:b0:41c:c12d:c1e2 with SMTP id v19-20020a056402175300b0041cc12dc1e2mr331748edx.227.1648932449322; Sat, 02 Apr 2022 13:47:29 -0700 (PDT) Received: from [192.168.0.253] (ip5f5abb55.dynamic.kabel-deutschland.de. [95.90.187.85]) by smtp.gmail.com with ESMTPSA id dm11-20020a170907948b00b006cf488e72e3sm2505910ejc.25.2022.04.02.13.47.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Apr 2022 13:47:28 -0700 (PDT) Message-ID: <356c24cf-625b-eea2-2c04-ce132d881cac@gmail.com> Date: Sat, 2 Apr 2022 22:47:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Greg KH Cc: Larry Finger , Phillip Potter , "open list:STAGING SUBSYSTEM" , Linux Kernel Mailing List , straube.linux@gmail.com From: Michael Straube Subject: staging: r8188eu: how to handle nested mutex under spinlock Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, smatch reported a sleeping in atomic context. rtw_set_802_11_disassociate() <- disables preempt -> _rtw_pwr_wakeup() -> ips_leave() rtw_set_802_11_disassociate() takes a spinlock and ips_leave() uses a mutex. I'm fairly new to the locking stuff, but as far as I know this is not a false positive since mutex can sleep, but that's not allowed under a spinlock. What is the best way to handle this? I'm not sure if converting the mutex to a spinlock (including all the other places where the mutex is used) is the right thing to do? thanks, Michael