From nobody Fri Jun 10 13:14:27 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 025E285E570 for ; Fri, 10 Jun 2022 13:14:44 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) Received: from apac01-obe.outbound.protection.outlook.com (mail-eastasiaazon11020017.outbound.protection.outlook.com [52.101.128.17]) (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 4LKLz63mzrz3G44; Fri, 10 Jun 2022 13:14:42 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUPcD8+eGEhZly0VtWf4n7PUcmlDQ5vKJgq5OiwVaMTLgE+fOkYqsKgn6AB/347Hat1tYOPFeSBoi7oXeTNLQhRKcLY6o5nfRaTTj88nxfuPLX2i98zk+El47hSgYmWDrVNzpjn7V1QRxouvi+1xDqPjjEB2sal2217zKDs/d47PDVvSE9A3eJgEGdN8a3KnaZeyTJWuAwGoY5+zc2jbBZpMN1I2Tp9+cRVkyH7kOEMkODbk4Nc00qGAa+vL+hBBkl5MRo1jTlxTjIph3HSidskCpDEkpsnumGFMaK4lIEGnFN/poobOC472p48Ux9LAxoLQEGp/rbohYe2YAqOOJA== 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=+ZAkbaDktIwnW/ZgWB+/Z+6w+gSBjKQ62HEqBzIn+xM=; b=nku1jSAq/cRmbdA/qUcsO3ZcE+sLBqWmDwVL1h1CvDhXkzzl0Y9c234RivkR0q/U9yAVcH+ATKWEK/sOL9gzT1RxUivS15ZwP8Uv/RuwUE3aI9DhIEed01udN94THD64lOyKdYKnxQXQ4Vv5d7vBroTW1TycWAcovnMvmQBTkD23lXveJ+LNkZrRHVtt5a2+IXn1WEY3W8cFqCBLzW+YIA1++ssFBEO6Bifch3RlnLbxsRj8Syxb+Eur0e7SkoMTTgx8ZTrTNdR0SqWdnvanq8KwfI+TY6Qen9vjthrNPF5hNtimr4Rjk9bR6dQi2Wxn1pnNCfijw542+tC/8pldAQ== 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=+ZAkbaDktIwnW/ZgWB+/Z+6w+gSBjKQ62HEqBzIn+xM=; b=AQSUmPzQ7pRnXOvfmuXUi8LqW5DotQnn+O3Y9QaleosQ/Zed7vsrHEU716Dt1jRJb6LKiQgzOAznVWYNGu538zF82OP0PpwshlmsyuNYZePEg2+H63tEfPIVkY+qT32HbQ7b7BwDmSS5BTNDRF2HxZ06jfx+B1Li2Tgq61fF/ZU= 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:14:31 +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:14:27 +0000 From: Souradeep Chakrabarti To: "freebsd-arm@FreeBSD.org" , Andrew Turner , Li-Wen Hsu CC: Wei Hu Subject: 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+KWgw86Uyk7M7UNJfNSw== Date: Fri, 10 Jun 2022 13:14:27 +0000 Message-ID: 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:14:27.001Z;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: ede08d70-eb3f-4de9-8322-08da4ae325bf 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: MPmJ8pc3/bFGMb2pGKPML7Iohun3gA3JckFOYmlM2rZXLEdvCzHhnDruJbLYX/X4nX5Zti+rqADv37QMCdj6IIZfDdudzeANJ72H4QjlOLiACOy762TnkA1yyF4epibJIO7WZZMZBQHW5ZppjVBPQLJZUVaFB0fYWYqVcs/ll+OtajchjjD9kJoWwVlQN6jFhkOLPbINjRutBOOnuyVoGHf1HjQTSAb6/MJlxzkDlqZwO9ogJXkxZZRl5ckVRL+FW7P2tXwTS9p6eumfGEY3j6/3L/5ROTHvKrdW0WFfnKi8u/epKc1hbgTV0/cMuxgURhKnCC8mr/TgdlXwVRZDBjEyswFTxhmrubSqbzJprVrAwTD2ZiEwWa+G7ont/Vx5wOMrbBPvJBieWJybu77/mn7RxICDHHy6l3RtIMt+d8mkQvHoZSoauLu0DlaCYcbLlrU9JYaF1QU+uGQV+Ys8FpJ6efAcctQIPYtCtvfevbX4zOsUo36S6F5zMDqg5mg8bPlaeRF0sZByo3JJWaFPDD6zN42UcnqaPmqYinLweIOLIZjguCD05omBT/Dh9SXlMxSs2MjFg/KkHzehQCDCeoUQXjDWVWfKC9DXH3T8755pOlnZhiNfNtBRT2RfLE3w+00nwduYJVOkz7epQwIqPD3EGcrmZPvr6s11GXYeQ1l87FEQYUDp7qWA5w552Sh7eOe5dQciykZyAq5cvQdsHfs3Z/gwzdK00A4BEggAeq8mf8Iz4fLP39J1UjdZn8zd 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)(86362001)(55016003)(33656002)(71200400001)(316002)(10290500003)(2906002)(52536014)(38070700005)(450100002)(66556008)(66946007)(8990500004)(4326008)(76116006)(66476007)(66446008)(64756008)(8676002)(91956017)(508600001)(82950400001)(82960400001)(8936002)(107886003)(186003)(38100700002)(5660300002)(4744005)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?0mDNwznCtOrjTrOIzWHVsHG+pat5piXmC9e/R85GoIE7Ko36vcIOqKD1Lc?= =?iso-8859-1?Q?dDESIS88rvjZ1NMsIsModQ3ghLyLkfelvc+jYwUJbYGi224/RiEB1nl2Bt?= =?iso-8859-1?Q?VzmMf9M5TZF+6W/VlrScWLUEz3/ta8cqld7AnUp5ci7RCTBvIVD1zwqtUH?= =?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oGX7/kHFJqeZE0RwnO3rSRR?= =?iso-8859-1?Q?xoHAVNDTsoP6Ma+cqp226ABw3FyYUgnMU3BwG7eJsH8R3xH/2g46I8KZDR?= =?iso-8859-1?Q?RDPgvANn5iHVauEJBlebYAAqg9D9RyI/SSSNGqF3pp48vsu2nPiJDtRtVU?= =?iso-8859-1?Q?1aQTiFbcnWZUwMMb1oK8COquUu70h/pnWJ94PwrJi7oFDE0pyMM/2fWw+7?= =?iso-8859-1?Q?V1FSQMd/HnktyTOdo/g0r7QmwyjfKqMpEdEc+irtlmk6Gj6MDchRsyFU5W?= =?iso-8859-1?Q?cMDmUiVjkuO+43NYSr1FucKZMTkufWKJznll9VfVdFzqUx46yMrViaV7aQ?= =?iso-8859-1?Q?WPfj6mhetfZfjQ1CK/vDpHBEn5ra0Z/6Aub4MzAuGvNfQYfRjMef3f6uJI?= =?iso-8859-1?Q?6/OmDOxhUcXjsoTjDR2YlrFUKa67ko/TViMIpHvYS1+qoDGVYXbW71gBr0?= =?iso-8859-1?Q?KOumoyw1/pRPJbsE0xPnKFKqU+pSr8ftA7GiXHDGHSHb7wCzLrlhl25f9V?= =?iso-8859-1?Q?GyNR7ptN58e8cQdHI2EUdZpz9pePcB4y6Ofep3Jd5cMud9kYxweCLKtV6j?= =?iso-8859-1?Q?mhmeDLd8RsYS5iBay9nIN3sk9uJjTyj+Y3fM8/5NFhKDFkeLxenTpYR8bt?= =?iso-8859-1?Q?UqvL4Wd+ZhUKetbOV/bduQUnN5QPrqKwq+XZCBbnrN6KRLfYhZNrtKrl4y?= =?iso-8859-1?Q?dijRsFfyB3jwMvmPlyQEl1bTI=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: ede08d70-eb3f-4de9-8322-08da4ae325bf X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2022 13:14:27.7217 (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: qMvAGD0Pir7rEvuGb0AtayszvSIXOKBGjVj61GIXAwL+xT9kj7QkPZE5QbFkR1A/8WH9Vej/e+0VWuPfHgWMwbwVYgnavFHffmTyPCWWRZY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0417 X-Rspamd-Queue-Id: 4LKLz63mzrz3G44 X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=microsoft.com header.s=selector2 header.b=AQSUmPzQ; 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 52.101.128.17 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)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:52.100.0.0/14]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; 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]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:52.96.0.0/12, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+] X-ThisMailContainsUnwantedMimeParts: N 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=