Received: by 2002:ac8:3b51:0:b0:3f3:9eb6:4eb6 with SMTP id r17csp2796381qtf; Wed, 24 May 2023 10:46:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vOJagoxL/GJHHWgNzf8yrx9Huz4fiq58F2X04ZO9P79nd+FVhnUb5CYqA4hrhNrwH86Lt X-Received: by 2002:a17:903:1112:b0:1a9:bc13:7e20 with SMTP id n18-20020a170903111200b001a9bc137e20mr21342109plh.44.1684950374334; Wed, 24 May 2023 10:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684950374; cv=none; d=google.com; s=arc-20160816; b=0UI1CDxDWFrmopMDNwMVNgfBwG61Ocr5LfFCeFd1KxqFfPh1Xd24U/TWX7lcIs3G8b 9vn/JV0bwGWWIUF4OBVAGaZlm3HT0U79itLyfcuDyrOJEt+MPqkP4U9O87Qe8zKqTP/c nIrHZKBZm2J2YfY7d7B3DBzVup4+8VaGyI3tYRpuQyxTYylw2PxncWbwJ75XkLtwB+kE V2CR0OrzQQZ11HgeZsnqfYq2I0F4Uu59YLpF+vV3nOWa/gA2qZLtCC9Duzuztd10BV/U EWQTVdVjjAh8CpiOvgy3tr8eJgimeNSkoU5Na9XiJt4/HaXKn5AH5Hep1Kpa/Z1PydeT n0BA== 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=Ex9yWJ56Lev7GjTZegSXG7ko2MWB3Wu3pA+GPLauB7o=; b=dwsn2KQxO2eW182GCv3FQZUbRtnM4BW3kC/NnSQoJSfh0k5U9sDYXHo1kdtRjKns2e Us1r762JYBCbL576c7g+rNi/3UyVKOWZWkwZr7zXiu58gYtLHR1C9HW5Tw7G/FUz4Tv4 WB42KkrUchVUYkjuZSK5+PvChLqaVT1yg1jseJ6faDN9p6QTkMJCj8WwV3CgvQGy/UhB KHbsvkN61TvU8QXbpJrDFqnAB8GXjp0VmuuotmiL2DAHCgsCQvyvmy6GzSYF6uDZ1KGw 1rdRUZWBqDQQSh++b3kWi1ttTgEBv2WwQ3/2SIVaOtfhycVt8vP2OA2yO0dnrM0WhSp4 kndg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="U/4t0VPB"; 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 a4-20020a1709027d8400b001ac36e5ec0esi1642161plm.299.2023.05.24.10.46.05; Wed, 24 May 2023 10:46:14 -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="U/4t0VPB"; 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 S236109AbjEXRp5 (ORCPT + 63 others); Wed, 24 May 2023 13:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236110AbjEXRpx (ORCPT ); Wed, 24 May 2023 13:45:53 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1BE122 for ; Wed, 24 May 2023 10:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684950317; x=1716486317; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GdnDifGCq605v24mSJbVHN2idq5dUI+5r+hWnGkWoXQ=; b=U/4t0VPBNgF0O7Y46zennTOGMHaQ5Ugh/nXuLQWkWP+f7yO3L4tMnIUC 4WK5p50qd0ZimboPUyoPd9sMGu+Sto4PRpN8KYtKygVnVd7RRMrd/Rxwa wXp9Lz2q1EhYlj8Fe1POnLV6JUCvhhZCzTHBiOFzrBLCsL1teBqjq5XZ4 DIh0wKHE3hYb3W/jfPhZo11xfF3NLKNuU+2lYbRIO6ikL8e0zis7JvUPn BNhC9r4qLMaXIsqGiKPAAsrDGy19566ODqRMg1MNAIKO6OFPGqvGW+NRt oONFq1H28ZqxjIPzO2IpPQDg7hsgNO/Bek9BXHnhfz0V/JHAP3xybi9c/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="440000404" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="440000404" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 10:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="769547925" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="769547925" Received: from hmozes-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.89.195]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 10:42:46 -0700 From: gregory.greenman@intel.com To: kvalo@kernel.org, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Haim Dreyfuss , Gregory Greenman Subject: [PATCH 06/14] wifi: iwlwifi: don't silently ignore missing suspend or resume ops Date: Wed, 24 May 2023 20:42:03 +0300 Message-Id: <20230524203151.0c55e0ca92f1.I6870fe1683215e65d3d036f9b576b03b7b7257be@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230524174211.1482360-1-gregory.greenman@intel.com> References: <20230524174211.1482360-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 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: Haim Dreyfuss In case the driver doesn't implement suspend or resume operations on the transport layer, notify the driver's upper layer. Otherwise, we might access d3_status uninitialized. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h index 9f1228b5a384..885581e636c7 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h @@ -1160,7 +1160,7 @@ static inline int iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, { might_sleep(); if (!trans->ops->d3_suspend) - return 0; + return -EOPNOTSUPP; return trans->ops->d3_suspend(trans, test, reset); } @@ -1171,7 +1171,7 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans, { might_sleep(); if (!trans->ops->d3_resume) - return 0; + return -EOPNOTSUPP; return trans->ops->d3_resume(trans, status, test, reset); } -- 2.38.1