On Thu, May 02, 2024 at 01:09:57PM +0300, Andy Shevchenko wrote: > On Thu, May 02, 2024 at 03:20:08PM +0530, Sunil V L wrote: > > On Thu, May 02, 2024 at 12:17:59PM +0300, Andy Shevchenko wrote: > > > On Wed, May 01, 2024 at 05:47:42PM +0530, Sunil V L wrote: > > ... > > > > > + * This driver is for generic 16550 compatible UART enumerated via ACPI > > > > + * platform bus instead of PNP bus like PNP0501. This is not a full > > > > > > This has to be told in the commit message. Anyway, we don't need a duplication > > > code, please use 8250_pnp. > > > > Thank you for the review!. Major issue with PNP0501 is, it gets enumerated > > in a different way which causes issue to get _DEP to work. > > pnpacpi_init() creates PNP data structures which gets skipped if the > > UART puts _DEP on the GSI provider (interrupt controller). In that case, > > we need to somehow reinitialize such PNP devices after interrupt > > controller gets probed. > > Then fix that code, we don't want a hack driver on top of the existing one for > the same. > > What I might think out of head is that used IRQ core for your case should > return a deferred probe error code when it's not ready, then 8250_pnp will > get reprobed. > Deferred probe was ruled out in prior discussion. Also, deferred probe will not work with _DEP approach. The reason is, PNP devices itself are not getting created from the ACPI name space when they have _DEP. Hence, serial_pnp_probe() will not be called at all. > > I tried a solution [1] but it required several > > functions to be moved out of __init. > > > This driver is not a duplicate of 8250_pnp. It just relies on UART > > enumerated as platform device instead of using PNP interfaces. > > Isn't it better and simple to have an option to enumerate as platform > > device instead of PNP? > > Ah, then extract platform driver first from 8250_core.c. > Let me know if I understand your suggestion correctly. Do you mean call something like serial8250_acpi_init() from serial8250_init() and register the driver directly in serial8250_acpi_init()? Thanks, Sunil