Skip to content

Commit 98b1783

Browse files
committed
Merge tag 'x86_misc_for_v6.0_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc x86 updates from Borislav Petkov: - Add a bunch of PCI IDs for new AMD CPUs and use them in k10temp - Free the pmem platform device on the registration error path * tag 'x86_misc_for_v6.0_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: hwmon: (k10temp): Add support for new family 17h and 19h models x86/amd_nb: Add AMD PCI IDs for SMN communication x86/pmem: Fix platform-device leak in error path
2 parents 42efa5e + d906fa7 commit 98b1783

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

arch/x86/kernel/amd_nb.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@
1919
#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0
2020
#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480
2121
#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630
22+
#define PCI_DEVICE_ID_AMD_17H_MA0H_ROOT 0x14b5
2223
#define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4
24+
#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8
25+
#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8
2326
#define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464
2427
#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec
2528
#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494
2629
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c
2730
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
31+
#define PCI_DEVICE_ID_AMD_17H_MA0H_DF_F4 0x1728
2832
#define PCI_DEVICE_ID_AMD_19H_DF_F4 0x1654
2933
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F4 0x14b1
3034
#define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5
3135
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d
3236
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e
37+
#define PCI_DEVICE_ID_AMD_19H_M60H_DF_F4 0x14e4
38+
#define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4
3339

3440
/* Protect the PCI config register pairs used for SMN. */
3541
static DEFINE_MUTEX(smn_mutex);
@@ -41,8 +47,11 @@ static const struct pci_device_id amd_root_ids[] = {
4147
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) },
4248
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) },
4349
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_ROOT) },
50+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_ROOT) },
4451
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_ROOT) },
4552
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_ROOT) },
53+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_ROOT) },
54+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_ROOT) },
4655
{}
4756
};
4857

@@ -61,12 +70,15 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
6170
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
6271
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
6372
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
73+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3) },
6474
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
6575
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
6676
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
6777
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
6878
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
6979
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
80+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
81+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
7082
{}
7183
};
7284

@@ -81,6 +93,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
8193
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) },
8294
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) },
8395
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
96+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F4) },
8497
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) },
8598
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F4) },
8699
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) },

arch/x86/kernel/pmem.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ static __init int register_e820_pmem(void)
2727
* simply here to trigger the module to load on demand.
2828
*/
2929
pdev = platform_device_alloc("e820_pmem", -1);
30-
return platform_device_add(pdev);
30+
31+
rc = platform_device_add(pdev);
32+
if (rc)
33+
platform_device_put(pdev);
34+
35+
return rc;
3136
}
3237
device_initcall(register_e820_pmem);

drivers/hwmon/k10temp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
428428
data->ccd_offset = 0x154;
429429
k10temp_get_ccd_support(pdev, data, 8);
430430
break;
431+
case 0xa0 ... 0xaf:
432+
data->ccd_offset = 0x300;
433+
k10temp_get_ccd_support(pdev, data, 8);
434+
break;
431435
}
432436
} else if (boot_cpu_data.x86 == 0x19) {
433437
data->temp_adjust_mask = ZEN_CUR_TEMP_RANGE_SEL_MASK;
@@ -445,6 +449,11 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
445449
data->ccd_offset = 0x300;
446450
k10temp_get_ccd_support(pdev, data, 8);
447451
break;
452+
case 0x60 ... 0x6f:
453+
case 0x70 ... 0x7f:
454+
data->ccd_offset = 0x308;
455+
k10temp_get_ccd_support(pdev, data, 8);
456+
break;
448457
case 0x10 ... 0x1f:
449458
case 0xa0 ... 0xaf:
450459
data->ccd_offset = 0x300;
@@ -489,10 +498,13 @@ static const struct pci_device_id k10temp_id_table[] = {
489498
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
490499
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
491500
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
501+
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3) },
492502
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
493503
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
494504
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
495505
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
506+
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
507+
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
496508
{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
497509
{}
498510
};

include/linux/pci_ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,13 @@
556556
#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
557557
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F3 0x144b
558558
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
559+
#define PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3 0x1727
559560
#define PCI_DEVICE_ID_AMD_19H_DF_F3 0x1653
560561
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F3 0x14b0
561562
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F3 0x167c
562563
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F3 0x166d
564+
#define PCI_DEVICE_ID_AMD_19H_M60H_DF_F3 0x14e3
565+
#define PCI_DEVICE_ID_AMD_19H_M70H_DF_F3 0x14f3
563566
#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
564567
#define PCI_DEVICE_ID_AMD_LANCE 0x2000
565568
#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001

0 commit comments

Comments
 (0)