From owner-freebsd-arch@FreeBSD.ORG Mon Sep 3 13:20:58 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 912CC1065670 for ; Mon, 3 Sep 2012 13:20:58 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 46F258FC08 for ; Mon, 3 Sep 2012 13:20:58 +0000 (UTC) Received: by yenl7 with SMTP id l7so945960yen.13 for ; Mon, 03 Sep 2012 06:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=GxDYku+2wyC1QmOA+gBXrhCySCNHpwtuEVbLGWujW38=; b=v/a7ikuhIBJrH/vK1oPJeVx4mUt5PG0Jlh/1b1AJwJJ1GEAW2TaVk28YkN7lJ64QNT tXpXMvEAwecynaHGrBjBd6a4ulYqSavUY0a5drl2Utq0acMtXo8yWBFrBjEEsBX2kYL5 gIBluTc2kJRR1jc7kDiwd7pDUZqlB81BmYi3zb1TT8oNCuGElsoanNgk+SPJoEMjWUBD zj5QcpK/ebjRa/qVwGlm7wOkkN6Y+1euaoRKQt8QTqc6ueJHzHF0PJ1dv8lmypunfgZo EDX07tNrGybG7gWYSryPXkE88HfKFBk1iUvR91xRlul3vC5w02fTPOTV0CKAsrJ9OF8v z4FA== Received: by 10.236.200.201 with SMTP id z49mr15080000yhn.41.1346678457607; Mon, 03 Sep 2012 06:20:57 -0700 (PDT) Received: from [10.10.1.152] (200-205-66-186.adseguros.com.br. [200.205.66.186]) by mx.google.com with ESMTPS id a4sm11910286anm.14.2012.09.03.06.20.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Sep 2012 06:20:57 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Luiz Otavio O Souza In-Reply-To: <99A4DDAC-7A6E-4FA5-B55A-5C30210D9981@bsdimp.com> Date: Mon, 3 Sep 2012 10:20:52 -0300 Content-Transfer-Encoding: quoted-printable Message-Id: <6AAF2B85-B720-45B5-8F92-FBD9F49F1E6F@gmail.com> References: <99A4DDAC-7A6E-4FA5-B55A-5C30210D9981@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1084) Cc: freebsd-arch@freebsd.org Subject: Re: spibus access serialization X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 13:20:58 -0000 On Sep 2, 2012, at 4:50 PM, Warner Losh wrote: >=20 > On Sep 2, 2012, at 6:37 AM, Luiz Otavio O Souza wrote: >=20 >> >=20 > This looks good to me as is. >=20 > spibus-02.diff >=20 > This looks good as well. There's another change mixed in = (DEVMETHOD_END), but it is likely benign enough to go in with this. If = you really want, split it out, but if you don't really want, things are = OK as is. >=20 > spibus-03.diff >=20 > + mtx_sleep(sc, &sc->sc_mtx, 0, "ar71xx_spi", 0); >=20 > I'm not sure I see what wakes this up. Am I missing something? Same = is true in all the drivers. The rest is decent enough, but does mean we = can only do acquire/release in a sleepable context. Is that going to be = OK? No, you're right, the patch is incomplete (my bad) :-/ For now doing the acquire/release only on sleepable context isn't = causing any problems, do you think i should change this ? I'll update the patch and do some more work to move some of common code = to default methods or to spibus code as suggested by ray@. Thanks for the review! Luiz=