Skip to content

Commit f8204f0

Browse files
ausyskingregkh
authored andcommitted
mei: avoid FW version request on Ibex Peak and earlier
The fixed MKHI client on PCH 6 gen platforms does not support fw version retrieval. The error is not fatal, but it fills up the kernel logs and slows down the driver start. This patch disables requesting FW version on GEN6 and earlier platforms. Fixes warning: [ 15.964298] mei mei::55213584-9a29-4916-badf-0fb7ed682aeb:01: Could not read FW version [ 15.964301] mei mei::55213584-9a29-4916-badf-0fb7ed682aeb:01: version command failed -5 Cc: <[email protected]> +v4.18 Cc: Paul Menzel <[email protected]> Signed-off-by: Alexander Usyskin <[email protected]> Signed-off-by: Tomas Winkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4d86dfd commit f8204f0

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

drivers/misc/mei/bus-fixup.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,21 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev)
218218
{
219219
int ret;
220220

221+
/* No need to enable the client if nothing is needed from it */
222+
if (!cldev->bus->fw_f_fw_ver_supported &&
223+
!cldev->bus->hbm_f_os_supported)
224+
return;
225+
221226
ret = mei_cldev_enable(cldev);
222227
if (ret)
223228
return;
224229

225-
ret = mei_fwver(cldev);
226-
if (ret < 0)
227-
dev_err(&cldev->dev, "FW version command failed %d\n", ret);
230+
if (cldev->bus->fw_f_fw_ver_supported) {
231+
ret = mei_fwver(cldev);
232+
if (ret < 0)
233+
dev_err(&cldev->dev, "FW version command failed %d\n",
234+
ret);
235+
}
228236

229237
if (cldev->bus->hbm_f_os_supported) {
230238
ret = mei_osver(cldev);

drivers/misc/mei/hw-me.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,8 @@ static bool mei_me_fw_type_sps(struct pci_dev *pdev)
13551355
#define MEI_CFG_FW_SPS \
13561356
.quirk_probe = mei_me_fw_type_sps
13571357

1358+
#define MEI_CFG_FW_VER_SUPP \
1359+
.fw_ver_supported = 1
13581360

13591361
#define MEI_CFG_ICH_HFS \
13601362
.fw_status.count = 0
@@ -1392,31 +1394,41 @@ static const struct mei_cfg mei_me_ich10_cfg = {
13921394
MEI_CFG_ICH10_HFS,
13931395
};
13941396

1395-
/* PCH devices */
1396-
static const struct mei_cfg mei_me_pch_cfg = {
1397+
/* PCH6 devices */
1398+
static const struct mei_cfg mei_me_pch6_cfg = {
13971399
MEI_CFG_PCH_HFS,
13981400
};
13991401

1402+
/* PCH7 devices */
1403+
static const struct mei_cfg mei_me_pch7_cfg = {
1404+
MEI_CFG_PCH_HFS,
1405+
MEI_CFG_FW_VER_SUPP,
1406+
};
1407+
14001408
/* PCH Cougar Point and Patsburg with quirk for Node Manager exclusion */
14011409
static const struct mei_cfg mei_me_pch_cpt_pbg_cfg = {
14021410
MEI_CFG_PCH_HFS,
1411+
MEI_CFG_FW_VER_SUPP,
14031412
MEI_CFG_FW_NM,
14041413
};
14051414

14061415
/* PCH8 Lynx Point and newer devices */
14071416
static const struct mei_cfg mei_me_pch8_cfg = {
14081417
MEI_CFG_PCH8_HFS,
1418+
MEI_CFG_FW_VER_SUPP,
14091419
};
14101420

14111421
/* PCH8 Lynx Point with quirk for SPS Firmware exclusion */
14121422
static const struct mei_cfg mei_me_pch8_sps_cfg = {
14131423
MEI_CFG_PCH8_HFS,
1424+
MEI_CFG_FW_VER_SUPP,
14141425
MEI_CFG_FW_SPS,
14151426
};
14161427

14171428
/* Cannon Lake and newer devices */
14181429
static const struct mei_cfg mei_me_pch12_cfg = {
14191430
MEI_CFG_PCH8_HFS,
1431+
MEI_CFG_FW_VER_SUPP,
14201432
MEI_CFG_DMA_128,
14211433
};
14221434

@@ -1428,7 +1440,8 @@ static const struct mei_cfg *const mei_cfg_list[] = {
14281440
[MEI_ME_UNDEF_CFG] = NULL,
14291441
[MEI_ME_ICH_CFG] = &mei_me_ich_cfg,
14301442
[MEI_ME_ICH10_CFG] = &mei_me_ich10_cfg,
1431-
[MEI_ME_PCH_CFG] = &mei_me_pch_cfg,
1443+
[MEI_ME_PCH6_CFG] = &mei_me_pch6_cfg,
1444+
[MEI_ME_PCH7_CFG] = &mei_me_pch7_cfg,
14321445
[MEI_ME_PCH_CPT_PBG_CFG] = &mei_me_pch_cpt_pbg_cfg,
14331446
[MEI_ME_PCH8_CFG] = &mei_me_pch8_cfg,
14341447
[MEI_ME_PCH8_SPS_CFG] = &mei_me_pch8_sps_cfg,
@@ -1473,6 +1486,8 @@ struct mei_device *mei_me_dev_init(struct pci_dev *pdev,
14731486
mei_device_init(dev, &pdev->dev, &mei_me_hw_ops);
14741487
hw->cfg = cfg;
14751488

1489+
dev->fw_f_fw_ver_supported = cfg->fw_ver_supported;
1490+
14761491
return dev;
14771492
}
14781493

drivers/misc/mei/hw-me.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
* @fw_status: FW status
2121
* @quirk_probe: device exclusion quirk
2222
* @dma_size: device DMA buffers size
23+
* @fw_ver_supported: is fw version retrievable from FW
2324
*/
2425
struct mei_cfg {
2526
const struct mei_fw_status fw_status;
2627
bool (*quirk_probe)(struct pci_dev *pdev);
2728
size_t dma_size[DMA_DSCR_NUM];
29+
u32 fw_ver_supported:1;
2830
};
2931

3032

@@ -62,7 +64,8 @@ struct mei_me_hw {
6264
* @MEI_ME_UNDEF_CFG: Lower sentinel.
6365
* @MEI_ME_ICH_CFG: I/O Controller Hub legacy devices.
6466
* @MEI_ME_ICH10_CFG: I/O Controller Hub platforms Gen10
65-
* @MEI_ME_PCH_CFG: Platform Controller Hub platforms (Up to Gen8).
67+
* @MEI_ME_PCH6_CFG: Platform Controller Hub platforms (Gen6).
68+
* @MEI_ME_PCH7_CFG: Platform Controller Hub platforms (Gen7).
6669
* @MEI_ME_PCH_CPT_PBG_CFG:Platform Controller Hub workstations
6770
* with quirk for Node Manager exclusion.
6871
* @MEI_ME_PCH8_CFG: Platform Controller Hub Gen8 and newer
@@ -77,7 +80,8 @@ enum mei_cfg_idx {
7780
MEI_ME_UNDEF_CFG,
7881
MEI_ME_ICH_CFG,
7982
MEI_ME_ICH10_CFG,
80-
MEI_ME_PCH_CFG,
83+
MEI_ME_PCH6_CFG,
84+
MEI_ME_PCH7_CFG,
8185
MEI_ME_PCH_CPT_PBG_CFG,
8286
MEI_ME_PCH8_CFG,
8387
MEI_ME_PCH8_SPS_CFG,

drivers/misc/mei/mei_dev.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ struct mei_fw_version {
426426
*
427427
* @fw_ver : FW versions
428428
*
429+
* @fw_f_fw_ver_supported : fw feature: fw version supported
430+
*
429431
* @me_clients_rwsem: rw lock over me_clients list
430432
* @me_clients : list of FW clients
431433
* @me_clients_map : FW clients bit map
@@ -506,6 +508,8 @@ struct mei_device {
506508

507509
struct mei_fw_version fw_ver[MEI_MAX_FW_VER_BLOCKS];
508510

511+
unsigned int fw_f_fw_ver_supported:1;
512+
509513
struct rw_semaphore me_clients_rwsem;
510514
struct list_head me_clients;
511515
DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX);

drivers/misc/mei/pci-me.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
6161
{MEI_PCI_DEVICE(MEI_DEV_ID_ICH10_3, MEI_ME_ICH10_CFG)},
6262
{MEI_PCI_DEVICE(MEI_DEV_ID_ICH10_4, MEI_ME_ICH10_CFG)},
6363

64-
{MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, MEI_ME_PCH_CFG)},
65-
{MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, MEI_ME_PCH_CFG)},
64+
{MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, MEI_ME_PCH6_CFG)},
65+
{MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, MEI_ME_PCH6_CFG)},
6666
{MEI_PCI_DEVICE(MEI_DEV_ID_CPT_1, MEI_ME_PCH_CPT_PBG_CFG)},
6767
{MEI_PCI_DEVICE(MEI_DEV_ID_PBG_1, MEI_ME_PCH_CPT_PBG_CFG)},
68-
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH_CFG)},
69-
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH_CFG)},
70-
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH_CFG)},
68+
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH7_CFG)},
69+
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH7_CFG)},
70+
{MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH7_CFG)},
7171
{MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_CFG)},
7272
{MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_CFG)},
7373
{MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, MEI_ME_PCH8_CFG)},

0 commit comments

Comments
 (0)