From owner-freebsd-current@FreeBSD.ORG Sun Mar 29 15:34:33 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD354106564A for ; Sun, 29 Mar 2009 15:34:33 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from web63907.mail.re1.yahoo.com (web63907.mail.re1.yahoo.com [69.147.97.122]) by mx1.freebsd.org (Postfix) with SMTP id 58D4D8FC08 for ; Sun, 29 Mar 2009 15:34:32 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: (qmail 38086 invoked by uid 60001); 29 Mar 2009 15:34:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1238340872; bh=+gWe+TfcTl2UxrL2X/pQQSQgedVHhw/umRZz20SBnSg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=OsFPQ3UnjUc4eVKDgky3iOC87GR75nPL1ATXYn0JReEWK9yhzxNUZpMm6croc3zcxLGMFGIq4951Fvke1KpgFUZG1B9XVfssfTU1Vc+ojMOu2Zpk5GOgBKBBnHK3yLpqNCzzAPU5UhGcsG2xMVyMVp6Iiiu2b/AFw1MlAJ0bPZM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=iO7yTgBSh//IatwuctISSPw+RUMLoi1rOfU//bdUPNIe/N2lU9w1U6KuH2aNGUfmt+kdr1r0uHMsbeojVGDjBB6u7q4dqYS9w3NYjkTQewiboxn3dUBmkgo2o9NdNm1sGvWRNlKtBjmV2Crx/mJuMlmH8sSHOOlefbHvIkMf00Q=; Message-ID: <513261.38032.qm@web63907.mail.re1.yahoo.com> X-YMail-OSG: 9htqcpIVM1nB3aO0wC7WwAdsm8krbqp0ShQNI3zxnoFPps_UQioDAC3nSi8IvpdJ0qifSUvsYe_9NSv6.M9rWfpNiHwYke.RSa3sqYTCSQXxpf0cAJGqbaRq_tuXETW30lNkvI3W3UsE4qoGOGFQYBWTvNoUUfghMezZ3LGJz.DBHBpV8b4OcxmP9KTQ_1WnTmAtlPBMY3mzLXdwSd26AYoV8UXZ3enT_NBhYyDCNMI4fEEXCxeUtA-- Received: from [98.242.222.229] by web63907.mail.re1.yahoo.com via HTTP; Sun, 29 Mar 2009 08:34:32 PDT X-Mailer: YahooMailWebService/0.7.289.1 Date: Sun, 29 Mar 2009 08:34:32 -0700 (PDT) From: Barney Cordoba To: current@freebsd.org In-Reply-To: <706191.48959.qm@web63902.mail.re1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: pci_alloc_resource is broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: barney_cordoba@yahoo.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 15:34:34 -0000 --- On Sat, 3/28/09, Barney Cordoba wrote: > From: Barney Cordoba > Subject: Re: Bus Resource busy panic > To: current@freebsd.org > Date: Saturday, March 28, 2009, 8:03 PM > --- On Sat, 3/28/09, Barney Cordoba > wrote: > > > From: Barney Cordoba > > Subject: Bus Resource busy panic > > To: current@freebsd.org > > Date: Saturday, March 28, 2009, 6:35 PM > > I have a situation that results in a panic in 8 that > runs > > happily in 7. > > Its a bus_alloc_resource of type SYS_RES_MEMORY that > is > > used by 2 > > separate devices. > > > > I see there is an RF_SHAREABLE flag. That flag > hadn't > > been set, but is there > > something in 8 that now requires it? > > > > As a side question, should a bus_alloc_resource call > panic > > the system just > > because the resource is busy? > > > > Barney > > Some more info on this. The panic is in > resource_list_alloc() and > setting SHAREABLE doesn't fix it. I see the same code > in 7 so > I'm not sure why it would work in 7 and not 8. > > Basically there are 2 devices that need to do IO on a > board, and they > are both doing > > bus_alloc_resource_any(dev, SYS_RES_MEMORY,&rid, > RF_ACTIVE); > > > Barney > I'm not sure if anyone was reading the original thread, so I created another with my results. Someone broke pci_alloc_resource. In the SYS_RES_MEMORY case, when rman_get_device() != dev (but rle->res is set), it erroneously falls to resource_list_alloc which will panic on device resource busy. It seems that this would preclude the sharing of a resource, as any secondary request will not only fail, but panic the system Barney