linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Klara Modin <klarasmodin@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Kent Gibson <warthog618@gmail.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v5 8/8] gpiolib: notify user-space about in-kernel line state changes
Date: Thu, 24 Oct 2024 13:59:56 +0200	[thread overview]
Message-ID: <195a21e5-79e1-4502-bc75-05e2893a2503@gmail.com> (raw)
In-Reply-To: <CAMRc=McUpRJ=EN3DB7gsgsNKZHhJym6vfURmX9+mXnYuXjNwMA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2494 bytes --]

On 2024-10-24 13:45, Bartosz Golaszewski wrote:
> On Thu, 24 Oct 2024 13:34:11 +0200, Klara Modin <klarasmodin@gmail.com> said:
>>
>> I think I hit the same, or a similar bug, on my Edgerouter 6P (Cavium
>> Octeon III):
>>
>> CPU 3 Unable to handle kernel paging request at virtual address
>> 0000000000000000, epc == ffffffff817a40c8, ra == ffffffff817a40a4
>> Oops[#1]:
>> CPU: 3 UID: 0 PID: 1 Comm: swapper/0 Not tainted
>> 6.12.0-rc4-next-20241023-00032-g01c8e35f8d89 #84
>> ...
>> Call Trace:
>> gpiod_direction_output (drivers/gpio/gpiolib.c:4164
>> drivers/gpio/gpiolib.c:2700 drivers/gpio/gpiolib.c:2694)
>> i2c_register_adapter (drivers/i2c/i2c-core-base.c:396
>> drivers/i2c/i2c-core-base.c:422 drivers/i2c/i2c-core-base.c:434
>> drivers/i2c/i2c-core-base.c:1574)
>> octeon_i2c_probe (drivers/i2c/busses/i2c-octeon-platdrv.c:247)
>>
>> (the complete log is attached)
>>
>> Unfortunately the oops remains after applying the diff and the call
>> trace looks to be the same.
>>
>> Please let me know if there's anything else you need.
>>
> 
> Hmm so it's desc->gdev that is NULL... Could you try the following:
> 
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index ae758ba6dc3d..c95c79ea2b49 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1026,6 +1026,9 @@ int gpiochip_add_data_with_key(struct gpio_chip
> *gc, void *data,
>   		}
>   	}
> 
> +	for (desc_index = 0; desc_index < gc->ngpio; desc_index++)
> +		gdev->descs[desc_index].gdev = gdev;
> +
>   	ATOMIC_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
>   	BLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);
> 
> @@ -1055,8 +1058,6 @@ int gpiochip_add_data_with_key(struct gpio_chip
> *gc, void *data,
>   	for (desc_index = 0; desc_index < gc->ngpio; desc_index++) {
>   		struct gpio_desc *desc = &gdev->descs[desc_index];
> 
> -		desc->gdev = gdev;
> -
>   		if (gc->get_direction && gpiochip_line_is_valid(gc, desc_index)) {
>   			assign_bit(FLAG_IS_OUT,
>   				   &desc->flags, !gc->get_direction(gc, desc_index));
> 
> I'm wondering if this is not an earlier commit.
> 
> Bart

That doesn't seem to change anything significantly:

Call Trace:
gpiod_direction_output (drivers/gpio/gpiolib.c:4165 
drivers/gpio/gpiolib.c:2701 drivers/gpio/gpiolib.c:2695)
i2c_register_adapter (drivers/i2c/i2c-core-base.c:396 
drivers/i2c/i2c-core-base.c:422 drivers/i2c/i2c-core-base.c:434 
drivers/i2c/i2c-core-base.c:1574)
octeon_i2c_probe (drivers/i2c/busses/i2c-octeon-platdrv.c:247)

[-- Attachment #2: gpiod_oops3_decoded.gz --]
[-- Type: application/gzip, Size: 6204 bytes --]

  reply	other threads:[~2024-10-24 12:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  9:10 [PATCH v5 0/8] gpio: notify user-space about config changes in the kernel Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 1/8] gpiolib: notify user-space when a driver requests its own desc Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 2/8] gpiolib: unduplicate chip guard in set_config path Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 3/8] gpio: cdev: go back to storing debounce period in the GPIO descriptor Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 4/8] gpio: cdev: prepare gpio_desc_to_lineinfo() for being called from atomic Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 5/8] gpiolib: add a per-gpio_device line state notification workqueue Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 6/8] gpio: cdev: put emitting the line state events on a workqueue Bartosz Golaszewski
2025-11-13 21:11   ` Sverdlin, Alexander
2025-11-14  8:21     ` Bartosz Golaszewski
2025-11-14  9:04       ` Sverdlin, Alexander
2025-11-14 10:11         ` Bartosz Golaszewski
2025-11-14 11:57           ` Sverdlin, Alexander
2025-11-14 15:26             ` Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 7/8] gpiolib: switch the line state notifier to atomic Bartosz Golaszewski
2024-10-18  9:10 ` [PATCH v5 8/8] gpiolib: notify user-space about in-kernel line state changes Bartosz Golaszewski
2024-10-23 21:05   ` Mark Brown
2024-10-24  6:49     ` Bartosz Golaszewski
2024-10-24  8:15       ` Bartosz Golaszewski
2024-10-24 11:34         ` Klara Modin
2024-10-24 11:45           ` Bartosz Golaszewski
2024-10-24 11:59             ` Klara Modin [this message]
2024-10-24 13:39               ` Bartosz Golaszewski
2024-10-20 11:51 ` [PATCH v5 0/8] gpio: notify user-space about config changes in the kernel Kent Gibson
2024-10-22  7:02 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=195a21e5-79e1-4502-bc75-05e2893a2503@gmail.com \
    --to=klarasmodin@gmail.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).