Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3527284pxb; Mon, 4 Apr 2022 20:00:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHlcUEO7OBLlArUmyuGfdhECJsOE/gCDnvpjP5WULuon1BMo3s23n/CkENGy2g7EWSJ4pD X-Received: by 2002:a17:902:7c0a:b0:156:87e0:846 with SMTP id x10-20020a1709027c0a00b0015687e00846mr1361250pll.8.1649127626410; Mon, 04 Apr 2022 20:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649127626; cv=none; d=google.com; s=arc-20160816; b=TKhgO3GGnFP180B9dyXFZCg709tMwFfn4Qu8NYdHynjCGiZqnk50eKzQ4LuEWADsgE KK87PzRRWeyy9fwD8dMAnCu3mu/wMyRO1z9iv1UFOJixbCL5S/aX/nefDUwBC9lFCGMB e5JW4ipscBOnKTLuxY5qQC5o2Foo0qrAl1uLRxlHMqX0gNdK36hUdFrurSHALCpi0msO 3FAHNUAjlI2Jz9P0WV7rJ5pGJNaBGxFZ9nM7lPOB8Sxriydtz33TjHcD9Cy8EgfIuV3b UdVPbFWUGDFSy1NbtSmmzzLIE2abFooyvUri2THA3vskO324QbTj2EYXIx11OcSbwM6w kBXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=zbodHHrevjydH+zdP0lL/nnwlQQVq6AdfqnfCx0W7oU=; b=m+GzkBWGAHnWE3wCeAV0VBqFvd1zTpT2dmrO4hI2+QdiYm/wsY2eAZEXqV4JcD18G9 iAkVA6idzWa5GxAVbTkIiwgHXxVMwvp4KIckU5t0/mQgOK+gY+Udnp44fcetUdKHn9y5 reez9ufgR3yvD9jNYqlTAxanfVY3mXc/Ti4DiEotimYlCSh7iUlLJ91mFu9F3lPFMjZe t0f5Ky4wJjiEDOI6XBtIj1oneGth564ygxdE7JMP/pQ7aOUnHG3Z23RHU9Ha+PWjk0Nq SY4lW1P9oIES2OF25gj8QNKlaaJ6102nilJPgTUJT9xUdYfTQ/A3wHg34eaVrfH4lOOd v+9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UHpjHkiD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a20-20020aa79714000000b004fa3a8e0057si10942260pfg.270.2022.04.04.20.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:00:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UHpjHkiD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3EAF2F1435; Mon, 4 Apr 2022 18:24:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357667AbiDCMV4 (ORCPT + 99 others); Sun, 3 Apr 2022 08:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236111AbiDCMVz (ORCPT ); Sun, 3 Apr 2022 08:21:55 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 729B83467E for ; Sun, 3 Apr 2022 05:20:01 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id e16so12478865lfc.13 for ; Sun, 03 Apr 2022 05:20:01 -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:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=zbodHHrevjydH+zdP0lL/nnwlQQVq6AdfqnfCx0W7oU=; b=UHpjHkiDrYV/NBMUyc1gt5luZX4ad+7i18Zz3kJ/GsF5tO2qtEINyZvbs3zDob86D7 ATCHqS8X3g7xgOdfEHxR4j2a2D97tcS9/7owd+fqQQOdMajcP9OC4v7ODAQZaseYt3D2 UCmlB2ILmTQ7ei0QhtadNgNR9zY+gKamkVBTFZysVrUj0CyPUeoHkwnOkVPOHXABrUCV 9PCVpy4Zrfc9+e955iSSq2nOWi4aI+fql5ouwdqZRyaDzFPecdVUbFNkitC8+qvk2GgZ 9bAPqcDzYwwD27LSE354DRPDYLSSG9HwzImx5LfPVqMUC60yUGB/wC05ZqGXvchHJzIK 0BUA== 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:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=zbodHHrevjydH+zdP0lL/nnwlQQVq6AdfqnfCx0W7oU=; b=EVSg3Yt33EQ5Vf2RpCYanwv15kj1+npQ7P7Qk4NGZYhjghiDHuwOzUDslZpA2/SnwO EI95nDw9+3mQo9UHzQIjMIi/eJozkkEy/O1RR6YuxoJkKGGNnVOpe9zQBzw4tjfGOyvI ouoIozXkY+2USRUDbxl2ebHUcBRjgWn81eDcG8GmUN3ye9JdexGbF/i3FIh5KVmOoVP4 UvR0kMRZIkfD2PCklVq3fuu9/FcPZCA1rBA2jiGqleBKkpgbCJZLRJqws+8h2GXWD5RL E3Y77cMfPMnkA87v0Aj3KMCtNF1Is+tkSNOIjs30HvH2QHr3NWaZf+KfMvTNqAlUB1Ne vT8g== X-Gm-Message-State: AOAM5314J/e4AL8Uy7C8/FeqLW/Ax88McPp5s3BCTb4Efra0/RYLi9LJ PRhiRzVQzXPQtL9as2mrlYg= X-Received: by 2002:a19:6750:0:b0:44a:1fd7:530f with SMTP id e16-20020a196750000000b0044a1fd7530fmr19392379lfj.341.1648988399546; Sun, 03 Apr 2022 05:19:59 -0700 (PDT) Received: from [192.168.1.11] ([46.235.67.247]) by smtp.gmail.com with ESMTPSA id c20-20020a196554000000b0044a1181c527sm810298lfj.9.2022.04.03.05.19.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Apr 2022 05:19:59 -0700 (PDT) Message-ID: Date: Sun, 3 Apr 2022 15:19:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: staging: r8188eu: how to handle nested mutex under spinlock Content-Language: en-US From: Pavel Skripkin To: Michael Straube , "Fabio M. De Francesco" Cc: Greg KH , Larry Finger , Phillip Potter , "open list:STAGING SUBSYSTEM" , Linux Kernel Mailing List References: <356c24cf-625b-eea2-2c04-ce132d881cac@gmail.com> <1813843.tdWV9SEqCh@leap> <942bbcb6-725d-9b47-5dfe-f105d30ea6b7@gmail.com> <7365301.EvYhyI6sBW@leap> <3fb13fee-a605-7f2e-81ad-45148082a733@gmail.com> In-Reply-To: <3fb13fee-a605-7f2e-81ad-45148082a733@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 4/3/22 14:48, Pavel Skripkin wrote: > On 4/3/22 14:41, Michael Straube wrote: >> >> Hi Fabio, >> >> wait.. >> >> rtw_set_802_11_disassociate() calls rtw_pwr_wakeup() only if >> check_fwstate(pmlmepriv, _FW_LINKED) is true. >> >> >> if (check_fwstate(pmlmepriv, _FW_LINKED)) { >> rtw_disassoc_cmd(padapter, 0, true); >> rtw_indicate_disconnect(padapter); >> rtw_free_assoc_resources(padapter, 1); >> rtw_pwr_wakeup(padapter); >> } >> > > msleep() cannot be called in atomic context: > > drivers/staging/r8188eu/core/rtw_pwrctrl.c:379 > > if (pwrpriv->ps_processing) { > while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000) > msleep(10); > } > Hm, just wondering, shouldn't we annotate load from pwrpriv->ps_processing with READ_ONCE() inside while loop? IIUC compiler might want to cache first load into register and we will stuck here forever. Am I missing something? With regards, Pavel Skripkin