Skip to contentSkip to conversation

Make firmware vs driver major version mismatch an error.

PATCH In review [email protected] 2 participants 2 messages Feb 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make firmware vs driver major version mismatch an error.

From: Eliot Blennerhassett <[email protected]>

I.e. incompatible firmware will fail driver load.

---
 pci/asihpi/hpidspcd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
pci/asihpi/hpidspcd.c +7 -0
index 8c0f251..f58d5a0 100644
@@ -103,6 +103,13 @@ short HpiDspCode_Open(
 		goto error2;
 	}
 
+	if (header.version / 10000 != HPI_VER_DECIMAL / 10000) {
+		HPI_DEBUG_LOG(ERROR,
+			"Firmware Major Version mismatch  DSP image %d != Driver %d\n",
+			header.version, HPI_VER_DECIMAL);
+		goto error2;
+	}
+
 	if (header.version != HPI_VER_DECIMAL) {
 		HPI_DEBUG_LOG(WARNING,
 			"Version mismatch  DSP image %d != Driver %d\n",
Signature · 1 line
1.7.0.rc0.8.ge3f67d
#1 lore raw

At Wed, 03 Feb 2010 10:07:37 +1300,

Quoted 6 lines · [email protected] wrote:

From: Eliot Blennerhassett <[email protected]>

I.e. incompatible firmware will fail driver load.

Applied now. Thanks.

Takashi

Quoted 25 lines
---
 pci/asihpi/hpidspcd.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
pci/asihpi/hpidspcd.c +7 -0
index 8c0f251..f58d5a0 100644
@@ -103,6 +103,13 @@ short HpiDspCode_Open(
 		goto error2;
 	}
 
+	if (header.version / 10000 != HPI_VER_DECIMAL / 10000) {
+		HPI_DEBUG_LOG(ERROR,
+			"Firmware Major Version mismatch  DSP image %d != Driver %d\n",
+			header.version, HPI_VER_DECIMAL);
+		goto error2;
+	}
+
 	if (header.version != HPI_VER_DECIMAL) {
 		HPI_DEBUG_LOG(WARNING,
 			"Version mismatch  DSP image %d != Driver %d\n",
Signature · 1 line
1.7.0.rc0.8.ge3f67d