Hello,
I ran powerdebug on Linaro Android 14.04 with a custom kernel (config file attached). While exporting gpios, it seems to crash the kernel (detail log attached).
I have some printfs, added in powerdebug export_free_gpios() function to assist during log taking.
for (i = 0 ; i <= gpio_max ; i++) { char command[50] = "";
printf("exporting gpio: %d\n", i); sprintf(command, "echo %d > /sys/class/gpio/export", i); printf("command: %s\n", command); if ((ret=system(command)) < 0) printf("error: failed to export gpio-%d\n", i); printf("ret: %d\n", ret); }
From log, it looks like while trying to export gpio 8, kernel crash is
happening -
"Unable to handle kernel NULL pointer dereference at virtual address 00000044" (details in attached log)
From output of /sys/kernel/debug/gpio it looks like gpio 8 is not
mapped to any device. Even manually trying to export gpio 8 causes the same crash.
root@arndale:/ # cat /sys/kernel/debug/gpio
GPIOs 0-7, GPA0: gpio-0 (s3c24xx-uart ) in hi gpio-1 (s3c24xx-uart ) in hi gpio-2 (s3c24xx-uart ) in lo gpio-3 (s3c24xx-uart ) in hi gpio-6 (i2c-bus ) in hi gpio-7 (i2c-bus ) in hi
GPIOs 9-14, GPA1: gpio-9 (s3c24xx-uart ) in hi gpio-10 (s3c24xx-uart ) in hi gpio-11 (s3c24xx-uart ) in hi gpio-12 (s3c24xx-uart ) in hi gpio-13 (s3c24xx-uart ) in lo gpio-14 (s3c24xx-uart ) in hi
GPIOs 16-23, GPA2:
GPIOs 25-29, GPB0:
GPIOs 31-35, GPB1:
GPIOs 37-40, GPB2:
GPIOs 42-45, GPB3: gpio-42 (i2c-bus ) in hi gpio-43 (i2c-bus ) in hi
GPIOs 47-53, GPC0: gpio-47 (dw-mci-bus ) in lo gpio-48 (dw-mci-bus ) in hi gpio-50 (dw-mci-bus ) in hi gpio-51 (dw-mci-bus ) in hi gpio-52 (dw-mci-bus ) in hi gpio-53 (dw-mci-bus ) in hi
GPIOs 55-58, GPC1: gpio-55 (dw-mci-bus ) in hi gpio-56 (dw-mci-bus ) in hi gpio-57 (dw-mci-bus ) in hi gpio-58 (dw-mci-bus ) in hi
GPIOs 60-66, GPC2:
GPIOs 68-74, GPC3: gpio-68 (dw-mci-bus ) in lo gpio-69 (dw-mci-bus ) in hi gpio-70 (dw-mci-cd ) in lo gpio-71 (dw-mci-bus ) in hi gpio-72 (dw-mci-bus ) in hi gpio-73 (dw-mci-bus ) in hi gpio-74 (dw-mci-bus ) in hi
GPIOs 76-82, GPC4:
GPIOs 84-87, GPD0: gpio-84 (s3c24xx-uart ) in lo gpio-85 (s3c24xx-uart ) in hi gpio-86 (s3c24xx-uart ) in lo gpio-87 (s3c24xx-uart ) in hi
GPIOs 89-96, GPD1:
GPIOs 98-103, GPY0:
GPIOs 105-108, GPY1:
GPIOs 110-115, GPY2:
GPIOs 117-124, GPY3:
GPIOs 126-133, GPY4:
GPIOs 135-142, GPY5:
GPIOs 144-151, GPY6:
GPIOs 153-160, GPX0:
GPIOs 162-169, GPX1: gpio-163 (VDD_33ON_2.8V ) out hi
GPIOs 171-178, GPX2: gpio-174 (S5M8767 DS2 ) out lo gpio-175 (S5M8767 DS3 ) out lo gpio-176 (S5M8767 DS4 ) out lo
GPIOs 180-187, GPX3: gpio-187 (HPD ) in lo
GPIOs 189-196, GPE0:
GPIOs 198-199, GPE1:
GPIOs 201-204, GPF0:
GPIOs 206-209, GPF1:
GPIOs 211-218, GPG0:
GPIOs 220-227, GPG1:
GPIOs 229-230, GPG2:
GPIOs 232-235, GPH0:
GPIOs 237-244, GPH1:
GPIOs 246-253, GPV0:
GPIOs 255-262, GPV1:
GPIOs 264-271, GPV2:
GPIOs 273-280, GPV3:
GPIOs 282-283, GPV4:
GPIOs 285-291, GPZ:
On the same board, running Linaro Saucy server does not cause any crash with powerdebug. In that case, output from /sys/kernel/debug/gpio looks as follows-
GPIOs 0-7, platform/11400000.pinctrl, gpa0:
GPIOs 8-13, platform/11400000.pinctrl, gpa1:
GPIOs 14-21, platform/11400000.pinctrl, gpa2:
GPIOs 22-26, platform/11400000.pinctrl, gpb0:
GPIOs 27-31, platform/11400000.pinctrl, gpb1:
GPIOs 32-35, platform/11400000.pinctrl, gpb2:
GPIOs 36-39, platform/11400000.pinctrl, gpb3:
GPIOs 40-46, platform/11400000.pinctrl, gpc0:
GPIOs 47-50, platform/11400000.pinctrl, gpc1:
GPIOs 51-57, platform/11400000.pinctrl, gpc2:
GPIOs 58-64, platform/11400000.pinctrl, gpc3:
GPIOs 65-68, platform/11400000.pinctrl, gpd0:
GPIOs 69-76, platform/11400000.pinctrl, gpd1: gpio-76 (usb3503 connect ) out hi
GPIOs 77-83, platform/11400000.pinctrl, gpc4:
GPIOs 84-89, platform/11400000.pinctrl, gpy0:
GPIOs 90-93, platform/11400000.pinctrl, gpy1:
GPIOs 94-99, platform/11400000.pinctrl, gpy2:
GPIOs 100-107, platform/11400000.pinctrl, gpy3:
GPIOs 108-115, platform/11400000.pinctrl, gpy4:
GPIOs 116-123, platform/11400000.pinctrl, gpy5:
GPIOs 124-131, platform/11400000.pinctrl, gpy6:
GPIOs 132-139, platform/11400000.pinctrl, gpx0:
GPIOs 140-147, platform/11400000.pinctrl, gpx1: gpio-141 (VDD_33ON_2.8V ) out hi gpio-144 (SW-TACT2 ) in hi gpio-145 (SW-TACT3 ) in hi gpio-146 (SW-TACT4 ) in hi gpio-147 (SW-TACT5 ) in hi
GPIOs 148-155, platform/11400000.pinctrl, gpx2: gpio-148 (SW-TACT6 ) in hi gpio-149 (SW-TACT7 ) in hi gpio-151 (S5M8767 DS2 ) out lo gpio-152 (S5M8767 DS3 ) out lo gpio-153 (S5M8767 DS4 ) out lo
GPIOs 156-163, platform/11400000.pinctrl, gpx3: gpio-161 (usb3503 reset ) out hi gpio-163 (HPD ) in lo
GPIOs 164-171, platform/13400000.pinctrl, gpe0:
GPIOs 172-173, platform/13400000.pinctrl, gpe1:
GPIOs 174-177, platform/13400000.pinctrl, gpf0:
GPIOs 178-181, platform/13400000.pinctrl, gpf1:
GPIOs 182-189, platform/13400000.pinctrl, gpg0:
GPIOs 190-197, platform/13400000.pinctrl, gpg1:
GPIOs 198-199, platform/13400000.pinctrl, gpg2:
GPIOs 200-203, platform/13400000.pinctrl, gph0:
GPIOs 204-211, platform/13400000.pinctrl, gph1:
GPIOs 212-219, platform/10d10000.pinctrl, gpv0:
GPIOs 220-227, platform/10d10000.pinctrl, gpv1:
GPIOs 228-235, platform/10d10000.pinctrl, gpv2:
GPIOs 236-243, platform/10d10000.pinctrl, gpv3:
GPIOs 244-245, platform/10d10000.pinctrl, gpv4:
GPIOs 246-252, platform/3860000.pinctrl, gpz:
Questions -
1. Is it kernel bug? 2. Why are some gpios (8, 15, 24, etc) not mapped to any device on android? 3. Total GPIOs count differ on Linaro Saucy and Linaro Android on same board. Is this expected?
-- Thanks, -Meraj
linaro-android@lists.linaro.org