Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Feb 2015 15:37:02 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        "John-Mark Gurney" <jmg@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 1205651 for review
Message-ID:  <201502031537.02953.jhb@freebsd.org>
In-Reply-To: <201502030012.t130Cnni073962@skunkworks.freebsd.org>
References:  <201502030012.t130Cnni073962@skunkworks.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, February 02, 2015 7:12:49 pm John-Mark Gurney wrote:
> http://p4web.freebsd.org/@@1205651?ac=10
> 
> Change 1205651 by jmg@jmg_pciehp on 2015/02/03 00:12:18
> 
> 	Add inital work to make PCIe HotPlug work...  This has been tested
> 	w/:
> 	<inserted ExpressCard>
> 	uart3: <MosChip MCS9922 PCIe to Peripheral Controller> port 0x3000-0x3007 
at device 0.0 on pci2
> 	uart4: <MosChip MCS9922 PCIe to Peripheral Controller> port 0x3008-0x300f 
at device 0.1 on pci2
> 	<removed ExpressCard>
> 	uart3: detached
> 	uart4: detached
> 	<inserted ExpressCard>
> 	uart3: <MosChip MCS9922 PCIe to Peripheral Controller> port 0x3000-0x3007 
at device 0.0 on pci2
> 	uart4: <MosChip MCS9922 PCIe to Peripheral Controller> port 0x3008-0x300f 
at device 0.1 on pci2
> 	
> 	This work is based upon gavin's project branch, but fixed
> 	to make some things work..
> 	
> 	Right now there is a nasty bit as we don't have a way for a
> 	non-acpi driver to add a new PCI device, so the code hard codes
> 	the extra space necessary for ACPI...  This will be fixed by
> 	adding necessary bus functions to tell ACPI to rescan the bus,
> 	etc...

Note that Ryan already had to solve this problem for SRIOV, and I think his 
solution will work fine.  In particular, you can have a pci_if.m method that 
the bus drivers implement that is something like 'pci_add_device()' to tell it 
about the new device(s) it needs to rescan without forcing an entire bus 
rescan (though a bus rescan might be useful for other reasons).
 	
> +/* Interesting values for PCIe Hotplug */
> +struct pcicfg_hp {
> +    struct task	hp_inttask;
> +    struct callout_handle hp_dllhndl;
> +    int		hp_cnt;		/* Giant locked */
> +    uint32_t	hp_slotcap;	/* cache this */
> +};

Do not use a callout_handle.  timeout() is about to be removed from the tree 
(there is only one consumer left).  Use a struct callout instead.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502031537.02953.jhb>