Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/amlogic Add a mising gpio pin description.



details:   https://anonhg.NetBSD.org/src/rev/0a754a28ff56
branches:  trunk
changeset: 367697:0a754a28ff56
user:      brook <brook%NetBSD.org@localhost>
date:      Thu Jun 23 03:36:00 2022 +0000

description:
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).

diffstat:

 sys/arch/arm/amlogic/meson8b_pinctrl.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 00ec977777d2 -r 0a754a28ff56 sys/arch/arm/amlogic/meson8b_pinctrl.c
--- a/sys/arch/arm/amlogic/meson8b_pinctrl.c    Wed Jun 22 22:41:13 2022 +0000
+++ b/sys/arch/arm/amlogic/meson8b_pinctrl.c    Thu Jun 23 03:36:00 2022 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        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),



Home | Main Index | Thread Index | Old Index