From owner-freebsd-current@freebsd.org Tue Feb 9 22:02:12 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 50679AA2638; Tue, 9 Feb 2016 22:02:12 +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 320FC1A60; Tue, 9 Feb 2016 22:02:12 +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 1FB56B999; Tue, 9 Feb 2016 17:02:11 -0500 (EST) From: John Baldwin To: Sreekanth Reddy Cc: freebsd-current@freebsd.org, ken@freebsd.org, scsi@freebsd.org Subject: Re: Panic on reloading a driver with same DEVICE_PROBE() return value Date: Tue, 09 Feb 2016 14:00:12 -0800 Message-ID: <2227929.z5Tr1XC1Xs@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); Tue, 09 Feb 2016 17:02:11 -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: Tue, 09 Feb 2016 22:02:12 -0000 On Tuesday, February 09, 2016 05:45:38 PM Sreekanth Reddy wrote: > Hi, > > While debugging more, I got one more clue, > > ----------------------------------------------------------------------------------------------- > static driver_t mps_pci_driver = { > "mpr", > mps_methods, > sizeof(struct mps_softc) > }; > > static devclass_t mps_devclass; > DRIVER_MODULE(mpr, pci, mps_pci_driver, mps_devclass, 0, 0); > ------------------------------------------------------------------------------------------------- > > in the above code snip-set, if I changed "DRIVER_MODULE" line as > DRIVER_MODULE(mpr3, pci, mps_pci_driver, mps_devclass, 0, 0); > (i.e. from "mpr" to "mpr3") then I am not observing any panic and I > can load & unload the mpr driver multiple times. Oh, that might be required, yes. DRIVER_MODULE uses its arguments to define a module name (in this case as "pci/mpr") and module names are required to be unique. I believe you should be getting a printf warning about this on the console. Something like: "module_register: cannot register pci/mpr from blah.ko; already loaded from foo.ko" -- John Baldwin