Robert Love [Sun, 10 Feb 2002 04:59:32 +0000 (20:59 -0800)]
[PATCH] preemptible kernel documentation, etc
Linus,
The attached patch adds a Documentation/preempt-locking.txt file which
describes the new locking rules wrt preemptive kernels (ie, watch
per-CPU data, etc). It also updates a CREDITS entry and adds some
comments.
Robert Love [Sun, 10 Feb 2002 04:58:05 +0000 (20:58 -0800)]
[PATCH] yet another lseek fix
Another lseek fix, spotted by Dave Hansen @ IBM. Missing a
corresponding lock_kernel for an unlock_kernel. Patch against
2.5.4-pre5, please apply. Thanks,
James Bottomley [Sat, 9 Feb 2002 16:23:57 +0000 (11:23 -0500)]
Various bugfixes to sync with 2.4 version:
- Fix bug in scripts that was causing CDRW hang
- add sense buffer length initialisation
- update lasi700 to new driver model and fix rmmod hang
- add correct MCA reporting to D700 driver
Alexander Viro [Sat, 9 Feb 2002 14:18:13 +0000 (06:18 -0800)]
[PATCH] affs cleanup
affs digs in blk_size[] to find the size of device (it
has its analog of superblock living in the middle of disk). That
information is available in ->s_bdev->bd_inode->i_size - no need
to mess with major/minor/arrays to get it.
Peter Osterlund [Sat, 9 Feb 2002 12:20:19 +0000 (04:20 -0800)]
[PATCH] Make cardbus device_register work
It compiles in -pre5 but doesn't work unless you also apply the patch
below. Without this patch, bus_id will be empty which makes
device_register fail.
Alexander Viro [Sat, 9 Feb 2002 03:27:14 +0000 (19:27 -0800)]
[PATCH] driverfs - preparation to fixes
Make dentry and ->i_sem manipulations in driverfs explicit. Something
is seriously rotten there and real fixes will take non-trivial work
(e.g, I suspect that we actually ought to kill driverfs_rename() - at
least cross-directory one for regular files, maybe completely). This
patch simply cleans the ground.
Alexander Viro [Sat, 9 Feb 2002 03:20:52 +0000 (19:20 -0800)]
[PATCH] ext2_new_block() cleanup
in ext2_new_block() inode->i_sb can't be NULL. Dead code removed.
merged returns in ext2_new_block()
in ext2_new_block() added a local variable (sbi) for sb->u.ext2_sb;
users converted.
calculation of prealloc_goal moved into beginning of function.
new local variable (block). Initialized to 0, set to the number of
allocated block only when we are known to be successful.
ext2_new_block() returns the value of 'block' now. As the result, out:
is gone - it's identical to out_unlock now.
check for block being chosen past the end of disk had been moved up No
sense to check that after we had done the preallocations...
quota allocation taken into the beginning of ext2_new_block(). we put
the number of blocks we'd reserved into dq_alloc and then decrement it
each time old code would do DQUOT_ALLOC/increment when it would do
DQUOT_FREE. On the exit we release dq_alloc blocks I.e. all
allocations are pushed into the beginning and all freeing - to the end.
now that we had moved the last possible point of failure up, we can do
the same with assignment of final result to block.
code that does allocation within a group had been taken out into a
helper - grab_block(map, size, goal).
decrementing fs-wide free blocks count moved into the beginning of
function. We try to reserve up to dq_alloc blocks - amount we _can_
grab is limited by the actual free space and root-reserved percentage.
That logics had been taken into a helper - reserve_blocks(sb, amount).
Number of blocks we had managed to reserve is put into es_alloc. When
we actually grab a block, es_alloc is decremented. Upon the exit we
release the leftovers. Old code didn't honor 'reserved for root' limit
when doing prealloc - now that had been fixed.
EXT2_BLOCKS_PER_GROUP(sb) put into a local variable (group_size)
similar "reserve and release leftovers in the end" scheme for group
(i.e. we try to reserve as much as we want in the group, then count how
much had been used up and release the leftovers in the end).
Alexander Viro [Sat, 9 Feb 2002 03:17:00 +0000 (19:17 -0800)]
[PATCH] (3/5) ext2_free_blocks() cleanup
new helper - group_release_blocks(desc, bh, count); updates free blocks
count for given group ext2_free_blocks now counts the blocks freed in
group and updates the per-group free blocks count at once.
Alexander Viro [Sat, 9 Feb 2002 03:16:52 +0000 (19:16 -0800)]
[PATCH] (1/5) ext2_free_blocks() cleanup
new helper function - release_blocks(sb, n); in ext2_free_blocks() we
count the blocks we'd freed and update the fs-wide count of free blocks
in the end - just before unlocking superblock. instead of doing that
step at a time.
Robert Love [Sat, 9 Feb 2002 03:11:35 +0000 (19:11 -0800)]
[PATCH] Re: [PATCH] Preemptible Kernel for 2.5
On Sat, 2002-02-09 at 01:43, Linus Torvalds wrote:
> That will clean up all your issues with header file ordering.
You are right, it did. I removed all the sched.h dependencies and this
reduced the size of the patch greatly. I now use current_thread_info()
and none of the header or include hackery from before. I've tested this
with and without preemption enabled with success.
I appreciate your help with this.
Again, this is a minimal i386-only patch. I have other arches,
documentation, etc. Patch against 2.5.4-pre5. Enjoy,
Jeff Garzik [Fri, 8 Feb 2002 23:26:59 +0000 (18:26 -0500)]
Update eepro100 net driver pci id list, at the prompting of
Andrew Morton and Hanno Boeck.
Three constants are substituted with their numeric equivalents,
a reverse of the norm, to make the linear progression of PCI ids
more clear, and easier to validate at a glance.
Dave Jones [Fri, 8 Feb 2002 09:43:32 +0000 (01:43 -0800)]
[PATCH] fix serial close hang
2.4/2.5 kernels suffer from an infinitely long hang when a serial tty device
is closed, and there are characters waiting to be sent. The hang occurs in
tty_wait_until_sent.
There is a timeout 'closing_wait' which defines how long to wait for the TX
buffers to empty; the problem is that the serial layer totally ignores it.
It is stored in two structures, 'info' and 'state'. It is initialised in
the 'state' structure, but used from the 'info' structure.
It turns out that 'hub6' was also missing.
I'm not currently clear what the expected behaviour should be when the
timeout is changed via setserial, and others have the port open - I've
opted to preserve the timeout until all users close the port. It's
trivial to change this behaviour though.
Dave Jones [Fri, 8 Feb 2002 09:43:23 +0000 (01:43 -0800)]
[PATCH] text.lock -> subsection changes.
Make spinlocks etc use subsections of their parent sections instead of
an ELF section of their own - needed for newer binutils when the parent
sector is removed.
Dave Jones [Fri, 8 Feb 2002 09:43:16 +0000 (01:43 -0800)]
[PATCH] handle out of spec SMP athlons.
Newer Athlons have means of checking if they are SMP capable or not.
This code adds checks that printk a warning on systems not intended
for SMP, and set the taint flag that modutils is already aware of.
The taint code is also improved to use defines instead of magic numbers.
Jeff Garzik [Fri, 8 Feb 2002 13:11:31 +0000 (08:11 -0500)]
After Al Viro's recent swapfile cleanup, the swap_device member of
swap_info_struct became pretty much superfluous. As we are minimizing
kdev_t usage anyway, I took the opportunity to remove swap_device
member, and replace the remaining usages with SWP_BLOCKDEV bit flag.
Adding SWP_BLOCKDEV in turn motivated a small cleanup of the
SWP_xxx bit flags and their usage.
Patch has been in light testing for a couple weeks, and
has been glanced at by Al. "looks sane"
Jeff Garzik [Fri, 8 Feb 2002 13:38:05 +0000 (08:38 -0500)]
Update eepro100 net driver link state tracking:
* Initialize interface carrier state in speedo_open.
* Update previous netif_carrier_{on,off} change to use
linux/mii.h constants.
Contributor: Andrew Morton, with modifications from me
Jeff Garzik [Fri, 8 Feb 2002 13:36:39 +0000 (08:36 -0500)]
Fix natsemi net driver rx-related hang, by polling for RX events
on all RX interrupts. Prior to this fix, RX FIFO overrun and RX
buffer overrun interrupts did not trigger an RX poll; now they do.
Jeff Garzik [Fri, 8 Feb 2002 13:35:21 +0000 (08:35 -0500)]
Update tulip net driver to indicate link beat to system,
via netif_carrier_{on,off}. Some placeholders to do this were
already in the code, making this an even easier and more obvious patch.
Also, decrease time until next link beat check, if link beat
is not present. (previously the code would wait 60 seconds until
next check, regardless of current link state)
Jeff Garzik [Fri, 8 Feb 2002 13:32:41 +0000 (08:32 -0500)]
tulip net driver updates:
* Add support for Conexant tulip clones.
* Do not store eeprom data on stack (128 or 512 bytes), it's a
large object, and also, we already have a copy in kmalloc'd RAM.
Jeff Garzik [Fri, 8 Feb 2002 13:27:49 +0000 (08:27 -0500)]
Add config option to enable natsemi net driver hardware bug workaround.
"some" systems with "some" cables see a large amount of errors,
due to a hardware bug. This bug is (apparently) not probe-able;
however it only appears on rare reference boards and the like,
so we simply add a config option and default the option to OFF.
Further detail:
When CONFIG_NATSEMI_CABLE_MAGIC option is enabled, PMDCSR_VAL
register value becomes 0x1898, a value provided by a NatSemi
app note. This enables a workaround for a hardware bug
which is (apparently) not probe-able. Luckily the hardware bug
is (apparently) not common either, so we default to disabling
this workaround.
David Howells [Thu, 7 Feb 2002 06:56:27 +0000 (22:56 -0800)]
[PATCH] thread information block
syscall latency improvement
* There's now an asm/thread_info.h header file with the basic structure
def and asm offsets in it.
* There's now a linux/thread_info.h header file which includes the asm
version and wraps some bitops calls to make convenience functions for
accessing the low-level flags.
* The task_struct has had some fields removed (and some flags), and has
acquired a pointer to the thread_info struct.
* task_struct's are now allocated on slabs in kernel/fork.c, whereas
thread_info structs are allocated at the bottom of the stack pages.
* Some more convenience functions are provided at the end of linux/sched.h to
access flags in other tasks (these are here because they need to access the
task_struct).
typo fix, fixing a compile time bug due to the change over to the new
filesystem definition patches in -pre2 (changes pcihpfs_fs_type to
pcihpfs_type).
Jeff Garzik [Thu, 7 Feb 2002 03:51:29 +0000 (22:51 -0500)]
eepro100 net driver link beat detection improvement.
Control interface running flag correctly, via netif_carrier_{on,off},
rather than manipulating the IFF_RUNNING bit directly from within
the driver (ug).
Contributors: Joerg Mayer, Stefans Rumpf
Jeff Garzik [Thu, 7 Feb 2002 02:45:57 +0000 (21:45 -0500)]
eepro100 net driver fix:
Second half of fix (first half of which added an embarrassingly
long time ago) which works around hardware bug at 10 mbit.
Contributors: Steve Parker, Arjan van de Ven