Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3675454iob; Tue, 17 May 2022 05:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybA9gVQ0n48uywjaxTPK1OcnSXfWKchP5w+2IP2KoamSDVK+F1/OSfDTVBuxZuSkL3MZhd X-Received: by 2002:a17:902:cec7:b0:15e:b8b0:b9c8 with SMTP id d7-20020a170902cec700b0015eb8b0b9c8mr23096872plg.155.1652789674135; Tue, 17 May 2022 05:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652789674; cv=none; d=google.com; s=arc-20160816; b=Lp/DS0CfUoONcWqGB6fJbn2PyB9ElfQ+EnXKlG9WBPwx+LVZmXy0xK59/ghld66hH8 kXpLjoDsxRX0PU6219XX0Pyr2opn23Lad6zQDMvQkOkG1ycqFX43AxrWpKHgLKHYK/J8 bheXqhTLk1+qyzVO0I7T+NEfQ41FwxxEuCcfy2jmE6UR9rgIjFA+DLc7/W0+uqNn7gVu L97IU8yJcrAafWnkxcBdLNJ00+csmrv3HjJnymkbx5eRpDvhqgrzUx4Ogzop46XJMA4R /huyCnYCrD7cGereR2S9WWDrdIsE/GvrwPaq9aCuvybNbevPzTdEMHo3w6+kOd+NDLkj ACIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a48ohQX9baCP+ngE3tbncN+xc7mJR6J4dNVRbnua3n4=; b=lvhLiGjYi2g35QeLYfC3Pv+YrVUxb19nYQsXb3gocSgEAYtKZGASF3ODyTHpViMDYM FrVAcYc+9PEMrc2+esUEAsBaS4nwxyVvLZJQTL15abXOsX9wiKT+wSqLWAJPd9cnvlvW 6wOt6l+Wz2VP6MacdHH3vfU0CKo7iYTIekf2OQXgs+/JdacW4RhEtrScZuGYncUflGFy kIFf9nT4j9PDKRENGWmflwR0MmEJU1f0lXEQ4rwfaHoKEulJwLyTEpsUR2CNG3wcllBR rw9dOSuTinuJRWwKqj7xLK9iLUg/JP7y+6s5m7vvYwMdf+gXnFmmApP3hv+iHUi/g69r 43aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WGGAHc2U; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170903300d00b00158951ab217si13253729pla.342.2022.05.17.05.14.17; Tue, 17 May 2022 05:14:34 -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=@intel.com header.s=Intel header.b=WGGAHc2U; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232766AbiEQJIP (ORCPT + 70 others); Tue, 17 May 2022 05:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244342AbiEQJHn (ORCPT ); Tue, 17 May 2022 05:07:43 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743D723171 for ; Tue, 17 May 2022 02:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652778404; x=1684314404; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ttOpXnLYQ6yRfaXL5Oy3O3S8eImL4Z4PjMNZ2xkhqFE=; b=WGGAHc2UNslVfsoJ5iSmnMyqPqNTE9u8J82bKw6A0A3eHiMNvLrkHO1Y Rp5f1tEO6tgDCq/ji+BmYYNOsPGkBcx1bYA8GVewgtH3dFu40YZ0DNHBf jvlY5PiqUgTz3G44EK+YGRK//QuA9uvGt1NY7h0Sdcqx5HPoC/F1irZfa iEqgpUKMx5FECFv1JKa4MWskRA12kaDuBNSG+SSnxS+qzaIsJDuRt1ee3 y/iwxhYPLZ8nLho48ngRhU9TK2NPzWjG0ndySMEXMnJpRZnvZgLNVRudR rTa/8SA0dAprUl3xGemLfM33is/vTZqC0OfXzFVeREBa0DuGeYudu8eF4 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="271064762" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="271064762" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 02:06:25 -0700 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="741679715" Received: from sgens-mobl3.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.212.48]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 02:06:23 -0700 From: gregory.greenman@intel.com To: kvalo@kernel.org Cc: johannes@sipsolutions.net, gregory.greenman@intel.com, linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 04/10] iwlwifi: fw: init SAR GEO table only if data is present Date: Tue, 17 May 2022 12:05:08 +0300 Message-Id: <20220517120044.bc45923b74e9.Id2b4362234b7f8ced82c591b95d4075dd2ec12f4@changeid> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220517090514.211796-1-gregory.greenman@intel.com> References: <20220517090514.211796-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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-wireless@vger.kernel.org From: Johannes Berg When no table data was read from ACPI, then filling the data and returning success here will fill zero values, which means transmit power will be limited to 0 dBm. This is clearly not intended. Return an error from iwl_sar_geo_init() if there's no data to fill into the command structure. Signed-off-by: Johannes Berg Fixes: 78a19d5285d9 ("iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage") Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 33aae639ad37..e6d64152c81a 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -937,6 +937,9 @@ int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, { int i, j; + if (!fwrt->geo_enabled) + return -ENODATA; + if (!iwl_sar_geo_support(fwrt)) return -EOPNOTSUPP; -- 2.35.1