From owner-freebsd-current@FreeBSD.ORG Mon Aug 20 02:28:35 2012 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 D0B3410657BA for ; Mon, 20 Aug 2012 02:28:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 81C868FC0A for ; Mon, 20 Aug 2012 02:28:35 +0000 (UTC) Received: by ggnk4 with SMTP id k4so5857926ggn.13 for ; Sun, 19 Aug 2012 19:28:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=5tiVN03sjrXPRIT+8jv5u0t4pSq4/GqTmpkeymO2y5c=; b=XXB11NcjRijOgft2scitVNC7ObCiMs63IlQ4LB9rhm/+YRSZ8g9MEsCmOdVW3oeH1b xT4Tpyi2bO8E7s5fA5aHfo/33OA8z1PVFymQhGK/7aAOF216AwM0hvI9olSa1CmatmwR /s0JfCo9m0nZlb+Coc0eWmj/SnYZFNwQjmpc8GKODL9+y7WyLq1LZFh4yREqeMb2smKM eHRj9axUiKSUSbrKEz17posY0hCrudEgEi/0ZDHV5b8EyozfYBM/dkXtHdccWGQ1NqC7 ZJKlwpNiV0oMIIxNFpjp1fSFeNgZJHI80yeGBNT8XXLtyWhzfgAAF6vfQ6Rd/vuUlv6F Os7A== Received: by 10.50.158.226 with SMTP id wx2mr8516159igb.18.1345429707319; Sun, 19 Aug 2012 19:28:27 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id pp4sm23154939igb.5.2012.08.19.19.28.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 19:28:26 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201208191832.39569.hselasky@c2i.net> Date: Sun, 19 Aug 2012 20:28:24 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4BC29F9C-B068-4464-9619-3ACD00D7C388@bsdimp.com> References: <20120819202622.6db6a8dd@fubar.geek.nz> <201208191832.39569.hselasky@c2i.net> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQlJkj/b9PGkiR3l90q0GHuV5ZQN7QnTQ7mrXEhU1OGjGCCLUWvGEwdL4oSbJradi7DYEAIP Cc: freebsd-current@freebsd.org, Andrew Turner Subject: Re: Recent changes in AT91 kernel code causes USB to not work [WAS: r239214 - in head/sys: dev/usb dev/usb/controller sys] 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: Mon, 20 Aug 2012 02:28:35 -0000 On Aug 19, 2012, at 10:32 AM, Hans Petter Selasky wrote: > Hi, >=20 > I'm trying to reproduce using "src/sys/KB920X arm". >=20 > So far the platform doesn't boot, because recent commits removed one = ore more=20 > of these clocks: >=20 > sc->sc_iclk =3D at91_pmc_clock_ref("udc_clk"); > sc->sc_fclk =3D at91_pmc_clock_ref("udpck"); AT91RM9200 hasn't supported clocks very well at all. But I don't think = that these clocks have ever been defined on the 9200 platform. > So I get a crash at a NULL pointer when trying to access one of these = clocks. >=20 > How to fix this? Hmmmm, the code didn't even compile until recently, and has crashed = every time I used it. > I simply added a NULL check. Now the platform hangs when setting up = the OHCI: >=20 > sys/dev/usb/controller/ohci_atmelarm.c >=20 > + printf("CLOCK ON\n"); > at91_pmc_clock_enable(sc->iclk); > at91_pmc_clock_enable(sc->fclk); These should be nops, because we enable all the pmc clocks early in the = attach process. that's likely the problem, if we aren't turning on the = clocks to the usb device (gadget), then=20 > bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, > OHCI_CONTROL, 0); >=20 > + printf("INIT\n"); >=20 > I see the clock ON printout, and then nothing more! Not sure if this = is caused=20 > by IRQ's hanging or not. >=20 > Andrew Turner: Can you fix these issues so that I can reproduce? It would help if you could pin-point where this stuff fails in the = stream of commits. I know mine were purposely small and isolated so = that they would be easy to bisect. Warner=