From owner-freebsd-scsi@freebsd.org Wed Feb 10 11:07:28 2016 Return-Path: Delivered-To: freebsd-scsi@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 B7ACFAA26D3 for ; Wed, 10 Feb 2016 11:07:28 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 98E5E6A7 for ; Wed, 10 Feb 2016 11:07:28 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: by mailman.ysv.freebsd.org (Postfix) id 99A3DAA26D1; Wed, 10 Feb 2016 11:07:28 +0000 (UTC) Delivered-To: scsi@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 7F51EAA26CF for ; Wed, 10 Feb 2016 11:07:28 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 26F316A4 for ; Wed, 10 Feb 2016 11:07:28 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: by mail-wm0-x22d.google.com with SMTP id p63so22978136wmp.1 for ; Wed, 10 Feb 2016 03:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4coW5Q9njeKK+A9EHJGEUo3mQ5Gl2X6KhY/L7yfP7ts=; b=NxhGRZDIV9Q5oX0qcfY+urxz2ao4Pr3+YF82hOr4a7lP2KXLN8UhA/vD/Js3cN28PC 3vqlwuXEPou9dEViOhMQPI3jYpD1fu5THFe4K+msjkivpi0Rlf/caQ24sN0Z0AcC2rSo +ww+fBGNbOfuADtcWNoDO4JDVnS6PP+tzTgas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=4coW5Q9njeKK+A9EHJGEUo3mQ5Gl2X6KhY/L7yfP7ts=; b=bQUava3LqH+uOhMebwM1PxSO+vILcyhNINeZyukWf3fVMofsVMIHOr8dSQUr2vELpP E11GEGco/p8bClR92x2SA6XKFEqA0asazAO3gFzIGZ1tajWiHJ8pUIbScgRN41Wnz3tQ vG8aqqp5zLovxHQufXZh25DLbE011BiPzckiGidw0BJhgvccZXnCJFtBxminbF/sJqCP 3KBug1SOzJQiTC5ML7kBxD2iLxATAfYCBLEufvIMVpyswouSu479gb4mHVZP3baiAisM LJ+qOVOi7f5x0a2jbcTFk9nJv7b985qmS0ubc10JpFd1aGhXzJwaebBCnx+oPT2PXtYt sDoA== X-Gm-Message-State: AG10YOSkxEL2w99eqVqGigLmcRXX/NsNMVJQ7Ei/HtkmtDDPnrzahcwiEzhV5HxSAysqsvesgtND7SDkPPMYF9RN MIME-Version: 1.0 X-Received: by 10.28.12.9 with SMTP id 9mr10745439wmm.76.1455102445946; Wed, 10 Feb 2016 03:07:25 -0800 (PST) Received: by 10.27.133.196 with HTTP; Wed, 10 Feb 2016 03:07:25 -0800 (PST) In-Reply-To: <2227929.z5Tr1XC1Xs@ralph.baldwin.cx> References: <2227929.z5Tr1XC1Xs@ralph.baldwin.cx> Date: Wed, 10 Feb 2016 16:37:25 +0530 Message-ID: Subject: Re: Panic on reloading a driver with same DEVICE_PROBE() return value From: Sreekanth Reddy To: John Baldwin Cc: freebsd-current@freebsd.org, ken@freebsd.org, scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 11:07:28 -0000 On Wed, Feb 10, 2016 at 3:30 AM, John Baldwin wrote: > 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" Yes, I am getting below messages, at OS boot time for Out-of-box driver module_register: module pci/mpr already exists! Module pci/mpr failed to register: 17 > > -- > John Baldwin