From owner-freebsd-current@freebsd.org Mon Feb 8 18:37:08 2016 Return-Path: Delivered-To: freebsd-current@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 EFC03AA1A24; Mon, 8 Feb 2016 18:37:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFFB31F0B; Mon, 8 Feb 2016 18:37:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 32815B958; Mon, 8 Feb 2016 13:37:07 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Cc: Sreekanth Reddy , ken@freebsd.org, scsi@freebsd.org, current@freebsd.org Subject: Re: Panic on reloading a driver with same DEVICE_PROBE() return value Date: Mon, 08 Feb 2016 10:28:45 -0800 Message-ID: <33145844.5EAIpev2G5@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 08 Feb 2016 13:37:07 -0500 (EST) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 08 Feb 2016 18:37:09 -0000 On Monday, February 08, 2016 08:13:26 PM Sreekanth Reddy wrote: > sc->facts = malloc(sizeof(MPI2_IOC_FACTS_REPLY), M_MPR, M_ZERO|M_NOWAIT); M_NOWAIT can fail with NULL. Normally in an attach routine you should use a blocking malloc (M_WAITOK) which will not fail with NULL. > * How can I reload the modified driver with return same device_probe() > value as the one which has loaded during the OS boot time. I observed > that whenever I try to load this modified driver using "kldload > ./mpr.ko" command then I see that driver in the /boot/kernel/ path has > executed. At runtime you can use the devctl(8) command on HEAD (it will be included in 10.3) to force a device to detach/attach to force a re-probe. e.g. devctl detach mpr0 # note that the device won't be named mpr0, you will need to use its PCI # location for this next: devctl attach pci0:4:0:0 -- John Baldwin