From owner-freebsd-drivers@freebsd.org Wed Nov 22 06:40:13 2017 Return-Path: Delivered-To: freebsd-drivers@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 34EF9DE26B1 for ; Wed, 22 Nov 2017 06:40:13 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (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 E13026F513 for ; Wed, 22 Nov 2017 06:40:12 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-qt0-x231.google.com with SMTP id h42so22409473qtk.11 for ; Tue, 21 Nov 2017 22:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=WAF4pbQiKR1g2QelguNIE/i4t6uBAttweHguZWawQBU=; b=jZe5aTyfvg9VG8nyawlUaSGSXD8uGDrPdcsvetiDQJjDX811HASDjgxjm89g26WHbl gfc4F2GJK+FU0EIu0wQ9QspR+mZ6i+F6WDjIn2CF351D9LSCf23KbTE1749w2mmhrlSb msPaL6gFLDS0FrneAEiyp+a/TGnMpJ6kMtyX4aw0/6/C6UnpUZM0dFn4fgx4oYHPsucV 3mIkM4Bl+dQS4hSohtJDX3LnS+KzUL2+s71wqICAsaEWE8Y9LQCPZZ4EmHInC19M+hGW QZwK1ZV0LL7NDPorOjVJAonClIWiW1QPHqIoF6K/9m8Ap7SiJr8pqLdSOX2vbtS/cN58 xoLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=WAF4pbQiKR1g2QelguNIE/i4t6uBAttweHguZWawQBU=; b=Ka7Su3fAh0I9PGej5p0E3EAnuTttXPv2XSjMVuucdiYroOUJUAjRvtCJY4BuXyECWB vN8xCaNyoW3HX3P5rLau2IKXue1q3AnAcfOONnK/IJYtv5vzouc9Ewqoz37ATSO7Ef0u Rrt/0dCHh7LT6JM9dOo/XHkBnoCFPPkVhoo1EqjLLfFqH3E3T1hSHwG5cvKZAlKcEyDv F7iikY6uhTAiosdN6Jr9ZClbHg0wVRQBOtwjKXVuMFhE5aAgljohaWnqLYrwMyBJ/oCw pgiSwW66UhsX2hAe4Clh+mb4G7rHxZ/tDu4f6AJw2PSCVqyvQGTL3TzFOlDfvQAD3q8e mCzw== X-Gm-Message-State: AJaThX4q7HBYEg8M4qS0aU2fK57LkrbF/p/hGGSZwpb+3hC/I5Ta4KcT /aoTqUgBlhRktILQHcLtp3xOgDZC X-Google-Smtp-Source: AGs4zMZyIIOvFM7mJ/HuWSkepEsoSjupNaG42I/5Ag8U+/MCPdpXNr24ha9ILwbvhgspGY7dGmed2w== X-Received: by 10.237.58.133 with SMTP id o5mr6482198qte.265.1511332811588; Tue, 21 Nov 2017 22:40:11 -0800 (PST) Received: from pc.farhan.codes ([2001:470:8:209::dead:c0de]) by smtp.gmail.com with ESMTPSA id h27sm6847241qtc.79.2017.11.21.22.40.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 22:40:10 -0800 (PST) To: freebsd-drivers@freebsd.org From: Farhan Khan Subject: Kernel page fault with the following non-sleepable locks Message-ID: Date: Wed, 22 Nov 2017 01:40:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 06:40:13 -0000 Hi all, I received this error following what appeared to be a PCI interrupt. Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex rtwn (network driver) r = 0 (0xfffffe000920c000) locked @ /usr/src/sys/dev/rtwn/pci/rtwn_pci_rx.c:290 This is followed by a stack trace, with the rtwn_pci_rx_frame as the last driver-relevant function. The fault code is "supervisor read instruction, page not present". I understand that this happens after a mutex lock is held beyond a period of time, as described here: https://www.freebsd.org/doc/en/books/faq/troubleshoot.html#idp59180136 My questions are: A) What defines long periods of time? B) What common patterns might cause this issue? Is there something in specific I should look for? Would it be a PCI read request that takes too long to return? Thank you, Farhan Khan From owner-freebsd-drivers@freebsd.org Wed Nov 22 06:52:35 2017 Return-Path: Delivered-To: freebsd-drivers@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 2A38CDE2A3E for ; Wed, 22 Nov 2017 06:52:35 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (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 CE4B96FB62 for ; Wed, 22 Nov 2017 06:52:34 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id q13so11049072qtb.5 for ; Tue, 21 Nov 2017 22:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=0ThiC5RzFPDSjqVoJ81unEVvSGKPqgiZ0ZoebxkBy3o=; b=NrFEiFsb7wvA421lXQ2RB2aV7sPJTziF5aUGuudlIKtAJZajcOMPUgu4YeFh5ngcjc o2rdPmQZoTBFqjmAJ8q/3w5iT1ghjKghmsbzJHnN1jV/mILKe3eNwOHCNXLTozQ1IzrC h09NofWWdDOrBwro+84kB6cJxOO7ZurjuPRn8E70rXlNPvKwrMH0LRq9VMx7NsyDkJEY fbFJJWH8lVj/P/XcVfaklVYOvK4mrN3xezA6nyUKxosOicSzP7DLxG/z5BJMyei3XWFB lB2MROEDjf9tm5pp9T7EUICHVrK8HzAkclbe+pDGI1o8g0Y/ZsH3yYqzrAR17MRmhJd4 vIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0ThiC5RzFPDSjqVoJ81unEVvSGKPqgiZ0ZoebxkBy3o=; b=HP3SgwmS8M8688pK1i4YYUgt1VKPW0FeaKbdFOvaRG21jKeRkAIiN4O6a18SQiWTQr i/YCNEuaU165NTTtJjbeB+9ULi1DiFc9q1qpOcVMNH4NlwTVzqpOxQJ2gIlZhPrxBBsL Oqufs6Xnt9MdhAC/iPXHkGJEqvgC5Wvt/eY2D5e6dcVvp5XtdONQmApwHvipVnDtCDXX ZNVEdrpFnwS0CIGcqsAACMbqM0MJjhhZ/R1zfru9QS1Qa4NIKrTHpQ6NvFzpDY6HedMP KlBvQrx79UtJRx7i1maygNGQK/Q5789olgFz0KLoKAqovJ+a4xHjKps0h8bjQ8OtrSQP AoFQ== X-Gm-Message-State: AJaThX4vceocX+D5M8RtG65E9qWt7BBsjq7/yQKehfJNTepXI1aUKq+b pj8KjFHzjQ/HJ5JAZ5OsMstpnieD X-Google-Smtp-Source: AGs4zMZzkcrnUT9omkdD6eQx+8754KLnOIpxTCtvr+snzDZMPKJF7tenGMIxxLkbwVWZQ3pkuIW++A== X-Received: by 10.200.63.140 with SMTP id d12mr32228281qtk.253.1511333553302; Tue, 21 Nov 2017 22:52:33 -0800 (PST) Received: from pc.farhan.codes ([2001:470:8:209::dead:c0de]) by smtp.gmail.com with ESMTPSA id u21sm9703898qku.8.2017.11.21.22.52.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 22:52:32 -0800 (PST) Subject: Re: Kernel page fault with the following non-sleepable locks From: Farhan Khan To: freebsd-drivers@freebsd.org References: Message-ID: <61cbfc1a-a362-afdc-d8bf-b53bda74c153@gmail.com> Date: Wed, 22 Nov 2017 01:52:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 06:52:35 -0000 Quick bit of context to my kernel panic. The panic occurs after running rtwn_rx_common() in /usr/src/sys/dev/rtwn/pci/rtwn_pci_rx.c. The instruction is capturing the return value from %rax. movq %rax,-0x50(%rbp) Hope this helps in diagnosing the issue! On 11/22/2017 01:40 AM, Farhan Khan wrote: > Hi all, > > I received this error following what appeared to be a PCI interrupt. > > Kernel page fault with the following non-sleepable locks held: > exclusive sleep mutex rtwn (network driver) r = 0 (0xfffffe000920c000) > locked @ /usr/src/sys/dev/rtwn/pci/rtwn_pci_rx.c:290 > > This is followed by a stack trace, with the rtwn_pci_rx_frame as the > last driver-relevant function. The fault code is "supervisor read > instruction, page not present". > > I understand that this happens after a mutex lock is held beyond a > period of time, as described here: > https://www.freebsd.org/doc/en/books/faq/troubleshoot.html#idp59180136 > > My questions are: > A) What defines long periods of time? > B) What common patterns might cause this issue? Is there something in > specific I should look for? Would it be a PCI read request that takes > too long to return? > > Thank you, > Farhan Khan