Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Dec 2008 18:45:29 -0800
From:      Garrett Cooper <yanefbsd@gmail.com>
To:        Scott Long <scottl@samsco.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "mav@freebsd.org" <mav@freebsd.org>, Alfred Perlstein <alfred@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: svn commit: r186182 - head/sys/dev/ata
Message-ID:  <0775EC1A-7920-4B2A-A00E-1A930953B597@gmail.com>
In-Reply-To: <72A0CF67-F521-4C4B-955D-A80A77CC1165@samsco.org>
References:  <4947D474.9040802@samsco.org> <20081216.101038.1172765453.imp@bsdimp.com> <4947F363.4010909@samsco.org> <20081216.120412.1346820326.imp@bsdimp.com> <20081227003826.GV18389@elvis.mu.org> <72A0CF67-F521-4C4B-955D-A80A77CC1165@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 26, 2008, at 18:33, Scott Long <scottl@samsco.org> wrote:

>
> On Dec 26, 2008, at 5:38 PM, Alfred Perlstein <alfred@freebsd.org>  
> wrote:
>
>> * M. Warner Losh <imp@bsdimp.com> [081216 11:06] wrote:
>>> In message: <4947F363.4010909@samsco.org>
>>>           Scott Long <scottl@samsco.org> writes:
>>> : M. Warner Losh wrote:
>>> : > In message: <4947D474.9040802@samsco.org>
>>> : >             Scott Long <scottl@samsco.org> writes:
>>> : > : Alexander Motin wrote:
>>> : > : > Author: mav
>>> : > : > Date: Tue Dec 16 16:04:40 2008
>>> : > : > New Revision: 186182
>>> : > : > URL: http://svn.freebsd.org/changeset/base/186182
>>> : > : >
>>> : > : > Log:
>>> : > : >   Call ata_legacy() only once on attach and save it's  
>>> result. Scanning PCI
>>> : > : >   configuration registers (which are not going to change)  
>>> on every interrupt
>>> : > : >   looks expensive, especially when interrupt is shared.  
>>> Profiling shows me 3%
>>> : > : >   of time spent by atapci0 on pure network load due to IRQ  
>>> sharing with em0.
>>> : > : >
>>> : > :
>>> : > : Nice change.  PCI Config registers are exceptionally slow to  
>>> access on
>>> : > : most systems.
>>> : >
>>> : > And we've been recommending to people for years that they  
>>> avoid config
>>> : > space access in interrupt handlers.  Maybe it is time for  
>>> something
>>> : > that checks and prints a warning?
>>> : >
>>> :
>>> : With the move to memory-mapped pci config registers, there was an
>>> : intention to allow low-end devices to put their registers into  
>>> config
>>> : space.  I think I recall some legacy ultra-low end devices that  
>>> also
>>> : put a few required registers into config space.  So while it's  
>>> not ideal
>>> : to access it from an interrupt handler, I can't think of why it  
>>> should
>>> : be expressly forbidden.
>>>
>>> True.  I wasn't planning on banning it, just warning about it so we
>>> could be purposeful in our use of it.  Likely unworkable though...
>>
>> Easy enough to stash a "once" varible in the generic device struct
>> and warn when returning from an isr when INVARIANTS or something is
>> turned on.
>>
>> Then you'd only get one warning per device once it happens.
>>
>>
>
> I prefer to do nothing.  It's not unsafe or erroneous to access cfg  
> registers.  But if some kind of message does get added, I insist  
> that it drop all pretenses and say, "you're too poor to run freebsd,  
> come back when you can afford better hardware.". :)
>
> Scott

Unfortunately embedded systems can't win the lottery ;.).
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0775EC1A-7920-4B2A-A00E-1A930953B597>