提交 fac7d118 编写于 作者: D David E. Box 提交者: Jun Tian

mfd: intel_pmt: Fix nuisance messages and handling of disabled capabilities

mainline inclusion
from mainline-v5.13-rc1
commit a1a5c1c3
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596K9
CVE: NA

Intel-SIG: commit a1a5c1c3 mfd: intel_pmt: Fix nuisance messages and
handling of disabled capabilities.
Backport for intel PMT (Platform Monitoring Technology) support

--------------------------------

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: 4f8217d5 ("mfd: Intel Platform Monitoring Technology support")
Signed-off-by: NDavid E. Box <david.e.box@linux.intel.com>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: Nyingbao jia <yingbao.jia@intel.com>
Signed-off-by: NJun Tian <jun.j.tian@intel.com>
上级 e44c89b4
...@@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header, ...@@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header,
case DVSEC_INTEL_ID_WATCHER: case DVSEC_INTEL_ID_WATCHER:
if (quirks & PMT_QUIRK_NO_WATCHER) { if (quirks & PMT_QUIRK_NO_WATCHER) {
dev_info(dev, "Watcher not supported\n"); dev_info(dev, "Watcher not supported\n");
return 0; return -EINVAL;
} }
name = "pmt_watcher"; name = "pmt_watcher";
break; break;
case DVSEC_INTEL_ID_CRASHLOG: case DVSEC_INTEL_ID_CRASHLOG:
if (quirks & PMT_QUIRK_NO_CRASHLOG) { if (quirks & PMT_QUIRK_NO_CRASHLOG) {
dev_info(dev, "Crashlog not supported\n"); dev_info(dev, "Crashlog not supported\n");
return 0; return -EINVAL;
} }
name = "pmt_crashlog"; name = "pmt_crashlog";
break; break;
default: default:
dev_err(dev, "Unrecognized PMT capability: %d\n", id);
return -EINVAL; return -EINVAL;
} }
...@@ -174,12 +173,8 @@ static int pmt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -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); header.offset = INTEL_DVSEC_TABLE_OFFSET(table);
ret = pmt_add_dev(pdev, &header, quirks); ret = pmt_add_dev(pdev, &header, quirks);
if (ret) { if (ret)
dev_warn(&pdev->dev,
"Failed to add device for DVSEC id %d\n",
header.id);
continue; continue;
}
found_devices = true; found_devices = true;
} while (true); } while (true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册