Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2090362pxb; Fri, 25 Mar 2022 10:55:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw34aFV5ndNS+sZVU516KmcYQic4BLEB3nwh0VUi/qzPa2+qgjRChaJknOoPKkyyJigTWDF X-Received: by 2002:a63:6c4:0:b0:382:8506:c127 with SMTP id 187-20020a6306c4000000b003828506c127mr577331pgg.279.1648230916076; Fri, 25 Mar 2022 10:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230916; cv=none; d=google.com; s=arc-20160816; b=IZhwlIvP1WgvykS8sieh0D+IgiDy1jMGQaeMDWXpGgjeCMwd0wM2gY8Re4KvPMdm1I /haIUjZUryDPkanuD/WlRkadQFIEo3cuyFb5pY3IwDgQxeFBpF8cxF3i94+/OkI5rmu9 BrafIahZ2ESqMrP4D7+URTTml9s4UMJJEPDjL3m5t3eZpYlcg61VFPLtA5wVO11+85gR hutjQ/gyyeAaiZcvNTu6MRhCyuBUVVW6elx4vQ4ZbpINlkc0D/gbUw/ycoPx/Z/8eosI HsmuqN16E2k3JnFFYlGxhp9+hMOM+L8zXMSJmPOfkBzouw69mzdOo4iX9Ir2Uebs++D8 sJjw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i2Bbg/cYRN5mrZnzSLn+Ht/7nppmZw0ahJ0M85HaGfg=; b=C9G9fGN9RJAMsLg/LkkG8fwpl27qcsO3CUw6FQJzT0GhCkqRXd8clUKNrKBXhc/d0e /1rdtbPvU2Dj8vGCZXI71tBe2tw7EXo4U9NNdOPz5Loc41KRICG2yPjrRTvSAPQRf3Nl EKXRDNbPIvuxNBxcy1rVRf+JijJ7BTVaweofPzPkycfNHGB6v4RS3DXjGvdy1MjDE/83 OGgKoEYiRvYLpsXHYoFsAKRI1qTc7f/SMeQFz3pT4/OktjvePglUXJa4BKZskAKDUT4V XPHY3PnpHAVSAAORLHcgiVj+I3c0Hk+bMc03WZ5bruMkyOBuolONJZWhebNEKHYiTbnq CDJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=g7EMGW1N; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g5-20020a17090a9b8500b001c6fd2c181dsi6513216pjp.94.2022.03.25.10.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:55:16 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-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=@quicinc.com header.s=qcdkim header.b=g7EMGW1N; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2AFE2D3AD0; Fri, 25 Mar 2022 10:35:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245311AbiCYRQe (ORCPT + 70 others); Fri, 25 Mar 2022 13:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbiCYRQd (ORCPT ); Fri, 25 Mar 2022 13:16:33 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56DC2E7F59 for ; Fri, 25 Mar 2022 10:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1648228499; x=1679764499; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=i2Bbg/cYRN5mrZnzSLn+Ht/7nppmZw0ahJ0M85HaGfg=; b=g7EMGW1Nl8xYDdSfOVulZGPTdc3ldVsFn45xsuVH0rGwSlVHo97gYHqo M+luuUw6zCW3s+eOZvBzh/1fDzNA/49cd4w+PeHaERazICLe/fF22m5bm 8tW0uKMqNGrL+zjgd+gNa7CSKzC6/QPMJbt3Pqws/RgHVftHK46HjiBey Y=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 Mar 2022 10:14:58 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2022 10:14:59 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 25 Mar 2022 10:14:58 -0700 Received: from [10.110.27.134] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 25 Mar 2022 10:14:57 -0700 Message-ID: Date: Fri, 25 Mar 2022 10:14:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [BUG] deadlock in nl80211_vendor_cmd Content-Language: en-US To: Johannes Berg , William McVicker CC: , Marek Szyprowski References: <0000000000009e9b7105da6d1779@google.com> <99eda6d1dad3ff49435b74e539488091642b10a8.camel@sipsolutions.net> <5d5cf050-7de0-7bad-2407-276970222635@quicinc.com> <2b2fa5d9-238a-81fa-8978-94bd9753b73e@quicinc.com> <1c6d5a1f033ef079cef4e3aaf6ead9f946da4db0.camel@sipsolutions.net> From: Jeff Johnson In-Reply-To: <1c6d5a1f033ef079cef4e3aaf6ead9f946da4db0.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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-wireless@vger.kernel.org On 3/25/2022 9:04 AM, Johannes Berg wrote: > On Fri, 2022-03-25 at 08:59 -0700, Jeff Johnson wrote: >> On 3/25/2022 5:09 AM, Johannes Berg wrote: >>> On Tue, 2022-03-22 at 21:58 +0000, William McVicker wrote: >>>> >>>> It would be nice if nl80211_vendor_cmd() could support taking the RTNL lock if >>>> requested via the vendor flags. That would require moving the wiphy lock to >>>> nl80211_vendor_cmds() so that it could take the RTNL and wiphy lock in the >>>> correct order. Is that something you'd be open to Johannes? >>> >>> Not very, to be honest. If we had a good use case for it, maybe, but >>> you're not even saying quite what the use case is :) >> >> I believe Will and I are up against the same issues. Out-of-tree Android >> drivers use a large number of vendor commands to support the >> requirements of the Android framework. Prior to 5.12 these vendor >> commands would always be called with the rtnl lock held, and in some >> cases the implementation of the vendor commands care about that, >> especially when calling back into the kernel. In particular we are faced >> with the issue that there are some kernel APIs that require that the >> rtnl lock be held, and as a result of the lock infrastructure change we >> can no longer call those APIs from vendor commands. That is a pretty >> severe limitation to work around. > > I'm not really sure how sympathetic I am to an out-of-tree use case I > cannot even see, and I'd probably consider problematic in the first > place :) You can see them, they're open source, just not in-tree. That doesn't mean you wouldn't find things there problematic. There are many reasons that most (all?) Android wifi drivers are out-of-tree, but that is a different discussion. > > Your easiest option might be to just patch NL80211_FLAG_NEED_RTNL into > your kernel for vendor commands and call it a day? Well it isn't my kernel, it's Android's kernel since now with the ACK they control the kernel: https://source.android.com/devices/architecture/kernel/android-common So Will and I would have to advocate for that, and this may be a reasonable short-term solution. But I'm sure that Greg KH would like to minimize the deltas between the ACK and upstream. /jeff