From owner-freebsd-current@FreeBSD.ORG Wed Nov 16 22:44:25 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78B2106566B; Wed, 16 Nov 2011 22:44:25 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBA48FC08; Wed, 16 Nov 2011 22:44:25 +0000 (UTC) Received: by ywe9 with SMTP id 9so400366ywe.13 for ; Wed, 16 Nov 2011 14:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yDjf+b5F9Kld/aWyMVLaxJh3OqO6xpEr6gNU5vDl5oQ=; b=veVNNRzkjCu9nyzm7KlZHfxB5Cgr3VImEjA1Q4QV1HNOzgRe+Ze1JPdsEXhNbJsBYl iZ4C8PoZR1IZOkQ2fllkTt9ifo+oSXqf0noIXK0vBXNamuQU0deWna1mQjLlhaHzRvzf CP4+2bFXu2QoU4HsU5JEUjwQRbm8GUwNvlpKY= MIME-Version: 1.0 Received: by 10.101.206.33 with SMTP id i33mr10501839anq.65.1321483464583; Wed, 16 Nov 2011 14:44:24 -0800 (PST) Sender: maksim.yevmenkin@gmail.com Received: by 10.100.122.19 with HTTP; Wed, 16 Nov 2011 14:44:24 -0800 (PST) In-Reply-To: <4EC43ABA.7060407@FreeBSD.org> References: <4EC43ABA.7060407@FreeBSD.org> Date: Wed, 16 Nov 2011 14:44:24 -0800 X-Google-Sender-Auth: Smh9Y2G-sWfZnJHquQtz8ySbJuM Message-ID: From: Maksim Yevmenkin To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: current@freebsd.org Subject: Re: [RFC] ahci(4) patch 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: Wed, 16 Nov 2011 22:44:25 -0000 On Wed, Nov 16, 2011 at 2:35 PM, Alexander Motin wrote: > Hi. > > On 16.11.2011 23:59, Maksim Yevmenkin wrote: >> >> would anyone object to the following ahci(4) patch? >> >> =3D=3D >> >> --- ahci.c.orig 2011-11-16 21:35:26.000000000 +0000 >> +++ ahci.c =A0 =A0 =A02011-11-16 21:35:41.000000000 +0000 >> @@ -500,7 +500,7 @@ >> =A0 =A0 =A0 =A0for (unit =3D 0; unit< =A0ctlr->channels; unit++) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ctlr->ichannels& =A0(1<< =A0unit)) = =3D=3D 0) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 child =3D device_add_child(dev, "ahcich", = -1); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 child =3D device_add_child(dev, "ahcich", = unit); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (child =3D=3D NULL) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device_printf(dev, "faile= d to add channel >> device\n"); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else >> >> =3D=3D >> >> the idea is to have "static" numbering for ada(4) disks. > > I do. The only way I see this useful is if you have BIOS configured for > non-hot-swappable disks, in which case you have some AHCI channels disabl= ed, > but want to keep numbers of the rest. While I don't like this mode in > general, especially when it can't be disabled, that patch could be useful= in > these cases. But in other cases, when you have several AHCI controllers, = it > just wont not work. You will receive error on attempt to create second > ahcich0. shouldn't achcichX be destroyed when disk is detached/removed/etc.? the particular problem i'm trying to address is disk re-numbering when one of the disks fails/removed/etc. i'm trying to use hints to wire disks to controllers/busses. it works perfectly fine with da(4) disks (even hot swappable ones) , but i can not make it to work with ada(4) disks. i'm perfectly fine to hid this under some sort of option (something similar to ATA_STATIC_ID, AHCI_STATIC_ID for example) thanks, max