From owner-freebsd-usb@freebsd.org Thu Sep 29 18:20:31 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34898C02A34 for ; Thu, 29 Sep 2016 18:20:31 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00E8AD99; Thu, 29 Sep 2016 18:20:31 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id 21so31511069pfy.0; Thu, 29 Sep 2016 11:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=rHt3O3OqDMes0bogh+YJPdtsgrtz6SDL+MX19Wv2WrM=; b=1IcEIr2n7Sis2pm0gGohAgPOl7AIWbOsYoKG9lrhien6N7IEMRKdCHP9VZQnk81rWj /jdZLDKdNAR80a26OWl/XK8JjS8rZyGLihZcXNsn4Qftyj/PFkBRJTJPoxOc0e+Fu4Ez t1sCqnO092CAAi36z8ZgcvQbZgY7kzbuga2Hdhgj+KSyp7CVRM8Im77k8qt+6cfSO0Oy S9gp1Ejh/uSxyBKY5bppwsL6kUey4s8irFu3CJXrW1qMfr3Fj+D07uR6bD7vr1GlT6G5 lTeHOPXS0N/AZjN/lcyDxH8UccCaoWsFWYGPoJ1jJYS6m+h+xF0K4CnrQ27Y4qh6WxUH asJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=rHt3O3OqDMes0bogh+YJPdtsgrtz6SDL+MX19Wv2WrM=; b=hpnbH9QKCNvCero8zZsW9MbsgvkxaEsgA7khYtlDFScHjELuTZWsHHkfniolM8bp/q Tn3uiZ/L4dYHXZvjt6I9EOfuSGGLVP6RM88bP8wa/T9xGYW/06AWIf/3wxV+ewo5aq6q X/69HOcz5mg1+XfMao+R/ENzl+b3iIzct5J7HdDAnY5lB1rjnHaznFuDCUWgNPRD3rpn +iihh/5nX0G2AJ6/yN2bsmTmeviCWAJ0mic+1VbHOCcmymMR03s2wQgoOAI2tSQmckNa GMgSLYtyAMxv3chJ/oSjg81yZQpWJrRLDZSKttcbCUirkRJTOhpRS1c5NEjJMvdnoxoe MgwA== X-Gm-Message-State: AA6/9Rk7zFfYGiC0IPWMlsD+nkYRKOBmkwbBFfwQZ4ZU5Fmj/aHQoYAH5Td9eEpQhZwkCg== X-Received: by 10.98.80.78 with SMTP id e75mr4614663pfb.131.1475173230579; Thu, 29 Sep 2016 11:20:30 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([12.229.62.29]) by smtp.gmail.com with ESMTPSA id y11sm21941408pfa.4.2016.09.29.11.20.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 11:20:29 -0700 (PDT) Sender: Alexander Motin Subject: Re: Status of PCIe Hotplug? To: Hans Petter Selasky , Jan Henrik Sylvester References: <3c6ab189-aad0-2593-1d3c-f221de294174@janh.de> <1635480.htdnZkDgDb@ralph.baldwin.cx> <6742d46b-304c-79c9-7233-61cd86ef6542@selasky.org> <623f33ff-faaf-02e0-0c6e-725b9e0319e1@selasky.org> Cc: John Baldwin , FreeBSD-USB Mailing List , Warner Losh From: Alexander Motin Message-ID: Date: Thu, 29 Sep 2016 11:20:28 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <623f33ff-faaf-02e0-0c6e-725b9e0319e1@selasky.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2016 18:20:31 -0000 On 29.09.2016 02:40, Hans Petter Selasky wrote: > On 09/29/16 11:24, Jan Henrik Sylvester wrote: >> On 09/29/2016 10:17, Hans Petter Selasky wrote: >>> Hi, >>> >>> I created this differential review: >>> >>> https://reviews.freebsd.org/D8070 >>> >>> Jan Henrik: Can you download this patch and try it instead of the one I >>> sent? >>> >>> --HPS >> >> Pulling the naked USB 3.0 ExpressCard without detaching it does not lead >> to a panic anymore. >> >> Anyhow, the scenario that happened frequently on 10.3 for me without a >> panic was pulling the USB 3.0 ExpressCard together with an usb stick. >> That still leads to a panic on 11.0 + D8070: >> >> fault code = supervisor read data, page not present >> instruction pointer = 0x20:0xffffffff80ab48ca >> stack pointer = 0x28:0xfffffe022476ba20 >> frame pointer = 0x28:0xfffffe022476baa0 >> code segment = base 0x0, limit 0xfffff, type 0x1b >> = DPL 0, pres 1, long 1, def32 0, gran 1 >> processor eflags = interrupt enabled, resume, IOPL = 0 >> current process = 4 (doneq0) >> trap number = 12 >> panic: page fault >> cpuid = 1 >> KDB: stack backtrace: >> #0 0xffffffff80b24107 at kdb_backtrace+0x67 >> #1 0xffffffff80ad93e2 at vpanic+0x182 >> #2 0xffffffff80ad9253 at panic+0x43 >> #3 0xffffffff80fa0d31 at trap_fatal+0x351 >> #4 0xffffffff80fa0f23 at trap_pfault+0x1e3 >> #5 0xffffffff80fa04cc at trap+0x26c >> #6 0xffffffff80f841d1 at calltrap+0x8 >> #7 0xffffffff8030a879 at xpt_release_simq+0x79 >> #8 0xffffffff8030a649 at xpt_async_process+0x409 >> #9 0xffffffff8030b187 at xpt_done_process+0x807 >> #10 0xffffffff8030d916 at xpt_done_td+0x146 >> #11 0xffffffff80a90055 at fork_exit+0x85 >> #12 0xffffffff80f8467e at fork_trampoline+0xe >> > > Hi, > > This panic seems to be an issue within the CAM subsystem. Apparently the > CAM sim detach is not waiting for the release to complete, so functions > inside umass.ko are referred after umass.ko is unloaded. > > imp+mav: Any comments? cam_sim_free() that should be called as part of SIM destruction process waits for all of SIM references to be dropped, that also recursively implies all other references. It worked file last time I tested it, but it was quite a long time ago. I can not say what went wrong here, but I guess that either USB somehow did not wait for cam_sim_free(), or something somewhere did not do reference counting properly, allowing destruction of some still referenced item. -- Alexander Motin