From df01e1af48216bd908706d439df81c8d95a1e1f7 Mon Sep 17 00:00:00 2001 From: brook Date: Thu, 23 Jun 2022 03:36:00 +0000 Subject: [PATCH] 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). --- sys/arch/arm/amlogic/meson8b_pinctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm/amlogic/meson8b_pinctrl.c b/sys/arch/arm/amlogic/meson8b_pinctrl.c index 8d514a159fb1..c92d46f169d9 100644 --- a/sys/arch/arm/amlogic/meson8b_pinctrl.c +++ b/sys/arch/arm/amlogic/meson8b_pinctrl.c @@ -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 @@ -27,7 +27,7 @@ */ #include -__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 @@ -226,6 +226,7 @@ static const struct meson_pinctrl_gpio meson8b_cbus_gpios[] = { 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),