Re: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64
Souradeep Chakrabarti <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.arm |
|---|---|
| Message-ID | <PSAP153MB05363A43D6926F96E06E3920CCA69@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> |
I have tried without RF_SHAREABLE as well, but it is failing allocate irq. Also I have tried with sc->vmbus_dev, parent(sc->vmbus_dev) acpi_container, grandparent(sc->vmbus_dev) acpi as dev. But it is failing. Thanks & Regards, Souradeep From: Hans Petter Selasky <[email protected]> Sent: Friday, June 10, 2022 7:06 PM To: Souradeep Chakrabarti <[email protected]>; [email protected] <[email protected]>; Andrew Turner <[email protected]>; Li-Wen Hsu <[email protected]>; Warner Losh <[email protected]> Cc: Wei Hu <[email protected]> Subject: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 On 6/10/22 15:16, Souradeep Chakrabarti wrote: > +Warner Losh > > > Thanks & Regards, > Souradeep > > > > From: Souradeep Chakrabarti <[email protected]> > Sent: Friday, June 10, 2022 6:44 PM > To: [email protected] <[email protected]>; Andrew Turner <[email protected]>; Li-Wen Hsu <[email protected]> > Cc: Wei Hu <[email protected]> > Subject: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 > > Hi, > I am trying to use bus_alloc_resource_any() to allocate a irq line for vmbus but it is failing. > > this is the patch : > > + sc->sc_vmbus_irid = 1; > + device_t parent = device_get_parent(device_get_parent(sc->vmbus_dev)); > + sc->sc_vmbus_ires = bus_alloc_resource_any(parent, > + SYS_RES_IRQ, &(sc->sc_vmbus_irid), RF_ACTIVE|RF_SHAREABLE); > + if (sc->sc_vmbus_ires == NULL) { > + device_printf(sc->vmbus_dev, "could not allocate IRQ\n"); > + return (ENXIO); > + } > + error = bus_setup_intr(sc->vmbus_dev, sc->sc_vmbus_ires, INTR_TYPE_NET | INTR_MPSAFE, > + NULL, vmbus_handle_intr_new, sc, &(sc->sc_vmbus_ihand)); > + if (error) { > + device_printf(sc->vmbus_dev, "failed to setup IRQ\n"); > + if (bus_release_resource(sc->vmbus_dev, SYS_RES_IRQ, sc->sc_vmbus_irid, sc->sc_vmbus_ires)) > + device_printf(sc->vmbus_dev, "could not release IRQ\n"); > + sc->sc_vmbus_ires = NULL; > + return (error); > + } > > What am I missing here? Any help would be greatly appreciated. > > Thanks & Regards, > Souradeep Maybe the IRQ is not sharable: RF_SHAREABLE --HPS