From nobody Fri Jun 10 13:36:03 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 CF7338333E4 for ; Fri, 10 Jun 2022 13:36:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4LKMS15Rkmz3LgM; Fri, 10 Jun 2022 13:36:16 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.232.175.95]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9E7F32603D5; Fri, 10 Jun 2022 15:36:08 +0200 (CEST) Message-ID: <57312f49-c6cf-868e-885d-c61ad8de7de1@selasky.org> Date: Fri, 10 Jun 2022 15:36:03 +0200 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: bus_alloc_resource_any failing to allocate irq for vmbus in amd64 Content-Language: en-US To: Souradeep Chakrabarti , "freebsd-arm@FreeBSD.org" , Andrew Turner , Li-Wen Hsu , Warner Losh Cc: Wei Hu References: From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4LKMS15Rkmz3LgM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [0.07 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; NEURAL_SPAM_MEDIUM(0.85)[0.845]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.53)[0.526]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[178.232.175.95:received] X-ThisMailContainsUnwantedMimeParts: N On 6/10/22 15:16, Souradeep Chakrabarti wrote: > +Warner Losh > > > Thanks & Regards, >  Souradeep > > > > From: Souradeep Chakrabarti > Sent: Friday, June 10, 2022 6:44 PM > 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 > > 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