From owner-svn-src-all@freebsd.org Wed May 18 15:15:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A68B4193E for ; Wed, 18 May 2016 15:15:32 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 229FC1337 for ; Wed, 18 May 2016 15:15:32 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22b.google.com with SMTP id u64so21449288lff.3 for ; Wed, 18 May 2016 08:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ci4Ej8w214ssjPyONw9choK9q7J2Tc4dsm3oVVCn+A0=; b=AWy7cYtbwgGIeJ23dX2ignkRfYjGbGvxIET9zwsLH706yqu7F7roGgxNca4tuYh+PU oCiDDqsrW8Nfhr90y5ZXfuVdEUfylXMAbRogBDG4c4TuFAe+XuibpTxWPm3FmleWpKgg RVbpqOQHT521ip1yzL21+wT3P5Pdg1P0mWcHkcwD7g516ulqdU/632BZimEaV/NM5WDv 0Cy/Pgt8IBzFP56fM1YX/A29d6o5WX+XqdwjUHbeiCkA6XnHDLyzYaJsbO53bv3FgRXN j6EG+H5OCeMTnNWLxM7CuEAmriiuu63C2yHIJnaHDH9sjS28RA9SoJDGgmD2SkIVwG+h 5+Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ci4Ej8w214ssjPyONw9choK9q7J2Tc4dsm3oVVCn+A0=; b=FG3/is8xLQcKYqK/oWW723J05KfZ6y/A3fbnGwPuKWsTVc3EIBiMioxG6bGqcm2pe+ OvzOJvZVsHT8I3kozh4pC003uC635PwPi/RHAIINMP3xurYWCPcSmvA9AQVyd2LU2BFi y0f8a+5c3AfnD0yWPVYELxGS27l6oGAQyqAm7VCxckOQI1VwRU1Y+dgEptEdeDCpYqVw YCZ4HYOOTIndZ/OaNUIz6Yh5IbvaH5rZ2HAHUXSiaXP7jodHq0EYkBEvv4ne3ZpjR5za bKHG98UYWedKAQn0VSW4oTfhZ4Jd3y7XgxNAln3cIn76vN4AQYEvVeH/FZryCsYp0SU6 D9qw== X-Gm-Message-State: AOPr4FWKgoTgW6sDN60jVcuu6FbPXJPaY1aI6srR8fxnyRD/d7wOpbFP6YkhVg2tHXvDYEgD0797C34kyMwfeg== X-Received: by 10.25.212.21 with SMTP id l21mr2823281lfg.144.1463584529990; Wed, 18 May 2016 08:15:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Wed, 18 May 2016 08:15:10 -0700 (PDT) In-Reply-To: <201605181505.u4IF5ixZ018827@repo.freebsd.org> References: <201605181505.u4IF5ixZ018827@repo.freebsd.org> From: Zbigniew Bodek Date: Wed, 18 May 2016 17:15:10 +0200 Message-ID: Subject: Re: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:15:32 -0000 2016-05-18 17:05 GMT+02:00 Andrew Turner : > Author: andrew > Date: Wed May 18 15:05:44 2016 > New Revision: 300149 > URL: https://svnweb.freebsd.org/changeset/base/300149 > > Log: > Return the struct intr_pic pointer from intr_pic_register. This will be > needed in later changes where we may not be able to lock the pic list > lock > to perform a lookup, e.g. from within interrupt context. > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm/allwinner/a10/a10_intc.c > head/sys/arm/allwinner/aw_nmi.c > head/sys/arm/arm/gic.c > head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c > head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > head/sys/arm/broadcom/bcm2835/bcm2836.c > head/sys/arm/mv/mpic.c > head/sys/arm/nvidia/tegra_gpio.c > head/sys/arm/nvidia/tegra_lic.c > head/sys/arm/ti/aintc.c > head/sys/arm/ti/omap4/omap4_wugen.c > head/sys/arm/ti/ti_gpio.c > head/sys/arm64/arm64/gic_v3_fdt.c > head/sys/kern/subr_intr.c > head/sys/mips/mediatek/mtk_gpio_v1.c > head/sys/mips/mediatek/mtk_gpio_v2.c > head/sys/mips/mediatek/mtk_intr_gic.c > head/sys/mips/mediatek/mtk_intr_v1.c > head/sys/mips/mediatek/mtk_intr_v2.c > head/sys/mips/mediatek/mtk_pcie.c > head/sys/mips/mips/mips_pic.c > head/sys/sys/intr.h > > Modified: head/sys/arm/allwinner/a10/a10_intc.c > > ============================================================================== > --- head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/allwinner/a10/a10_intc.c Wed May 18 15:05:44 2016 > (r300149) > @@ -250,6 +250,7 @@ a10_intr(void *arg) > static int > a10_intr_pic_attach(struct a10_aintc_softc *sc) > { > + struct intr_pic *pic; > int error; > uint32_t irq; > const char *name; > @@ -266,9 +267,9 @@ a10_intr_pic_attach(struct a10_aintc_sof > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); > - error = intr_pic_register(sc->sc_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->sc_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0)); > } > > Modified: head/sys/arm/allwinner/aw_nmi.c > > ============================================================================== > --- head/sys/arm/allwinner/aw_nmi.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/allwinner/aw_nmi.c Wed May 18 15:05:44 2016 > (r300149) > @@ -362,7 +362,7 @@ aw_nmi_attach(device_t dev) > device_get_nameunit(sc->dev), sc->intr.irq) != 0) > goto error; > > - if (intr_pic_register(dev, (intptr_t)xref) != 0) { > + if (intr_pic_register(dev, (intptr_t)xref) == NULL) { > device_printf(dev, "could not register pic\n"); > goto error; > } > > Modified: head/sys/arm/arm/gic.c > > ============================================================================== > --- head/sys/arm/arm/gic.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/arm/gic.c Wed May 18 15:05:44 2016 (r300149) > @@ -711,7 +711,7 @@ arm_gic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 > 14:43:17 2016 (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 18 > 15:05:44 2016 (r300149) > @@ -1045,8 +1045,11 @@ bcm_gpio_pic_attach(struct bcm_gpio_soft > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->sc_dev, > - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); > + if (intr_pic_register(sc->sc_dev, > + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 > 14:43:17 2016 (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed May 18 > 15:05:44 2016 (r300149) > @@ -341,7 +341,10 @@ bcm_intc_pic_register(struct bcm_intc_so > if (error != 0) > return (error); > } > - return (intr_pic_register(sc->sc_dev, xref)); > + if (intr_pic_register(sc->sc_dev, xref) == NULL) > + return (ENXIO); > + > + return (0); > } > #endif > > > Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c > > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Wed May 18 15:05:44 2016 > (r300149) > @@ -598,6 +598,7 @@ static int > bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) > { > struct bcm_lintc_irqsrc *bisrcs; > + struct intr_pic *pic; > int error; > u_int flags; > uint32_t irq; > @@ -653,9 +654,9 @@ bcm_lintc_pic_attach(struct bcm_lintc_so > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->bls_dev)); > - error = intr_pic_register(sc->bls_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->bls_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, > 0)); > } > > Modified: head/sys/arm/mv/mpic.c > > ============================================================================== > --- head/sys/arm/mv/mpic.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/mv/mpic.c Wed May 18 15:05:44 2016 (r300149) > @@ -274,7 +274,7 @@ mv_mpic_attach(device_t dev) > bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); > return (ENXIO); > } > - if (intr_pic_register(dev, OF_xref_from_device(dev)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_device(dev)) == NULL) { > device_printf(dev, "could not register PIC\n"); > bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); > return (ENXIO); > > Modified: head/sys/arm/nvidia/tegra_gpio.c > > ============================================================================== > --- head/sys/arm/nvidia/tegra_gpio.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/nvidia/tegra_gpio.c Wed May 18 15:05:44 2016 > (r300149) > @@ -452,8 +452,11 @@ tegra_gpio_pic_attach(struct tegra_gpio_ > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->dev, > - OF_xref_from_node(ofw_bus_get_node(sc->dev)))); > + if (intr_pic_register(sc->dev, > + OF_xref_from_node(ofw_bus_get_node(sc->dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm/nvidia/tegra_lic.c > > ============================================================================== > --- head/sys/arm/nvidia/tegra_lic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/nvidia/tegra_lic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -233,7 +233,7 @@ tegra_lic_attach(device_t dev) > } > > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "Cannot register PIC\n"); > goto fail; > } > > Modified: head/sys/arm/ti/aintc.c > > ============================================================================== > --- head/sys/arm/ti/aintc.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/ti/aintc.c Wed May 18 15:05:44 2016 (r300149) > @@ -220,6 +220,7 @@ ti_aintc_post_filter(device_t dev, struc > static int > ti_aintc_pic_attach(struct ti_aintc_softc *sc) > { > + struct intr_pic *pic; > int error; > uint32_t irq; > const char *name; > @@ -236,9 +237,9 @@ ti_aintc_pic_attach(struct ti_aintc_soft > } > > xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); > - error = intr_pic_register(sc->sc_dev, xref); > - if (error != 0) > - return (error); > + pic = intr_pic_register(sc->sc_dev, xref); > + if (pic == NULL) > + return (ENXIO); > > return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, > 0)); > } > > Modified: head/sys/arm/ti/omap4/omap4_wugen.c > > ============================================================================== > --- head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm/ti/omap4/omap4_wugen.c Wed May 18 15:05:44 2016 > (r300149) > @@ -210,7 +210,7 @@ omap4_wugen_attach(device_t dev) > return (ENXIO); > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "can't register PIC\n"); > goto fail; > } > > Modified: head/sys/arm/ti/ti_gpio.c > > ============================================================================== > --- head/sys/arm/ti/ti_gpio.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/arm/ti/ti_gpio.c Wed May 18 15:05:44 2016 (r300149) > @@ -904,8 +904,11 @@ ti_gpio_pic_attach(struct ti_gpio_softc > if (error != 0) > return (error); /* XXX deregister ISRCs */ > } > - return (intr_pic_register(sc->sc_dev, > - OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)))); > + if (intr_pic_register(sc->sc_dev, > + OF_xref_from_node(ofw_bus_get_node(sc->sc_dev))) == NULL) > + return (ENXIO); > + > + return (0); > } > > static int > > Modified: head/sys/arm64/arm64/gic_v3_fdt.c > > ============================================================================== > --- head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/arm64/arm64/gic_v3_fdt.c Wed May 18 15:05:44 2016 > (r300149) > @@ -139,7 +139,7 @@ gic_v3_fdt_attach(device_t dev) > > #ifdef INTRNG > xref = OF_xref_from_node(ofw_bus_get_node(dev)); > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto error; > } > @@ -172,7 +172,7 @@ error: > /* Failure so free resources */ > gic_v3_detach(dev); > > - return (err); > + return (ENXIO); > Few line above we have: err = gic_v3_attach(dev); if (err != 0) goto error; So now we would not return error code from gic_v3_attach() but always ENXIO... > } > > /* OFW bus interface */ > > Modified: head/sys/kern/subr_intr.c > > ============================================================================== > --- head/sys/kern/subr_intr.c Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/kern/subr_intr.c Wed May 18 15:05:44 2016 (r300149) > @@ -911,22 +911,22 @@ pic_destroy(device_t dev, intptr_t xref) > /* > * Register interrupt controller. > */ > -int > +struct intr_pic * > intr_pic_register(device_t dev, intptr_t xref) > { > struct intr_pic *pic; > > if (dev == NULL) > - return (EINVAL); > + return (NULL); > pic = pic_create(dev, xref); > if (pic == NULL) > - return (ENOMEM); > + return (NULL); > > pic->pic_flags |= FLAG_PIC; > > debugf("PIC %p registered for %s \n", pic, > device_get_nameunit(dev), dev, xref); > - return (0); > + return (pic); > } > > /* > > Modified: head/sys/mips/mediatek/mtk_gpio_v1.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_gpio_v1.c Wed May 18 15:05:44 2016 > (r300149) > @@ -308,7 +308,7 @@ mtk_gpio_attach(device_t dev) > goto fail; > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto fail; > } > > Modified: head/sys/mips/mediatek/mtk_gpio_v2.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_gpio_v2.c Wed May 18 15:05:44 2016 > (r300149) > @@ -299,7 +299,7 @@ mtk_gpio_attach(device_t dev) > goto fail; > } > > - if (intr_pic_register(dev, OF_xref_from_node(node)) != 0) { > + if (intr_pic_register(dev, OF_xref_from_node(node)) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto fail; > } > > Modified: head/sys/mips/mediatek/mtk_intr_gic.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_gic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -213,7 +213,7 @@ mtk_gic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_intr_v1.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_v1.c Wed May 18 15:05:44 2016 > (r300149) > @@ -201,7 +201,7 @@ mtk_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_intr_v2.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_intr_v2.c Wed May 18 15:05:44 2016 > (r300149) > @@ -196,7 +196,7 @@ mtk_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/mips/mediatek/mtk_pcie.c > > ============================================================================== > --- head/sys/mips/mediatek/mtk_pcie.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mediatek/mtk_pcie.c Wed May 18 15:05:44 2016 > (r300149) > @@ -319,7 +319,7 @@ mtk_pci_attach(device_t dev) > } > > /* Register ourselves as an interrupt controller */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup_rman; > } > > Modified: head/sys/mips/mips/mips_pic.c > > ============================================================================== > --- head/sys/mips/mips/mips_pic.c Wed May 18 14:43:17 2016 > (r300148) > +++ head/sys/mips/mips/mips_pic.c Wed May 18 15:05:44 2016 > (r300149) > @@ -223,7 +223,7 @@ mips_pic_attach(device_t dev) > * Now, when everything is initialized, it's right time to > * register interrupt controller to interrupt framefork. > */ > - if (intr_pic_register(dev, xref) != 0) { > + if (intr_pic_register(dev, xref) == NULL) { > device_printf(dev, "could not register PIC\n"); > goto cleanup; > } > > Modified: head/sys/sys/intr.h > > ============================================================================== > --- head/sys/sys/intr.h Wed May 18 14:43:17 2016 (r300148) > +++ head/sys/sys/intr.h Wed May 18 15:05:44 2016 (r300149) > @@ -110,7 +110,7 @@ bool intr_isrc_init_on_cpu(struct intr_i > int intr_isrc_dispatch(struct intr_irqsrc *, struct trapframe *); > u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); > > -int intr_pic_register(device_t, intptr_t); > +struct intr_pic *intr_pic_register(device_t, intptr_t); > int intr_pic_deregister(device_t, intptr_t); > int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, > u_int); > > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >