On 10.12.2024 17:03:06, Stefano Offredi wrote: > Il giorno mar 10 dic 2024 alle ore 16:28 Marc Kleine-Budde > <mkl@xxxxxxxxxxxxxx> ha scritto: > > > > On 10.12.2024 16:18:07, Stefano Offredi wrote: > > > > > Even with those lines of code, If I print spi->irq before the call > > > > > to request_threaded_irq() it keeps different error codes > > > > > values (-19, -22, depending on whether I set the gpio controller > > > > > values in ACPI table). > > > > > > > > Just to clarify: from the Linux point of view "rx-int" is a GPIO, not an > > > > interrupt. It's connected to the "nINT1/GPIO1" pin of the mcp251xfd and > > > > this is optional. The IRQ which is available under spi->irq is connected > > > > to the "nINT" pin of the mcp251xfd. > > > > > > > > > Even If I remove in ACPI table all the gpio references listed > > > > > here below: > > > > > > > > > > - GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullDefault... > > > > > - Package () {"rx-int-gpios", Package () { ^CAN0, 0, 0, 0 } } > > > > > > > > > > the spi->irq keeps error value -2. > > > > > > > > I suggest to first remove all "rx-int" related stuff from your ACPI > > > > table and concentrate that "spi->irq" has a proper value. > > > > > > > > The relevant code is in acpi_status acpi_register_spi_device(): > > > > > > > > | https://elixir.bootlin.com/linux/v5.15/source/drivers/spi/spi.c#L2294 > > > > > > > > > > Ok thanks I will investigate on it. > > > > > > Just to be sure, will the driver, if rx-int and interrupt logic is not > > > > "rx-int" is not used as an interrupt source. To keep things simple > > forget about "rx-int" for now. > > > > > used, perform a polling on the spi bus to check for messages incoming > > > on the can controller? > > > > No - polling is not implemented and makes IMHO no sense, as it's quite > > some overhead. > > > > Ok, now it's clear, rx-int (INT0) is not necessary, If you use "rx-int" it would be connected to "nINT1/GPIO1" not "INT0" > but nINT is necessary. ACK > I will investigate starting from acpi_register_spi_device. > I think that the problem depends on the fact that my gpio controller is not > described in the ACPI table, (is loaded as an external module after the boot), > and the reference from the ACPI mcp descriptor fails. > Thanks again for your support. I'll be back when I have solved it. If the GPIO controller is loaded late, you might run into the problem, which this patch fixes: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d24cfee7f63d6b44d45a67c5662bd1cc48e8b3ca regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature