Score:0

What driver created this dmesg message?

de flag

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

Martin avatar
kz flag
you could check the list of loaded modules, as it must come from one of them. But apart from that, there is not much you can do to track down the source... But there should not be many messages which do not prepend their identification in front of the message.
Score:1
cn flag

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.

Brydon Gibson avatar
de flag
In this case - I know who called it. It happened when I tried to export a GPIO pin. It's unfortunate that some drivers don't identify themselves when posting a message
Score:0
ca flag

It seems that the driver is gpio-thunderx (see here)

More generally, I don't think you can infer which driver wrote a specific line on dmesg if the driver itself does not prepend its name. You need to check on source code.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.