pci_alloc_resource is broken

From: Barney Cordoba <barney_cordoba_at_yahoo.com>
Date: Sun, 29 Mar 2009 08:34:32 -0700 (PDT)
--- On Sat, 3/28/09, Barney Cordoba <barney_cordoba_at_yahoo.com> wrote:

> From: Barney Cordoba <barney_cordoba_at_yahoo.com>
> Subject: Re: Bus Resource busy panic
> To: current_at_freebsd.org
> Date: Saturday, March 28, 2009, 8:03 PM
> --- On Sat, 3/28/09, Barney Cordoba
> <barney_cordoba_at_yahoo.com> wrote:
> 
> > From: Barney Cordoba <barney_cordoba_at_yahoo.com>
> > Subject: Bus Resource busy panic
> > To: current_at_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


      
Received on Sun Mar 29 2009 - 13:34:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:45 UTC