From owner-freebsd-current@FreeBSD.ORG Sun May 29 01:45:49 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4285C1065673 for ; Sun, 29 May 2011 01:45:49 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id F42188FC17 for ; Sun, 29 May 2011 01:45:48 +0000 (UTC) Received: by gwb15 with SMTP id 15so1486349gwb.13 for ; Sat, 28 May 2011 18:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=d5ygujzJsHgxzuRflY028TH2BXr+mFvgeu3YEtfrhA8=; b=ZfrQzzOYgzJKkVV6zSJjU4c9XKbpFzpz2D56BxkaGC19cqhNXTugjpTpbfUBnJjCwQ kQF9mKJ2J9EBxk4bWNSJgrMYcohoepGr3Loh8ipj9R22/cgNCf+azyUfC8NK3uheSoW9 LhDxFcJqfMvmaxuwQx5NnyOTzmdNrbXQcoyxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W5dY1WhnXpkkZskmTDZHf3hf2pUBl9vG8roYC+wkKQ9v4QMYCNmg9WM8LxZ/TP32SL Kh36ecJKHcpcCz0dpoTcG3/9/QnsSKDVyGharc0h3urDoDZ+yg8fRaXGw9lmjhorR/Cm yNkOIh6IPxhDJtQoG9ChCoocOE+xTLva+FiTc= MIME-Version: 1.0 Received: by 10.236.92.116 with SMTP id i80mr4565571yhf.348.1306633548122; Sat, 28 May 2011 18:45:48 -0700 (PDT) Received: by 10.236.107.197 with HTTP; Sat, 28 May 2011 18:45:48 -0700 (PDT) In-Reply-To: <201105260940.37035.jhb@freebsd.org> References: <201105260940.37035.jhb@freebsd.org> Date: Sun, 29 May 2011 03:45:48 +0200 Message-ID: From: "deeptech71@gmail.com" To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: pcib allocation failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 01:45:49 -0000 On Thu, May 26, 2011 at 3:40 PM, John Baldwin wrote: > Ohh, you have two devices behind this bridge that have prefetch ranges. > > As a hack, can you try this: > > Index: pci_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- pci_pci.c =A0 (revision 222285) > +++ pci_pci.c =A0 (working copy) > @@ -162,8 +162,13 @@ pcib_write_windows(struct pcib_softc *sc, int mask > =A0{ > =A0 =A0 =A0 =A0device_t dev; > =A0 =A0 =A0 =A0uint32_t val; > + =A0 =A0 =A0 uint16_t cmd; > > =A0 =A0 =A0 =A0dev =3D sc->dev; > + =A0 =A0 =A0 cmd =3D pci_read_config(dev, PCIR_COMMAND, 2); > + =A0 =A0 =A0 if (cmd & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pci_write_config(dev, PCIR_COMMAND, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cmd & ~(PCIM_CMD_PORTEN | PCIM_CMD_= MEMEN), 2); > =A0 =A0 =A0 =A0if (sc->io.valid && mask & WIN_IO) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0val =3D pci_read_config(dev, PCIR_IOBASEL_= 1, 1); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((val & PCIM_BRIO_MASK) =3D=3D PCIM_BRI= O_32) { > @@ -192,6 +197,8 @@ pcib_write_windows(struct pcib_softc *sc, int mask > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_write_config(dev, PCIR_PMBASEL_1, sc->= pmem.base >> 16, 2); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_write_config(dev, PCIR_PMLIMITL_1, sc-= >pmem.limit >> 16, 2); > =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 if (cmd & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pci_write_config(dev, PCIR_COMMAND, cmd, 2)= ; > =A0} > > =A0static void > @@ -337,6 +344,9 @@ pcib_probe_windows(struct pcib_softc *sc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_read_config(de= v, PCIR_PMLIMITL_1, 2)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0max =3D 0xffffffff; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* XXX: Testing hack */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (device_get_unit(sc->sc_dev) =3D=3D 1) i'm assuming that "sc->sc_dev" should be "dev" (this fixes a compilation er= ror). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->pmem.limit =3D 0xefffff= ff; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pcib_alloc_window(sc, &sc->pmem, SYS_RES_M= EMORY, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0RF_PREFETCHABLE, max); > =A0 =A0 =A0 =A0} that seems to work! btw, is my machine a test-pig for an upcoming change to the PCI bus driver?