Date: Fri, 10 Jun 2022 15:13:46 +0000 From: Souradeep Chakrabarti <schakrabarti@microsoft.com> To: Hans Petter Selasky <hps@selasky.org>, "freebsd-arm@FreeBSD.org" <freebsd-arm@FreeBSD.org>, Andrew Turner <andrew@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>, Warner Losh <imp@bsdimp.com> Cc: Wei Hu <weh@microsoft.com> Subject: Re: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Message-ID: <PSAP153MB05363A43D6926F96E06E3920CCA69@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> In-Reply-To: <57312f49-c6cf-868e-885d-c61ad8de7de1@selasky.org> References: <PSAP153MB05369D4402537B4FB5F6EC5FCCA69@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <PSAP153MB053627262A8BC9EF3AAA21ABCCA69@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <57312f49-c6cf-868e-885d-c61ad8de7de1@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I have tried without RF_SHAREABLE as well, but it is failing allocate irq.= =0A= Also I have tried with sc->vmbus_dev, parent(sc->vmbus_dev) acpi_container,= =0A= grandparent(sc->vmbus_dev) acpi as dev. But it is failing.=0A= =0A= Thanks & Regards,=0A= =A0Souradeep=0A= =0A= =0A= =0A= From: Hans Petter Selasky <hps@selasky.org>=0A= Sent: Friday, June 10, 2022 7:06 PM=0A= To: Souradeep Chakrabarti <schakrabarti@microsoft.com>; freebsd-arm@FreeBSD= .org <freebsd-arm@FreeBSD.org>; Andrew Turner <andrew@freebsd.org>; Li-Wen = Hsu <lwhsu@freebsd.org>; Warner Losh <imp@bsdimp.com>=0A= Cc: Wei Hu <weh@microsoft.com>=0A= Subject: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for = vmbus in amd64 =0A= =A0=0A= On 6/10/22 15:16, Souradeep Chakrabarti wrote:=0A= > +Warner Losh=0A= > =0A= > =0A= > Thanks & Regards,=0A= >=A0 =A0Souradeep=0A= > =0A= > =0A= > =0A= > From: Souradeep Chakrabarti <schakrabarti@microsoft.com>=0A= > Sent: Friday, June 10, 2022 6:44 PM=0A= > To: freebsd-arm@FreeBSD.org <freebsd-arm@FreeBSD.org>; Andrew Turner <and= rew@freebsd.org>; Li-Wen Hsu <lwhsu@freebsd.org>=0A= > Cc: Wei Hu <weh@microsoft.com>=0A= > Subject: bus_alloc_resource_any failing to allocate irq for vmbus in amd6= 4=0A= >=A0=A0 =0A= > Hi,=0A= > I am trying to use bus_alloc_resource_any() to allocate a irq line for vm= bus but it is failing.=0A= > =0A= > this is the patch :=0A= > =0A= > + =A0sc->sc_vmbus_irid =3D 1;=0A= > + =A0device_t parent =3D device_get_parent(device_get_parent(sc->vmbus_de= v));=0A= > + =A0sc->sc_vmbus_ires =3D bus_alloc_resource_any(parent,=0A= > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 SYS_RES_IRQ, &(sc->sc_vmbus_irid), RF_ACTIVE|R= F_SHAREABLE);=0A= > + =A0 if (sc->sc_vmbus_ires =3D=3D NULL) {=0A= > + =A0 =A0 =A0 =A0 =A0 device_printf(sc->vmbus_dev, "could not allocate IR= Q\n");=0A= > + =A0 =A0 =A0 =A0 =A0 return (ENXIO);=0A= > + =A0 }=0A= > + =A0 error =3D bus_setup_intr(sc->vmbus_dev, sc->sc_vmbus_ires, INTR_TYP= E_NET | INTR_MPSAFE,=0A= > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NUL= L, vmbus_handle_intr_new, sc, &(sc->sc_vmbus_ihand));=0A= > + =A0 if (error) {=0A= > + =A0 =A0 =A0 =A0 =A0 device_printf(sc->vmbus_dev, "failed to setup IRQ\n= ");=0A= > + =A0 =A0 =A0 =A0 =A0 if (bus_release_resource(sc->vmbus_dev, SYS_RES_IRQ= , sc->sc_vmbus_irid, sc->sc_vmbus_ires))=0A= > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 device_printf(sc->vmbus_dev, "could= not release IRQ\n");=0A= > + =A0 =A0 =A0 =A0 =A0 sc->sc_vmbus_ires =3D NULL;=0A= > + =A0 =A0 =A0 =A0 =A0 return (error);=0A= > + =A0 }=0A= > =0A= > What am I missing here? Any help would be greatly appreciated.=0A= > =0A= > Thanks & Regards,=0A= > Souradeep=0A= =0A= Maybe the IRQ is not sharable:=0A= =0A= RF_SHAREABLE=0A= =0A= --HPS=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?PSAP153MB05363A43D6926F96E06E3920CCA69>