Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3140644rwo; Mon, 24 Jul 2023 06:56:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlHEBgn1LgkKYEG4EoRnI5upC870zV2X8mlna8BcKrKltKTv0JG8bFfXHM8FkDWUPL5fHhnN X-Received: by 2002:ac2:4ec5:0:b0:4fb:89b3:3373 with SMTP id p5-20020ac24ec5000000b004fb89b33373mr4847083lfr.43.1690206962271; Mon, 24 Jul 2023 06:56:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690206962; cv=pass; d=google.com; s=arc-20160816; b=EfIvRJH80rnnGy4nmGsh0BNSc+LumlKQ9hC1GgMAuNh+5I54VT+IBD1YPk7WjZtgBQ 4sad+nWF9jBLq1hiNNFBKSHwbOp612TPFUD9kqZEUg/+sX5tstzV9RAL9tf0EH88Z9cX 3noRGV4Nya0aooOybUFnHb1Z50QKSMdxc5N8WtCATpqsC26PMPEKmuRcEWhOkOV2dH+U 0yb/VJRLQTJt6Y+BNQj7pCtQi0b/nKYVv42VHEnKZHbVBxYZTUgFObScAsF9lvaeD+a6 CLTtl4kqull0lHPIxXduAg2oU6eMinDo92/HC6unXwyV/UmX2QJOTBOvLocFzDirPkNC uqFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=7JH2N+MZ4Yew6D8lRMINgoPINuXIJ+oLnl1vxRiDcug=; fh=OINt9P2euf8Jdu/YxzAtxdN83tvg/DGdYfSND9fUKtI=; b=yTc/VDr6k+th5eQ4nzPUvEo0y/nwAjaehEOh/7TRtYgAj2KjFEZGG++31vjAVT5Ogw r7t/GGZCL0t9QQKkQD0R74dFjRiVNW2KAPMq+M3gNRXxpVE5WEVBqgIL2Iq7HO1RBrXg s4CvOuZ8144iMdXdAz+9LOBAqkS4Xsm5RtPgcwASkL54sPAaToedtE9Bc41lEkGwmNOZ pl2G4rbPZm5oXn2s9J1gcCwdgyYZdVY1aa6ZxMIxbLERdKSRV4hpzNJYk2Q+lNuIP50w +3UyTPFAcNrRkIpc+VWcSbiiL9jRgpjmnYpALiAQuCFucoC/N6zp/F4afQMOWXFArA/7 XyGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="Ol/r5rij"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020aa7de04000000b005222a66a953si1769659edv.627.2023.07.24.06.55.46; Mon, 24 Jul 2023 06:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@amd.com header.s=selector1 header.b="Ol/r5rij"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbjGXNop (ORCPT + 58 others); Mon, 24 Jul 2023 09:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232333AbjGXNno (ORCPT ); Mon, 24 Jul 2023 09:43:44 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::615]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 406FB19A1; Mon, 24 Jul 2023 06:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VlncVbPTUH5dAnc3UCpmyu/OacANLCQNR23qjGr3WvhEXM0BuunTmRGP4uBE8bRPLukSCYQxdZHLchnt/mkmqp0bM0SSJM297ONErgyGRp7FhEYWT1BpJCcw+whN62Qy2r70tPIZoSL15ngtV0QvTyIYkoWr1Z4p0ixYyZU/SVPfIemdZhJEPFIunC47P9ebOgoG12mlnKkObThNucJO3xP5vcia4Qtta1ARsNKAzNWvGTnx82t9b/qFq2ObBdvrwj2T+S86UeiyCSwwg0xhzE71mQZPBhs+Ej/xvICra+jwSmTmrSGH6g3le/vjrdlZ6R+9n02Ag0ZKNP5QSTSKWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7JH2N+MZ4Yew6D8lRMINgoPINuXIJ+oLnl1vxRiDcug=; b=MiBuAgp9iTFwKrdzDkp6DZPMPpP11pdxahVnAt2Fnmt74iaf+TdiWp4/C3g94Y8lEBuk5w4aO3UTqBvXOqLENJ71ogHgwXemXGGhVV6WHv3RvFxHCIxMZq60QWnIAQTpKw+zijZCrqbKRVyabuey2DKiR6go7XhgeCLBmzchtuxBdfpeu7DjLTfEgpkTBEkNVjwKFTuHNrtkC/eW9aWu4LvmA0qQxbd2stFVFL8qVrK5aDebKRzLJt4H5nFKmw/HM9o2uEfkp21DnCQJsS13dFdeB6PDiNuay/pjtsrxlOOiQxARTZ4xxO2IlGU7froHigz9ZQN09cfpqei3PAMzZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7JH2N+MZ4Yew6D8lRMINgoPINuXIJ+oLnl1vxRiDcug=; b=Ol/r5rijg6JclY5Z+jppK8yHaYnXiS2ck+GdynX1T3UKQYjn3Yg0IfEb7AwsNFkUbbcOK78QQ+XuUAfCm4BTknKHyFo4ndlaNK0oSkCTZ89Yrlt9MzsUD08ARwmXluFCZdAVzOzDw18X7AGHeDFR39qnz8UDPIcX4Zb7CGpoYxk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by CY8PR12MB7684.namprd12.prod.outlook.com (2603:10b6:930:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul 2023 13:40:37 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::36f9:ffa7:c770:d146]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::36f9:ffa7:c770:d146%7]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023 13:40:37 +0000 Message-ID: <7d059aed-fac0-cdcd-63d5-58185bb345db@amd.com> Date: Mon, 24 Jul 2023 08:40:33 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH V7 4/9] wifi: mac80211: Add support for ACPI WBRF To: Andrew Lunn , Evan Quan Cc: rafael@kernel.org, lenb@kernel.org, Alexander.Deucher@amd.com, Christian.Koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mdaenzer@redhat.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, hdegoede@redhat.com, jingyuwang_vip@163.com, Lijo.Lazar@amd.com, jim.cromie@gmail.com, bellosilicio@gmail.com, andrealmeid@igalia.com, trix@redhat.com, jsg@jsg.id.au, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org References: <20230719090020.2716892-1-evan.quan@amd.com> <20230719090020.2716892-5-evan.quan@amd.com> <9b1f45f9-02a3-4c03-b9d5-cc3b9ab3a058@lunn.ch> Content-Language: en-US From: "Limonciello, Mario" In-Reply-To: <9b1f45f9-02a3-4c03-b9d5-cc3b9ab3a058@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0101.namprd04.prod.outlook.com (2603:10b6:806:122::16) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|CY8PR12MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 46ef888e-9e45-440c-f24d-08db8c4b903d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1clvL9l3lWYE9hEIrdcf2Dtu/xIfWqROz7J30rMAUT3fGeCOmwBeS4MCEMokD0DDd69kygMyM00BNwGbztVY52NarfjT0BaIr3DbTzPCdNjwMqs8lc+qf0zYdpBrfdhcWJfX4+SlQSD3kzUk0qqKOvbaAlZCt52xVOU7JwZjQyxr1xu3Z27c/SBn1x7vCxUc3q63i8GVuzBk6/mSO8xP182b5qsGAy3tcfsLgShwVH6fBdfZ45FxC/ofuGdXVorOFMFwcoM2hmRLbn9aQeReLQHUghlNrV19V4DJj7NdsRTwbSuUBR42kLFWFY/oexHF1CLT1xrJDGgT92+YUPuefQT3O1M4S5KCzh+jyZrScqpH+gNhyJB+BCm86nBzE7e0/nPksgJeSP1DChU7pkg/KZUzeoThZ0GOqDfIf0vP28wp0G34kHGgF/Y7xQ2vXIkAfR1BCwlY6xd+Gq2JtuvHCMlG0eRuAy1LIIL5qSQF8ix8MM4nMGCUZia9BM2EchU3/n5RXNhm+wpHDZoFg/7Zr2iWpOPCjs73LbZcirxlXpqkgvScKaAs0jYc6Ql2y25oAgAbcteiiBSHIWa9W6oF/W141TQOB6TRiVXpd8lSazCg5CXlJ4kg3xSzxnRp2uy5R79Ws2PrtxX5U5FZHMNL5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(366004)(451199021)(186003)(26005)(53546011)(6506007)(31696002)(5660300002)(36756003)(8936002)(8676002)(7416002)(2906002)(2616005)(86362001)(38100700002)(83380400001)(6486002)(6666004)(6512007)(316002)(66556008)(4326008)(6636002)(66946007)(66476007)(478600001)(31686004)(110136005)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T2sxSWd3ZnNRSlNzSWxqUFZRbW5TVEFkcnBoZkRZTTdDbjY0MlUyQ2hFTzN0?= =?utf-8?B?MXB6NHNEaFFZUHJ5SlBpTTljd3cyaWFoZ3UxdXVoalhzWFNGSGJuMGlpMzJ3?= =?utf-8?B?WlU4a0NMaXNUK3M1U3JwdDZ5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Kc2Zv?= =?utf-8?B?ckpZaXgydUNYRnhUUkNNZktnYmlJUDNmUzlXYmhXa1BTZXRwS3RUOFVXL3hh?= =?utf-8?B?VS9XTXhuOEVUSWZPajNLYVl1cktyTzlMZGw1UWJIYjVkZDczL0lGZThaNDBF?= =?utf-8?B?VEdGbUFyTmt6MVdGTjBwQ0hka2pPajV4Ty9wcmdDUzhINzNmRENac3pPbDFS?= =?utf-8?Q?xnKVfmZv/rWeB7Bpua4KsJL1K?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46ef888e-9e45-440c-f24d-08db8c4b903d X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:40:37.6890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h1sKb9G7leKWVRP1St/LYYzp82fnZQ/SGhX1eWFj4JSlvRIjfA6zAeoeY196V8FuVaTPhuLIvJLPUVieh0DZxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7684 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_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 7/24/2023 04:22, Andrew Lunn wrote: >> @@ -1395,6 +1395,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) >> debugfs_hw_add(local); >> rate_control_add_debugfs(local); >> >> + ieee80211_check_wbrf_support(local); >> + >> rtnl_lock(); >> wiphy_lock(hw->wiphy); >> > >> +void ieee80211_check_wbrf_support(struct ieee80211_local *local) >> +{ >> + struct wiphy *wiphy = local->hw.wiphy; >> + struct device *dev; >> + >> + if (!wiphy) >> + return; >> + >> + dev = wiphy->dev.parent; >> + if (!dev) >> + return; >> + >> + local->wbrf_supported = wbrf_supported_producer(dev); >> + dev_dbg(dev, "WBRF is %s supported\n", >> + local->wbrf_supported ? "" : "not"); >> +} > > This seems wrong. wbrf_supported_producer() is about "Should this > device report the frequencies it is using?" The answer to that depends > on a combination of: Are there consumers registered with the core, and > is the policy set so WBRF should take actions. > > The problem here is, you have no idea of the probe order. It could be > this device probes before others, so wbrf_supported_producer() reports > false, but a few second later would report true, once other devices > have probed. > > It should be an inexpensive call into the core, so can be made every > time the channel changes. All the core needs to do is check if the > list of consumers is empty, and if not, check a Boolean policy value. > > Andrew No, it's not a combination of whether consumers are registered with the core. If a consumer probes later it needs to know the current in use frequencies too. The reason is because of this sequence of events: 1) Producer probes. 2) Producer selects a frequency. 3) Consumer probes. 4) Producer stays at same frequency. If the producer doesn't notify the frequency because a consumer isn't yet loaded then the consumer won't be able to get the current frequency.