From nobody Fri Jun 10 13:16:32 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 761A285E9F0 for ; Fri, 10 Jun 2022 13:16:44 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2093.outbound.protection.outlook.com [40.107.255.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LKM1R31mYz3G65; Fri, 10 Jun 2022 13:16:43 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZta9GbXMlcMBGjCikHItHRbn7cioL9GM9EctdPPZYn0V2Ynhol81QA6vcfm6ArZAGAGdjNy/t/ejO0yUrKIJDoU3F1mHmONIQBWb/xiKsBdqiGCEJOvJ+aROAR9zmd2apN3rd8aa5DwNwl7Dxe82+XxZeZsPPGqbD3ZXLv0fmFfwYj+HnmvkIq36EQN4KHzsXTWaIHS4hSFu100NOYqwd+04X7rvwMaGGxP2lrmiZWbWTaPPpkFcpId2L3hL3RxKDNsKivCYxgLjfW0KC4mNFCp/XcpzffYA/1lSgmuPVJuJC4uTSWx+d9tk/SQZ4m0Kz3I5z10dDGkXsKmKw/cfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6idosPKX4aig8qq8qY/QKzyLiSqY/+M7QK8/wZ95kQo=; b=Y4btHnnvB6KydBPmiHZ8E9WzO4TUGDxfFay/uxvnGTPQpX4hVD1v9AKRbTx2Lj/BkIe25PmS9ykdM/9dQQFzGn1sHEHEdA8/Z5j/Hk78FWIXaWW3gIkCl7tkY8Oe/EDBLE9H3cRRbxhLXwGQjSb5rXW4td4NIuse64yw9s0DXfDajumM/FmhOSIMzovow1Y3WE1CQf5saxshPF2a0yu0MbgXJreL0syaTbS/OJMYivZ+0ATvZqeABRf5BrdDU8vw0rmv+hwfUI03ow3e0PJvA8QBfrjUzRWl+lIGcevPQDcuxJUCcBt0uuY50icBxRlJJNRIiiaZBj4x4IzERLqLqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6idosPKX4aig8qq8qY/QKzyLiSqY/+M7QK8/wZ95kQo=; b=OLf+wE/nLvdxhXgM5DZj3gauQ+ObjgO3PK/ug+Gf2Mwf9UxX1BK0W8QLi3tQNbt/wHgpp2M8qlaoaP4vp4L5o65e/eIkz3xDLuw+vImeGtJBIIL5oHm21rcLaAxivDQM//tAX50+XM3ZX/n6mhr1Tp68S8joufh7mHqQvyyFrDY= Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM (2603:1096:301:75::14) by KL1P15301MB0417.APCP153.PROD.OUTLOOK.COM (2603:1096:820:24::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.3; Fri, 10 Jun 2022 13:16:33 +0000 Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::ac6a:6a77:68b6:c5a9]) by PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::ac6a:6a77:68b6:c5a9%4]) with mapi id 15.20.5353.007; Fri, 10 Jun 2022 13:16:32 +0000 From: Souradeep Chakrabarti To: "freebsd-arm@FreeBSD.org" , Andrew Turner , Li-Wen Hsu , Warner Losh CC: Wei Hu Subject: Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Thread-Topic: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Thread-Index: AQHYfMuQ20+KWgw86Uyk7M7UNJfNS61Ins+b Date: Fri, 10 Jun 2022 13:16:32 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-06-10T13:16:31.983Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6f3c2ffd-2ea6-4682-033e-08da4ae37045 x-ms-traffictypediagnostic: KL1P15301MB0417:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CtoR93zmFPlhQoYo+vAonVYp1zuZ2k1v4P/8n/4YwFjnd3O/HrXS1nypugx01DrJqVEJfU2z2NSc6RL7io3HnmpuS71hbIWD6Is9GtX3givHTTX96xHarAWE2t22nhHaFQ3vR8CbfRVLjkmJZgq78otKN9DgLTzsTsUzaA0+zdvlL0SuhlepsakSbcwIQH3pXAhTvQwP/wW8Txk3y6Tbuf+RSKF8HyhXUSOM7miOvp+CX2L1z+5eEbnWAc0mwE/zGT6rmP+u1FupEvvLftJpsUIp6RylXTQ2k2sWWWa0CsnJOCuCXY8OnUEMpkInob2RTs21dA7omZeSJNZgtpkPcVncmOziM4yCCnXydHiX9Bey3vRQx+A4HA8DgTcGadB4QuQmpw4/hKbPYbCuJAhEpvNFdMLYp5vfJjZ1yP9VySOaNgPq5kI2gT2GS2T9DT+iI+1O53+0MQ5j6IvOL8qmfYWq4K1ZsASrx5NWl1urMdSfhkCkf5bH9DoZ5pi8qB2olEd6TsOKEcGtX34g7U6w6HWcKPUQKruojqAqJDVc9nWd0XwvBGLahPCecJEtNEOnQciDuWXcU7KhyAJq8FGEqNusYb9UaX8xyT1AvbY+P/PHiU1SwZBpY/I1QAubkoRPzQu5OBO0kZY7wsv/z8ZcwAvcp0rDIMz7ogHpATql6y1DDYX5f7pp5M6WF6zimtI+cV8JJgEIXYna082S5JzjYkaev9ngxSE0Z8MNN6hFA+yyK0uwp90vKcRTCcAxEWQN x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PSAP153MB0536.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230013)(4636009)(366004)(451199009)(110136005)(26005)(9686003)(7696005)(6506007)(53546011)(2940100002)(86362001)(55016003)(33656002)(71200400001)(316002)(10290500003)(2906002)(52536014)(38070700005)(66556008)(66946007)(8990500004)(4326008)(76116006)(66476007)(66446008)(64756008)(8676002)(91956017)(508600001)(82950400001)(82960400001)(8936002)(107886003)(186003)(38100700002)(5660300002)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?MCnsGz57hM3hGwlrZXGu/GiMyRLU+Fo/mj8Q1PJGp68Ncx+ESzJczNTmee?= =?iso-8859-1?Q?PmkC3O4l5LTRx0wzjEdilAwqRiimTimwTD2Q4iF6x6A0JYcd44uFAaAQPR?= =?iso-8859-1?Q?FZ/jeHBn4ai1cpJyUOM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so-8859-1?Q?7I+wvHqbP+UpiFCsUmBRWha0ow9g6WOGQz+rD1sgIBvcCbcPbW9hTBLDYU?= =?iso-8859-1?Q?ogHXFo81i8ToAjEzARfqvSFfcrFBOMqf32002Yok/SvWyWuAv0I6CAU/ZL?= =?iso-8859-1?Q?Wds3IfrusSRYetZqSbjgNgGsFyADJalM27LZ69beLTH3lqYjbBtwCgNA7J?= =?iso-8859-1?Q?2ZtyMB78mI/3Gxx8X4bYAgS3DZVyPlXHFNp1Gmn1E4u1o40mMOwAcs/on0?= =?iso-8859-1?Q?NaNK9ALMCy6Lig4/mpxY64SjgSG9a4LLsEXW6XUycOB0Wbjj2nXEZS+gvg?= =?iso-8859-1?Q?mtoPIcvEjfLVfoyqI/KC7YdJJOnkWpEG2RxcA9Rmb2XbqPuvxFCfO7E0vO?= =?iso-8859-1?Q?DSMmGIXVDzMjcvt3VH297wMLKV1DQrV+almW/zM7ZuTw3aVhvM1KfkOe9x?= =?iso-8859-1?Q?cmsvkgO4L7nvCJPONEZUmL13DCky4GKaMVfEW/m7ohgpP6mVcMDSOOs0Ml?= =?iso-8859-1?Q?bYYlfLSTe6DJErKY4Xmuzpkwy1H7A+TyPVbQIqtwtHVwTFFvmjw7omzjBc?= =?iso-8859-1?Q?jk9GwJKZnag7+V1dfaub9furSuHjKlaTnwKfC3Lu0cjzQynlCXEujuynRf?= =?iso-8859-1?Q?zgHX5BrSkGLYfQj5oQfy9Lhr6MSPzeqg+fBVc1cJOCm561yqTYerAKvP50?= =?iso-8859-1?Q?l8aISg5aEpiiYAVbt8SmiJvJDVN0jifFypm2TBGSlbHLRqY3Lki7yi/TWJ?= =?iso-8859-1?Q?xzzCsp7HLfIgRF5mu3/wz5+XQ=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PSAP153MB0536.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 6f3c2ffd-2ea6-4682-033e-08da4ae37045 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2022 13:16:32.7792 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GYIRnbFl1LRP2UpZh3DWMMSGK73zG1FgLo2heOKygIaIuhaOWCXgzR+KosdmVpSLpSGu5sqyyPfzoz8GwY7Pfat4RJ6iF8A3P4QcMAFqoe4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0417 X-Rspamd-Queue-Id: 4LKM1R31mYz3G65 X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=microsoft.com header.s=selector2 header.b="OLf+wE/n"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=microsoft.com; spf=pass (mx1.freebsd.org: domain of schakrabarti@microsoft.com designates 40.107.255.93 as permitted sender) smtp.mailfrom=schakrabarti@microsoft.com X-Spamd-Result: default: False [-10.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[40.107.255.93:from]; NEURAL_HAM_SHORT(-1.00)[-0.995]; MLMMJ_DEST(0.00)[freebsd-arm]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.255.93:from] X-ThisMailContainsUnwantedMimeParts: N +Warner Losh=0A= =0A= =0A= Thanks & Regards,=0A= =A0Souradeep=0A= =0A= =0A= =0A= From: Souradeep Chakrabarti =0A= Sent: Friday, June 10, 2022 6:44 PM=0A= To: freebsd-arm@FreeBSD.org ; Andrew Turner ; Li-Wen Hsu =0A= Cc: Wei Hu =0A= Subject: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 = =0A= =A0=0A= Hi,=0A= I am trying to use bus_alloc_resource_any() to allocate a irq line for vmbu= s 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_dev)= );=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|RF= _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 IRQ\= 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_TYPE_= NET | INTR_MPSAFE,=0A= + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL,= 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 n= ot 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=