From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 23 17:37:03 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9850087F; Tue, 23 Oct 2012 17:37:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 521AA8FC14; Tue, 23 Oct 2012 17:37:03 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so644999pbb.13 for ; Tue, 23 Oct 2012 10:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=864LoZucaSico/1QkOtjQS3qd8yQPOx5T8xyGBar2uM=; b=Q4Jbnicgn3vMdzFSiMaUDwK+IGotxi3X9jYabIsTPVCJo/N7kg2/cEYxnCydzAbObd F1ucuXKvT7puTzsd+Cis3S2cEe9DoG2mBDlk/YiGl63NWzaFTCvjVWM/Ghe2fNFLQx0F oGaG00DHUnzLICc25l++67Rdlm5Yy3tGyikyvywqCilkqxbWGvviYoaX51BlZ+ROszT3 RbiUy68IzZHJosvSDv9WlEXJXs/futNiCFVIwiuha8ImzrkmKWez9Fm3MGay+L9dwWf7 G3/82MFXUNBHq2rHW08/4DIxFvOCWNSN8fekD/B2RjiEaHpA+DywHs63hD6mALu/0zRF YFIg== MIME-Version: 1.0 Received: by 10.68.135.168 with SMTP id pt8mr43060977pbb.24.1351013822653; Tue, 23 Oct 2012 10:37:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Tue, 23 Oct 2012 10:37:02 -0700 (PDT) In-Reply-To: <201210230916.11513.zec@fer.hr> References: <201210222317.00457.zec@fer.hr> <201210230916.11513.zec@fer.hr> Date: Tue, 23 Oct 2012 10:37:02 -0700 X-Google-Sender-Auth: Nb2vhf1AA3MPGTEWUU8N4AtIx9w Message-ID: Subject: Re: VIMAGE crashes on 9.x with hotplug net80211 devices From: Adrian Chadd To: Marko Zec , Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 17:37:03 -0000 On 23 October 2012 00:16, Marko Zec wrote: > As already mentioned earlier, I don't terribly object if you'd place > CURVNET_SET(ifp->if_vnet) inside if_free() and a limited number of similar > functions, but I don't quite believe this is will enough to solve the > device_detach() issue without having to touch any of the drivers... That's why I'm asking for more/better ideas. So far my ideas are: * for hotplug insert - do the same as what you're doing during the kldload and boot device enumeration pass - call CURVNET_SET(vnet0) * for device unload (hotplug or otherwise) - if vnet isn't set, implicitly set it to vnet0 * for the net80211 vaps, they get destroyed in a few places (ioctl path, device detach path, I'm sure I saw one more) so I have to use CURVNET_SET(ifp->if_vnet) on those. Now, that _should_ fix it for ath(4) and net80211, and it should fix it for all the other non-USB wireless devices out there. Now as for USB - Hans, what do you think? Should we do something similar? How does VIMAGE work right now with USB wireless and USB ethernet devices? Marko - thanks for persisting with this. I'd like to try and make this work for 10.0. Adrian