From owner-svn-src-all@FreeBSD.ORG Thu Apr 2 03:25:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34D9EC7E; Thu, 2 Apr 2015 03:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0644F935; Thu, 2 Apr 2015 03:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t323Pa8P088201; Thu, 2 Apr 2015 03:25:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t323PaNE088200; Thu, 2 Apr 2015 03:25:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201504020325.t323PaNE088200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 2 Apr 2015 03:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280979 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 02 Apr 2015 03:25:37 -0000 Author: gonzo Date: Thu Apr 2 03:25:35 2015 New Revision: 280979 URL: https://svnweb.freebsd.org/changeset/base/280979 Log: - Make interrupt resource optional: some upstream FDT blobs (e.g. TI's) do not have interupt property in pl310 node. Interrupt is used only to detect cache activity when L2 cache is disabled, it's not vital for normal operations. - Fix intrhook allocation/initialization Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Thu Apr 2 02:43:48 2015 (r280978) +++ head/sys/arm/arm/pl310.c Thu Apr 2 03:25:35 2015 (r280979) @@ -420,6 +420,7 @@ pl310_config_intr(void *arg) config_intrhook_disestablish(sc->sc_ich); free(sc->sc_ich, M_DEVBUF); + sc->sc_ich = NULL; } static int @@ -453,7 +454,7 @@ pl310_attach(device_t dev) sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) { - panic("Cannot allocate IRQ\n"); + device_printf(dev, "cannot allocate IRQ, not using interrupt\n"); } pl310_softc = sc; @@ -505,14 +506,18 @@ pl310_attach(device_t dev) if (bootverbose) pl310_print_config(sc); } else { - malloc(sizeof(*sc->sc_ich), M_DEVBUF, M_WAITOK); - sc->sc_ich->ich_func = pl310_config_intr; - sc->sc_ich->ich_arg = sc; - if (config_intrhook_establish(sc->sc_ich) != 0) { - device_printf(dev, - "config_intrhook_establish failed\n"); - return(ENXIO); + if (sc->sc_irq_res != NULL) { + sc->sc_ich = malloc(sizeof(*sc->sc_ich), M_DEVBUF, M_WAITOK); + sc->sc_ich->ich_func = pl310_config_intr; + sc->sc_ich->ich_arg = sc; + if (config_intrhook_establish(sc->sc_ich) != 0) { + device_printf(dev, + "config_intrhook_establish failed\n"); + free(sc->sc_ich, M_DEVBUF); + return(ENXIO); + } } + device_printf(dev, "L2 Cache disabled\n"); }