Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23062337rwd; Fri, 30 Jun 2023 17:29:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlECCKoMSebupum1NWR+IU18kFZedHVO8vRx63M5r9irDGghgxPiXJc0p3qfBLMqOqSzwxJn X-Received: by 2002:a25:286:0:b0:c1d:5199:8ec5 with SMTP id 128-20020a250286000000b00c1d51998ec5mr3834158ybc.60.1688171399514; Fri, 30 Jun 2023 17:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688171399; cv=none; d=google.com; s=arc-20160816; b=yn6UKABmIwRx8td8IsBRist+AZOEfr44nliVLDZe2upEO7oJkpRQNz3ZaSlmljZc/j HKnk9WyVjpYP6dmhC5OOXo0Xi5wz7yAtcWKH+xt/w9J137CQhLQCeKk6CYFZF698qBDf 7QQvQ9d/DIlRiIyZKAhuQMm6ZgDdTxPyW1VXP6ulLd8hoAW4lJDEMVL4ETigWYKCmnVu IV662QPmNhNuunqlTrPAMUChZPSgamOO2sNc4NumKYq7UCU/FDmrjSuMPvTyox9wigaU iWWq2TPMILDNIq+J3/qeaIPJKlyKCxArxh+WbRH64M4wHXzWrfHr9RbbZGyHZuYJ2gfm t6YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RSoC/5hYUUQ3sGJr52lBB+aV7IzoV8b72rkry2pxCQg=; fh=D6nYKxI5p4Smxpa6kt74yrzpYFjczuTbkMJFqTiguQY=; b=cVFOOIW95joNkyBIpCV6yWHZQJ1pWS4CUpv99qT5q4TlhxTfQKNS2AbwM4xQ0j5R1m gvrSsbFkL8Qp4BfJ6oBzUlE0Bc3Y3DJLJF0Pey+8zQB2VVcLXvyzUR5bbo0YwySL5G1S WemylRwCBHUmn62M7J97lUixMo4FP+Wc7f/tr71wxCnUa3+XV5xJW0TXHaNc2irKgf7g U4M4YE8ZtaJaE0O+y9gmJ2WJuBGPFOb6Cv3NUio+Dgi8wJq5AWiBfPFKOMfEK2h/6iyI EZqxh1h4sxCEmAVb/VY4sKASkB0QHTbZbQGnF0tLQMXkXwmSzN0MHV4MkjCeozHg3ipr JOJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=yAyplwTg; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020a635149000000b0054fda551fecsi13227958pgl.426.2023.06.30.17.29.46; Fri, 30 Jun 2023 17:29:59 -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=@lunn.ch header.s=20171124 header.b=yAyplwTg; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbjGAAUn (ORCPT + 59 others); Fri, 30 Jun 2023 20:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjGAAUm (ORCPT ); Fri, 30 Jun 2023 20:20:42 -0400 Received: from vps0.lunn.ch (unknown [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124083A9B; Fri, 30 Jun 2023 17:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=RSoC/5hYUUQ3sGJr52lBB+aV7IzoV8b72rkry2pxCQg=; b=yAyplwTga+cJQhNVxS4WCa0avC XATcUdMc7wgQTO46g7k9dcH2lTxfJGRCofunObU6mN+84w113eNMP2VoKVQEFW1R1wTRQT0i64hLW KT9C9WzHFOqZAlNELVDobW+4G2P/rybEr2j3erhGyjDcrRq59amX2UprnR8BcrFLmzDQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qFOKp-000LM8-66; Sat, 01 Jul 2023 02:19:31 +0200 Date: Sat, 1 Jul 2023 02:19:31 +0200 From: Andrew Lunn To: 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, Mario.Limonciello@amd.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 Subject: Re: [PATCH V5 1/9] drivers core: Add support for Wifi band RF mitigations Message-ID: <7e7db6eb-4f46-407a-8d1f-16688554ad80@lunn.ch> References: <20230630103240.1557100-1-evan.quan@amd.com> <20230630103240.1557100-2-evan.quan@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630103240.1557100-2-evan.quan@amd.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 > Drivers/subsystems contributing frequencies: > > 1) During probe, check `wbrf_supported_producer` to see if WBRF supported > for the device. What is the purpose of this stage? Why would it not be supported for this device? > +#ifdef CONFIG_WBRF > +bool wbrf_supported_producer(struct device *dev); > +int wbrf_add_exclusion(struct device *adev, > + struct wbrf_ranges_in *in); > +int wbrf_remove_exclusion(struct device *dev, > + struct wbrf_ranges_in *in); > +int wbrf_retrieve_exclusions(struct device *dev, > + struct wbrf_ranges_out *out); > +bool wbrf_supported_consumer(struct device *dev); > + > +int wbrf_register_notifier(struct notifier_block *nb); > +int wbrf_unregister_notifier(struct notifier_block *nb); > +#else > +static inline bool wbrf_supported_producer(struct device *dev) { return false; } > +static inline int wbrf_add_exclusion(struct device *adev, > + struct wbrf_ranges_in *in) { return -ENODEV; } > +static inline int wbrf_remove_exclusion(struct device *dev, > + struct wbrf_ranges_in *in) { return -ENODEV; } The normal aim of stubs is that so long as it is not expected to be fatal if the functionality is missing, the caller should not care if it is missing. So i would expect these to return 0, indicating everything worked as expected. > +static inline int wbrf_retrieve_exclusions(struct device *dev, > + struct wbrf_ranges_out *out) { return -ENODEV; } This is more complex. Ideally you want to return an empty set, so there is nothing to do. So i think the stub probably wants to do a memset and then return 0. > +static inline bool wbrf_supported_consumer(struct device *dev) { return false; } > +static inline int wbrf_register_notifier(struct notifier_block *nb) { return -ENODEV; } > +static inline int wbrf_unregister_notifier(struct notifier_block *nb) { return -ENODEV; } And these can just return 0. Andrew