linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amd64_edac - Add Family 17h Model 70h PCI IDs
@ 2019-09-04 21:13 Isaac Vaughn
  2019-09-04 21:53 ` Borislav Petkov
  0 siblings, 1 reply; 21+ messages in thread
From: Isaac Vaughn @ 2019-09-04 21:13 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: trivial, linux-edac

Dear Mr. Petkov,

I noticed the current EDAC driver doesn't support the new Zen 2 (model 70h) processors, so I patched the new device ids in. The changes are minimal, I merely extended the existing enums with information from the new models.

This is my first kernel patch and I'm not sure I followed the guide (kernel.org/doc/html/v5.2/process/submitting-patches.html) correctly, so please let me know if I need to resubmit this email with updated formatting prior to review.

Sincerely,
Isaac Vaughn

Signed-off-by: Isaac Vaughn <isaac.vaughn@knights.ucf.edu>
---

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 873437be86d9..a35c97f9100a 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2253,6 +2253,15 @@ static struct amd64_family_type family_types[] = {
                        .dbam_to_cs             = f17_base_addr_to_cs_size,
                }
        },
+ [F17_M70H_CPUS] = {
+         .ctl_name = F17h_M70h,
+         .f0_id = PCI_DEVICE_ID_AMD_17H_M70H_DF_F0,
+         .f6_id = PCI_DEVICE_ID_AMD_17H_M70H_DF_F6,
+         .ops = {
+                 .early_channel_count        = f17_early_channel_count,
+                 .dbam_to_cs         = f17_base_addr_to_cs_size,
+         }
+ },
 };
 
 /*
@@ -3241,6 +3250,10 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
                        fam_type = &family_types[F17_M30H_CPUS];
                        pvt->ops = &family_types[F17_M30H_CPUS].ops;
                        break;
+         } else if (pvt->model >= 0x70 && pvt->model <= 0x7f) {
+                 fam_type = &family_types[F17_M70H_CPUS];
+                 pvt->ops = &family_types[F17_M70H_CPUS].ops;
+                 break;
                }
                /* fall through */
        case 0x18:
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 8f66472f7adc..1adf7ddbf744 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -119,6 +119,8 @@
 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F6 0x15ee
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F0 0x1490
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F6 0x1496
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F0 0x1440
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F6 0x1446
 
 /*
  * Function 1 - Address Map
@@ -285,6 +287,7 @@ enum amd_families {
        F17_CPUS,
        F17_M10H_CPUS,
        F17_M30H_CPUS,
+ F17_M70H_CPUS,
        NUM_FAMILIES,
 };
 
~
~
~
~
~

^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [PATCH] Add PCI device IDs for family 17h, model 70h
@ 2019-09-06 23:21 Isaac Vaughn
  2019-09-07  5:59 ` Borislav Petkov
  0 siblings, 1 reply; 21+ messages in thread
From: Isaac Vaughn @ 2019-09-06 23:21 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Mauro Carvalho Chehab, James Morse, linux-edac, linux-kernel

Add the new Family 17h Model 70h PCI IDs (device 18h functions 0 and 6)
to the AMD64 EDAC module.

Cc: Borislav Petkov <bp@alien8.de> (maintainer:EDAC-AMD64)
Cc: Mauro Carvalho Chehab <mchehab@kernel.org> (supporter:EDAC-CORE)
Cc: James Morse <james.morse@arm.com> (reviewer:EDAC-CORE)
Cc: linux-edac@vger.kernel.org (open list:EDAC-AMD64)
Cc: linux-kernel@vger.kernel.org (open list)
Signed-off-by: Isaac Vaughn <isaac.vaughn@knights.ucf.edu>
---
 drivers/edac/amd64_edac.c | 13 +++++++++++++
 drivers/edac/amd64_edac.h |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 873437be86d9..a35c97f9100a 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2253,6 +2253,15 @@ static struct amd64_family_type family_types[] = {
 			.dbam_to_cs		= f17_base_addr_to_cs_size,
 		}
 	},
+	[F17_M70H_CPUS] = {
+		.ctl_name = "F17h_M70h",
+		.f0_id = PCI_DEVICE_ID_AMD_17H_M70H_DF_F0,
+		.f6_id = PCI_DEVICE_ID_AMD_17H_M70H_DF_F6,
+		.ops = {
+			.early_channel_count	= f17_early_channel_count,
+			.dbam_to_cs		= f17_base_addr_to_cs_size,
+		}
+	},
 };
 
 /*
@@ -3241,6 +3250,10 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
 			fam_type = &family_types[F17_M30H_CPUS];
 			pvt->ops = &family_types[F17_M30H_CPUS].ops;
 			break;
+		} else if (pvt->model >= 0x70 && pvt->model <= 0x7f) {
+			fam_type = &family_types[F17_M70H_CPUS];
+			pvt->ops = &family_types[F17_M70H_CPUS].ops;
+			break;
 		}
 		/* fall through */
 	case 0x18:
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 8f66472f7adc..1adf7ddbf744 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -119,6 +119,8 @@
 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F6 0x15ee
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F0 0x1490
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F6 0x1496
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F0 0x1440
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F6 0x1446
 
 /*
  * Function 1 - Address Map
@@ -285,6 +287,7 @@ enum amd_families {
 	F17_CPUS,
 	F17_M10H_CPUS,
 	F17_M30H_CPUS,
+	F17_M70H_CPUS,
 	NUM_FAMILIES,
 };
 
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-09-07 12:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 21:13 [PATCH] amd64_edac - Add Family 17h Model 70h PCI IDs Isaac Vaughn
2019-09-04 21:53 ` Borislav Petkov
2019-09-04 22:21   ` Ghannam, Yazen
2019-09-05  1:21   ` Isaac Vaughn
2019-09-05  7:09     ` Borislav Petkov
2019-09-05 13:17       ` Isaac Vaughn
2019-09-05 13:54         ` Borislav Petkov
2019-09-06  1:01           ` [PATCH] Add PCI device IDs for family 17h, model 70h Isaac Vaughn
2019-09-06  1:41             ` Ghannam, Yazen
2019-09-06  1:56           ` Isaac Vaughn
2019-09-06  9:12             ` Borislav Petkov
     [not found]               ` <20190906075729.9e2faf7147da62fc26006833@knights.ucf.edu>
2019-09-06 12:14                 ` Borislav Petkov
2019-09-06 13:02               ` Guenter Roeck
2019-09-06 13:09                 ` Boris Petkov
     [not found]                   ` <B08C8E54-43FA-4E29-8D7D-5F9C4AF20CCF@Knights.ucf.edu>
2019-09-06 14:50                     ` Borislav Petkov
2019-09-06 23:27                       ` Isaac Vaughn
2019-09-06 16:11                   ` Guenter Roeck
2019-09-06 16:22                     ` Borislav Petkov
2019-09-06 23:21 Isaac Vaughn
2019-09-07  5:59 ` Borislav Petkov
2019-09-07 12:09   ` Isaac Vaughn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).