On Sun, Dec 30, 2018 at 10:35 AM H. Nikolaus Schaller <hns@xxxxxxxxxxxxx> wrote: > > Am 30.12.2018 um 10:24 schrieb Andreas Kemnade <andreas@xxxxxxxxxxxx>: > >> Any ideas what might be causing this on boot? Are we maybe missing > >> a call on boot to mmc_gpio_get_cd() somewhere? > >> > > it hides some bogous cd gpio defines in dtb. At least on some pyra > > models. We had wrong polarity there. > > Before this patch cd gpios were not really being used. With correct code > it uses bad definitions. This makes a lot of sense, can you folks confirm that fixing the device tree fixes the issue? If there are old device trees deployed (and I am thinking about mass production here, not prototype boards) we might have to insert quirks to the GPIO core to account for their erroneous polarity flags. If that is necessary we can patch drivers/gpio/gpiolib-of.c with a quirk to deal with it, this is where I collect all GPIO DT quirk business. We would then use something like if (of_machine_is_compatible("funny-board")) && !strcmp(name, "cd")) etc. Yours, Linus Walleij