From owner-freebsd-scsi@freebsd.org Tue Feb 9 09:25:57 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 E653FAA234B for ; Tue, 9 Feb 2016 09:25:56 +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 C8E88D92 for ; Tue, 9 Feb 2016 09:25:56 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: by mailman.ysv.freebsd.org (Postfix) id C9089AA2349; Tue, 9 Feb 2016 09:25:56 +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 C8A46AA2348 for ; Tue, 9 Feb 2016 09:25:56 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::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 64408D8D for ; Tue, 9 Feb 2016 09:25:56 +0000 (UTC) (envelope-from sreekanth.reddy@broadcom.com) Received: by mail-wm0-x235.google.com with SMTP id g62so14569125wme.0 for ; Tue, 09 Feb 2016 01:25:56 -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=ZsqPExS5WZI2cQT5BEYzu2HaDEVgz3QQ/U/X0UqDCzc=; b=DCw4FTwPqyaxT4wISYZqN0QOE5eMavlYo1GNkc+lq45RlbsyIpZ311MAMZH1NJO+lH 2T4S+BtvCe3ycjuMjfWCg9wV7liv8O6wJJP1pYLO/j2iz0BJpHD1bMobrG9S2+NYnEil /39BdCSgyIpndoNQTWwBlY3C5KXsJlUWQgKjk= 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=ZsqPExS5WZI2cQT5BEYzu2HaDEVgz3QQ/U/X0UqDCzc=; b=cHtrRDuFg1FpzIansIQwpsuyW+JYMzVpUAg3RaBNnV/fh9lx2nsRmSk8bp7hMAzcT1 Ld0UDbNBQ/xkT90DJVwy9Uerrm6TPnv4HGDJ9xCCHl0l2fk7Ss9DmDorThkX5lbCv6JB teJ9lVfqw05TSB5A6FLS6OKyx1zrKgsFMbQPAZeSrFuaMf+1jrZKJ4LyYvemwhHodAqp LHj2XbJllC9xLj4iX2JIO6hRrFEVkygrVBvxnIr8DBfs9mft9VECnZp24+GwNdghJBIq a/Q7gnOWXnopvOVLSAOjjUllxim3JzEynPXx1moeYmFnvkm/Elb9tq7Oy3z3lNBU5/zN nq0A== X-Gm-Message-State: AG10YOQ9thmHxM9uCRKbeqhBikIRlk2/osl7B3j8NSnkkUTFBPpAFrOVkzyuioDOSd/Fq2hUZm+GXd8T2TtZB9Wp MIME-Version: 1.0 X-Received: by 10.194.58.169 with SMTP id s9mr28055695wjq.52.1455009954500; Tue, 09 Feb 2016 01:25:54 -0800 (PST) Received: by 10.27.133.196 with HTTP; Tue, 9 Feb 2016 01:25:54 -0800 (PST) In-Reply-To: <33145844.5EAIpev2G5@ralph.baldwin.cx> References: <33145844.5EAIpev2G5@ralph.baldwin.cx> Date: Tue, 9 Feb 2016 14:55:54 +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, current@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: Tue, 09 Feb 2016 09:25:57 -0000 On Mon, Feb 8, 2016 at 11:58 PM, John Baldwin wrote: > 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. Yes I agree that in an attach routine we should to use a blocking malloc (M_WAITOK) flag. But, here I am observing same page fault even with (M_WAITOK) flag. Here, page fault is occurring inside the malloc function and driver is not receiving any NULL or any other value. > >> * 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 I have started downloading the current kernel. I will verify this today/tomorrow. > > -- > John Baldwin