Module Name:    src
Committed By:   brook
Date:           Thu Jun 23 03:36:00 UTC 2022

Modified Files:
        src/sys/arch/arm/amlogic: meson8b_pinctrl.c

Log Message:
Add a mising gpio pin description.

This file enumerates the gpio pins in two different ways: as enum
values and as an array of data.  The enum values are used as keys into
the array.  One of the enums, GPIODV_9, is missing from the table.  As
a result, lookup fails to find a matching entry and returns an invalid
entry, which causes the kernel to panic.  This patch adds the missing
data to the array.

However, the underlying problem is not fixed.  Somewhere in the kernel
is lookup logic that does not check the validity of the results to
ensure that a match indeed occurred.  There are no doubt other
potential panics to be triggered by the same lookup code applied to
other tables (or future versions of this one).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/amlogic/meson8b_pinctrl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/amlogic/meson8b_pinctrl.c
diff -u src/sys/arch/arm/amlogic/meson8b_pinctrl.c:1.2 src/sys/arch/arm/amlogic/meson8b_pinctrl.c:1.3
--- src/sys/arch/arm/amlogic/meson8b_pinctrl.c:1.2	Wed Aug 14 09:50:20 2019
+++ src/sys/arch/arm/amlogic/meson8b_pinctrl.c	Thu Jun 23 03:36:00 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: meson8b_pinctrl.c,v 1.2 2019/08/14 09:50:20 jmcneill Exp $ */
+/* $NetBSD: meson8b_pinctrl.c,v 1.3 2022/06/23 03:36:00 brook Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson8b_pinctrl.c,v 1.2 2019/08/14 09:50:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson8b_pinctrl.c,v 1.3 2022/06/23 03:36:00 brook Exp $");
 
 #include <sys/param.h>
 
@@ -226,6 +226,7 @@ static const struct meson_pinctrl_gpio m
 	CBUS_GPIO(GPIOY_14, 3, 14, 3, 14),
 
 	/* GPIODV */
+	CBUS_GPIO(GPIODV_9, 6, 9, 0, 9),
 	CBUS_GPIO(GPIODV_24, 6, 24, 0, 24),
 	CBUS_GPIO(GPIODV_25, 6, 25, 0, 25),
 	CBUS_GPIO(GPIODV_26, 6, 26, 0, 26),

Reply via email to