summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* - Remove unnecessary LOCKPARENT manipulation.jeff2005-03-281-20/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Rev 1.83 of kern_lock.c fixes the td_locks assert, reenable it here.jeff2005-03-281-3/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Don't bump the count twice in the LK_DRAIN case.jeff2005-03-281-2/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Fix the lockmgr flags so that external flags and internal flags arejeff2005-03-281-35/+33
| | | | | | | grouped together with room for each set to expand. This makes the external lock mask sane. Sponsored by: Isilon Systems, Inc.
* - Move code that should probably be an assert above the main body ofjeff2005-03-281-15/+14
| | | | | | | vrele so that we can decrease the indentation of the real work and make things slightly more clear. Sponsored by: Isilon Systems, Inc.
* Check that supplied facility is not bigger than LOG_NFACILITIES.glebius2005-03-281-0/+7
| | | | | PR: bin/79260 Submitted by: Shuichi KITAGUCHI
* Bump .Dd for the previous commit.brueffer2005-03-281-1/+1
|
* - Remove the now-unused LK_REENABLE flag.jeff2005-03-281-3/+1
| | | | Sponsored by: Isilon Systems, Inc.
* - nwfs_lookup() is no longer responsible for unlocking the dvp, this isjeff2005-03-281-26/+10
| | | | | | | handled in vfs_lookup.c. This code was missing PDIRUNLOCK use prior to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c. Sponsored by: Isilon Systems, Inc.
* - Fix the hpfs build, hpfs_hash.c was removed from the repository.jeff2005-03-281-1/+1
|
* - hpfs_lookup() is no longer responsible for unlocking the dvp, this isjeff2005-03-281-11/+6
| | | | | | | handled in vfs_lookup.c. This code was missing PDIRUNLOCK use prior to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c. Sponsored by: Isilon Systems, Inc.
* Fix typo - link for bsde_add_rule(3) manual page was not created.pjd2005-03-281-1/+1
| | | | MFC after: 1 week
* - ext2fs_lookup() is no longer responsible for unlocking the dvp, this isjeff2005-03-282-32/+2
| | | | | | | handled in vfs_lookup.c. This code was missing PDIRUNLOCK use prior to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c. Sponsored by: Isilon Systems, Inc.
* Properly return rule number.pjd2005-03-281-1/+1
| | | | | | Submitted by: Wojciech A. Koszek PR: bin/79292 MFC after: 1 week
* - UFS no longer uses PDIRUNLOCK to track the parent state. Instead, we nowjeff2005-03-281-12/+7
| | | | | | | rely on ufs to always leave the parent locked except in the ISDOTDOT case. Adjust asserts to deal with these changes. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-288-158/+21
| | | | Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-7/+5
| | | | | | | | - In the ISDOTDOT case we have to unlock the dvp before locking the child, if this fails we must relock dvp before returning an error. This was missing before. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-283-146/+41
| | | | | | | | | | | - Network filesystems are written with a special idiom that checks the cache first, and may even unlock dvp before discovering that a network round-trip is required to resolve the name. I believe dvp is prevented from being recycled even in the forced unmount case by the shared lock on the mount point. If not, this code should grow checks for VI_DOOMED after it relocks dvp or it will access NULL v_data fields. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-21/+4
| | | | Sponsored by: Isilon Systems, Inc.
* - Adjust asserts in vop_lookup_post() to match the new post PDIRUNLOCKjeff2005-03-281-11/+8
| | | | | | vfs. Sponsored by: Isilon Systems, Inc.
* - Get rid of PDIRUNLOCK, instead, we fixup the lock state immediately afterjeff2005-03-281-13/+51
| | | | | | | | | | | | | calling VOP_LOOKUP(). Rather than having each filesystem check the LOCKPARENT flag, we simply check it once here and unlock as required. The only unusual case is ISDOTDOT, where we require an unlocked vnode on return. Relocking this vnode with the child locked is allowed since the child is actually its parent. - Add a few asserts for some unusual conditions that I do not believe can happen. These will later go away and turn into implementations for these conditions. Sponsored by: Isilon Systems, Inc.
* - Remove PDIRUNLOCK, it will soon be unused in every filesystems. The onlyjeff2005-03-281-1/+0
| | | | | | | | | | case where filesystems legitimately need to unlock the directory vp is in the DOTDOT case, which we can explicitly check for in lookup(). Furthermore, allowing filesystems to unlock dvp can lead to lock order reversals in lookup() when we vrele the dvp while the child is still locked. Sponsored by: Isilon Systems, Inc.
* The make_dev(9) functions no longer handle dev_ts, but struct cdevs.brueffer2005-03-281-9/+9
| | | | | | PR: 78172 Submitted by: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl> MFC after: 3 days
* Note when 'stat' appeared in FreeBSD.obrien2005-03-281-1/+3
|
* Fix module build on amd64. There may be a cleaner way to do the .PATHnjl2005-03-281-0/+1
|
* You must selwakeup{,pri}() when closing a selectable object or thegreen2005-03-271-0/+1
| | | | | | | td->td_sel will get trashed and crash the system. Fix BPF's mistake in this area. MFC after: 1 day
* Clean up resources properly if acpi_perf fails to attach. First, changenjl2005-03-272-8/+20
| | | | | | acpi_bus_alloc_gas() to delete the resource it set if alloc fails. Then, change acpi_perf to delete the resource after releasing it if alloc fails. This should make probe and attach both fully restartable if either fails.
* Add powernow to kernel build target.njl2005-03-272-0/+2
|
* Hook powernow up to the build for i386 and amd64.njl2005-03-271-1/+5
|
* Add the powernow driver, which handles AMD Mobile Athlon PowerNow! (k7)njl2005-03-271-0/+928
| | | | | | | | | and AMD Cool&Quiet PowerNow! (k8) cpufreq control. This driver is enabled for both i386 and amd64 architectures. It has both acpi and legacy BIOS attachments. Thanks to Bruno Ducrot for writing this driver and Jung-uk Kim for testing. Submitted by: Bruno Ducrot (ducrot:poupinou.org)
* Serialize task queue by starting only one thread instead of three. Thisnjl2005-03-271-1/+1
| | | | | | | | may help with various interdependencies between subsystems. More testing is needed to understand what the underlying issues are here. Tested by: Juho Vuori MFC after: 2 days
* Fix AMD64 cross-builds when WITH_LIB32 is defined.ru2005-03-271-4/+4
| | | | (Initially spotted by kris@ on RELENG_5.)
* We usually say "to conform some standard" so I guess this is a typo.delphij2005-03-272-2/+2
|
* Fix copy&paste error in my previous commit.mux2005-03-271-2/+2
| | | | Spotted by: ru
* MFen: Copyright Year Updatedelphij2005-03-271-1/+2
| | | | | | - hardware/common/artheader.sgml: 1.5 -> 1.6 Obtained from: The FreeBSD Simplified Chinese Project CVS
* Unbreak style(9) breakage from last commit. We try to avoid definingimp2005-03-271-4/+2
| | | | | | variables in internal blocks. Also, go ahead and fail if we can't load the firmware. It should have failed like this, but never did (firmware loads generally don't fail).
* Sync translation with my local work. This is essentiallydelphij2005-03-271-1396/+734
| | | | | | MFen 1.761.2.11 -> 1.829. Obtained from: The FreeBSD Simplified Chinese Project CVS
* Fix a bunch of bugs I came accross when looking at the ixgb(4) driver,mux2005-03-273-41/+9
| | | | | | | | | | | | | | | | | | | | some of which are rather serious: - Use the device sysctl tree instead of rolling our own. - Don't create a bus_dmamap_t to pass to bus_dmamem_alloc(), it is bus_dmamem_alloc() that creates it itself. The DMA map created by the driver was overwritten and its memory was leaked. - Fix resource handling bugs in the error path of ixgb_dma_alloc(). - Don't use vtophys() to get the base address of the TX and RX rings when busdma already gave us the correct address to use! - Remove now useless includes and the alpha_XXX_dmamap() hack. - Don't initialize if_output to ether_output(), ether_ifattach() does it for us already. - Add proper module dependencies on ether and pci. Unfortunately, I'm not lucky enough to own an ixgb(4) card, nor a machine with a bus where to plug it in and I couldn't find anyone able to test these patches, so they are only build-tested and I won't MFC them for 5.4-RELEASE.
* Unbreak LINT.pjd2005-03-271-0/+3
|
* Don't defer the boot-time exploration of high-speed USB busses.iedowse2005-03-271-3/+9
| | | | | | | This ensures that we explore EHCI busses before their companion controllers' busses, so that ports connected to full/low speed devices will be properly routed to the companion controllers by the time the OHCI/UHCI exploration occurs.
* When PAM support was added to rexecd in revision 1.29 (just prior tonectar2005-03-271-2/+17
| | | | | | | | | | | | | | | | | | | | | 5.0-RELEASE), a visually elusive bug was introduced. A comparison operator was changed to assignment. As a result, rexecd behaved always as if the `-i' option had been specified. It would allow root logins. This commit corrects the situation in the obvious way. A separate bug was introduced at the same time. The PAM library functions are called between the invocation of getpwnam(3) and the use of the returned static object. Since many PAM library functions result in additional getpwnam(3) calls, the contents of the returned static object could be changed from under rexecd. With this commit, getpwnam_r(3) is used instead. Other PAM-using applications should be reviewed for similar errors in getpw* usage. Security: rexecd's documented default policy of disallowing root logins was not enforced. Reviewed by: cperciva
* Unstaticize config. It was being optimized away.des2005-03-271-1/+1
| | | | MFC after: 3 days
* When doing the initial open of the proc via procfs, complain if we arealfred2005-03-273-8/+14
| | | | | | unable to open the /proc/pid/mem file. Otherwise doing a truss on a nonexistant pid makes us return success even though no such process exists.
* I've been working on this somewhat so I'm moving thealfred2005-03-272-313/+329
| | | | parts I'm touching to be as style(9) compliant as I can.
* Argh. PCI resource list became an STAILQ instead of an SLIST. Try towpaul2005-03-272-1/+18
| | | | | deal with this while maintaining backards source compatibility with stable.
* Check in ntoskrnl_var.h, which should have been included in thewpaul2005-03-271-2/+18
| | | | previous commit.
* Finally bring an end to the great "make the Atheros NDIS driverwpaul2005-03-275-183/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | work on SMP" saga. After several weeks and much gnashing of teeth, I have finally tracked down all the problems, despite their best efforts to confound and annoy me. Problem nunmber one: the Atheros windows driver is _NOT_ a de-serialized miniport! It used to be that NDIS drivers relied on the NDIS library itself for all their locking and serialization needs. Transmit packet queues were all handled internally by NDIS, and all calls to MiniportXXX() routines were guaranteed to be appropriately serialized. This proved to be a performance problem however, and Microsoft introduced de-serialized miniports with the NDIS 5.x spec. Microsoft still supports serialized miniports, but recommends that all new drivers written for Windows XP and later be deserialized. Apparently Atheros wasn't listening when they said this. This means (among other things) that we have to serialize calls to MiniportSendPackets(). We also have to serialize calls to MiniportTimer() that are triggered via the NdisMInitializeTimer() routine. It finally dawned on me why NdisMInitializeTimer() takes a special NDIS_MINIPORT_TIMER structure and a pointer to the miniport block: the timer callback must be serialized, and it's only by saving the miniport block handle that we can get access to the serialization lock during the timer callback. Problem number two: haunted hardware. The thing that was _really_ driving me absolutely bonkers for the longest time is that, for some reason I couldn't understand, my test machine would occasionally freeze or more frustratingly, reset completely. That's reset and in *pow!* back to the BIOS startup. No panic, no crashdump, just a reset. This appeared to happen most often when MiniportReset() was called. (As to why MiniportReset() was being called, see problem three below.) I thought maybe I had created some sort of horrible deadlock condition in the process of adding the serialization, but after three weeks, at least 6 different locking implementations and heroic efforts to debug the spinlock code, the machine still kept resetting. Finally, I started single stepping through the MiniportReset() routine in the driver using the kernel debugger, and this ultimately led me to the source of the problem. One of the last things the Atheros MiniportReset() routine does is call NdisReadPciSlotInformation() several times to inspect a portion of the device's PCI config space. It reads the same chunk of config space repeatedly, in rapid succession. Presumeably, it's polling the hardware for some sort of event. The reset occurs partway through this process. I discovered that when I single-stepped through this portion of the routine, the reset didn't occur. So I inserted a 1 microsecond delay into the read loop in NdisReadPciSlotInformation(). Suddenly, the reset was gone!! I'm still very puzzled by the whole thing. What I suspect is happening is that reading the PCI config space so quickly is causing a severe PCI bus error. My test system is a Sun w2100z dual Opteron system, and the NIC is a miniPCI card mounted in a miniPCI-to-PCI carrier card, plugged into a 100Mhz PCI slot. It's possible that this combination of hardware causes a bus protocol violation in this scenario which leads to a fatal machine check. This is pure speculation though. Really all I know for sure is that inserting the delay makes the problem go away. (To quote Homer Simpson: "I don't know how it works, but fire makes it good!") Problem number three: NdisAllocatePacket() needs to make sure to initialize the npp_validcounts field in the 'private' section of the NDIS_PACKET structure. The reason if_ndis was calling the MiniportReset() routine in the first place is that packet transmits were sometimes hanging. When sending a packet, an NDIS driver will call NdisQueryPacket() to learn how many physical buffers the packet resides in. NdisQueryPacket() is actually a macro, which traverses the NDIS_BUFFER list attached to the NDIS_PACKET and stashes some of the results in the 'private' section of the NDIS_PACKET. It also sets the npp_validcounts field to TRUE To indicate that the results are now valid. The problem is, now that if_ndis creates a pool of transmit packets via NdisAllocatePacketPool(), it's important that each time a new packet is allocated via NdisAllocatePacket() that validcounts be initialized to FALSE. If it isn't, and a previously transmitted NDIS_PACKET is pulled out of the pool, it may contain stale data from a previous transmission which won't get updated by NdisQueryPacket(). This would cause the driver to miscompute the number of fragments for a given packet, and botch the transmission. Fixing these three problems seems to make the Atheros driver happy on SMP, which hopefully means other serialized miniports will be happy too. And there was much rejoicing. Other stuff fixed along the way: - Modified ndis_thsuspend() to take a mutex as an argument. This allows KeWaitForSingleObject() and KeWaitForMultipleObjects() to avoid any possible race conditions with other routines that use the dispatcher lock. - Fixed KeCancelTimer() so that it returns the correct value for 'pending' according to the Microsoft documentation - Modfied NdisGetSystemUpTime() to use ticks and hz rather than calling nanouptime(). Also added comment that this routine wraps after 49.7 days. - Added macros for KeAcquireSpinLock()/KeReleaseSpinLock() to hide all the MSCALL() goop. - For x86, KeAcquireSpinLockRaiseToDpc() needs to be a separate function. This is because it's supposed to be _stdcall on the x86 arch, whereas KeAcquireSpinLock() is supposed to be _fastcall. On amd64, all routines use the same calling convention so we can just map KeAcquireSpinLockRaiseToDpc() directly to KfAcquireSpinLock() and it will work. (The _fastcall attribute is a no-op on amd64.) - Implement and use IoInitializeDpcRequest() and IoRequestDpc() (they're just macros) and use them for interrupt handling. This allows us to move the ndis_intrtask() routine from if_ndis.c to kern_ndis.c. - Fix the MmInitializeMdl() macro so that is uses sizeof(vm_offset_t) when computing mdl_size instead of uint32_t, so that it matches the MmSizeOfMdl() routine. - Change a could of M_WAITOKs to M_NOWAITs in the unicode routines in subr_ndis.c. - Use the dispatcher lock a little more consistently in subr_ntoskrnl.c. - Get rid of the "wait for link event" hack in ndis_init(). Now that I fixed NdisReadPciSlotInformation(), it seems I don't need it anymore. This should fix the witness panic a couple of people have reported. - Use MSCALL1() when calling the MiniportHangCheck() function in ndis_ticktask(). I accidentally missed this one when adding the wrapping for amd64.
* Remove another ';' after if().phk2005-03-271-1/+1
| | | | Also spotted by: bz
* Remove extra ; at end of if().phk2005-03-271-1/+1
| | | | Found by: bz
* If a device_add_child fails (i.e. low memory situation), be sure to freenjl2005-03-272-0/+4
| | | | | | | the unused ivars also. Submitted by: pjd Obtained from: Coverity Prevent analysis
OpenPOWER on IntegriCloud