Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp689845pxb; Wed, 24 Feb 2021 12:18:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqPGzB7762sxQpTsTCz5kFO/Puz2uo0Bnu20/KeSoW1uYhz+RjFuGCCMvbP0hnjMdlTQon X-Received: by 2002:a50:f9c6:: with SMTP id a6mr10067586edq.240.1614197898403; Wed, 24 Feb 2021 12:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614197898; cv=none; d=google.com; s=arc-20160816; b=Phr3FOk59fDVsraAvMGzhzS/MmOUsaLQtkdDal4VbyhHWyQy2m9FpnpbP14OO2e/7V grjtVmxWKJTvqr5m/Umu2saeerJ1eiVbVQMjohSi9poZIbf/bLIASqrCcRD3DrRjYLNC CtBndJ49wMwd8ZiZTsKHYdf3ZYMO3H0goS2Wqx3HGRpprSBF0LS6sjykW3P76c7XStxu inNZMz7lQp2BCviuDtcy/RKHrezwYTtDtiA9f2y8S/0WMN0JI9CDPENy6Baarf9Yik0B yPKbIpqLtr4dxcKI5H7KOONbbFmaBk3zGQEcBzwiXl3xLD98CZF3hcWJOAFNLzeWvYuK quLw== 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 :ironport-sdr:ironport-sdr; bh=OSDtavlFZ1nXZkT0qm0QtVxhSAJOimFTjW6NYAKo3v4=; b=RMEbsQYwVwOz6ewqPqQAfzoDd1SMZ6r20KDwMns0iKlrkoyfjlqn7IcDBNCVhNbTmk 4d6NOtoEQK+m0Qf9vhWiJbTsvdQ0esgIRZnTakh6rRXeXJWXrU5JhhZb6weJNlFtXedd bXBoIalIBZHyqyVwBzqyTJjW3i0sGGnDYAtMZPmg4MFkFoMxGQJbWP6lZ5lSEL/SHbCH ktSGdrQ6IrcS2YbHyWU4K2xrtlkbhBhIK/BNAf6xJxt4jQEjMUigsLZyDQQKiCOSaNyU 3WsTtxCkRyR5YtZqc1+doCx2aapqDRfWOk2w0izO3SQnrACbBOAOqNQ1D2ZbY16M7luS Qv2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si1904005ejz.595.2021.02.24.12.17.54; Wed, 24 Feb 2021 12:18:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235239AbhBXUQk (ORCPT + 99 others); Wed, 24 Feb 2021 15:16:40 -0500 Received: from mga17.intel.com ([192.55.52.151]:7357 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235605AbhBXUMo (ORCPT ); Wed, 24 Feb 2021 15:12:44 -0500 IronPort-SDR: gv6AbQYvGAKiqubHclKpiNViOx0hb+rkMZF7aFteD1HhpgaUD5cXf1Ll94+pi4b/kH8kBaMUGl LoTWRV/okSnA== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="165162186" X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="165162186" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 12:10:55 -0800 IronPort-SDR: GnkWRUM9MVOWcyCXKaQbxOOe9sQjawPljt1KyH6E4NxKDODyVKntO9NfBQuPX1eKcAUcGMMCw1 cj/ApTkB1tiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="404080289" Received: from linux.intel.com ([10.54.29.200]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2021 12:10:55 -0800 Received: from debox1-desk2.jf.intel.com (debox1-desk2.jf.intel.com [10.54.75.16]) by linux.intel.com (Postfix) with ESMTP id 3DCA15804A9; Wed, 24 Feb 2021 12:10:55 -0800 (PST) From: "David E. Box" To: lee.jones@linaro.org, hdegoede@redhat.com, mgross@linux.intel.com Cc: "David E. Box" , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH V2 1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities Date: Wed, 24 Feb 2021 12:10:04 -0800 Message-Id: <20210224201005.1034005-1-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128172846.99352-1-david.e.box@linux.intel.com> References: <20210128172846.99352-1-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some products will be available that have PMT capabilities that are not supported. Remove the warnings in this instance to avoid nuisance messages and confusion. Also return an error code for capabilities that are disabled by quirk to prevent them from keeping the driver loaded if only disabled capabilities are found. Fixes: 4f8217d5b0ca ("mfd: Intel Platform Monitoring Technology support") Signed-off-by: David E. Box Reviewed-by: Hans de Goede --- For merge in platform-drivers-x86 Based on 5.11-rc1 review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Changes from V1: - None. Patch 2 added. drivers/mfd/intel_pmt.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c index 744b230cdcca..65da2b17a204 100644 --- a/drivers/mfd/intel_pmt.c +++ b/drivers/mfd/intel_pmt.c @@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header, case DVSEC_INTEL_ID_WATCHER: if (quirks & PMT_QUIRK_NO_WATCHER) { dev_info(dev, "Watcher not supported\n"); - return 0; + return -EINVAL; } name = "pmt_watcher"; break; case DVSEC_INTEL_ID_CRASHLOG: if (quirks & PMT_QUIRK_NO_CRASHLOG) { dev_info(dev, "Crashlog not supported\n"); - return 0; + return -EINVAL; } name = "pmt_crashlog"; break; default: - dev_err(dev, "Unrecognized PMT capability: %d\n", id); return -EINVAL; } @@ -174,12 +173,8 @@ static int pmt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) header.offset = INTEL_DVSEC_TABLE_OFFSET(table); ret = pmt_add_dev(pdev, &header, quirks); - if (ret) { - dev_warn(&pdev->dev, - "Failed to add device for DVSEC id %d\n", - header.id); + if (ret) continue; - } found_devices = true; } while (true); base-commit: a7d53dbbc70a81d5781da7fc905b656f41ad2381 -- 2.25.1