What driver created this dmesg message?

Usually, dmesg entries are prepended by the name of the driver that is posting the message to the buffer. This makes it easy to track down where the error is coming from and how to fix it. In my case, the following message has no meta-information about it:

[12208.948242] Pin 28 not available for GPIO

This string (or relevant substrings) doesn't seem to be present in the linux kernel sources, so there must be a driver or something present.

Short of grepping through all of the source that I can find that's running on this machine, is there any way to figure out who sent this message so I can further diagnose why this particular error is occurring?

Note This question isn't necessarily about this specific message, but a general question about how to back-track and find an offending driver


Well grepping the kernel source is exactly the best way to find out:

bericote [~/src/linux] % git grep -F "not available for GPIO"
drivers/gpio/gpio-thunderx.c:   WARN_RATELIMIT(!rv, "Pin %d not available for GPIO\n", line);

So the answer seems to be the gpio-thunderx module but I suspect that doesn't answer the question you really wanted to ask.

What you really want to know is what causes it, but the code that issues it is a generic check that is called by various routines that try and access a GPIO pin and what you probably really want to know is who called that routine - in other words what part of the kernel is trying to access something that isn't a GPIO as a GPIO.