From nobody Fri Jun 10 15:13:46 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 3839B8413CC for ; Fri, 10 Jun 2022 15:13:59 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) Received: from apac01-obe.outbound.protection.outlook.com (mail-eastasiaazon11020023.outbound.protection.outlook.com [52.101.128.23]) (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 4LKPck1X1pz3pmk; Fri, 10 Jun 2022 15:13:58 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bVrQz7spJkbxp/K8oCgHv0mV1GI8EgtKeOSTatZol8g0EO6wjbr45kWJgxZ7szCsWsWoOk8s5txrSWEmbkQB2cD4SCYMYOKsbUlJBXBaDxw1W+sf8tIXPNO6LdxAXHcsTj4px1N8ObmmWX4qZyGsq4josDWYVa75FTv/TOUokpfaX0WI/9dkQjrv/+TVBAaErv4524Zv4U/dqai+UPx/tHUFI1rH4/SDbMzx+8fch3YvBsVShonqC4K07FIUHu/peal+hWlT2aPYpxp+3y10Ct98RSUOO9w9xQPryy7ujwNuXCseITEmiMoUQNO/kg821mAz7TCo6aU6HBA0WGC5RQ== 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=ND/SePkwf7RUXLhcun/jUbWdxfPf6Ndhc8TJ6RE/RP4=; b=lpidHa0sp9P+ZvbOh/YMoBgEuGu+KrRzb7VB/ekiExbLQeLF/Um3vJoM6YzgxWu8fzo0fnNiZfA/Iy9pnRcd9hrBkjO5bjI2wJvj1X0nscUH2PwFq48Kru6o5IdJpEjdfm2wNntlQLoA0k/EP4qbbrEHlVvB1F0FM0TiOnZ4bIA02an0kIRqwjcB14vdZD4v/p8gUq+wdctfWV8Qwz2WIH1SkbJHBAQJ5OrF6jTJn7x8KAYykzy/UGfY+NYg2n9zUBVNaxjF14DNxMS8WhbAYRMe7tCiG+0RSNGvZ+7Tw85taaBiN2kRnq11xsMvnxPAF7yxNnAl6+ix1NG8WGcHGA== 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=ND/SePkwf7RUXLhcun/jUbWdxfPf6Ndhc8TJ6RE/RP4=; b=IDQAsKW/vsGCQeBuRwQMXl/jRcSlpBHvHCSm/6vmgu4QQ3uLfTjnSW/VmcWBq+535rTVpzmiKbSWvVLelqDKPM6yqcp3waqm01VzjPIm+BBU2ExNZxNAGfgdFlkXTx6MiUpswXtJLxHKrgEsyJv/i/L3BpInyCRxoMIVVdyrm1U= Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM (2603:1096:301:75::14) by SI2P153MB0638.APCP153.PROD.OUTLOOK.COM (2603:1096:4:1fd::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.0; Fri, 10 Jun 2022 15:13:47 +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 15:13:47 +0000 From: Souradeep Chakrabarti To: Hans Petter Selasky , "freebsd-arm@FreeBSD.org" , Andrew Turner , Li-Wen Hsu , Warner Losh CC: Wei Hu Subject: Re: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Thread-Topic: [EXTERNAL] Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Thread-Index: AQHYfMuQ20+KWgw86Uyk7M7UNJfNS61Ins+bgAAFqICAABpMYQ== Date: Fri, 10 Jun 2022 15:13:46 +0000 Message-ID: References: <57312f49-c6cf-868e-885d-c61ad8de7de1@selasky.org> In-Reply-To: <57312f49-c6cf-868e-885d-c61ad8de7de1@selasky.org> 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-10T15:13:46.086Z;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: adfbfd64-9103-460c-df0e-08da4af3d0f9 x-ms-traffictypediagnostic: SI2P153MB0638: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: Ui+eKd8BwaKK2o0JcLo11L476ijzyJrhapsFQq50LiWl6/FLulJG5B3Ri9bU5evVcD0SRG3PB7uWakiEQNCtQxenMO+5VBXJe91HWP03gXDzc/1W208f4c7VGUhIQSOkNhjVUq9lraVIymBfHH5mfanXoaKrasWj4kWnV8/dFFVWmlUHHKbvcfy73bfp/wAFGKPhy0kMOL8EeEO2nOMEB4F/VKd9hqj8z/yt0L6cqdjd+C6hOT/8ZOj3IiKySaeE/yrDWH7CL12y9YFncCG/8VuAZv0iNHuC1jLzWL93uNZjhxXM9LsBVuinm4LXKjlXUQbD0P7XqO4fUPGBdZCHl8lXm3R1ceSPYo3uRbOthCE4uyXVvWtwKV5ujJmH8CUhwKs47QFvVcW3sZ3clTKB8kTroJlJmZil9AcNxYu2fLIwBaUNpuSfkjpCxiAOEe+2rN2iJz30CqDM/EIrP4/G+FBrtISODQb8xMCwwE0Ok6/JyQ6gUtkinSjSduWUa+ySBHRKsB9CZy20QQZj/Ae6yHwQaWk+VGBSPLV8Xt2Y7oFq3TVciMgXgMeVSQqUXaNNqlR1PBxmOxScCDiM77CGeVDrLCDlhknCzdYeDroOuVXkKpFBM9jpfvkrzAIOiY3NOoIIcEhsJz0I/vLxs3E9deVRkbHG4YOokzmSKbk+KX9FCuZ3GRLaQmdjkJLt1ckCXrgJjbXNJty0jJdINanb0b8pjizg+LNYPiumNexIu0bDbPPA2f5+bBY2OYqzzwUH 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)(8936002)(52536014)(38100700002)(10290500003)(5660300002)(8676002)(76116006)(122000001)(316002)(82950400001)(82960400001)(71200400001)(110136005)(508600001)(4326008)(38070700005)(64756008)(91956017)(26005)(66556008)(66476007)(66446008)(66946007)(86362001)(9686003)(6506007)(7696005)(53546011)(107886003)(186003)(55016003)(2906002)(33656002)(8990500004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?attyZXKbuMd+Ry5rc4wxATB42FqK3R6cHTFlNW+64QsfQXpne8O+lxBZOo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KZ8yiOHGKzKjCpAXoML5YH6q5sviuvE6do9OHVum?= =?iso-8859-1?Q?EWy/nk0ABgUgeGkLhxNQKAhom3tIpCjTHygUB4EssyDRrcEXabBKsnYUMa?= =?iso-8859-1?Q?lXQ5eTpHndLb1WGI8n4ngOCTfG9ux5UsE4zJFBOT3JPKB9bKlHZjPm4VkP?= =?iso-8859-1?Q?gawQe3ZckIjteBqPfRD+TYnXM07gXTEDj0uLX31cZ6RH/UyPDIOaHkIIgV?= =?iso-8859-1?Q?PmeY6Ny/USp90aZD1YCifAbigX9HtWaE1HRre24BjVDYF6WXnkUXIzwkGK?= =?iso-8859-1?Q?4G8n+kpLlkLyJ8Hm/tuxBSw/QLyRv9uncw4e71kTlOflr3x1iv6DQRXxmJ?= =?iso-8859-1?Q?mQDDnIoDeNDTYelpMjn2aNU2j97gwM9uO1V2OIZSIsZtE21mlTKsaW0MZU?= =?iso-8859-1?Q?wixm8I1GT0OFNJKNa2wENUwCuKw8LfcJlyOPJZdYDkpLpjqVqUsYnW/zkQ?= =?iso-8859-1?Q?6TvygYKWWtKPU8ypUqTWEsggpUQhB1RidyuHekRvDjV33NtT5NNA4qgPQT?= =?iso-8859-1?Q?MJvvIsBgaSej+Ba0kcecI88ur9y3mxPesxsWCyyJFLjPZX3gI6uXRmLlaE?= =?iso-8859-1?Q?y5oyZusSveVNU3FdI8hZoHBWOKUDPmyBX5tL44v4zEb5pHTkrbA0+dR+hO?= =?iso-8859-1?Q?YlShmwA4k/pp+aVnCf0qnH35QaDtRFFywRfSvAlppv0ntxj8bv163iDnOo?= =?iso-8859-1?Q?FgrruGvrMi76fC6izJ7dlkcb1eFDFC23206BnBbNwDxz0yc6Tn+Ik6+Cer?= =?iso-8859-1?Q?Zv2eIkXW5A+Zgo1Tl5VCfJCf/ZsSxLsz9sZl66gv4uDwj1FvO8zCbXAQOZ?= =?iso-8859-1?Q?Yc/2Km7HIjex8a+jcgGcZivg8=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: adfbfd64-9103-460c-df0e-08da4af3d0f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2022 15:13:46.9422 (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: ifmOT3vYBG0GZKuDDQsntnkKAzGySiwBvZrcaCTPUDmflzaeyGowrFF70NmyqhXtbSz/CcX+2rRpcn8TUNyDOXzNP5+uCRAyFEP2tBnZhbw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2P153MB0638 X-Rspamd-Queue-Id: 4LKPck1X1pz3pmk X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=microsoft.com header.s=selector2 header.b="IDQAsKW/"; 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.23 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:52.100.0.0/14]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; RCPT_COUNT_FIVE(0.00)[6]; 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 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 =0A= Sent: Friday, June 10, 2022 7:06 PM=0A= To: Souradeep Chakrabarti ; freebsd-arm@FreeBSD= .org ; Andrew Turner ; Li-Wen = Hsu ; Warner Losh =0A= Cc: Wei Hu =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 =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 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=