commit b47711bfbcd4eb77ca61ef0162487b20e023ae55 Merge: 7556afa... 2e08c0c... Author: Linus Torvalds Date: Fri Jan 25 08:44:29 2008 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6: selinux: make mls_compute_sid always polyinstantiate security/selinux: constify function pointer tables and fields security: add a secctx_to_secid() hook security: call security_file_permission from rw_verify_area security: remove security_sb_post_mountroot hook Security: remove security.h include from mm.h Security: remove security_file_mmap hook sparse-warnings (NULL as 0). Security: add get, set, and cloning of superblock security information security/selinux: Add missing "space" commit 7556afa0e0e436cad4f560ee83e5fbd5dac9359a Merge: e07dd2a... d6c49a7... Author: Linus Torvalds Date: Fri Jan 25 08:40:02 2008 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6: [AVR32] extint: Set initial irq type to low level [AVR32] extint: change set_irq_type() handling [AVR32] NMI debugging [AVR32] constify function pointer tables [AVR32] ATNGW100: Update defconfig [AVR32] ATSTK1002: Update defconfig [AVR32] Kconfig: Choose daughterboard instead of CPU [AVR32] Add support for ATSTK1003 and ATSTK1004 [AVR32] Clean up external DAC setup code [AVR32] ATSTK1000: Move gpio-leds setup to setup.c [AVR32] Add support for AT32AP7001 and AT32AP7002 [AVR32] Provide more CPU information in /proc/cpuinfo and dmesg [AVR32] Oprofile support [AVR32] Include instrumentation menu Disable VGA text console for AVR32 architecture [AVR32] Enable debugging only when needed ptrace: Call arch_ptrace_attach() when request=PTRACE_TRACEME [AVR32] Remove redundant try_to_freeze() call from do_signal() [AVR32] Drop GFP_COMP for DMA memory allocations commit e07dd2ad305f6b29b47d713600aa8b722ef2a9f7 Merge: eba0e31... 7bc5c41... Author: Linus Torvalds Date: Fri Jan 25 08:39:18 2008 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (56 commits) [GFS2] Allow journal recovery on read-only mount [GFS2] Lockup on error [GFS2] Fix page_mkwrite truncation race path [GFS2] Fix typo [GFS2] Fix write alloc required shortcut calculation [GFS2] gfs2_alloc_required performance [GFS2] Remove unneeded i_spin [GFS2] Reduce inode size by moving i_alloc out of line [GFS2] Fix assert in log code [GFS2] Fix problems relating to execution of files on GFS2 [GFS2] Initialize extent_list earlier [GFS2] Allow page migration for writeback and ordered pages [GFS2] Remove unused variable [GFS2] Fix log block mapper [GFS2] Minor correction [GFS2] Eliminate the no longer needed sd_statfs_mutex [GFS2] Incremental patch to fix compiler warning [GFS2] Function meta_read optimization [GFS2] Only fetch the dinode once in block_map [GFS2] Reorganize function gfs2_glmutex_lock ... commit eba0e319c12fb098d66316a8eafbaaa9174a07c3 Merge: df8dc74... 15e7b44... Author: Linus Torvalds Date: Fri Jan 25 08:38:25 2008 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (125 commits) [CRYPTO] twofish: Merge common glue code [CRYPTO] hifn_795x: Fixup container_of() usage [CRYPTO] cast6: inline bloat-- [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long [CRYPTO] tcrypt: Make xcbc available as a standalone test [CRYPTO] xcbc: Remove bogus hash/cipher test [CRYPTO] xcbc: Fix algorithm leak when block size check fails [CRYPTO] tcrypt: Zero axbuf in the right function [CRYPTO] padlock: Only reset the key once for each CBC and ECB operation [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h [CRYPTO] salsa20-asm: Remove unnecessary dependency on CRYPTO_SALSA20 [CRYPTO] tcrypt: Add select of AEAD [CRYPTO] salsa20: Add x86-64 assembly version [CRYPTO] salsa20_i586: Salsa20 stream cipher algorithm (i586 version) [CRYPTO] gcm: Introduce rfc4106 [CRYPTO] api: Show async type [CRYPTO] chainiv: Avoid lock spinning where possible [CRYPTO] seqiv: Add select AEAD in Kconfig [CRYPTO] scatterwalk: Handle zero nbytes in scatterwalk_map_and_copy [CRYPTO] null: Allow setkey on digest_null ... commit df8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e Merge: 556a169... 4a3ad20... Author: Linus Torvalds Date: Fri Jan 25 08:34:42 2008 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ... commit 556a169dab38b5100df6f4a45b655dddd3db94c1 Author: Pekka Enberg Date: Fri Jan 25 08:20:51 2008 +0200 slab: fix bootstrap on memoryless node If the node we're booting on doesn't have memory, bootstrapping kmalloc() caches resorts to fallback_alloc() which requires ->nodelists set for all nodes. Fix that by calling set_up_list3s() for CACHE_CACHE in kmem_cache_init(). As kmem_getpages() is called with GFP_THISNODE set, this used to work before because of breakage in 2.6.22 and before with GFP_THISNODE returning pages from the wrong node if a node had no memory. So it may have worked accidentally and in an unsafe manner because the pages would have been associated with the wrong node which could trigger bug ons and locking troubles. Tested-by: Mel Gorman Tested-by: Olaf Hering Reviewed-by: Christoph Lameter Signed-off-by: Pekka Enberg [ With additional one-liner by Olaf Hering - Linus ] Signed-off-by: Linus Torvalds commit eb36f4fc019835cecf0788907f6cab774508087b Author: Karsten Keil Date: Fri Jan 25 11:55:28 2008 +0100 fix oops on rmmod capidrv Fix overwriting the stack with the version string (it is currently 10 bytes + zero) when unloading the capidrv module. Safeguard against overwriting it should the version string grow in the future. Should fix Kernel Bug Tracker Bug 9696. Signed-off-by: Gerd v. Egidy Acked-by: Karsten Keil Signed-off-by: Linus Torvalds commit 7bc5c414fe6627ec518c82d154c796f0981f5b02 Author: Abhijith Das Date: Fri Jan 18 14:06:37 2008 -0600 [GFS2] Allow journal recovery on read-only mount This patch allows gfs2 to perform journal recovery even if it is mounted read-only. Strictly speaking, a read-only mount should not be writing to the filesystem, but we do this only to perform journal recovery. A read-only mount will fail if we don't recover the dirty journal. Also, when gfs2 is used as a root filesystem, it will be mounted read-only before being mounted read-write during the boot sequence. A failed read-only mount will panic the machine during bootup. Signed-off-by: Abhijith Das Signed-off-by: Steven Whitehouse commit 1b8177ec1e779bcc3ed89419ff7c80dbc3dcc489 Author: Bob Peterson Date: Sat Jan 19 21:50:24 2008 -0600 [GFS2] Lockup on error I spotted this bug while I was digging around. Looks like it could cause a lockup in some rare error condition. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit b7fe2e391ee7b711d6dfd6a694d60c4f21113cbb Author: Steven Whitehouse Date: Thu Jan 17 15:12:03 2008 +0000 [GFS2] Fix page_mkwrite truncation race path There was a bug in the truncation/invalidation race path for ->page_mkwrite for gfs2. It ought to return 0 so that the effect is the same as if the page was truncated at any of the other points at which the page_lock is dropped. This will result in the restart of the whole page fault path. If it was due to a real truncation (as opposed to an invalidate because we let a glock go) then the ->fault path will pick that up when it gets called again. Signed-off-by: Steven Whitehouse commit 3e5cd0877e6d2f059dc36b8206cb7e93938151db Author: Bob Peterson Date: Wed Jan 16 08:45:39 2008 -0600 [GFS2] Fix typo This patch fixes a minor typo. Surprisingly, it still compiled. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 1af535727bbf68e1da7ac232de47315da4c66ade Author: Steven Whitehouse Date: Wed Jan 16 14:24:05 2008 +0000 [GFS2] Fix write alloc required shortcut calculation The comparison was being made against the wrong quantity. Signed-off-by: Steven Whitehouse commit 05220535196d413db434527a3edcba79b7187df8 Author: Bob Peterson Date: Fri Jan 11 13:44:50 2008 -0600 [GFS2] gfs2_alloc_required performance This is a small I/O performance enhancement to gfs2. (Actually, it is a rework of an earlier version I got wrong). The idea here is to check if the write extends past the last block in the file. If so, the function can save itself a lot of time and trouble because it knows an allocate will be required. Benchmarks like iozone should see better performance. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 598278bd4808ed81b0e6fa445458a7d549f72a32 Author: Bob Peterson Date: Fri Jan 11 13:31:12 2008 -0600 [GFS2] Remove unneeded i_spin This patch removes a vestigial variable "i_spin" from the gfs2_inode structure. This not only saves us memory (>300000 of these in memory for the oom test) it also saves us time because we don't have to spend time initializing it (i.e. slightly better performance). Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 6dbd822487d0a9f14432cb4680415b80656b63a2 Author: Steven Whitehouse Date: Thu Jan 10 15:18:55 2008 +0000 [GFS2] Reduce inode size by moving i_alloc out of line It is possible to reduce the size of GFS2 inodes by taking the i_alloc structure out of the gfs2_inode. This patch allocates the i_alloc structure whenever its needed, and frees it afterward. This decreases the amount of low memory we use at the expense of requiring a memory allocation for each page or partial page that we write. A quick test with postmark shows that the overhead is not measurable and I also note that OCFS2 use the same approach. In the future I'd like to solve the problem by shrinking down the size of the members of the i_alloc structure, but for now, this reduces the immediate problem of using too much low-memory on x86 and doesn't add too much overhead. Signed-off-by: Steven Whitehouse commit ac39aadd0440ae696e6dacaa8006ce1737b17008 Author: Steven Whitehouse Date: Thu Jan 10 14:49:43 2008 +0000 [GFS2] Fix assert in log code Although the values were all being calculated correctly, there was a race in the assert due to the way it was using atomic variables. This changes the value we assert on so that we get the same effect by testing a different variable. This prevents the assert triggering when it shouldn't. Signed-off-by: Steven Whitehouse commit 9656b2c14c6ee0806c90a6be41dec71117fc8f50 Author: Steven Whitehouse Date: Tue Jan 8 08:14:30 2008 +0000 [GFS2] Fix problems relating to execution of files on GFS2 This patch fixes a couple of problems which affected the execution of files on GFS2. The first is that there was a corner case where inodes were not always uptodate at the point at which permissions checks were being carried out, this was resulting in refusal of execute permission, but only on the first lookup, subsequent requests worked correctly. The second was a problem relating to incorrect updating of file sizes which was introduced with the write_begin/end code for GFS2 a little while back. Signed-off-by: Steven Whitehouse Cc: Abhijith Das commit 0811a127cb83ad2e0355e5e3e30164d7ef0f2d65 Author: Bob Peterson Date: Thu Jan 3 09:24:53 2008 -0600 [GFS2] Initialize extent_list earlier Here is a patch for the latest upstream GFS2 code: The journal extent map needs to be initialized sooner than it currently is. Otherwise failed mount attempts (e.g. not enough journals, etc.) may panic trying to access the uninitialized list. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit e5d9dc278c7f79c220e4506cc1ade2efa2ca73fd Author: Steven Whitehouse Date: Thu Jan 3 11:31:38 2008 +0000 [GFS2] Allow page migration for writeback and ordered pages To improve performance on NUMA, we use the VM's standard page migration for writeback and ordered pages. Probably we could also do the same for journaled data, but that would need a careful audit of the code, so will be the subject of a later patch. Signed-off-by: Steven Whitehouse commit 65a6290998f3d38b5c5e84423ae9e08bdd957095 Author: Steven Whitehouse Date: Wed Jan 2 10:16:56 2008 +0000 [GFS2] Remove unused variable The go_drop_th function is never called or referenced. Signed-off-by: Steven Whitehouse commit ff91cc9bb41b62bc4ea7d5ced396fabf97539df9 Author: Steven Whitehouse Date: Fri Dec 14 14:04:34 2007 +0000 [GFS2] Fix log block mapper A missing offset in the calculation. Signed-off-by: Steven Whitehouse commit fa3742fa8545df20e54aa0953a1873cca3a9bd92 Author: Bob Peterson Date: Wed Dec 12 17:52:13 2007 -0600 [GFS2] Minor correction This is a small correction to my previously posted patch1. It just changes a divide to a shift. It's faster and doesn't introduce odd dependencies on 32-bit compiles. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit c3f60b6e3a7667f78a63b15cf09655ecfca757fc Author: Bob Peterson Date: Wed Dec 12 11:44:41 2007 -0600 [GFS2] Eliminate the no longer needed sd_statfs_mutex This patch eliminates the unneeded sd_statfs_mutex mutex but preserves the ordering as discussed. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit b3513fca7e41965d85125c9770ce5f8fd4ff509a Author: Bob Peterson Date: Wed Dec 12 09:24:08 2007 -0600 [GFS2] Incremental patch to fix compiler warning Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 15c7cee7995a9013f1b2f31a15b70e1d2e8ae501 Author: Bob Peterson Date: Tue Dec 11 19:29:17 2007 -0600 [GFS2] Function meta_read optimization This patch optimizes function gfs2_meta_read. Basically, gfs2_meta_wait was being called regardless of whether a disk read was requested. This just pulls that wait into the if that triggers the read. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit b0d5fd307463405fe1f57494fbb37f810715ed6d Author: Bob Peterson Date: Tue Dec 11 19:16:09 2007 -0600 [GFS2] Only fetch the dinode once in block_map Function gfs2_block_map was often looking up the disk inode twice. This optimizes it so that only does it once. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 398bbe68321947f6763fbc259a01eb548ce19408 Author: Bob Peterson Date: Tue Dec 11 19:13:54 2007 -0600 [GFS2] Reorganize function gfs2_glmutex_lock This patch optimizes the function gfs2_glmutex_lock. The basic theory is: Why bother initializing a holder, setting up wait bits and then waiting on them, if you know the glock can be yours. So the holder stuff is placed inside the if checking if the glock is locked. This one needs careful scrutiny because changing anything to do with locking should strike terror into one's heart. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 5fdc2eeb5d1d3800367f471690b01fcd1fd5b963 Author: Bob Peterson Date: Tue Dec 11 19:00:16 2007 -0600 [GFS2] Run through full bitmaps quicker in gfs2_bitfit I eliminated the passing of an unused parameter into gfs2_bitfit called rgd. This also changes the gfs2_bitfit code that searches for free (or used) blocks. Before, the code was trying to check for bytes that indicated 4 blocks in the undesired state. The problem is, it was spending more time trying to do this than it actually was saving. This version only optimizes the case where we're looking for free blocks, and it checks a machine word at a time. So on 32-bit machines, it will check 32-bits (16 blocks) and on 64-bit machines, it will check 64-bits (32 blocks) at a time. The compiler optimizes that quite well and we save some time, especially when running through full bitmaps (like the bitmaps allocated for the journals). There's probably a more elegant or optimized way to do this, but I haven't thought of it yet. I'm open to suggestions. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 0d0868bde33273a200b33e54f4fad6099ad0c566 Author: Bob Peterson Date: Tue Dec 11 18:51:25 2007 -0600 [GFS2] Get rid of useless "found" variable in quota.c This just eliminates an unused variable from the quota code. Not likely to be a time saver. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit da6dd40d59fa9617ed697b90114e197036901632 Author: Bob Peterson Date: Tue Dec 11 18:49:21 2007 -0600 [GFS2] Journal extent mapping This patch saves a little time when gfs2 writes to the journals by keeping a mapping between logical and physical blocks on disk. That's better than constantly looking up indirect pointers in buffers, when the journals are several levels of indirection (which they typically are). Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit e9e1ef2b6ee401d7c1e1eb38052857b4b206d172 Author: Bob Peterson Date: Mon Dec 10 14:13:27 2007 -0600 [GFS2] Remove function gfs2_get_block This patch is just a cleanup. Function gfs2_get_block() just calls function gfs2_block_map reversing the last two parameters. By reversing the parameters, gfs2_block_map() may be called directly and function gfs2_get_block may be eliminated altogether. Since this function is done for every block operation, this streamlines the code and makes it a little bit more efficient. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit 2066b58b0a038d7aedd24133677efb8856cac3a1 Author: David Teigland Date: Thu Dec 6 09:35:25 2007 -0600 [GFS2] use pid for plock owner for nfs clients The fl_owner is that of lockd when posix locks arrive from nfs clients, so it can't be used to distinguish between lock holders. Use fl_pid as owner instead; it's the pid of the process on the nfs client. Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse commit dbee2199c37336e89060fbe9abdfd1ca8454372a Author: Steven Whitehouse Date: Fri Nov 30 08:17:15 2007 +0000 [GFS2] Remove unused variable Signed-off-by: Steven Whitehouse commit 292c8c14cace19c94c6abe25506310239daf949e Author: Abhijith Das Date: Thu Nov 29 14:13:54 2007 -0600 [GFS2] patch to check for recursive lock requests in gfs2_rename code path A certain scenario in the rename code path triggers a kernel BUG() because it accidentally does recursive locking The first lock is requested to unlink an already existing inode (replacing a file) and the second lock is requested when the destination directory needs to alloc some space. It is rare that these two events happen during the same rename call, and even more rare that these two instances try to lock the same rgrp. It is, however, possible. https://bugzilla.redhat.com/show_bug.cgi?id=404711 Signed-off-by: Abhijith Das Signed-off-by: Steven Whitehouse commit c97bfe4351771675963e02f34d31e206fd2d7150 Author: Wendy Cheng Date: Thu Nov 29 17:56:51 2007 -0500 [GFS2] Remove lock methods for lock_nolock protocol GFS2 supports two modes of locking - lock_nolock for single node filesystem and lock_dlm for cluster mode locking. The gfs2 lock methods are removed from file operation table for lock_nolock protocol. This would allow VFS to handle posix lock and flock logics just like other in-tree filesystems without duplication. Signed-off-by: S. Wendy Cheng Signed-off-by: Steven Whitehouse commit bcd405599faa16cf32a3d3f1ce6a1e12cb37fede Author: Fabio M. Di Nitto Date: Wed Nov 28 16:22:09 2007 +0100 [GFS2] Remove unrequired code Signed-off-by: Fabio M. Di Nitto Signed-off-by: Steven Whitehouse commit 6a69a23f7df18f39e4a084e10b62ff4a144b05a5 Author: Fabio Massimo Di Nitto Date: Tue Nov 27 06:16:42 2007 +0100 [GFS2] Fix build warnings Hi Steven, Steven Whitehouse wrote: > Hi, > > Now in the -nmw git tree. Thanks, > > Steve. > > On Wed, 2007-11-21 at 11:54 -0600, Ryan O'Hara wrote: this patch introduces a bunch of build warnings by leaving around struct inode *inode = &ip->i_inode; The patch in attachment cleans them up. Please apply. Signed-off-by: Fabio Massimo Di Nitto Signed-off-by: Steven Whitehouse commit 002ef1dc63ded14507c110d3cf83d0c3f51374ab Author: Ryan O'Hara Date: Wed Nov 21 11:54:54 2007 -0600 [GFS2] remove unnecessary permission checks Remove read/write permission() checks from xattr operations. VFS layer is already handling permission for xattrs via the xattr_permission() call, so there is no need for gfs2 to check permissions. Futhermore, using permission() for SELinux xattrs ops is incorrect. Signed-off-by: Ryan O'Hara Signed-off-by: Steven Whitehouse commit 1a2781cfa5ed8eb82bb311d684f268c1822dae69 Author: Fabio Massimo Di Nitto Date: Fri Nov 16 09:50:40 2007 +0000 [GFS2] Fix runtime issue with UP kernels The issue is indeed UP vs SMP and it is totally random. spin_is_locked() is a bad assertion because there is no correct answer on UP. on UP spin_is_locked() has to return either one value or another, always. This means that in my setup I am lucky enough to trigger the issue and your you are lucky enough not to. the patch in attachment removes the bogus calls to BUG_ON and according to David (in CC and thanks for the long explanation on the problem) we can rely upon things like lockdep to find problem that might be trying to catch. Signed-off-by: Fabio M. Di Nitto Cc: David S. Miller Signed-off-by: Steven Whitehouse commit 00c134756c5ad570a1ad3d6f93a67fc9c25a67ea Author: David Teigland Date: Thu Nov 15 09:01:13 2007 -0600 [GFS2] tidy up error message Print error with log_error() to be consistent with others. Signed-off-by: David Teigland Signed-off-by: Fabio M. Di Nitto Signed-off-by: Steven Whitehouse commit 0b7580c786a5feda6291fe68ead3a1b92b6b35b8 Author: Fabio Massimo Di Nitto Date: Thu Nov 15 13:48:52 2007 +0000 [GFS2] Check for installation of mount helpers for DLM mounts The patch is a fix to abort mount if the mount.gfs* and possible umount.* are missing from /sbin. While we do what we can to guarantee that they are installed properly in userland (CVS HEAD), we want to make sure that mount still aborts properly. The only sign of missing helpers is that lock_dlm will receive no mount options at all. According to David the problem does not exist for lock_nolock as the helpers are not required. The patch has been tested for both gfs and gfs2 and it works as expected. The lack of mount.gfs* will generate an error that is propagated to mount: oot@node1:~# mount -t gfs2 /dev/nbd2 /mnt/ mount: wrong fs type, bad option, bad superblock on /dev/nbd2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so [ 3513.303346] GFS2: fsid=: Trying to join cluster "lock_dlm", "gutsy:gfs2" [ 3513.304546] DLM/GFS2/GFS ERROR: (u)mount helpers are not installed properly! [ 3513.306290] GFS2: fsid=: can't mount proto=lock_dlm, table=gutsy:gfs2, hostdata= You might want to notice that it will also avoid mount to hang or fail silently or with strange errors that will require the cluster to reboot/restart before you can actually mount the filesystem again. Signed-off-by: Fabio M. Di Nitto Signed-off-by: Steven Whitehouse commit e35b921185728850c5db3b5d5b356178f931a157 Author: Steven Whitehouse Date: Fri Nov 9 10:07:21 2007 +0000 [GFS2] Don't periodically update the jindex We only care about the content of the jindex in two cases, one is when we mount the fs and the other is when we need to recover another journal. In both cases we have to update the jindex anyway, so there is no point in updating it periodically between times, so this removes it to simplify gfs2_logd. Signed-off-by: Steven Whitehouse commit ec69b188837a347769e187997d040e84a683b38a Author: Steven Whitehouse Date: Fri Nov 9 10:01:41 2007 +0000 [GFS2] Move gfs2_logd into log.c This means that we can mark gfs2_ail1_empty static and prepares the way for further changes. Signed-off-by: Steven Whitehouse commit fd041f0b4045db8646b36d393cbb274db60649f5 Author: Steven Whitehouse Date: Thu Nov 8 14:55:03 2007 +0000 [GFS2] Use atomic_t for journal free blocks counter This patch changes the counter which keeps track of the free blocks in the journal to an atomic_t in preparation for the following patch which will update the log reservation code. Signed-off-by: Steven Whitehouse commit 2bcd610d2fdea608a8fdac32788fc35a32a2327c Author: Steven Whitehouse Date: Thu Nov 8 14:25:12 2007 +0000 [GFS2] Don't add glocks to the journal The only reason for adding glocks to the journal was to keep track of which locks required a log flush prior to release. We add a flag to the glock to allow this check to be made in a simpler way. This reduces the size of a glock (by 12 bytes on i386, 24 on x86_64) and means that we can avoid extra work during the journal flush. Signed-off-by: Steven Whitehouse commit 8cbc4342478311c2a85260a7ca54d96cb7f71f7b Author: David Teigland Date: Wed Nov 7 09:03:56 2007 -0600 [GFS2] check kthread_should_stop when waiting Use wait_event_interruptible() in the lock_dlm thread instead of an open coded equivalent, and include a kthread_should_stop() check in the wait test so we don't miss a kthread_stop(). Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse commit c7227e46423a57b4df27a2d75b5869bd3ae654d0 Author: Bob Peterson Date: Fri Nov 2 09:37:15 2007 -0500 [GFS2] Given device ID rather than s_id in "id" sysfs file This patch changes the /sys/fs/gfs2//id file to give the device id "major:minor" rather than the s_id. That enables gfs2_tool to match devices properly (by id, not name) when locating the tuning files. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse commit e589665eb97b297412fb16b4c1737a01a91db903 Author: Steven Whitehouse Date: Fri Nov 2 09:14:31 2007 +0000 [GFS2] Remove flags no longer required The HIF_MUTEX and HIF_PROMOTE flags were set on the glock holders depending upon which of the two waiters lists they were going to be queued upon. They were then tested when the holders were taken off the lists to ensure that the right type of holder was being dequeued. Since we are already using separate lists, there doesn't seem a lot of point having these flags as well, and since setting them and testing them is in the fast path for locking and unlocking glock, this patch removes them. Signed-off-by: Steven Whitehouse commit 3042a2ccd68d2b609d283219e51cba363aa35c1d Author: Steven Whitehouse Date: Fri Nov 2 08:39:34 2007 +0000 [GFS2] Reorder writeback for glock sync Previously we were doing (write data, wait for data, write metadata, wait for metadata). After this patch we so (write metadata, write data, wait for data, wait for metadata) which should be more efficient. Also I noticed that the drop_bh and xmote_bh functions were almost identical. In fact the only difference was a single test, and that test is such that in the drop_bh case, it would always evaluate to the correct result. As such we can use the xmote_bh functions in all the places where we were using the drop_bh function and remove the drop_bh functions. Signed-off-by: Steven Whitehouse commit 52d4c74b08bf859f698ddb4e8a43c0dc8d4a0685 Author: Steven Whitehouse Date: Thu Nov 1 09:34:14 2007 +0000 [GFS2] Add sync_page to metadata address space operations This set of address space operations was missing a sync_page operation. Signed-off-by: Steven Whitehouse commit c2932e03dbcfe7ea9052953dbd5f3157183c1e9b Author: Steven Whitehouse Date: Thu Nov 1 09:26:54 2007 +0000 [GFS2] Remove "reclaim limit" This call to reclaim glocks is not needed, and in particular we don't want it in the fast path for locking glocks. The limit was entirely arbitrary anyway and we can't expect users to adjust things like this, the remaining code will do the right thing on its own. Signed-off-by: Steven Whitehouse commit 60b0d0877986b8fa70148f06055422d2ed858e88 Author: Steven Whitehouse Date: Wed Oct 31 14:24:33 2007 +0000 [GFS2] Remove unused variables These haven't been used for some time, remove them. Signed-off-by: Steven Whitehouse commit 47e83b509127f5e83ae5d93afd5c7cb9241acc38 Author: Steven Whitehouse Date: Thu Oct 18 11:15:50 2007 +0100 [GFS2] Use correct include file in ops_address.c Something changed in the upstream kernel, and it needs this one-liner to allow ops_address.c to build. Signed-off-by: Steven Whitehouse commit c41d4f09f13671f98ba4b82fdc94420cdc09be08 Author: Steven Whitehouse Date: Wed Oct 17 14:05:41 2007 +0100 [GFS2] Don't hold page lock when starting transaction This is an addendum to the new AOPs work which moves the point at which we take the page lock so that we don't get it until the last possible moment. This resolves a conflict between starting transactions and the page lock. Signed-off-by: Steven Whitehouse commit b8e7cbb65bcc99630e123422c6829ce3c0fcdf14 Author: Steven Whitehouse Date: Wed Oct 17 09:04:24 2007 +0100 [GFS2] Add writepages for GFS2 jdata This patch resolves a lock ordering issue where we had been getting a transaction lock in the wrong order with respect to the page lock. By using writepages rather than just writepage, it is then possible to start a transaction before locking the page, and thus matching the locking order elsewhere in the code. Signed-off-by: Steven Whitehouse commit 9ff8ec32e58875022447af619bec6e5aee7c77e4 Author: Steven Whitehouse Date: Fri Sep 28 13:49:05 2007 +0100 [GFS2] Split gfs2_writepage into three cases This patch splits gfs2_writepage into separate functions for each of the three cases: writeback, ordered and journalled. As a result it becomes a lot easier to see what each one is doing. The common code is moved into gfs2_writepage_common. This fixes a performance bug where we were doing more work than strictly required in the ordered write case. Signed-off-by: Steven Whitehouse commit 5561093e2cac9f7d2a77e39cc689b8d2b7f9b2bc Author: Steven Whitehouse Date: Wed Oct 17 08:47:38 2007 +0100 [GFS2] Introduce gfs2_set_aops() Just like ext3 we now have three sets of address space operations to cover the cases of writeback, ordered and journalled data writes. This means that the individual operations can now become less complicated as we are able to remove some of the tests for file data mode from the code. Signed-off-by: Steven Whitehouse commit bf36a713169432643d4fc7eeb4e0ace96d791d26 Author: Steven Whitehouse Date: Wed Oct 17 08:35:19 2007 +0100 [GFS2] Add gfs2_is_writeback() This adds a function "gfs2_is_writeback()" along the lines of the existing "gfs2_is_jdata()" in order to clean up the code and make the various tests for the inode mode more obvious. It also fixes the PageChecked() logic where we were resetting the flag too early in the case of an error path. Signed-off-by: Steven Whitehouse commit e7e36f143565d14950055c893cfaf4400ad64d34 Author: Steven Whitehouse Date: Tue Oct 16 11:47:04 2007 +0100 [GFS2] Remove unused field in struct gfs2_inode Removes a field that is not used. Signed-off-by: Steven Whitehouse commit f91a0d3e24e4b0198be5fae20d45a35c40d1efce Author: Steven Whitehouse Date: Mon Oct 15 16:29:05 2007 +0100 [GFS2] Remove useless i_cache from inodes The i_cache was designed to keep references to the indirect blocks used during block mapping so that they didn't have to be looked up continually. The idea failed because there are too many places where the i_cache needs to be freed, and this has in the past been the cause of many bugs. In addition there was no performance benefit being gained since the disk blocks in question were cached anyway. So this patch removes it in order to simplify the code to prepare for other changes which would otherwise have had to add further support for this feature. Signed-off-by: Steven Whitehouse commit 3cc3f710ce0effe397b830826a1a081fa81f11c7 Author: Steven Whitehouse Date: Mon Oct 15 15:40:33 2007 +0100 [GFS2] Use ->page_mkwrite() for mmap() This cleans up the mmap() code path for GFS2 by implementing the page_mkwrite function for GFS2. We are thus able to use the generic filemap_fault function for our ->fault() implementation. This now means that shared writable mappings will be much more efficiently shared across the cluster if there is a reasonable proportion of read activity (the greater proportion, the better). As a side effect, it also reduces the size of the code, removes special cases from readpage and readpages, and makes the code path easier to follow. Signed-off-by: Steven Whitehouse commit 51ff87bdd9f21a5d3672517b75d25ab5842d94a8 Author: Steven Whitehouse Date: Mon Oct 15 14:42:35 2007 +0100 [GFS2] Clean up internal read function As requested by Christoph, this patch cleans up GFS2's internal read function so that it no longer uses the do_generic_mapping_read function. This function is obsolete and GFS2 is the last user of it. As a side effect the internal read code gets smaller and easier to read and gfs2_readpage is split into two. One function has the locking and the other function has the rest of the logic. Signed-off-by: Steven Whitehouse Cc: Christoph Hellwig commit cc7e79b168a552152299bd8a8254dc099aacc993 Author: Wendy Cheng Date: Fri Oct 5 00:27:58 2007 -0400 [GFS2] Handle multiple glock demote requests Fix a race condition where multiple glock demote requests are sent to a node back-to-back. This patch does a check inside handle_callback() to see whether a demote request is in progress. If true, it sets a flag to make sure run_queue() will loop again to handle the new request, instead of erronously setting gl_demote_state to a different state. Signed-off-by: S. Wendy Cheng Signed-off-by: Steven Whitehouse commit d6c49a7a78fc841418bbd58bda504076f80ec51d Author: Haavard Skinnemoen Date: Thu Jan 24 16:56:53 2008 +0100 [AVR32] extint: Set initial irq type to low level David Brownell pointed out a mismatch in the avr32 extint code: > I noticed a small glitch that's not fixed by this patch: the > initial type is falling edge, but IRQ_TYPE_NONE is mapped to > IRQ_TYPE_LEVEL_LOW. Potentially surprising. Fix it by setting the initial type (and handler) to low level, matching the meaning of IRQ_TYPE_NONE. Signed-off-by: Haavard Skinnemoen commit e4f586f280bbfa05c68f99df2db981356ee30533 Author: David Brownell Date: Tue Dec 18 20:50:28 2007 -0800 [AVR32] extint: change set_irq_type() handling Update the AVR32 EIC code to use the new __set_irq_handler_unlocked() call, getting rid of one more instance of this widespread problem. Signed-off-by: David Brownell Signed-off-by: Haavard Skinnemoen commit e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9 Author: Haavard Skinnemoen Date: Wed Oct 10 14:58:29 2007 +0200 [AVR32] NMI debugging Change the NMI handler to use the die notifier chain to signal anyone who cares. Add a simple "nmi debugger" which hooks into this chain and that may dump registers, task state, etc. when it happens. Signed-off-by: Haavard Skinnemoen commit f6135d12db4bed3b992052020f1c50d749cd8dc6 Author: Jan Engelhardt Date: Tue Jan 22 20:41:37 2008 +0100 [AVR32] constify function pointer tables Signed-off-by: Jan Engelhardt Signed-off-by: Haavard Skinnemoen commit 00625723428c23748668ca225e199a2c674c63f7 Author: Haavard Skinnemoen Date: Wed Jan 9 23:21:15 2008 +0100 [AVR32] ATNGW100: Update defconfig Signed-off-by: Haavard Skinnemoen commit f141035decdf8e3ce498991deee3984cb47426bf Author: Haavard Skinnemoen Date: Wed Jan 9 22:45:05 2008 +0100 [AVR32] ATSTK1002: Update defconfig Turn off a few useless options, enable a few useful ones and enable quite a few new drivers. Signed-off-by: Haavard Skinnemoen commit e8897bfef2b056a527df21b25b602c59dbbad67a Author: Haavard Skinnemoen Date: Thu Nov 29 11:15:15 2007 +0100 [AVR32] Kconfig: Choose daughterboard instead of CPU Remove the CPU selection menu and instead let it be selected by the board or daughterboard option. Add daughterboard selection for ATSTK1000 (this was previously determined based on CPU type.) Signed-off-by: Haavard Skinnemoen commit 78693e47a285dbfafabc85a42797660e4fe2967b Author: Haavard Skinnemoen Date: Mon Oct 29 17:03:26 2007 +0100 [AVR32] Add support for ATSTK1003 and ATSTK1004 ATSTK1003 and ATSTK1004 are CPU daughterboards for ATSTK1000 featuring the AT32AP7001 and AT32AP7002 CPUs, respectively. Signed-off-by: Haavard Skinnemoen commit 64d81052671bc2e66efd46251883f5e8e3043db9 Author: Haavard Skinnemoen Date: Mon Oct 29 16:24:09 2007 +0100 [AVR32] Clean up external DAC setup code Reduce the ridiculous amount of #ifdef clutter in atstk1002.c a bit by moving all the extdac stuff into its own function and providing an empty stub for the case when it isn't wanted. Signed-off-by: Haavard Skinnemoen commit f4c41b2689eec03bd4f8145a08903862673e002b Author: Haavard Skinnemoen Date: Mon Oct 29 16:02:51 2007 +0100 [AVR32] ATSTK1000: Move gpio-leds setup to setup.c There may be other boards than STK1002 that want to use the leds on STK1000. Move it to stk1000 common code to make it easier to reuse. Signed-off-by: Haavard Skinnemoen commit 438ff3f3cc33833206a48492e9d6674e4e82bed8 Author: Haavard Skinnemoen Date: Mon Oct 29 15:28:07 2007 +0100 [AVR32] Add support for AT32AP7001 and AT32AP7002 These are derivatives of the AT32AP7000 chip, which means that most of the code stays the same. Rename a few files, functions, definitions and config symbols to reflect that they apply to all AP700x chips, and exclude some platform devices from chips where they aren't present. Signed-off-by: Haavard Skinnemoen commit 281ef58ccf62eaa6c4e4b7e4c0a3ee6b52e84e5b Author: Haavard Skinnemoen Date: Fri Dec 7 10:21:02 2007 +0100 [AVR32] Provide more CPU information in /proc/cpuinfo and dmesg Add the following fields to /proc/cpuinfo: * chip type and revision (from the JTAG chip id) * cpu MHz (from clk_get_rate()) * features (from the CONFIG0 register) Also rename "cpu family" to "cpu arch" and "cpu type" to "cpu core" to remove some ambiguity. Show chip type and revision at bootup, and clarify that the other kinds of IDs that we're already printing are for the cpu core and architecture. Rename "AP7000" to "AP7" since that's the name of the core. Signed-off-by: Haavard Skinnemoen commit 2853ce5ecefe9d9ca119f33db0c23a3f075e35d9 Author: Haavard Skinnemoen Date: Wed Jan 4 17:26:23 2006 +0100 [AVR32] Oprofile support This adds the necessary architecture code to run oprofile on AVR32 using the performance counters documented by the AVR32 Architecture Manual. Signed-off-by: Haavard Skinnemoen Acked-by: Philippe Elie commit a7f5bf9b95ace39cd8b61e8c9ca1035966779ed1 Author: Haavard Skinnemoen Date: Wed Oct 31 15:22:34 2007 +0100 [AVR32] Include instrumentation menu Remove KPROBES option from Kconfig.debug and include kernel/Kconfig.instrumentation. Signed-off-by: Haavard Skinnemoen commit 9e4e980b027c892b02a73d6ea0d01c197b818a32 Author: Hans-Christian Egtvedt Date: Mon Dec 3 10:43:28 2007 +0100 Disable VGA text console for AVR32 architecture This patch disables the VGA text console for AVR32 architecture since it does not provide the vga.h include file. AVR32 users should use framebuffer console instead if they need a console on an attached display. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen commit 13b54a50525a9685065684e1e11258d27dd27bdf Author: Haavard Skinnemoen Date: Tue Nov 27 13:50:45 2007 +0100 [AVR32] Enable debugging only when needed Keep track of processes being debugged (including the kernel itself) and turn the OCD system on and off as appropriate. Since enabling debugging turns off some optimizations in the CPU core, this fixes the issue that enabling KProbes support or simply running a program under gdbserver will reduce system performance significantly until the next reboot. The CPU performance will still be reduced for all processes while a process is being debugged, but this is a lot better than reducing the performance forever. Signed-off-by: Haavard Skinnemoen commit 6ea6dd93c9454cc9521134f907bc970d09f460e4 Author: Haavard Skinnemoen Date: Tue Nov 27 13:02:40 2007 +0100 ptrace: Call arch_ptrace_attach() when request=PTRACE_TRACEME arch_ptrace_attach() is a hook that allows the architecture to do book-keeping after a ptrace attach. This patch adds a call to this hook when handling a PTRACE_TRACEME request as well. Currently only one architecture, m32r, implements this hook. When called, it initializes a number of debug trap slots in the ptraced task's thread struct, and it looks to me like this is the right thing to do after a PTRACE_TRACEME request as well, not only after PTRACE_ATTACH. Please correct me if I'm wrong. I want to use this hook on AVR32 to turn the debugging hardware on when a process is actually being debugged and keep it off otherwise. To be able to do this, I need to intercept PTRACE_TRACEME and PTRACE_ATTACH, as well as PTRACE_DETACH and thread exit. The latter two can be handled by existing hooks. Signed-off-by: Haavard Skinnemoen commit 7f0f616bb093823b70855685cf085d39a8784818 Author: Haavard Skinnemoen Date: Wed Nov 28 14:51:44 2007 +0100 [AVR32] Remove redundant try_to_freeze() call from do_signal() get_signal_to_deliver() will call try_to_freeze(), so there's no point in do_signal() doing it as well. Signed-off-by: Haavard Skinnemoen commit 3611553ef985ef7c5863c8a94641738addd04cff Author: Haavard Skinnemoen Date: Thu Jul 5 17:08:09 2007 +0200 [AVR32] Drop GFP_COMP for DMA memory allocations dma_alloc_coherent wants to split pages after allocation in order to reduce the memory footprint. This does not work well with GFP_COMP pages, so drop this flag before allocation. This patch was forward-ported from BSP 2.0 Signed-off-by: Haavard Skinnemoen commit 4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 Author: Greg Kroah-Hartman Date: Thu Jan 24 22:50:12 2008 -0800 Driver core: coding style fixes Fix up a number of coding style issues in the drivers/base/ directory that have annoyed me over the years. checkpatch.pl is now very happy. Signed-off-by: Greg Kroah-Hartman commit e374a2bfebf359f846216336de91670be40499da Author: Greg Kroah-Hartman Date: Thu Jan 24 21:59:04 2008 -0800 Kobject: fix coding style issues in kobject c files Clean up the kobject.c and kobject_uevent.c files to follow the proper coding style rules. Signed-off-by: Greg Kroah-Hartman commit 79a6ee42fd81be9abc6bdab08f932875924b26a5 Author: Greg Kroah-Hartman Date: Thu Jan 24 21:27:06 2008 -0800 Kobject: fix coding style issues in kobject.h Finally clean up the odd spaces and other mess in kobject.h Signed-off-by: Greg Kroah-Hartman commit d462943afee8bff610258a82dba666e8ab72c9c8 Author: Greg Kroah-Hartman Date: Thu Jan 24 21:04:46 2008 -0800 Driver core: fix coding style issues in device.h Finally clean up the odd spaces and other mess in device.h Signed-off-by: Greg Kroah-Hartman commit 5ed2c832ed256b18d90c2462369c62fd79312e6c Author: Dave Young Date: Tue Jan 22 15:14:18 2008 +0800 spi: use class iteration api Convert to use the class iteration api. Signed-off-by: Dave Young Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman commit 9c7701088a61cc0cf8a6e1c68d1e74e3cc2ee0b7 Author: Dave Young Date: Tue Jan 22 14:01:34 2008 +0800 scsi: use class iteration api Convert to use the class iteration api. Signed-off-by: Dave Young Cc: James Bottomley Signed-off-by: Greg Kroah-Hartman commit 71da890509fec13d54329485bf5e4ac16b992bb6 Author: Dave Young Date: Tue Jan 22 14:00:34 2008 +0800 rtc: use class iteration api Convert to use the class iteration api. Signed-off-by: Dave Young Cc: Alessandro Zummo Signed-off-by: Greg Kroah-Hartman commit 443cad920a1c6894da3de917ce02a194cc6d80ea Author: Dave Young Date: Tue Jan 22 13:58:22 2008 +0800 power supply : use class iteration api Convert to use the class iteration api. Signed-off-by: Dave Young Cc: Anton Vorontsov Cc: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit 73cf60232ef16e1f8a64defa97214a1722db1e6c Author: Dave Young Date: Tue Jan 22 13:56:32 2008 +0800 ieee1394: use class iteration api Convert to use the class iteration api. Signed-off-by: Dave Young Cc: Stefan Richter Signed-off-by: Greg Kroah-Hartman commit fd04897bb20be29d60f7e426a053545aebeaa61a Author: Dave Young Date: Tue Jan 22 15:27:08 2008 +0800 Driver Core: add class iteration api Add the following class iteration functions for driver use: class_for_each_device class_find_device class_for_each_child class_find_child Signed-off-by: Dave Young Acked-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 63b6971a0876b744e2fcf3c9df15d130501e1deb Author: Cornelia Huck Date: Mon Jan 21 16:09:44 2008 +0100 Driver core: Cleanup get_device_parent() in device_add() and device_move() Make setup_parent() void as get_device_parent() will always return either a valid kobject or NULL. Introduce cleanup_glue_dir() to drop reference grabbed on "glue" directory by get_device_parent(). Use it for cleanup in device_move() and device_add() on errors. This should fix the refcounting problem reported in http://marc.info/?l=linux-kernel&m=120052487909200&w=2 Signed-off-by: Cornelia Huck Cc: Dave Young Cc: Gabor Gombas Cc: Tejun Heo Cc: Al Viro Cc: Marcel Holtmann Cc: David Miller Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 4f0146919be6bff47b5ea97252bcec0286e4dd19 Author: Jan Engelhardt Date: Tue Jan 22 20:50:54 2008 +0100 UIO: constify function pointer tables Signed-off-by: Jan Engelhardt Signed-off-by: Greg Kroah-Hartman commit ae72cddb2338bc36b991674a56a7bf70ae104d9e Author: Stephen Rothwell Date: Fri Jan 11 17:24:53 2008 +1100 Driver Core: constify the name passed to platform_device_register_simple This name is just passed to platform_device_alloc which has its parameter declared const. Signed-off-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman commit 92b421416f8194aec87b1439487b5544e9ac8187 Author: Randy Dunlap Date: Mon Dec 31 10:05:43 2007 -0800 driver core: fix build with SYSFS=n When SYSFS=n and MODULES=y, build ends with: linux-2.6.24-rc6-mm1/drivers/base/module.c: In function 'module_add_driver': linux-2.6.24-rc6-mm1/drivers/base/module.c:49: error: 'module_kset' undeclared (first use in this function) make[3]: *** [drivers/base/module.o] Error 1 Below is one possible fix. Build-tested with all 4 config combinations of SYSFS & MODULES. Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman commit 9148fe8767dc8612b2e66d11126744d6436cc94e Author: Randy Dunlap Date: Mon Dec 31 10:05:34 2007 -0800 sysfs: make SYSFS_DEPRECATED depend on SYSFS Make SYSFS_DEPRECATED depend on SYSFS since files that check CONFIG_SYSFS_DEPRECATED don't check for CONFIG_SYSFS first. Also don't prompt user about SYSFS_DEPRECATED if SYSFS=n. Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman commit db1118a460c7bfd20278955cbf56c0b283a9701f Author: Denis Cheng Date: Thu Dec 6 02:24:40 2007 +0800 Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init LIST_HEAD has been widely used, so switch to this simpler method. Signed-off-by: Denis Cheng Signed-off-by: Greg Kroah-Hartman commit 44bfe16e1083d66f97a5289e359c52ee2c8b19a7 Author: Greg Kroah-Hartman Date: Tue Nov 27 11:28:26 2007 -0800 kobject: add sample code for how to use ksets/ktypes/kobjects This is a more complex example showing how to create a kset and a ktype and some default attributes for a group of kobjects. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 40efcb05f213180b7cc8fd8d963377305f236c28 Author: Greg Kroah-Hartman Date: Tue Nov 27 11:28:26 2007 -0800 kobject: add sample code for how to use kobjects in a simple manner. This is a simple kobject module, showing how to use kobj_attributes in basic and more complex ways. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 36d78d6c5b50ba945bbdee9bf1d8daac00154e02 Author: Greg Kroah-Hartman Date: Tue Nov 27 11:28:26 2007 -0800 kobject: update the kobject/kset documentation This provides a much-needed kobject and kset documentation update. Thanks to Kay Sievers, Alan Stern, Jonathan Corbet, Randy Dunlap, Jan Engelhardt, and others for reviewing and providing help with this document. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 5008743dc7f98dd1ad4f20f4d7ff0b479e78895d Author: Greg Kroah-Hartman Date: Tue Nov 27 11:28:26 2007 -0800 kobject: remove old, outdated documentation. As we are replacing the documentation, it's easier to do this in a two stage pass, delete the old file and add the new one. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit af5ca3f4ec5cc4432a42a73b050dd8898ce8fd00 Author: Kay Sievers Date: Thu Dec 20 02:09:39 2007 +0100 Driver core: change sysdev classes to use dynamic kobject names All kobjects require a dynamically allocated name now. We no longer need to keep track if the name is statically assigned, we can just unconditionally free() all kobject names on cleanup. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 528a4bf1d5ffed310d26fc1d82d45c02949f71cf Author: Greg Kroah-Hartman Date: Thu Dec 20 08:13:05 2007 -0800 Kobject: remove kobject_unregister() as no one uses it anymore There are no in-kernel users of kobject_unregister() so it should be removed. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 78a2d906b40fe530ea800c1e873bfe8f02326f1e Author: Greg Kroah-Hartman Date: Thu Dec 20 08:13:05 2007 -0800 Kobject: convert remaining kobject_unregister() to kobject_put() There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 197b12d6796a3bca187f22a8978a33d51e2bcd79 Author: Greg Kroah-Hartman Date: Thu Dec 20 08:13:05 2007 -0800 Kobject: convert fs/* from kobject_unregister() to kobject_put() There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit c10997f6575f476ff38442fa18fd4a0d80345f9d Author: Greg Kroah-Hartman Date: Thu Dec 20 08:13:05 2007 -0800 Kobject: convert drivers/* from kobject_unregister() to kobject_put() There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 38a382ae5dd4f4d04e3046816b0a41836094e538 Author: Greg Kroah-Hartman Date: Thu Dec 20 08:13:05 2007 -0800 Kobject: convert arch/* from kobject_unregister() to kobject_put() There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 7a6a41615bfb2f03ce797bc24104c50b42c935e5 Author: Greg Kroah-Hartman Date: Sat Dec 22 21:18:25 2007 -0800 Modules: remove unneeded release function Now that kobjects properly clean up their name structures, no matter if they have a release function or not, we can drop this empty module kobject release function too (it was needed prior to this because of the way we handled static kobject names, we based the fact that if a release function was present, then we could safely free the name string, now we are more smart about things and only free names we have previously set.) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 0f4dafc0563c6c49e17fe14b3f5f356e4c4b8806 Author: Kay Sievers Date: Wed Dec 19 01:40:42 2007 +0100 Kobject: auto-cleanup on final unref We save the current state in the object itself, so we can do proper cleanup when the last reference is dropped. If the initial reference is dropped, the object will be removed from sysfs if needed, if an "add" event was sent, "remove" will be send, and the allocated resources are released. This allows us to clean up some driver core usage as well as allowing us to do other such changes to the rest of the kernel. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 12e339ac6e31a34fe42396aec8fb1c0b43caf61e Author: Greg Kroah-Hartman Date: Tue Apr 9 12:14:34 2002 -0700 Kset: remove kset_add function No one is calling this anymore, so just remove it and hard-code the one internal-use of it. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 6d06adfaf82d154023141ddc0c9de18b6a49090b Author: Greg Kroah-Hartman Date: Wed Dec 19 11:26:50 2007 -0800 Kobject: remove kobject_register() The function is no longer used by anyone in the kernel, and it prevents the proper sending of the kobject uevent after the needed files are set up by the caller. kobject_init_and_add() can be used in its place. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit f9cb074bff8e762ef24c44678a5a7d907f82fbeb Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: rename kobject_init_ng() to kobject_init() Now that the old kobject_init() function is gone, rename kobject_init_ng() to kobject_init() to clean up the namespace. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e1543ddf739b22a8c4218716ad50c26b3e147403 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: remove kobject_init() as no one uses it anymore The old kobject_init() function is on longer in use, so let us remove it from the public scope (kset mess in the kobject.c file still uses it, but that can be cleaned up later very simply.) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b2d6db5878a0832659ed58476357eea2db915550 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: rename kobject_add_ng() to kobject_add() Now that the old kobject_add() function is gone, rename kobject_add_ng() to kobject_add() to clean up the namespace. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 9e7bbccd0290e720e0874443932869c55f63d5a8 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: remove kobject_add() as no one uses it anymore The old kobject_add() function is on longer in use, so let us remove it from the public scope (kset mess in the kobject.c file still uses it, but that can be cleaned up later very simply.) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit ac3c8141f62f357169980ec21b7be6d29964a394 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert kernel/module.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 649316b25b148e57c8ef71748fc69fa6db276ad1 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert drivers/md/md.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Neil Brown Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d5a379f77bc79c0a78b26f8c0159f55c8b11d68b Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert block/ll_rw_blk.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Jens Axboe Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 29e3dd0df1b9556170ce90484a9d1a2ff9104ea7 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert block/elevator.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Jens Axboe Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit edfaa7c36574f1bf09c65ad602412db9da5f96bf Author: Kay Sievers Date: Mon May 21 22:08:01 2007 +0200 Driver core: convert block from raw kobjects to core devices This moves the block devices to /sys/class/block. It will create a flat list of all block devices, with the disks and partitions in one directory. For compatibility /sys/block is created and contains symlinks to the disks. /sys/class/block |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1 |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10 |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5 |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6 |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7 |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8 |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9 `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 /sys/block/ |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 09f82ea92822a7bbb7e816508abbda47ed54a77f Author: Alan Stern Date: Mon Nov 19 10:53:40 2007 -0500 Kobject: drop child->parent ref at unregistration This patch (as1015) reverts changes that were made to the driver core about four years ago. The intent back then was to avoid certain kinds of invalid memory accesses by leaving kernel objects allocated as long as any of their children were still allocated. The original and correct approach was to wait only as long as any children were still _registered_; that's what this patch reinstates. This fixes a problem in the SCSI core made visible by the class_device to regular device conversion: A reference loop (scsi_device holds reference to request_queue, which is the child of a gendisk, which is the child of the scsi_device) prevents the data structures from being released, even though they are deregistered okay. It's possible that this change will cause a few bugs to surface, things that have been hidden for several years. They can be fixed easily enough by having the child device take an explicit reference to the parent whenever needed. Signed-off-by: Alan Stern Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 97c146ef075dc40ae34407c03d3860fc3850b8e8 Author: Kay Sievers Date: Thu Nov 29 23:46:11 2007 +0100 sysfs: fix /sys/module/*/holders after sysfs logic change Sysfs symlinks now require fully registered kobjects as a target, otherwise the call to create a symlink will fail. Here we register the kobject before we request the symlink in the holders directory. Signed-off-by: Kay Sievers Cc: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit da231fd5d113ab6da5dab7a2d2c38d0a540f939c Author: Kay Sievers Date: Wed Nov 21 17:29:15 2007 +0100 Driver core: fix class glue dir cleanup logic We should remove the glue directory between the class and the bus device _after_ we sent out the 'remove' event for the device, otherwise the parent relationship is no longer valid, and composing the path with deleted sysfs entries will not work. Cc: Alan Stern Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit ef2c51746dc89c2326ce522f8fb8a57695780e75 Author: Alan Stern Date: Fri Nov 16 11:57:28 2007 -0500 Driver core: fix race in __device_release_driver This patch (as1013) was suggested by David Woodhouse; it fixes a race in the driver core. If a device is unregistered at the same time as its driver is unloaded, the driver's code pages may be unmapped while the remove method is still running. The calls to get_driver() and put_driver() were intended to prevent this, but they don't work if the driver's module count has already dropped to 0. Instead, the patch keeps the device on the driver's list until after the remove method has returned. This forces the necessary synchronization to occur. Signed-off-by: Alan Stern Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman commit c8e90d822bff3e0502d004facedb05859f98055f Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/base/bus to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 7dc72b2842381684b864750af31a5fb168dec764 Author: Greg Kroah-Hartman Date: Wed Nov 28 23:49:41 2007 -0800 Driver core: clean up debugging messages The driver core debugging messages are a mess. This provides a unified message that makes them actually useful. The format for new kobject debug messages should be: driver/bus/class: 'OBJECT_NAME': FUNCTION_NAME: message.\n Note, the class code is not changed in this patch due to pending patches in my queue that this would conflict with. A later patch will clean them up. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e5dd12784617f0f1fae5f96a7fac1ec4c49fadbe Author: Greg Kroah-Hartman Date: Wed Nov 28 15:59:15 2007 -0800 Driver core: move the static kobject out of struct driver This patch removes the kobject, and a few other driver-core-only fields out of struct driver and into the driver core only. Now drivers can be safely create on the stack or statically (like they currently are.) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit c63469a3985a9771c18a916b8d42845d044ea0b1 Author: Greg Kroah-Hartman Date: Wed Nov 28 12:23:18 2007 -0800 Driver core: move the driver specific module code into the driver core The module driver specific code should belong in the driver core, not in the kernel/ directory. So move this code. This is done in preparation for some struct device_driver rework that should be confined to the driver core code only. This also lets us keep from exporting these functions, as no external code should ever be calling it. Thanks to Andrew Morton for the !CONFIG_MODULES fix. Signed-off-by: Greg Kroah-Hartman commit cbe9c595f1de2e2a98403be2c14bfbc2486e84c4 Author: Greg Kroah-Hartman Date: Wed Dec 19 15:54:39 2007 -0400 Driver: add driver_add_kobj for looney iseries_veth driver The iseries driver wants to hang kobjects off of its driver, so, to preserve backwards compatibility, we need to add a call to the driver core to allow future changes to work properly. Hopefully no one uses this function in the future and the iseries_veth driver authors come to their senses so I can remove this hack... Cc: Dave Larson Cc: Santiago Leon Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 23b9c1ab5baf368a32b7242bf110ef1f48700d04 Author: Greg Kroah-Hartman Date: Tue Dec 4 22:53:16 2007 -0800 Infiniband: make ipath driver use default driver groups. Make the ipath driver use the new driver functions so that it does not touch the sysfs portion of the driver structure. We also remove the redundant symlink from the device back to the driver, as it is already in the sysfs tree. Any userspace tools should be using the standard symlink, not some driver specific one. Cc: Roland Dreier Cc: Bryan O'Sullivan Cc: Arthur Jones Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 0478b83adb0269033221dc063d1185a224681ee8 Author: Cornelia Huck Date: Wed Dec 5 12:50:31 2007 +0100 zfcp: Use device_driver default attribute groups. CC: Swen Schillig Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 5b88feb134e0a7413cb9cb6ba677943615ca56cc Author: Cornelia Huck Date: Wed Dec 5 12:50:28 2007 +0100 netiucv: Use device_driver default attribute groups. CC: Ursula Braun Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 57c745340a60c51d2b9af3d4dcf7e0ede284855b Author: Cornelia Huck Date: Wed Dec 5 12:50:23 2007 +0100 driver core: Introduce default attribute groups. This is lot like default attributes for devices (and indeed, a lot of the code is lifted from there). Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 2b937303188807b498d1a3163f60305f0941538e Author: Greg Kroah-Hartman Date: Wed Nov 28 12:23:18 2007 -0800 PCI: remove foolish code from pci-driver.c The PCI bus should not be trying to declare its own attribute type. Especially as this code could never ever be called because the driver core overwrites the driver kobject type to be its own internal type. Delete all of this code as it was never being used and is not correct. Also update my copyright on the file while I'm touching things there. Signed-off-by: Greg Kroah-Hartman commit 03d43b19b9f56c1d18bc8f2f7890534fbe6a285d Author: Greg Kroah-Hartman Date: Wed Nov 28 12:23:18 2007 -0800 PCI: use proper call to driver_create_file Don't try to call the "raw" sysfs_create_file when we already have a helper function to do this kind of work for us. Signed-off-by: Greg Kroah-Hartman commit 2344c6de6b6f2a4b07e4416aac9522d23e00d7bc Author: Greg Kroah-Hartman Date: Wed Nov 28 12:23:18 2007 -0800 PCMCIA: use proper call to driver_create_file Don't try to call the "raw" sysfs_create_file when we already have a helper function to do this kind of work for us. Signed-off-by: Greg Kroah-Hartman commit 15147ffd57576fc00a23ad8a020ff46493a4f924 Author: Greg Kroah-Hartman Date: Wed Nov 28 12:23:18 2007 -0800 USB: use proper call to driver_create_file Don't try to call the "raw" sysfs_create_file when we already have a helper function to do this kind of work for us. Signed-off-by: Greg Kroah-Hartman commit c6f7e72a3f4641095ade9ded287d910c980c6148 Author: Greg Kroah-Hartman Date: Thu Nov 1 19:41:16 2007 -0700 driver core: remove fields from struct bus_type struct bus_type is static everywhere in the kernel. This moves the kobject in the structure out of it, and a bunch of other private only to the driver core fields are now moved to a private structure. This lets us dynamically create the backing kobject properly and gives us the chance to be able to document to users exactly how to use the struct bus_type as there are no fields they can improperly access. Thanks to Kay for the build fixes on this patch. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b249072ee6897fe4f8d461c7bb4b926223263c28 Author: Greg Kroah-Hartman Date: Thu Nov 1 19:41:16 2007 -0700 driver core: add way to get to bus device klist This allows an easier way to get to the device klist associated with a struct bus_type (you have three to choose from...) This will make it easier to move these fields to be dynamic in a future patch. The only user of this is the PCI core which horribly abuses this interface to rearrange the order of the pci devices. This should be done using the existing bus device walking functions, but that's left for future patches. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 0fed80f7a63abd7168907267af69ee31f6bcf301 Author: Greg Kroah-Hartman Date: Thu Nov 1 19:41:16 2007 -0700 driver core: add way to get to bus kset This allows an easier way to get to the kset associated with a struct bus_type (you have three to choose from...) This will make it easier to move these fields to be dynamic in a future patch. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit cc972e896b303f453f5893ecf8eca0d0e395ab64 Author: Greg Kroah-Hartman Date: Thu Nov 1 13:31:26 2007 -0700 driver core: remove owner field from struct bus_type This isn't used by anything in the driver core, and by no one in the 204 different usages of it in the kernel tree. Remove this field so no one gets any idea that it is needed to be used. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e32cc7366d88eeba12d22272a73dd83fb570ccb0 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert net/bridge/br_if.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Stephen Hemminger Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 1eada11c88251e0a30ce5690d2607bb4293b3564 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert mm/slub.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Christoph Lameter Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit cf15126b3d4511e06e5299781ab74922590900be Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert kernel/user.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e43b9192c59402685bd1f809068dd13aa5931570 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert kernel/params.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit a5815ddf26aa8208d4ad79b4fba5e6bf7d5ba688 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert fs/char_dev.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 78be3d2f574bf8a9886550ad07b8124b194badb8 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert drivers/net/iseries_veth.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kyle A. Lucke Cc: David Gibson Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 9990513c1ef040528c4e38163a073089d39c7903 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert drivers/base/core.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 60728d62e4d273776e9ef9704f9ff8e8a248a8a1 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: convert drivers/base/class.c to use kobject_init/add_ng() This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 52840bd628707979b5bbcce3c506786d3a69dba0 Author: Greg Kroah-Hartman Date: Mon Dec 17 23:05:35 2007 -0700 Kobject: the cris iop_fw_load.c code is broken This code is really really really broken. So much so that it's almost impossible to fix with a simple patch, so just comment out the offending registration with the kobject core, and mark the driver as broken. The problem is that the code is trying to register a "raw" struct device, which is not allowed. struct device is only for use within the driver model. This is being done to try to use the firmware layer which wants a struct device. To properly fix this, use something easy, like a platform device, which is a struct device and can be used for this kind of thing. Cc: Mikael Starvik Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 542eb75a27616bdde95c8d3764e0ab703579f8b5 Author: Greg Kroah-Hartman Date: Wed Dec 19 09:23:20 2007 -0800 Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Jacob Shin Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit a521cf209c6e7042f85b2c5b16da3ffa8004fb7b Author: Greg Kroah-Hartman Date: Wed Dec 19 09:23:20 2007 -0800 Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_create_and_add Make this kobject dynamic and convert it to not use kobject_register, which is going away. Cc: Jacob Shin Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 3830c62fef49f8bb1b2f353c7fb9469e3d038f5d Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/md/md.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Neil Brown Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit c199790a8bc90c91b88ad1205dee2955401cff81 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change arch/ia64/kernel/topology.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Tony Luck Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 73f368cf679babef42e54f0fe19270040ac9d4d7 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kyle McMartin Cc: Matthew Wilcox Cc: Grant Grundler Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 8dde2a96c146cc0491beec41fe3bf0477a1f15aa Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/net/ibmveth.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Dave Larson Cc: Santiago Leon Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d48b335256cd75fcb1a4abb3ce8136d8d9c931cc Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change arch/sh/kernel/cpu/sh4/sq.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 89c426066462263c90957c37af29765855516b83 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/block/pktcdvd.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Jens Axboe Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit a77aa28a2db3d134dd387f0f05cd6b6717fb1d28 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/acpi/system.c to use kobject_create_and_add Stop using kobject_register for this static kobject, as it's overkill. This way is much simpler. Cc: Len Brown Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 5b3f355d8fef95901505e924818b3031092453c2 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change arch/x86/kernel/cpu/intel_cacheinfo.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Ashok Raj Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 61030bfb79148b12b661580c8e3c2adfe1d9fc9e Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/base/sys.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 64dbcac3a16d0d22045b2c80d7f208196575486a Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/pci/hotplug/pci_hotplug_core.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kristen Carlson Accardi Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 94f57f33680922197581b127b3badde7ef658258 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/cpuidle/sysfs.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Shaohua Li Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b2ed215a3338b8b16187be8d136153054118a41e Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/edac to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Acked-by: Doug Thompson Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 038c5b3e412b0b751cb4b1507506bad3c7ffefae Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/cpufreq/cpufreq.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Dominik Brodowski Cc: Ashok Raj Cc: Jacob Shin Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d6d292c451e0ffe715fff36dc3a1129868258fa3 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/firmware/efivars.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Matt Domsch Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit dd002e807486f9858147c073069a37ba625baad8 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/firmware/edd.c to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Matt Domsch Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 35be0681983752116a8161ad3b30e830963108a4 Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change drivers/infiniband to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Roland Dreier Cc: Sean Hefty Cc: Hal Rosenstock Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 901195ed7f4b2f30dc5a36271887939c5d7bfb9f Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change GFS2 to use kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Steven Whitehouse Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 43b98c4a66760d18d4056beed4078a8dbad193cc Author: Greg Kroah-Hartman Date: Mon Dec 17 15:54:39 2007 -0400 Kobject: change net/bridge to use kobject_create_and_add The kobject in the bridge code is only used for registering with sysfs, not for any lifespan rules. This patch changes it to be only a pointer and use the simpler api for this kind of thing. Cc: Stephen Hemminger Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 81e7c6a636c81d9eeaeaa732bfbace44535fab00 Author: Greg Kroah-Hartman Date: Tue Dec 4 22:41:54 2007 +0000 UIO: fix kobject usage The uio kobject code is "wierd". This patch should hopefully fix it up to be sane and not leak memory anymore. Cc: Kay Sievers Cc: Thomas Gleixner Cc: Benedikt Spranger Signed-off-by: Hans J. Koch Signed-off-by: Greg Kroah-Hartman commit 9f66fa2a4690a16da0dbaae2f44ddfc313802504 Author: Greg Kroah-Hartman Date: Wed Nov 28 23:49:41 2007 -0800 kobject: clean up debugging messages The kobject debugging messages are a mess. This provides a unified message that makes them actually useful. The format for new kobject debug messages should be: kobject: 'KOBJECT_NAME' (ADDRESS): FUNCTION_NAME: message.\n Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit cfb36fff45e3997b8044c81045fc4869ba5f281a Author: Greg Kroah-Hartman Date: Wed Nov 28 10:46:22 2007 -0800 kobject: grab the kset reference in kobject_add, not kobject_init kobject_init should not be grabing any references, but only initializing the object. This patch fixes this, and makes the lock hold-time shorter for when a kset is present in the kobject. The current kernel tree has been audited to verify that this change should be safe. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d76e15fb20eeb7632ef38876a884fe3508b2c01d Author: Greg Kroah-Hartman Date: Tue Nov 27 11:28:26 2007 -0800 driver core: make /sys/power a kobject /sys/power should not be a kset, that's overkill. This patch renames it to power_kset and fixes up all usages of it in the tree. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 37b0c020343080241984d978981d6caf877b278a Author: Greg Kroah-Hartman Date: Mon Nov 26 22:11:55 2007 -0800 driver core: clean up device_shutdown device_shutdown does not need to be in a separate file. Move it into the driver core file where it belongs. This also moves us one more step closer to making devices_kset static, now only the crazy sysdevs are keeping that from happening... Signed-off-by: Greg Kroah-Hartman commit 822a89ed1ea0f7a2d8079307426fbeeac0370138 Author: Greg Kroah-Hartman Date: Tue Nov 20 13:56:21 2007 -0800 driver core: clean up shutdown.c shutdown.c had some stuff it did not need, including a duplicate extern in the power.h file. This cleans up all of that. Signed-off-by: Greg Kroah-Hartman commit c829a5b49858a83cc7bb5e1e730796575f5bb261 Author: Greg Kroah-Hartman Date: Wed Nov 7 13:56:19 2007 -0800 kobject: convert parisc/pdc_stable to use kobject_create Using a kset for this simple directory is an overkill. Cc: Kay Sievers Cc: Thibaut VARENE Cc: Matthew Wilcox Cc: Grant Grundler Cc: Kyle McMartin Signed-off-by: Greg Kroah-Hartman commit bc87d2fe7a1190f1c257af8a91fc490b1ee35954 Author: Greg Kroah-Hartman Date: Wed Nov 7 13:56:19 2007 -0800 kobject: convert efivars to use kobject_create Using a kset for this simple directory is an overkill. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit 6e90aa972dda8ef86155eefcdbdc8d34165b9f39 Author: Greg Kroah-Hartman Date: Tue Nov 6 15:08:08 2007 -0800 kobject: convert ecryptfs to use kobject_create Using a kset for this trivial directory is an overkill. Cc: Kay Sievers Cc: Mike Halcrow Cc: Phillip Hellewell Signed-off-by: Greg Kroah-Hartman commit f55842f2329f4b3a3a6bb98b005bca3cc851d38a Author: Greg Kroah-Hartman Date: Tue Nov 6 15:03:30 2007 -0800 kobject: clean up rpadlpar horrid sysfs abuse rpadlpar pci hotplug driver was doing some pretty bad stuff with the sysfs files. This cleans up the logic to be sane and gets rid of the gratuitous kset that is not needed for a simple directory like this. Note, this patch is not even build tested, let alone run-time tested. Someone with access to this hardware and can test would be greatly appreciated. Cc: Kay Sievers Cc: John Rose Cc: Badari Pulavarty Cc: Kamalesh Babulal Signed-off-by: Greg Kroah-Hartman commit 2fb9113b974c3c7c43e76647bd5077238e274e1c Author: Greg Kroah-Hartman Date: Tue Nov 6 15:03:30 2007 -0800 kobject: remove subsystem_(un)register functions These functions are no longer used and are the last remants of the old subsystem crap. So delete them for good. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 0ff21e46630abce11fdaaffabd72bbd4eed5ac2c Author: Greg Kroah-Hartman Date: Tue Nov 6 10:36:58 2007 -0800 kobject: convert kernel_kset to be a kobject kernel_kset does not need to be a kset, but a much simpler kobject now that we have kobj_attributes. We also rename kernel_kset to kernel_kobj to catch all users of this symbol with a build error instead of an easy-to-ignore build warning. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 5c03c7ab886859eb195440dbb6ccb8c30c4e84cc Author: Greg Kroah-Hartman Date: Fri Nov 2 16:19:59 2007 -0700 kset: remove decl_subsys macro This macro is no longer used. ksets should be created dynamically with a call to kset_create_and_add() not declared statically. Yes, there are 5 remaining static struct kset usages in the kernel tree, but they will be fixed up soon. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 830d3cfb16728e2496edc2985ad8f68025135e37 Author: Greg Kroah-Hartman Date: Tue Nov 6 10:36:58 2007 -0800 kset: convert block_subsys to use kset_create Dynamically create the kset instead of declaring it statically. We also rename block_subsys to block_kset to catch all users of this symbol with a build error instead of an easy-to-ignore build warning. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit c60b71787982cefcf9fa09aa281fa8c4c685d557 Author: Greg Kroah-Hartman Date: Fri Nov 2 16:19:59 2007 -0700 kset: convert ocfs2 to use kset_create Dynamically create the kset instead of declaring it statically. Also use the new kobj_attribute which cleans up this file a _lot_. Cc: Kay Sievers Cc: Mark Fasheh Cc: Kurt Hackel Signed-off-by: Greg Kroah-Hartman commit f62ed9e33b3ccff54d66b08f82d11940bb9e269b Author: Greg Kroah-Hartman Date: Mon Nov 5 13:16:15 2007 -0800 firmware: change firmware_kset to firmware_kobj There is no firmware "subsystem" it's just a directory in /sys that other portions of the kernel want to hook into. So make it a kobject not a kset to help alivate anyone who tries to do some odd kset-like things with this. Cc: Kay Sievers Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 15f2f9b3a9db65aaf908fe7ee17bbe262ae3550f Author: Greg Kroah-Hartman Date: Fri Nov 2 16:19:59 2007 -0700 firmware: remove firmware_(un)register() These functions are no longer called or needed, so we can remove them. As I rewrote the whole firmware.c file, add my copyright. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 99e0d2fc6c60ca44f56203eeda9fc0e07b508f06 Author: Greg Kroah-Hartman Date: Fri Nov 2 16:19:59 2007 -0700 kobject: convert /sys/firmware/acpi/ to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers Cc: Len Brown Signed-off-by: Greg Kroah-Hartman commit 9651d350ab2c1b9ef1875be2a9def1c375e6503f Author: Greg Kroah-Hartman Date: Fri Nov 2 16:19:59 2007 -0700 kset: convert edd to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Matt Domsch Signed-off-by: Greg Kroah-Hartman commit 000f2a4d8cfc1e1cbc0aa98136015e7ae7719b46 Author: Kay Sievers Date: Fri Nov 2 13:47:53 2007 +0100 Driver Core: kill subsys_attribute and default sysfs ops Remove the no longer needed subsys_attributes, they are all converted to the more sensical kobj_attributes. There is no longer a magic fallback in sysfs attribute operations, all kobjects which create simple attributes need explicitely a ktype assigned, which tells the core what was intended here. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 4443d07fcfab39c4d2d9d7711cff983f15b374fc Author: Greg Kroah-Hartman Date: Fri Nov 2 15:25:00 2007 -0700 kset: convert parisc/pdc_stable.c to use kset_create Dynamically create the kset instead of declaring it statically. This makes the kobject attributes now work properly that I broke in the previous patch. Cc: Kay Sievers Cc: Thibaut VARENE Cc: Matthew Wilcox Cc: Grant Grundler Cc: Kyle McMartin Signed-off-by: Greg Kroah-Hartman commit 7f548217860a7cf8a345d87792a07512450dfbff Author: Greg Kroah-Hartman Date: Fri Nov 2 15:25:00 2007 -0700 kobject: convert parisc/pdc_stable to kobj_attr interface This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. NOTE, this needs the next patch in the series in order to work properly. This will build, but the sysfs files will not properly operate. Cc: Kay Sievers Cc: Thibaut VARENE Cc: Matthew Wilcox Cc: Grant Grundler Cc: Kyle McMartin Signed-off-by: Greg Kroah-Hartman commit d91885bef25be2bab686bed082a5d82e358333b9 Author: Greg Kroah-Hartman Date: Fri Nov 2 17:17:00 2007 -0400 kset: convert s390 ipl.c to use kset_create Dynamically create the kset instead of declaring it statically. This makes the kobject attributes now work properly that I broke in the previous patch. Cc: Kay Sievers Cc: Michael Holzheu Cc: Heiko Carstens Cc: Volker Sameske Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 9b949165bd4a86c536cb92a9ce4367effbde9079 Author: Greg Kroah-Hartman Date: Fri Nov 2 17:17:00 2007 -0400 kobject: convert s390 ipl.c to kobj_attr interface This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. NOTE, this needs the next patch in the series in order to work properly. This will build, but the sysfs files will not properly operate. Thanks to Cornelia for the build fix on this patch. Cc: Kay Sievers Cc: Michael Holzheu Cc: Heiko Carstens Cc: Volker Sameske Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 79393fc46ede43451a500a132e5de9856f5a4c83 Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 kobject: convert pseries/power.c to kobj_attr interface This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. Cc: Kay Sievers Cc: Manish Ahuja Signed-off-by: Greg Kroah-Hartman commit 851324c6ffdf94976b4a925d0684a4faa993b9ca Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 kobject: convert arm/mach-omap1/pm.c to kobj_attr interface This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. Cc: Kay Sievers Cc: Cliff Brake Cc: Dirk Behme Signed-off-by: Greg Kroah-Hartman commit 66ac831e03879c3c7dae76f793e6094e407081d2 Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 kset: convert efivars to use kset_create for the vars sub-subsystem. Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit 89a07e34b16d9dcdf0a9ada3ca0c9a506b490c8f Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 kset: convert efivars to use kset_create for the efi subsystem. Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit 9e5f7f9abe18a4f134585a2de016974cbda80539 Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 firmware: export firmware_kset so that people can use that instead of the braindead firmware_register interface Needed for future firmware subsystem cleanups. In the end, the firmware_register/unregister functions will be deleted entirely, but we need this symbol so that subsystems can migrate over. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit 334c6307543a2b8af730a422f466d5f9442b606a Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 kobject: convert efivars to kobj_attr interface This cleans up a lot of code and gets rid of a unneeded macro, and gets us one step closer to deleting the deprecated subsys_attr code. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit 97fa5bb74c26fda93757b94ed248f5dabd4ad3d7 Author: Greg Kroah-Hartman Date: Wed Nov 7 13:56:19 2007 -0800 efivars: make new_var and del_var binary sysfs files These files should not be "normal" sysfs files as they really are binary ones. This patch makes them binary files and saves code in doing so. Cc: Kay Sievers Tested-by: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman commit af6370ea9268443351d6e931c702dc8162a1c8a1 Author: Greg Kroah-Hartman Date: Fri Nov 2 13:20:40 2007 -0700 ecryptfs: remove version_str file from sysfs This file violates the one-value-per-file sysfs rule. If you all want it added back, please do something like a per-feature file to show what is present and what isn't. Cc: Kay Sievers Cc: Mike Halcrow Cc: Phillip Hellewell Signed-off-by: Greg Kroah-Hartman commit eb41d9465cdafee45e0cb30f3b7338646221908e Author: Kay Sievers Date: Fri Nov 2 13:47:53 2007 +0100 fix struct user_info export's sysfs interaction Clean up the use of ksets and kobjects. Kobjects are instances of objects (like struct user_info), ksets are collections of objects of a similar type (like the uids directory containing the user_info directories). So, use kobjects for the user_info directories, and a kset for the "uids" directory. On object cleanup, the final kobject_put() was missing. Cc: Dhaval Giani Cc: Srivatsa Vaddagiri Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 386f275f5d097758f867bc99ddeaeb7a03b6b190 Author: Kay Sievers Date: Fri Nov 2 13:47:53 2007 +0100 Driver Core: switch all dynamic ksets to kobj_sysfs_ops Switch all dynamically created ksets, that export simple attributes, to kobj_attribute from subsys_attribute. Struct subsys_attribute will be removed. Signed-off-by: Kay Sievers Cc: Mike Halcrow Cc: Phillip Hellewell Signed-off-by: Greg Kroah-Hartman commit 23b5212cc7422f475b82124334b64277b5b43013 Author: Kay Sievers Date: Fri Nov 2 13:47:53 2007 +0100 Driver Core: add kobj_attribute handling Add kobj_sysfs_ops to replace subsys_sysfs_ops. There is no need for special kset operations, we want to be able to use simple attribute operations at any kobject, not only ksets. The whole concept of any default sysfs attribute operations will go away with the upcoming removal of subsys_sysfs_ops. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 6dcec2511ff55b4abaca7ad3433011a7c04c2430 Author: Greg Kroah-Hartman Date: Thu Nov 1 13:31:26 2007 -0700 kset: convert struct bus_device->drivers to use kset_create Dynamically create the kset instead of declaring it statically. Having 3 static kobjects in one structure is not only foolish, but ripe for nasty race conditions if handled improperly. We also rename the field to catch any potential users of it (not that there should be outside of the driver core...) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 3d8995963dfec66ef6270e729bf75903e9043f9d Author: Greg Kroah-Hartman Date: Thu Nov 1 13:31:26 2007 -0700 kset: convert struct bus_device->devices to use kset_create Dynamically create the kset instead of declaring it statically. Having 3 static kobjects in one structure is not only foolish, but ripe for nasty race conditions if handled improperly. We also rename the field to catch any potential users of it (not that there should be outside of the driver core...) Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 039a5dcd2fc45188a2d522df630db4f7ef903a0f Author: Greg Kroah-Hartman Date: Thu Nov 1 10:39:50 2007 -0700 kset: convert /sys/power to use kset_create Dynamically create the kset instead of declaring it statically. We also rename power_subsys to power_kset to catch all users of the variable and we properly export it so that people don't have to guess that it really is present in the system. The pseries code is wierd, why is it createing /sys/power if CONFIG_PM is disabled? Oh well, stupid big boxes ignoring config options... Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 7405c1e15edfe43b137bfbc5882f1af34d6d414d Author: Greg Kroah-Hartman Date: Thu Nov 1 10:39:50 2007 -0700 kset: convert /sys/module to use kset_create Dynamically create the kset instead of declaring it statically. We also rename module_subsys to module_kset to catch all users of the variable. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 081248de0a0288a0ce4e1447a07ccf56aa4fae01 Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kset: move /sys/slab to /sys/kernel/slab /sys/kernel is where these things should go. Also updated the documentation and tool that used this directory. Cc: Kay Sievers Acked-by: Christoph Lameter Signed-off-by: Greg Kroah-Hartman commit 27c3a314d55b810f3b51902d1d815c714a7afbd2 Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kset: convert slub to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Christoph Lameter Signed-off-by: Greg Kroah-Hartman commit aade4041aa60a3ed335391ba308458e26f2dbc0a Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kset: convert /sys/devices/system to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 9b477705360c16198d7a4bd73d199f5a957585b0 Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kobject: convert s390 hypervisor to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Thanks to Cornelia for the build fix. Cc: Kay Sievers Cc: Michael Holzheu Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman commit 2d72fc00a1fb055e6127ccd30cac3f0eafaa98d0 Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kobject: convert /sys/hypervisor to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. We also rename hypervisor_subsys to hypervisor_kset to catch all users of the variable. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 881c6cfd7c5edfe6129006e2404654bfe5911050 Author: Greg Kroah-Hartman Date: Thu Nov 1 09:29:06 2007 -0600 kset: convert /sys/devices to use kset_create Dynamically create the kset instead of declaring it statically. We also rename devices_subsys to devices_kset to catch all users of the variable. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b0d78e5549b44b3d64bf8b3ffe95280025ed102e Author: Greg Kroah-Hartman Date: Mon Oct 29 23:22:26 2007 -0500 kset: convert drivers/base/firmware.c to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 443dbf9007854ef2892226615e23b60a35b89697 Author: Greg Kroah-Hartman Date: Mon Oct 29 23:22:26 2007 -0500 kset: convert drivers/base/class.c to use kset_create Dynamically create the kset instead of declaring it statically. The class_obj subsystem is not yet converted as it is more complex and should be going away soon with the removal of class_device from the kernel tree. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 59a548338ac6c9d7549c54278d0f724088585928 Author: Greg Kroah-Hartman Date: Mon Oct 29 23:22:26 2007 -0500 kset: convert drivers/base/bus.c to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit bd35b93d8049ab47b5bfaf6b10ba39badf21d1c3 Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kset: convert kernel_subsys to use kset_create Dynamically create the kset instead of declaring it statically. We also rename kernel_subsys to kernel_kset to catch all users of this symbol with a build error instead of an easy-to-ignore build warning. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e5e38a86c0bbe8475543f10f0a48393a45df5182 Author: Greg Kroah-Hartman Date: Mon Oct 29 23:22:26 2007 -0500 kset: remove decl_subsys_name The last user of this macro (pci hotplug core) is now switched over to using a dynamic kset, so this macro is no longer needed at all. Cc: Kay Sievers Cc: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman commit 81ace5cd8fcb55e144f496af40d4275b03252456 Author: Greg Kroah-Hartman Date: Mon Oct 29 23:22:26 2007 -0500 kset: convert pci hotplug to use kset_create_and_add This also renames pci_hotplug_slots_subsys to pcis_hotplug_slots_kset catch all current users with a build error instead of a build warning which can easily be missed. Cc: Kay Sievers Cc: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman commit d405936b322220dc5cca9d2b58ef1911ae8efec9 Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kset: convert dlm to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Steven Whitehouse Signed-off-by: Greg Kroah-Hartman commit 136a27507fd09006973f11b17ca971d4c176a06a Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kset: convert gfs2 dlm to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Steven Whitehouse Signed-off-by: Greg Kroah-Hartman commit 9bec101a0c38d559a8c95b44d850cd09a7b4edef Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kset: convert gfs2 to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Steven Whitehouse Signed-off-by: Greg Kroah-Hartman commit 00d2666623368ffd39afc875ff8a2eead2a0436c Author: Greg Kroah-Hartman Date: Mon Oct 29 14:17:23 2007 -0600 kobject: convert main fs kobject to use kobject_create This also renames fs_subsys to fs_kobj to catch all current users with a build error instead of a build warning which can easily be missed. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 917e865df7eb020f20ffc2b4204f282a587df94f Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kset: convert ecryptfs to use kset_create Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Mike Halcrow Cc: Phillip Hellewell Signed-off-by: Greg Kroah-Hartman commit 3794491d0c4b6355c55b0379f003900e57666a97 Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kobject: convert configfs to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers Signed-off-by: Joel Becker Signed-off-by: Greg Kroah-Hartman commit 191e186bd0589e28496745275157323a6f7902ca Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kobject: convert debugfs to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 69d8e1389551b107b1a8ec70c280cb7a56096666 Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kobject: convert securityfs to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers Acked-by: Chris Wright Signed-off-by: Greg Kroah-Hartman commit 5c89e17e9c2bc03ed16320967832b33b174e6234 Author: Greg Kroah-Hartman Date: Mon Oct 29 20:13:17 2007 +0100 kobject: convert fuse to use kobject_create We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers Cc: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 43968d2f1648f4dc92437dc0363a3e88377445b3 Author: Greg Kroah-Hartman Date: Mon Nov 5 22:24:43 2007 -0800 kobject: get rid of kobject_kset_add_dir kobject_kset_add_dir is only called in one place so remove it and use kobject_create() instead. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 4ff6abff832fbc6cb1d769f6106c841bc2b09f63 Author: Greg Kroah-Hartman Date: Mon Nov 5 22:24:43 2007 -0800 kobject: get rid of kobject_add_dir kobject_create_and_add is the same as kobject_add_dir, so drop kobject_add_dir. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 3f9e3ee9dc3605e5c593b5d708494571fb0d3970 Author: Greg Kroah-Hartman Date: Mon Nov 5 13:16:15 2007 -0800 kobject: add kobject_create_and_add function This lets users create dynamic kobjects much easier. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b727c702896f88d2ff6c3e03bd011d7c3dffe3e1 Author: Greg Kroah-Hartman Date: Thu Sep 27 14:48:53 2007 -0700 kset: add kset_create_and_add function Now ksets can be dynamically created on the fly, no static definitions are required. Thanks to Miklos for hints on how to make this work better for the callers. And thanks to Kay for finding some stupid bugs in my original version and pointing out that we need to handle the fact that kobject's can have a kset as a parent and to handle that properly in kobject_add(). Cc: Kay Sievers Cc: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 12d03da7c19366268bdbc9fb0cd08d719c0cc283 Author: Greg Kroah-Hartman Date: Tue Oct 16 10:11:44 2007 -0600 kobject: remove kobj_set_kset_s as no one is using it anymore What a confusing name for a macro... Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 3514faca19a6fdc209734431c509631ea92b094e Author: Greg Kroah-Hartman Date: Tue Oct 16 10:11:44 2007 -0600 kobject: remove struct kobj_type from struct kset We don't need a "default" ktype for a kset. We should set this explicitly every time for each kset. This change is needed so that we can make ksets dynamic, and cleans up one of the odd, undocumented assumption that the kset/kobject/ktype model has. This patch is based on a lot of help from Kay Sievers. Nasty bug in the block code was found by Dave Young Cc: Kay Sievers Cc: Dave Young Signed-off-by: Greg Kroah-Hartman commit c11c4154e7ff4cebfadad849b1e22689d759c3f4 Author: Greg Kroah-Hartman Date: Mon Dec 3 21:31:08 2007 -0800 kobject: add kobject_init_and_add function Also add a kobject_init_and_add function which bundles up what a lot of the current callers want to do all at once, and it properly handles the memory usages, unlike kobject_register(); Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 244f6cee9a928103132a722292bfa0eb84114b07 Author: Greg Kroah-Hartman Date: Mon Dec 3 21:31:08 2007 -0800 kobject: add kobject_add_ng function This is what the kobject_add function is going to become. Add this to the kernel and then we can convert the tree over to use it. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit e86000d042d23904bbb609af2f8618a541cf129b Author: Greg Kroah-Hartman Date: Mon Dec 3 21:31:08 2007 -0800 kobject: add kobject_init_ng function This is what the kobject_init function is going to become. Add this to the kernel and then we can convert the tree over to use it. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 18041f4775688af073d9b3ab0ffc262c1847e60b Author: Greg Kroah-Hartman Date: Mon Dec 3 21:31:08 2007 -0800 kobject: make kobject_cleanup be static No one except the kobject core calls it so make the function static. Signed-off-by: Greg Kroah-Hartman commit 663a47430b361f863b515752a97166a7a4b92d35 Author: Greg Kroah-Hartman Date: Thu Nov 29 18:32:47 2007 -0500 kobject: fix up kobject_set_name to use kvasprintf Kay pointed out that kobject_set_name was being very stupid, doing two allocations for every call, when it should just be using the kernel function kvasprintf() instead. This change adds the internal kobject_set_name_vargs() function, which other follow-on patches will be using. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 15f2bbb28e96e20149548926e5b08551ba140b14 Author: Greg Kroah-Hartman Date: Mon Dec 3 21:16:20 2007 -0700 kobject: convert icom to use kref, not kobject The IBM icom serial driver is using a kobject only for reference counting, nothing else. So switch it to use a kref instead, which is all that is needed, and is much smaller. Cc: Anton Blanchard Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Ryan S. Arnold Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit f7eb12c626d4375faf03039261546bd19c1325fd Author: Greg Kroah-Hartman Date: Wed Nov 28 10:46:22 2007 -0800 kobject: convert hvcs to use kref, not kobject hvcs is using a kobject only for reference counting, nothing else. So switch it to use a kref instead, which is all that is needed, and is much smaller. Cc: Anton Blanchard Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Ryan S. Arnold Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 12b20ded6f980d9161b1c6b062560b65a7295e1c Author: Greg Kroah-Hartman Date: Wed Nov 28 10:46:22 2007 -0800 kobject: convert hvc_console to use kref, not kobject hvc_console is using a kobject only for reference counting, nothing else. So switch it to use a kref instead, which is all that is needed, and is much smaller. Cc: Anton Blanchard Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Ryan S. Arnold Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit a045171f875cd61f690981a78ab98fbd137c938b Author: Greg Kroah-Hartman Date: Mon Dec 3 21:16:20 2007 -0700 kobject: convert ibmasm to use kref, not kobject The IBM asm driver is using a kobject only for reference counting, nothing else. So switch it to use a kref instead, which is all that is needed, and is much smaller. Cc: Max Asböck Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d7b37889650bb316f5c4ad4b0569ba897120d70d Author: Jiri Slaby Date: Wed Nov 21 14:55:19 2007 -0800 sysfs: remove SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED is deprecated, use DEFINE_SPINLOCK instead Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Cc: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit 2f90a851800e88436873c8d27238cf219b9ef48e Author: Kay Sievers Date: Thu Nov 1 20:20:52 2007 +0100 sysfs: create optimal relative symlink targets Instead of walking from the source down to the root of sysfs, and back to the target, we stop at the first directory the source and the target share. This link: /devices/pci0000:00/0000:00:1d.7/usb1/1-0:1.0/ep_81 pointed to: ../../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0/usb_endpoint/usbdev2.1_ep81 now it just points to: usb_endpoint/usbdev1.1_ep81 Thanks to Denis Cheng for bringing this up, and sending the initial patch. CC: Denis Cheng Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 7b8712e563df4fefc25d3107fa3fb3abb7331ff4 Author: Emil Medve Date: Tue Oct 30 14:37:14 2007 -0500 driver core: Make the dev_*() family of macros in device.h complete Removed duplicates defined elsewhere Signed-off-by: Emil Medve Signed-off-by: Greg Kroah-Hartman commit 30a468b1c1b9911ae515ff8972ee10c50cca3021 Author: Greg Kroah-Hartman Date: Mon Oct 15 15:01:24 2007 -0700 ecryptfs: clean up attribute mess It isn't that hard to add simple kset attributes, so don't go through all the gyrations of creating your own object type and show and store functions. Just use the functions that are already present. This makes things much simpler. Note, the version_str string violates the "one value per file" rule for sysfs. I suggest changing this now (individual files per type supported is one suggested way.) Cc: Michael A. Halcrow Cc: Michael C. Thompson Cc: Tyler Hicks Signed-off-by: Greg Kroah-Hartman commit 02ff82cac7ee7351d2649c4a3568f12e4e0fe534 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 cosa: Convert from class_device to device for cosa sync driver struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: Jan "Yenya" Kasprzak Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 7dd817d083b6fc103b9ea4f2b4f4a1c6a09e29a0 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 tifm: Convert from class_device to device for TI flash media Signed-off-by: Tony Jones Cc: Alex Dubov Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 6013c12be8313b3205b41912d965b03f3b06147d Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 pktcdvd: Convert from class_device to device for block/pktcdvd struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: Peter Osterlund Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit aa2758261469374b598e2a6a2702e000a6ab2fbb Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 paride: Convert from class_device to device for block/paride struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: Tim Waugh Cc: Jens Axboe Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit a98894ab02bc9a3e2dc8cccab55d7ed200d3b05f Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 mtd: Convert from class_device to device for MTD/mtdchar struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: David Woodhouse Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 0c55445f201841bfd6c658c47df8311b6722f002 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 MCP_UCB1200: Convert from class_device to device struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: Russell King Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 68db2bc98cc1594a1cc487755aff4340fd4f1611 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 adb: Convert from class_device to device struct class_device is going away, this converts the code to use struct device instead. Signed-off-by: Tony Jones Cc: Joshua Thompson Cc: Benjamin Herrenschmidt Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit d78b03683a6f96645d265abdd5c556547dc76d70 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 ISDN: Convert from class_device to device for ISDN capi Signed-off-by: Tony Jones Cc: Kay Sievers Acked-by: Karsten Keil Signed-off-by: Greg Kroah-Hartman commit dbc1272ed4a9ce45ecc50e7ea7d52e7413eb1a4f Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 IDE: Convert from class_device to device for ide-tape Signed-off-by: Tony Jones Cc: Gadi Oxman Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 891f78ea833edd4a1e524e15bfe297a7a84d81a0 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 DMA: Convert from class_device to device for DMA engine Signed-off-by: Tony Jones Signed-off-by: Dan Williams Cc: Shannon Nelson Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 62ca8792560e5bd7dc09f54ed3523a7864f416c7 Author: Kay Sievers Date: Tue Sep 25 02:03:03 2007 +0200 coda: convert struct class_device to struct device Signed-off-by: Kay Sievers Cc: Tony Jones Cc: Jan Harkes Signed-off-by: Greg Kroah-Hartman commit 7ea7ed01ff741918532978b30f6f226ed6f78476 Author: Tony Jones Date: Tue Sep 25 02:03:03 2007 +0200 aoechr: Convert from class_device to device Signed-off-by: Tony Jones Cc: Jens Axboe Cc: Sam Hopkins Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 41ca28ab2abd76dc203e2c3a7cd609607cb927c3 Author: Evgeniy Polyakov Date: Mon Dec 10 23:03:43 2007 +0300 kref: add kref_set() This adds kref_set() to the kref api for future use by people who really know what they are doing with krefs... From: Evgeniy Polyakov Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit 775b64d2b6ca37697de925f70799c710aab5849a Author: Rafael J. Wysocki Date: Sat Jan 12 20:40:46 2008 +0100 PM: Acquire device locks on suspend This patch reorganizes the way suspend and resume notifications are sent to drivers. The major changes are that now the PM core acquires every device semaphore before calling the methods, and calls to device_add() during suspends will fail, while calls to device_del() during suspends will block. It also provides a way to safely remove a suspended device with the help of the PM core, by using the device_pm_schedule_removal() callback introduced specifically for this purpose, and updates two drivers (msr and cpuid) that need to use it. Signed-off-by: Alan Stern Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 7a83d456a86d559a6347115d206d23774bc152d9 Author: Greg Kroah-Hartman Date: Wed Oct 24 21:52:56 2007 -0700 kobject: remove incorrect comment in kobject_rename As pointed out by Kay. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman commit b1c7192df1b089ed654c76fbf14d7f7dbf4b9616 Author: Robert P. J. Day Date: Wed Nov 7 04:09:46 2007 -0500 Documentation: Replace obsolete "driverfs" with "sysfs". Signed-off-by: Robert P. J. Day commit 20fd1e3bea554620d489f3542496639c1babe0b3 Author: Frank Seidel Date: Fri Nov 9 14:49:23 2007 +0100 nozomi driver This is a driver to control the cardbus wireless data card that works on 3g networks. Greg Kroah-Hartman did the initial driver cleanup. Thanks to Arnaud Patard for help with bugfixing. Thanks to Alan Cox for a lot of tty fixes. Thanks to Satyam Sharma for fixing buildbreakage. Thanks to Frank Seidel for a lot of bugfixes and rewriting to make it a sane Linux driver Thanks to Jiri Slaby for a lot bugfixes, cleanups and rewrites that make it much more readable. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Frank Seidel Signed-off-by: Jiri Slaby commit 9fd5b1c906a9b4b0efb24cb2b4d20c678ff26122 Author: Jean Delvare Date: Tue Jan 8 18:11:24 2008 +0100 sysfs: Fix a copy-n-paste typo in comment Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman commit 463e526083fdaa284eaea45b53bb917ed3c72900 Author: Zhang Le Date: Tue Jan 8 00:59:16 2008 +0800 Chinese: add translation of Codingstyle Signed-off-by: Zhang Le Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 22033d38bca82a4a511450562086c69f5dc457ee Author: Li Yang Date: Wed Oct 24 01:04:21 2007 +0800 Chinese: add translation of sparse.txt Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit c642ecf874028c9f41d18d59a9d663c2a954cc45 Author: Bryan Wu Date: Wed Oct 24 01:00:23 2007 +0800 Chinese: add translation of volatile-considered-harmful.txt Signed-off-by: Bryan Wu Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 6941ee8896bfc462c3e3ad113c769a57ecbf3b2a Author: TripleX Chung Date: Wed Oct 24 00:57:24 2007 +0800 Chinese: add translation of stable_kernel_rules.txt Signed-off-by: TripleX Chung Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit d1a1d45142ed3969b3cc3964f81e4249f9e49fbf Author: Dave Young Date: Wed Oct 24 01:14:29 2007 +0800 Chinese: add translation of oops-tracing.txt Signed-off-by: Dave Young Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 09792200e465db0861dee25bdecfc55278907ed3 Author: Li Yang Date: Wed Oct 24 00:51:11 2007 +0800 Chinese: add translation of SubmittingDrivers Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 12428e7626378dec7968cd4f5df9aab2ee58e735 Author: TripleX Chung Date: Wed Oct 24 00:46:43 2007 +0800 Chinese: add translation of SubmittingPatches Signed-off-by: TripleX Chung Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 5dae82cc186da487cf33d7f5648a9ab3e02eaee4 Author: Li Yang Date: Tue Oct 23 21:58:51 2007 +0800 Chinese: Change man-pages maintainer address in HOWOTO The email address of the man-pages maintainer has changed. Cc: Michael Kerrisk Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 24277db3894941026662743e400e77c68c4a9e92 Author: Li Yang Date: Wed Jul 25 02:43:32 2007 +0800 Chinese: rephrase English introduction in HOWTO Rephrase the introduction as suggested by Jesper Juhl. Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 6b2cb91efce215c3c34b1b79b15f30e860761a3e Author: Li Yang Date: Wed Jul 25 02:03:06 2007 +0800 Chinese: Add the known_regression URI to the HOWTO Update translation for commit be3884943674f8ee7656b1d8b71c087ec900c836. Signed-off-by: Li Yang Signed-off-by: Greg Kroah-Hartman commit 2e08c0c1c3977a5ddc88887dd3af1b26c433e9d0 Author: Eamon Walsh Date: Thu Jan 24 15:30:52 2008 -0500 selinux: make mls_compute_sid always polyinstantiate This patch removes the requirement that the new and related object types differ in order to polyinstantiate by MLS level. This allows MLS polyinstantiation to occur in the absence of explicit type_member rules or when the type has not changed. Potential users of this support include pam_namespace.so (directory polyinstantiation) and the SELinux X support (property polyinstantiation). Signed-off-by: Eamon Walsh Acked-by: Stephen Smalley Signed-off-by: James Morris commit 1996a10948e50e546dc2b64276723c0b64d3173b Author: Jan Engelhardt Date: Wed Jan 23 00:02:58 2008 +0100 security/selinux: constify function pointer tables and fields Constify function pointer tables and fields. Signed-off-by: Jan Engelhardt Signed-off-by: James Morris commit 63cb34492351078479b2d4bae6a881806a396286 Author: David Howells Date: Tue Jan 15 23:47:35 2008 +0000 security: add a secctx_to_secid() hook Add a secctx_to_secid() LSM hook to go along with the existing secid_to_secctx() LSM hook. This patch also includes the SELinux implementation for this hook. Signed-off-by: Paul Moore Acked-by: Stephen Smalley Signed-off-by: James Morris commit c43e259cc756ece387faae849af0058b56d78466 Author: James Morris Date: Sat Jan 12 22:05:48 2008 +1100 security: call security_file_permission from rw_verify_area All instances of rw_verify_area() are followed by a call to security_file_permission(), so just call the latter from the former. Acked-by: Eric Paris Signed-off-by: James Morris commit bced95283e9434611cbad8f2ff903cd396eaea72 Author: H. Peter Anvin Date: Sat Dec 29 16:20:25 2007 -0800 security: remove security_sb_post_mountroot hook The security_sb_post_mountroot() hook is long-since obsolete, and is fundamentally broken: it is never invoked if someone uses initramfs. This is particularly damaging, because the existence of this hook has been used as motivation for not using initramfs. Stephen Smalley confirmed on 2007-07-19 that this hook was originally used by SELinux but can now be safely removed: http://marc.info/?l=linux-kernel&m=118485683612916&w=2 Cc: Stephen Smalley Cc: James Morris Cc: Eric Paris Cc: Chris Wright Signed-off-by: H. Peter Anvin Signed-off-by: James Morris commit 42d7896ebc5f7268b1fe6bbd20f2282e20ae7895 Author: James Morris Date: Wed Dec 26 15:12:37 2007 +1100 Security: remove security.h include from mm.h Remove security.h include from mm.h, as it is only needed for a single extern declaration, and pulls in all kinds of crud. Fine-by-me: David Chinner Acked-by: Eric Paris Signed-off-by: James Morris commit 88c3f7a8f2c86be264d326cf6f49a3e8c30d13a6 Author: Richard Knutsson Date: Sat Dec 8 12:02:48 2007 +0100 Security: remove security_file_mmap hook sparse-warnings (NULL as 0). Fixing: CHECK mm/mmap.c mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1944:29: warning: Using plain integer as NULL pointer Signed-off-by: Richard Knutsson Signed-off-by: James Morris commit c9180a57a9ab2d5525faf8815a332364ee9e89b7 Author: Eric Paris Date: Fri Nov 30 13:00:35 2007 -0500 Security: add get, set, and cloning of superblock security information Adds security_get_sb_mnt_opts, security_set_sb_mnt_opts, and security_clont_sb_mnt_opts to the LSM and to SELinux. This will allow filesystems to directly own and control all of their mount options if they so choose. This interface deals only with option identifiers and strings so it should generic enough for any LSM which may come in the future. Filesystems which pass text mount data around in the kernel (almost all of them) need not currently make use of this interface when dealing with SELinux since it will still parse those strings as it always has. I assume future LSM's would do the same. NFS is the primary FS which does not use text mount data and thus must make use of this interface. An LSM would need to implement these functions only if they had mount time options, such as selinux has context= or fscontext=. If the LSM has no mount time options they could simply not implement and let the dummy ops take care of things. An LSM other than SELinux would need to define new option numbers in security.h and any FS which decides to own there own security options would need to be patched to use this new interface for every possible LSM. This is because it was stated to me very clearly that LSM's should not attempt to understand FS mount data and the burdon to understand security should be in the FS which owns the options. Signed-off-by: Eric Paris Acked-by: Stephen D. Smalley Signed-off-by: James Morris commit 19c5fc198c369bb00f3ed9716ef40648865d8d94 Author: Joe Perches Date: Mon Nov 19 17:53:44 2007 -0800 security/selinux: Add missing "space" Add missing space. Signed-off-by: Joe Perches Signed-off-by: James Morris commit 15e7b4452b72ae890f2fcb027b4c4fa63a1c9a7a Author: Sebastian Siewior Date: Mon Jan 14 17:07:57 2008 +1100 [CRYPTO] twofish: Merge common glue code There is almost no difference between 32 & 64 bit glue code. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit b966b54654598aebdac9c57f102d769b36d2f68f Author: Alexey Dobriyan Date: Tue Jan 8 21:36:34 2008 +1100 [CRYPTO] hifn_795x: Fixup container_of() usage Signed-off-by: Alexey Dobriyan Signed-off-by: Herbert Xu commit e6ccc727f30a02670f6a00df6d548942bc988f43 Author: Ilpo Järvinen Date: Tue Jan 8 17:20:31 2008 +1100 [CRYPTO] cast6: inline bloat-- Bloat-o-meter shows rather high readings for cast6... crypto/cast6.c: cast6_setkey | -1310 cast6_encrypt | -4567 cast6_decrypt | -4561 3 functions changed, 10438 bytes removed, diff: -10438 crypto/cast6.c: W | +659 Q | +308 QBAR | +316 3 functions changed, 1283 bytes added, diff: +1283 crypto/cast6.o: 6 functions changed, 1283 bytes added, 10438 bytes removed, diff: -9155 Signed-off-by: Ilpo Järvinen Signed-off-by: Herbert Xu commit 6eb7228421c01ba48a6a88a7a5b3e71cfb70d4a9 Author: Herbert Xu Date: Tue Jan 8 17:16:44 2008 +1100 [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long Thanks to David Miller for pointing out that the SLAB (or SLOB/SLUB) cache uses the alignment of unsigned long long if the architecture kmalloc/slab alignment macros are not defined. This patch changes the CRYPTO_MINALIGN so that it uses the same default value. Signed-off-by: Herbert Xu commit 38ed9ab23b8614c9c1553b2961ef2627f3088fd9 Author: Herbert Xu Date: Tue Jan 1 15:59:28 2008 +1100 [CRYPTO] tcrypt: Make xcbc available as a standalone test Currently the gcm(aes) tests have to be taken together with all other algorithms. This patch makes it available by itself at number 106. Signed-off-by: Herbert Xu commit 94765b9e4cba8e3c51c292338db16aa174894d30 Author: Herbert Xu Date: Tue Jan 1 15:49:17 2008 +1100 [CRYPTO] xcbc: Remove bogus hash/cipher test When setting the digest size xcbc tests to see if the underlying algorithm is a hash. This is silly because we don't allow it to be a hash and we've specifically requested for a cipher. This patch removes the bogus test. Signed-off-by: Herbert Xu commit 1b87887d6c232becba77835b29a424cf78442b7d Author: Herbert Xu Date: Tue Jan 1 15:44:50 2008 +1100 [CRYPTO] xcbc: Fix algorithm leak when block size check fails When the underlying algorithm has a block size other than 16 we abort without freeing it. In fact, we try to return the algorithm itself as an error! This patch plugs the leak and makes it return -EINVAL instead. Signed-off-by: Herbert Xu commit 2a999a3abb2d3885741b09b9d05280db7e757544 Author: Herbert Xu Date: Sun Dec 30 20:24:11 2007 +1100 [CRYPTO] tcrypt: Zero axbuf in the right function The axbuf buffer is used by test_aead and therefore should be zeroed there instead of in test_hash. Signed-off-by: Herbert Xu commit 866cd902e864e9d0e31299efa9d61fc9a9bec315 Author: Herbert Xu Date: Thu Dec 27 00:04:44 2007 +1100 [CRYPTO] padlock: Only reset the key once for each CBC and ECB operation Currently we reset the key for each segment fed to the xcrypt instructions. This patch optimises this for CBC and ECB so that we only do this once for each encrypt/decrypt operation. Signed-off-by: Herbert Xu commit 1c5dfe6a959b79215c0f73d793169a7d5755900e Author: Herbert Xu Date: Mon Dec 24 08:54:24 2007 +0800 [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h As Andrew Morton correctly points out, we need to explicitly include sched.h as we use the function cond_resched in crypto/scatterwalk.h. Signed-off-by: Herbert Xu commit 214dc54f6f1b71bcd895ef272c108c67ef046200 Author: Tan Swee Heng Date: Tue Dec 18 22:45:35 2007 +0800 [CRYPTO] salsa20-asm: Remove unnecessary dependency on CRYPTO_SALSA20 Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit d1cda4e39638e906f022c8ce56f566b617e1f77e Author: Sebastian Siewior Date: Tue Dec 18 00:08:27 2007 +0800 [CRYPTO] tcrypt: Add select of AEAD ERROR: "crypto_aead_setauthsize" [crypto/tcrypt.ko] undefined! ERROR: "crypto_alloc_aead" [crypto/tcrypt.ko] undefined! Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 9a7dafbba47384c330779c75a1546684efaa8c1a Author: Tan Swee Heng Date: Tue Dec 18 00:04:40 2007 +0800 [CRYPTO] salsa20: Add x86-64 assembly version This is the x86-64 version of the Salsa20 stream cipher algorithm. The original assembly code came from . It has been reformatted for clarity. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 974e4b752ee623854c5dc2bbfc7c7725029ce173 Author: Tan Swee Heng Date: Mon Dec 10 15:52:56 2007 +0800 [CRYPTO] salsa20_i586: Salsa20 stream cipher algorithm (i586 version) This patch contains the salsa20-i586 implementation. The original assembly code came from . I have reformatted it (added indents) so that it matches the other algorithms in arch/x86/crypto. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit dadbc53d0bbde0e84c40b9f6bc5c50eb9eb7352a Author: Herbert Xu Date: Mon Dec 17 15:33:17 2007 +0800 [CRYPTO] gcm: Introduce rfc4106 This patch introduces the rfc4106 wrapper for GCM just as we have an rfc4309 wrapper for CCM. The purpose of the wrapper is to include part of the IV in the key so that it can be negotiated by IPsec. Signed-off-by: Herbert Xu commit 189ed66e95fb23666a62963b718dcbe62adbadde Author: Herbert Xu Date: Fri Dec 14 22:29:37 2007 +0800 [CRYPTO] api: Show async type This patch adds an async field to /proc/crypto for ablkcipher and aead algorithms. Signed-off-by: Herbert Xu commit e7cd2514ea506f06bd4f7b13a9b62afd60f9c73b Author: Herbert Xu Date: Fri Dec 14 22:28:14 2007 +0800 [CRYPTO] chainiv: Avoid lock spinning where possible This patch makes chainiv avoid spinning by postponing requests on lock contention if the user allows the use of asynchronous algorithms. If a synchronous algorithm is requested then we behave as before. This should improve IPsec performance on SMP when two CPUs attempt to transmit over the same SA. Currently one of them will spin doing nothing waiting for the other CPU to finish its encryption. This patch makes it postpone the request and get on with other work. If only one CPU is transmitting for a given SA, then we will process the request synchronously as before. Signed-off-by: Herbert Xu commit 4726204200327c04a77b819e2c653c063f1bc6ab Author: Herbert Xu Date: Fri Dec 14 10:19:27 2007 +0800 [CRYPTO] seqiv: Add select AEAD in Kconfig Now that seqiv supports AEAD algorithms it needs to select the AEAD option. Thanks to Erez Zadok for pointing out the problem. Signed-off-by: Herbert Xu commit 6e050778c5d08a97d5d98f7cb62bc503e872615c Author: Herbert Xu Date: Fri Dec 14 00:44:11 2007 +0800 [CRYPTO] scatterwalk: Handle zero nbytes in scatterwalk_map_and_copy It's better to return silently than crash and burn when someone feeds us a zero length. In particular the null digest algorithm when used as part of authenc will do that to us. Signed-off-by: Herbert Xu commit ce5bd4aca3c467936370846119b7f3daf9ccea78 Author: Herbert Xu Date: Fri Dec 14 00:28:40 2007 +0800 [CRYPTO] null: Allow setkey on digest_null We need to allow setkey on digest_null if it is to be used directly by authenc instead of through hmac. Signed-off-by: Herbert Xu commit 3631c650c495d61b1dabf32eb26b46873636e918 Author: Herbert Xu Date: Thu Dec 13 22:28:59 2007 +0800 [CRYPTO] null: Add null blkcipher algorithm This patch adds a null blkcipher algorithm called ecb(cipher_null) for backwards compatibility. Previously the null algorithm when used by IPsec copied the data byte by byte. This new algorithm optimises that to a straight memcpy which lets us better measure inherent overheads in our IPsec code. Signed-off-by: Herbert Xu commit 93cc74e078eed8735585e5687903727bcfbcc8b4 Author: Joy Latten Date: Wed Dec 12 20:24:22 2007 +0800 [CRYPTO] tcrypt: Add CCM vectors This patch adds 7 test vectors to tcrypt for CCM. The test vectors are from rfc 3610. There are about 10 more test vectors in RFC 3610 and 4 or 5 more in NIST. I can add these as time permits. I also needed to set authsize. CCM has a prerequisite of authsize. Signed-off-by: Joy Latten Signed-off-by: Herbert Xu commit 4a49b499dfa0c9e42be6d6fdd771f3434c776278 Author: Joy Latten Date: Wed Dec 12 20:25:13 2007 +0800 [CRYPTO] ccm: Added CCM mode This patch adds Counter with CBC-MAC (CCM) support. RFC 3610 and NIST Special Publication 800-38C were referenced. Signed-off-by: Joy Latten Signed-off-by: Herbert Xu commit d29ce988aeb459203c74f14747f4f77e1829ef78 Author: Herbert Xu Date: Wed Dec 12 19:24:27 2007 +0800 [CRYPTO] aead: Create default givcipher instances This patch makes crypto_alloc_aead always return algorithms that is capable of generating their own IVs through givencrypt and givdecrypt. All existing AEAD algorithms already do. New ones must either supply their own or specify a generic IV generator with the geniv field. Signed-off-by: Herbert Xu commit 14df4d80433b8413f901e80880c39e8759b8418f Author: Herbert Xu Date: Wed Dec 12 12:27:26 2007 +0800 [CRYPTO] seqiv: Add AEAD support This patch adds support for using seqiv with AEAD algorithms. This is useful for those AEAD algorithms that performs authentication before encryption because the IV generated by the underlying encryption algorithm won't be available for authentication. Signed-off-by: Herbert Xu commit 5b6d2d7fdf806f2b5a9352416f9e670911fc4748 Author: Herbert Xu Date: Wed Dec 12 19:23:36 2007 +0800 [CRYPTO] aead: Add aead_geniv_alloc/aead_geniv_free This patch creates the infrastructure to help the construction of IV generator templates that wrap around AEAD algorithms by adding an IV generator to them. This is useful for AEAD algorithms with no built-in IV generator or to replace their built-in generator. Signed-off-by: Herbert Xu commit aedb30dc49eeecd48558b601c47e0b3f9e42c602 Author: Herbert Xu Date: Wed Dec 12 19:27:25 2007 +0800 [CRYPTO] aead: Allow algorithms with no givcrypt support Some algorithms always require manual IV construction. For instance, the generic CCM algorithm requires the first byte of the IV to be manually constructed. Such algorithms are always used by other algorithms equipped with their own IV generators and do not need IV generation per se. Signed-off-by: Herbert Xu commit 3a282bd2e77966e7361fffbd5d1cea6eb0499b6c Author: Herbert Xu Date: Sat Dec 8 20:13:15 2007 +0800 [CRYPTO] aead: Add top-level givencrypt/givdecrypt calls This patch finally makes the givencrypt/givdecrypt operations available to users by adding crypto_aead_givencrypt and crypto_aead_givdecrypt. A suite of helpers to allocate and fill in the request is also available. Signed-off-by: Herbert Xu commit e56dd56418fcc024683d1638564a494d9e9aab85 Author: Herbert Xu Date: Mon Dec 10 16:20:24 2007 +0800 [CRYPTO] authenc: Add givencrypt operation This patch implements the givencrypt function for authenc. It simply calls the givencrypt operation on the underlying cipher instead of encrypt. Signed-off-by: Herbert Xu commit 743edf57272fd420348e148bf94f9e48ed6abb70 Author: Herbert Xu Date: Mon Dec 10 16:18:01 2007 +0800 [CRYPTO] aead: Add givcrypt operations This patch adds the underlying givcrypt operations for aead and associated support elements. The rationale is identical to that of the skcipher givcrypt operations, i.e., sometimes only the algorithm knows how the IV should be generated. A new request type aead_givcrypt_request is added which contains an embedded aead_request structure with two new elements to support this operation. The new elements are seq and giv. The seq field should contain a strictly increasing 64-bit integer which may be used by certain IV generators as an input value. The giv field will be used to store the generated IV. It does not need to obey the alignment requirements of the algorithm because it's not used during the operation. The existing iv field must still be available as it will be used to store intermediate IVs and the output IV if chaining is desired. Signed-off-by: Herbert Xu commit 03bf712fb4defc7831c727d1e32d0269f7f96de0 Author: Herbert Xu Date: Sat Dec 1 18:35:38 2007 +1100 [CRYPTO] skcipher: Add top-level givencrypt/givdecrypt calls This patch finally makes the givencrypt/givdecrypt operations available to users by adding crypto_skcipher_givencrypt and crypto_skcipher_givdecrypt. A suite of helpers to allocate and fill in the request is also available. Signed-off-by: Herbert Xu commit 0a270321dbf948963aeb0e8382fe17d2c2eb3771 Author: Herbert Xu Date: Fri Nov 30 21:38:37 2007 +1100 [CRYPTO] seqiv: Add Sequence Number IV Generator This generator generates an IV based on a sequence number by xoring it with a salt. This algorithm is mainly useful for CTR and similar modes. This patch also sets it as the default IV generator for ctr. Signed-off-by: Herbert Xu commit 45d44eb56ad197cfccb8f84b5df64abff8b7cb96 Author: Herbert Xu Date: Sun Dec 2 21:21:02 2007 +1100 [CRYPTO] skcipher: Remove crypto_spawn_ablkcipher Now that gcm and authenc have been converted to crypto_spawn_skcipher, this patch removes the obsolete crypto_spawn_ablkcipher function. Signed-off-by: Herbert Xu commit 1472e5ebaac14dafbc0f978b5e951f1e9ca0b251 Author: Herbert Xu Date: Fri Dec 7 19:26:11 2007 +0800 [CRYPTO] gcm: Use crypto_grab_skcipher This patch converts the gcm algorithm over to crypto_grab_skcipher which is a prerequisite for IV generation. Signed-off-by: Herbert Xu commit d00aa19b507b39ee9a680d0d2ac2ae483686453a Author: Herbert Xu Date: Fri Dec 7 20:31:10 2007 +0800 [CRYPTO] gcm: Allow block cipher parameter This patch adds the gcm_base template which takes a block cipher parameter instead of cipher. This allows the user to specify a specific CTR implementation. This also fixes a leak of the cipher algorithm that was previously looked up but never freed. Signed-off-by: Herbert Xu commit 9ffde35a8edd3486cd7c80af931c15cec99a1a0d Author: Herbert Xu Date: Mon Dec 17 20:12:49 2007 +0800 [CRYPTO] authenc: Use crypto_grab_skcipher This patch converts the authenc algorithm over to crypto_grab_skcipher which is a prerequisite for IV generation. This patch also changes authenc to set its ASYNC status depending on the ASYNC status of the underlying skcipher. Signed-off-by: Herbert Xu commit b9c55aa475599183d0eab6833ea23e70c52dd24b Author: Herbert Xu Date: Tue Dec 4 12:46:48 2007 +1100 [CRYPTO] skcipher: Create default givcipher instances This patch makes crypto_alloc_ablkcipher/crypto_grab_skcipher always return algorithms that are capable of generating their own IVs through givencrypt and givdecrypt. Each algorithm may specify its default IV generator through the geniv field. For algorithms that do not set the geniv field, the blkcipher layer will pick a default. Currently it's chainiv for synchronous algorithms and eseqiv for asynchronous algorithms. Note that if these wrappers do not work on an algorithm then that algorithm must specify its own geniv or it can't be used at all. Signed-off-by: Herbert Xu commit 806d183aa6cc565d0f6bd2fb7fc6bfb175cc4813 Author: Herbert Xu Date: Wed Dec 5 12:10:53 2007 +1100 [CRYPTO] eseqiv: Add Encrypted Sequence Number IV Generator This generator generates an IV based on a sequence number by xoring it with a salt and then encrypting it with the same key as used to encrypt the plain text. This algorithm requires that the block size be equal to the IV size. It is mainly useful for CBC. It has one noteworthy property that for IPsec the IV happens to lie just before the plain text so the IV generation simply increases the number of encrypted blocks by one. Therefore the cost of this generator is entirely dependent on the speed of the underlying cipher. Signed-off-by: Herbert Xu commit 15c67286685cddce207b646306e8819ec8268ede Author: Herbert Xu Date: Fri Nov 30 20:17:28 2007 +1100 [CRYPTO] skcipher: Added skcipher_givcrypt_complete This patch adds the helper skcipher_givcrypt_complete which should be called when an ablkcipher algorithm has completed a givcrypt request. Signed-off-by: Herbert Xu commit 7f47073911f0e4384d38a0827d28305a177c8816 Author: Herbert Xu Date: Tue Nov 27 23:17:23 2007 +0800 [CRYPTO] chainiv: Add chain IV generator The chain IV generator is the one we've been using in the IPsec stack. It simply starts out with a random IV, then uses the last block of each encrypted packet's cipher text as the IV for the next packet. It can only be used by synchronous ciphers since we have to make sure that we don't start the encryption of the next packet until the last one has completed. It does have the advantage of using very little CPU time since it doesn't have to generate anything at all. Signed-off-by: Herbert Xu commit ecfc43292f68566c144afca966b46b371c26d56c Author: Herbert Xu Date: Wed Dec 5 21:08:36 2007 +1100 [CRYPTO] skcipher: Add skcipher_geniv_alloc/skcipher_geniv_free This patch creates the infrastructure to help the construction of givcipher templates that wrap around existing blkcipher/ablkcipher algorithms by adding an IV generator to them. Signed-off-by: Herbert Xu commit 927eead52c958829ef62c8aa5da2751033a2cf98 Author: Herbert Xu Date: Tue Nov 27 21:15:31 2007 +0800 [CRYPTO] cryptd: Use geniv of the underlying algorithm If the underlying algorithm specifies a specific geniv algorithm then we should use it for the cryptd version as well. Signed-off-by: Herbert Xu commit 23508e11ab3bb405dca66bf4d77e488bf2b07b0c Author: Herbert Xu Date: Tue Nov 27 21:33:24 2007 +0800 [CRYPTO] skcipher: Added geniv field This patch introduces the geniv field which indicates the default IV generator for each algorithm. It should point to a string that is not freed as long as the algorithm is registered. Signed-off-by: Herbert Xu commit 61da88e2b800eed2b03834a73c46cc89ad48716d Author: Herbert Xu Date: Mon Dec 17 21:51:27 2007 +0800 [CRYPTO] skcipher: Add givcrypt operations and givcipher type Different block cipher modes have different requirements for intialisation vectors. For example, CBC can use a simple randomly generated IV while modes such as CTR must use an IV generation mechanisms that give a stronger guarantee on the lack of collisions. Furthermore, disk encryption modes have their own IV generation algorithms. Up until now IV generation has been left to the users of the symmetric key cipher API. This is inconvenient as the number of block cipher modes increase because the user needs to be aware of which mode is supposed to be paired with which IV generation algorithm. Therefore it makes sense to integrate the IV generation into the crypto API. This patch takes the first step in that direction by creating two new ablkcipher operations, givencrypt and givdecrypt that generates an IV before performing the actual encryption or decryption. The operations are currently not exposed to the user. That will be done once the underlying functionality has actually been implemented. It also creates the underlying givcipher type. Algorithms that directly generate IVs would use it instead of ablkcipher. All other algorithms (including all existing ones) would generate a givcipher algorithm upon registration. This givcipher algorithm will be constructed from the geniv string that's stored in every algorithm. That string will locate a template which is instantiated by the blkcipher/ablkcipher algorithm in question to give a givcipher algorithm. Signed-off-by: Herbert Xu commit 378f4f51f9fdd8df80ea875320e2bf1d7c6e6e77 Author: Herbert Xu Date: Mon Dec 17 20:07:31 2007 +0800 [CRYPTO] skcipher: Add crypto_grab_skcipher interface Note: From now on the collective of ablkcipher/blkcipher/givcipher will be known as skcipher, i.e., symmetric key cipher. The name blkcipher has always been much of a misnomer since it supports stream ciphers too. This patch adds the function crypto_grab_skcipher as a new way of getting an ablkcipher spawn. The problem is that previously we did this in two steps, first getting the algorithm and then calling crypto_init_spawn. This meant that each spawn user had to be aware of what type and mask to use for these two steps. This is difficult and also presents a problem when the type/mask changes as they're about to be for IV generators. The new interface does both steps together just like crypto_alloc_ablkcipher. As a side-effect this also allows us to be stronger on type enforcement for spawns. For now this is only done for ablkcipher but it's trivial to extend for other types. This patch also moves the type/mask logic for skcipher into the helpers crypto_skcipher_type and crypto_skcipher_mask. Finally this patch introduces the function crypto_require_sync to determine whether the user is specifically requesting a sync algorithm. Signed-off-by: Herbert Xu commit 84c911523020a2e39b307a2da26ee1886b7214fe Author: Herbert Xu Date: Mon Dec 17 21:42:08 2007 +0800 [CRYPTO] gcm: Add support for async ciphers This patch adds the necessary changes for GCM to be used with async ciphers. This would allow it to be used with hardware devices that support CTR. Signed-off-by: Herbert Xu commit 5311f248b7764ba8b59e6d477355f766e5609686 Author: Herbert Xu Date: Mon Dec 17 21:34:32 2007 +0800 [CRYPTO] ctr: Refactor into ctr and rfc3686 As discussed previously, this patch moves the basic CTR functionality into a chainable algorithm called ctr. The IPsec-specific variant of it is now placed on top with the name rfc3686. So ctr(aes) gives a chainable cipher with IV size 16 while the IPsec variant will be called rfc3686(ctr(aes)). This patch also adjusts gcm accordingly. Signed-off-by: Herbert Xu commit 653ebd9c8510a7d647ed23e66e1338f848ebdbab Author: Herbert Xu Date: Tue Nov 27 19:48:27 2007 +0800 [CRYPTO] blkcipher: Merge ablkcipher and blkcipher into one option/module With the impending addition of the givcipher type, both blkcipher and ablkcipher algorithms will use it to create givcipher objects. As such it no longer makes sense to split the system between ablkcipher and blkcipher. In particular, both ablkcipher.c and blkcipher.c would need to use the givcipher type which has to reside in ablkcipher.c since it shares much code with it. This patch merges the two Kconfig options as well as the modules into one. Signed-off-by: Herbert Xu commit 2589469d7bc69bdfad4e05d88a0d2748f92ef0f3 Author: Herbert Xu Date: Wed Dec 12 19:16:38 2007 +0800 [CRYPTO] gcm: Fix request context alignment This patch fixes the request context alignment so that it is actually aligned to the value required by the algorithm. Signed-off-by: Herbert Xu commit 68b6c7d6919be7c732fc6229c55e35d0166e9258 Author: Herbert Xu Date: Fri Dec 7 20:18:17 2007 +0800 [CRYPTO] api: Add crypto_attr_alg_name This patch adds a new helper crypto_attr_alg_name which is basically the first half of crypto_attr_alg. That is, it returns an algorithm name parameter as a string without looking it up. The caller can then look it up immediately or defer it until later. Signed-off-by: Herbert Xu commit 551a09a7a954f720067f207657bbbd26a3fe156a Author: Herbert Xu Date: Sat Dec 1 21:47:07 2007 +1100 [CRYPTO] api: Sanitise mask when allocating ablkcipher/hash When allocating ablkcipher/hash objects, we use a mask that's wider than the usual type mask. This patch sanitises the mask supplied by the user so we don't end up using a narrower mask which may lead to unintended results. Signed-off-by: Herbert Xu commit 5e553110f27ff77591ec7305c6216ad6949f7a95 Author: Borislav Petkov Date: Fri Dec 14 16:43:32 2007 +0800 [CRYPTO] authenc: Select HASH in Kconfig i get here: ---- LD vmlinux SYSMAP System.map SYSMAP .tmp_System.map Building modules, stage 2. MODPOST 226 modules ERROR: "crypto_hash_type" [crypto/authenc.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 --- which fails because crypto_hash_type is declared in crypto/hash.c. You might wanna fix it like so: Signed-off-by: Borislav Petkov Signed-off-by: Herbert Xu commit f17922bc75d6261dd6e0e2d687ff43b96e91e04a Author: Adrian Bunk Date: Wed Dec 12 10:42:41 2007 +0800 [CRYPTO] geode: Add __dev{init,exit} annotations This patch adds __dev{init,exit} annotations. Signed-off-by: Adrian Bunk Signed-off-by: Herbert Xu commit 7c3d703fa81db42f9766325cebd6bfc1c5eac838 Author: Herbert Xu Date: Mon Dec 10 16:15:41 2007 +0800 [CRYPTO] authenc: Merge common hashing code This patch merges the common hashing code between encryption and decryption. Signed-off-by: Herbert Xu commit 12dc5e62b4f93f1d399fd81e35be3f9ea0027712 Author: Herbert Xu Date: Mon Dec 10 10:55:21 2007 +0800 [CRYPTO] authenc: Use RTA_OK to check length This patch changes setkey to use RTA_OK to check the validity of the setkey request. Signed-off-by: Herbert Xu commit c2c61f513db395ddd8d67690bf3301ebe1e8155a Author: Herbert Xu Date: Mon Dec 10 10:54:44 2007 +0800 [CRYPTO] authenc: Fix typo in ivsize The ivsize should be fetched from ablkcipher, not blkcipher. Signed-off-by: Herbert Xu commit 2d74d405fc5ea78b20a4a2efd24201db424e07b1 Author: Sebastian Siewior Date: Mon Dec 10 15:49:41 2007 +0800 [CRYPTO] s390-aes: Use correct encrypt/decrypt function in fallback crypto_blkcipher_decrypt is wrong because it does not care about the IV. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit fdc520aa693d462f4958339534a3b596f95795b7 Author: Sebastian Siewior Date: Mon Dec 10 15:48:17 2007 +0800 [CRYPTO] geode: Use correct encrypt/decrypt function in fallback crypto_blkcipher_decrypt is wrong because it does not care about the IV. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 5de8f1b562e87ae9d93a4e0897e54c18a5e82915 Author: Tan Swee Heng Date: Fri Dec 7 17:17:43 2007 +0800 [CRYPTO] tcrypt: Added salsa20 speed test This patch adds a simple speed test for salsa20. Usage: modprobe tcrypt mode=206 Signed-of-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 0b77abb3b2d0c2eee1da79a3f3bd4312a0edb156 Author: Zoltan Sogor Date: Fri Dec 7 16:53:23 2007 +0800 [CRYPTO] lzo: Add LZO compression algorithm support Add LZO compression algorithm support Signed-off-by: Zoltan Sogor Signed-off-by: Herbert Xu commit 91755a921c4af51c355bcb74a98b717d5c1818b6 Author: Zoltan Sogor Date: Fri Dec 7 16:48:11 2007 +0800 [CRYPTO] tcrypt: Add common compression tester function Add common compression tester function Modify deflate test case to use the common compressor test function Signed-off-by: Zoltan Sogor Signed-off-by: Herbert Xu commit 8bff664cdf8797564fb6b59b7be028846fab8c27 Author: Tan Swee Heng Date: Fri Dec 7 16:41:29 2007 +0800 [CRYPTO] tcrypt: Salsa20 large test vector This is a large test vector for Salsa20 that crosses the 4096-bytes page boundary. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit eb6f13eb9f812f5812ed5d14f241309da369dee6 Author: Tan Swee Heng Date: Fri Dec 7 16:38:45 2007 +0800 [CRYPTO] salsa20_generic: Fix multi-page processing This patch fixes the multi-page processing bug that affects large test vectors (the same bug that previously affected ctr.c). There is an optimization for the case walk.nbytes == nbytes. Also we now use crypto_xor() instead of adhoc XOR routines. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 7f6813786a6521380e1756ca5b4336bc63c5bf7d Author: Herbert Xu Date: Thu Dec 6 14:59:53 2007 +0800 [CRYPTO] gcm: Put abreq in private context instead of on stack The abreq structure is currently allocated on the stack. This is broken if the underlying algorithm is asynchronous. This patch changes it so that it's taken from the private context instead which has been enlarged accordingly. Signed-off-by: Herbert Xu commit b2ab4a57b018aafbba35bff088218f5cc3d2142e Author: Herbert Xu Date: Wed Dec 5 20:59:25 2007 +1100 [CRYPTO] scatterwalk: Restore custom sg chaining for now Unfortunately the generic chaining hasn't been ported to all architectures yet, and notably not s390. So this patch restores the chainging that we've been using previously which does work everywhere. Signed-off-by: Herbert Xu commit 42c271c6c538857cb13c5ead5184d264d745f675 Author: Herbert Xu Date: Fri Dec 7 18:52:49 2007 +0800 [CRYPTO] scatterwalk: Move scatterwalk.h to linux/crypto The scatterwalk infrastructure is used by algorithms so it needs to move out of crypto for future users that may live in drivers/crypto or asm/*/crypto. Signed-off-by: Herbert Xu commit fe70f5dfe1a7b5caab96531089dac3d8728c0ebd Author: Herbert Xu Date: Tue Dec 4 20:07:27 2007 +1100 [CRYPTO] aead: Return EBADMSG for ICV mismatch This patch changes gcm/authenc to return EBADMSG instead of EINVAL for ICV mismatches. This convention has already been adopted by IPsec. Signed-off-by: Herbert Xu commit 6160b289929c0b622e64aa36106d8e6e53fcd826 Author: Herbert Xu Date: Tue Dec 4 19:17:50 2007 +1100 [CRYPTO] gcm: Fix ICV handling The crypto_aead convention for ICVs is to include it directly in the output. If we decided to change this in future then we would make the ICV (if the algorithm has an explicit one) available in the request itself. For now no algorithm needs this so this patch changes gcm to conform to this convention. It also adjusts the tcrypt aead tests to take this into account. Signed-off-by: Herbert Xu commit 8df213d9b520a4b58b7a8f7f2200324d4e40363d Author: Herbert Xu Date: Sun Dec 2 14:55:47 2007 +1100 [CRYPTO] tcrypt: Make gcm available as a standalone test Currently the gcm(aes) tests have to be taken together with all other ciphers. This patch makes it available by itself at number 35. Signed-off-by: Herbert Xu commit 481f34ae752ac74c4cbd88a9954dd4ed10e84f81 Author: Herbert Xu Date: Tue Dec 4 20:04:21 2007 +1100 [CRYPTO] authenc: Fix hash verification The previous code incorrectly included the hash in the verification which also meant that we'd crash and burn when it comes to actually verifying the hash since we'd go past the end of the SG list. This patch fixes that by subtracting authsize from cryptlen at the start. Signed-off-by: Herbert Xu commit e236d4a89a2ffbc8aa18064161f4f159c4d89b4a Author: Herbert Xu Date: Thu Nov 22 23:11:53 2007 +0800 [CRYPTO] authenc: Move enckeylen into key itself Having enckeylen as a template parameter makes it a pain for hardware devices that implement ciphers with many key sizes since each one would have to be registered separately. Since the authenc algorithm is mainly used for legacy purposes where its key is going to be constructed out of two separate keys, we can in fact embed this value into the key itself. This patch does this by prepending an rtnetlink header to the key that contains the encryption key length. Signed-off-by: Herbert Xu commit 7ba683a6deba70251756aa5a021cdaa5c875a7a2 Author: Herbert Xu Date: Sun Dec 2 18:49:21 2007 +1100 [CRYPTO] aead: Make authsize a run-time parameter As it is authsize is an algorithm paramter which cannot be changed at run-time. This is inconvenient because hardware that implements such algorithms would have to register each authsize that they support separately. Since authsize is a property common to all AEAD algorithms, we can add a function setauthsize that sets it at run-time, just like setkey. This patch does exactly that and also changes authenc so that authsize is no longer a parameter of its template. Signed-off-by: Herbert Xu commit e29bc6ad0e84e3157e0f49130a15b278cb232c72 Author: Herbert Xu Date: Thu Nov 22 22:46:40 2007 +0800 [CRYPTO] authenc: Use or instead of max on alignment masks Since alignment masks are always one less than a power of two, we can use binary or to find their maximum. Signed-off-by: Herbert Xu commit 9aa6ad3e87af58b4fc87bd4beef1d4c6d9a4c5b7 Author: Kamalesh Babulal Date: Sat Dec 1 12:52:35 2007 +1100 [HWRNG] pasemi: Add missing wait argument to data_present drivers/char/hw_random/pasemi-rng.c: In function `pasemi_rng_data_present': drivers/char/hw_random/pasemi-rng.c:53: error: `wait' undeclared (first use in this function) drivers/char/hw_random/pasemi-rng.c:53: error: (Each undeclared identifier is reported only once drivers/char/hw_random/pasemi-rng.c:53: error: for each function it appears in.) drivers/char/hw_random/pasemi-rng.c: At top level: drivers/char/hw_random/pasemi-rng.c:93: warning: initialization from incompatible pointer type Signed-off-by: Kamalesh Babulal Signed-off-by: Andrew Morton Signed-off-by: Herbert Xu commit b0c3e75d857f3785a4b274e26b1c0b2327580dda Author: Sebastian Siewior Date: Sat Dec 1 12:47:37 2007 +1100 [CRYPTO] aes_s390: Add fallback driver Some CPUs support only 128 bit keys in HW. This patch adds SW fallback support for the other keys which may be required. The generic algorithm (and the block mode) must be availble in case of a fallback. Signed-off-by: Sebastian Siewior Signed-off-by: Jan Glauber Signed-off-by: Herbert Xu commit a10e11946bb2d59516a5252b1b588e2963a13ebe Author: Denis Cheng Date: Fri Nov 30 16:59:30 2007 +1100 [CRYPTO] tcrypt: Use print_hex_dump from linux/kernel.h These utilities implemented in lib/hexdump.c are more handy, please use this. Signed-off-by: Denis Cheng Signed-off-by: Herbert Xu commit d2456c66236c15d6462f1ac751cdbd48a34e9704 Author: Sebastian Siewior Date: Fri Nov 30 16:36:57 2007 +1100 [CRYPTO] geode: do not copy the IV too often There is no reason to keep the IV in the private structre. Instead keep just a pointer to make the patch smaller :) This also remove a few memcpy()s Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 9617d6ef6278edd04070ae404c871f65a466c6d2 Author: Jan Glauber Date: Fri Nov 30 15:57:05 2007 +1100 [CRYPTO] tcrypt: AES CBC test vectors from NIST SP800-38A Add test vectors to tcrypt for AES in CBC mode for key sizes 192 and 256. The test vectors are copied from NIST SP800-38A. Signed-off-by: Jan Glauber Signed-off-by: Herbert Xu commit a773edb3ed0c3288f5ae76adc7d48c934ccfcf8c Author: Tan Swee Heng Date: Fri Nov 30 00:36:07 2007 +1100 [CRYPTO] tcrypt: AES CTR large test vector This patch adds a large AES CTR mode test vector. The test vector is 4100 bytes in size. It was generated using a C++ program that called Crypto++. Note that this patch increases considerably the size of "struct cipher_testvec" and hence the size of tcrypt.ko. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 6d1a69d53a34e6d906551d92e7639b739332b177 Author: Tan Swee Heng Date: Fri Nov 30 00:30:11 2007 +1100 [CRYPTO] tcrypt: Support for large test vectors Currently the number of entries in a cipher test vector template is limited by TVMEMSIZE/sizeof(struct cipher_testvec). This patch circumvents the problem by pointing cipher_tv to each entry in the template, rather than the template itself. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 0971eb0de9446b66bd45696338f54948314db379 Author: Herbert Xu Date: Fri Nov 30 00:23:53 2007 +1100 [CRYPTO] ctr: Fix multi-page processing When the data spans across a page boundary, CTR may incorrectly process a partial block in the middle because the blkcipher walking code may supply partial blocks in the middle as long as the total length of the supplied data is more than a block. CTR is supposed to return any unused partial block in that case to the walker. This patch fixes this by doing exactly that, returning partial blocks to the walker unless we received less than a block-worth of data to start with. This also allows us to optimise the bulk of the processing since we no longer have to worry about partial blocks until the very end. Thanks to Tan Swee Heng for fixes and actually testing this :) Signed-off-by: Herbert Xu commit 06e1a8f0505426a97292174a959560fd86ea0a3d Author: Sebastian Siewior Date: Fri Nov 30 00:15:11 2007 +1100 [CRYPTO] aes-asm: Merge common glue code 32 bit and 64 bit glue code is using (now) the same piece code. This patch unifies them. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 28db8e3e38e593d22e2c69942bb1ca7be2a35f05 Author: Mikko Herranen Date: Mon Nov 26 22:24:11 2007 +0800 [CRYPTO] gcm: New algorithm Add GCM/GMAC support to cryptoapi. GCM (Galois/Counter Mode) is an AEAD mode of operations for any block cipher with a block size of 16. The typical example is AES-GCM. Signed-off-by: Mikko Herranen Reviewed-by: Mika Kukkonen Signed-off-by: Herbert Xu commit e3a4ea4fd2e5f154ae9233f1ce30e7564e5cbcfc Author: Mikko Herranen Date: Mon Nov 26 22:12:07 2007 +0800 [CRYPTO] tcrypt: Add aead support Add AEAD support to tcrypt, needed by GCM. Signed-off-by: Mikko Herranen Reviewed-by: Mika Kukkonen Signed-off-by: Herbert Xu commit ff85a8082f0665fe6f79d50eb79bdccb98cabfa2 Author: Denys Vlasenko Date: Fri Nov 23 21:21:03 2007 +0800 [CRYPTO] camellia: Move more common code into camellia_setup_tail Analogously to camellia7 patch, move "absorb kw2 to other subkeys" and "absorb kw4 to other subkeys" code parts into camellia_setup_tail(). This further reduces source and object code size at the cost of two brances in key setup code. Signed-off-by: Denys Vlasenko Signed-off-by: Herbert Xu commit dedcf8b0647572ca00547efef58dfab6b8dddf83 Author: Denys Vlasenko Date: Fri Nov 23 21:14:24 2007 +0800 [CRYPTO] camellia: Move common code into camellia_setup_tail Move "key XOR is end of F-function" code part into camellia_setup_tail(), it is sufficiently similar between camellia_setup128 and camellia_setup256. Signed-off-by: Denys Vlasenko Signed-off-by: Herbert Xu commit acca79a664859e3ddaea87af86d4ccfb2e07cd65 Author: Denys Vlasenko Date: Fri Nov 23 21:10:03 2007 +0800 [CRYPTO] camellia: Merge encrypt/decrypt routines for all key lengths unifies encrypt/decrypt routines for different key lengths. This reduces module size by ~25%, with tiny (less than 1%) speed impact. Also collapses encrypt/decrypt into more readable (visually shorter) form using macros. Signed-off-by: Denys Vlasenko Signed-off-by: Herbert Xu commit 2ddae4a64491f790799e2adbfaec72a23dc2e7ef Author: Denys Vlasenko Date: Fri Nov 23 21:05:55 2007 +0800 [CRYPTO] camellia: Code shrink Remove unused macro params. Use (u8)(expr) instead of (expr) & 0xff, helps gcc to realize how to use simpler commands. Move CAMELLIA_FLS macro closer to encrypt/decrypt routines. Signed-off-by: Denys Vlasenko Signed-off-by: Herbert Xu commit 3f8214ea335e422702340d7e835921e78367f99d Author: Herbert Xu Date: Tue Nov 20 20:32:56 2007 +0800 [CRYPTO] ctr: Use crypto_inc and crypto_xor This patch replaces the custom inc/xor in CTR with the generic functions. Signed-off-by: Herbert Xu commit d0b9007a27206fe944d9db72e13dab157b8e118c Author: Herbert Xu Date: Tue Nov 20 17:49:49 2007 +0800 [CRYPTO] pcbc: Use crypto_xor This patch replaces the custom xor in CBC with the generic crypto_xor. It changes the operations for in-place encryption slightly to avoid calling crypto_xor with tmpbuf since it is not necessarily aligned. Signed-off-by: Herbert Xu commit 50b6544e1371bfe884f787107a8de0c2f8546e8f Author: Herbert Xu Date: Tue Nov 20 17:36:00 2007 +0800 [CRYPTO] cbc: Require block size to be a power of 2 All common block ciphers have a block size that's a power of 2. In fact, all of our block ciphers obey this rule. If we require this then CBC can be optimised to avoid an expensive divide on in-place decryption. I've also changed the saving of the first IV in the in-place decryption case to the last IV because that lets us use walk->iv (which is already aligned) for the xor operation where alignment is required. Signed-off-by: Herbert Xu commit 3c7f076da557eadb37240d70b0399ff9763fa2ae Author: Herbert Xu Date: Tue Nov 20 17:33:39 2007 +0800 [CRYPTO] cbc: Use crypto_xor This patch replaces the custom xor in CBC with the generic crypto_xor. Signed-off-by: Herbert Xu commit 7613636def82092a5c7b6322078a2af832410417 Author: Herbert Xu Date: Tue Nov 20 17:26:06 2007 +0800 [CRYPTO] api: Add crypto_inc and crypto_xor With the addition of more stream ciphers we need to curb the proliferation of ad-hoc xor functions. This patch creates a generic pair of functions, crypto_inc and crypto_xor which does big-endian increment and exclusive or, respectively. For optimum performance, they both use u32 operations so alignment must be as that of u32 even though the arguments are of type u8 *. Signed-off-by: Herbert Xu commit fcd06755936d2209b69650d2a7cc99cbcd3ccc67 Author: Patrick McHardy Date: Wed Nov 21 12:51:52 2007 +0800 [HIFN]: Add support for using the random number generator Signed-off-by: Patrick McHardy Acked-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit 37a8023ce59bfc1fa24067fd94aee7b286f4c01b Author: Patrick McHardy Date: Wed Nov 21 12:47:13 2007 +0800 [HIFN]: Improve PLL initialization The current PLL initalization has a number of deficiencies: - uses fixed multiplier of 8, which overclocks the chip when using a reference clock that operates at frequencies above 33MHz. According to a comment in the BSD source, this is true for the external clock on almost all every board. - writes to a reserved bit - doesn't follow the initialization procedure specified in chapter 6.11.1 of the HIFN hardware users guide - doesn't allow to use the PCI clock This patch adds a module parameter to specify the reference clock (pci or external) and its frequency and uses that to calculate the optimum multiplier to reach the maximal speed. By default it uses the external clock and assumes a speed of 66MHz, which effectively halfs the frequency currently used. Signed-off-by: Patrick McHardy Acked-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit 984e976f5382ff09351ddd3b023937611396d739 Author: Patrick McHardy Date: Wed Nov 21 12:24:45 2007 +0800 [HWRNG]: move status polling loop to data_present callbacks Handle waiting for new random within the drivers themselves, this allows to use better suited timeouts for the individual rngs. Signed-off-by: Patrick McHardy Acked-by: Michael Buesch Signed-off-by: Herbert Xu commit 2407d60872dd2a95404c6048f775f3b64d438f4b Author: Tan Swee Heng Date: Fri Nov 23 19:45:00 2007 +0800 [CRYPTO] salsa20: Salsa20 stream cipher This patch implements the Salsa20 stream cipher using the blkcipher interface. The core cipher code comes from Daniel Bernstein's submission to eSTREAM: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/ref/ The test vectors comes from: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/ It has been tested successfully with "modprobe tcrypt mode=34" on an UML instance. Signed-off-by: Tan Swee Heng Signed-off-by: Herbert Xu commit 332f8840f7095d294f9bb066b175a100bcde214c Author: Herbert Xu Date: Thu Nov 15 22:36:07 2007 +0800 [CRYPTO] ablkcipher: Add distinct ABLKCIPHER type Up until now we have ablkcipher algorithms have been identified as type BLKCIPHER with the ASYNC bit set. This is suboptimal because ablkcipher refers to two things. On the one hand it refers to the top-level ablkcipher interface with requests. On the other hand it refers to and algorithm type underneath. As it is you cannot request a synchronous block cipher algorithm with the ablkcipher interface on top. This is a problem because we want to be able to eventually phase out the blkcipher top-level interface. This patch fixes this by making ABLKCIPHER its own type, just as we have distinct types for HASH and DIGEST. The type it associated with the algorithm implementation only. Which top-level interface is used for synchronous block ciphers is then determined by the mask that's used. If it's a specific mask then the old blkcipher interface is given, otherwise we go with the new ablkcipher interface. Signed-off-by: Herbert Xu commit 86f578de5ba6ea11ead9284d9f036fee01ba5893 Author: Herbert Xu Date: Thu Nov 15 19:00:06 2007 +0800 [CRYPTO] doc: Update api-intro.txt This patch updates the list of transforms we support and clarifies that the Block Ciphers interface in fact supports all ciphers including stream ciphers. It also removes the obsolete Configuration Notes section and adds the linux-crypto mailing list as the primary bug reporting address. Finally it documents the fact that setkey should only be called from user context. Signed-off-by: Herbert Xu commit 468577abe37ff7b453a9ac613e0ea155349203ae Author: Herbert Xu Date: Thu Nov 15 12:08:45 2007 +0800 [CRYPTO] scatterwalk: Use generic scatterlist chaining This patch converts the crypto scatterwalk code to use the generic scatterlist chaining rather the version specific to crypto. Signed-off-by: Herbert Xu commit 102d49d3d0f0f471b338b6805001fc3ca7bf663b Author: Andrew Morton Date: Tue Nov 13 21:55:28 2007 +0800 [CRYPTO] hifn: Add missing includes alpha: drivers/crypto/hifn_795x.c: In function 'ablkcipher_walk_init': drivers/crypto/hifn_795x.c:1231: error: implicit declaration of function 'sg_init_table' drivers/crypto/hifn_795x.c:1243: error: implicit declaration of function 'sg_set_page' drivers/crypto/hifn_795x.c: In function 'ablkcipher_walk_exit': drivers/crypto/hifn_795x.c:1257: error: implicit declaration of function 'sg_page' drivers/crypto/hifn_795x.c:1257: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast drivers/crypto/hifn_795x.c: In function 'ablkcipher_add': drivers/crypto/hifn_795x.c:1278: warning: passing argument 1 of 'kmap_atomic' makes pointer from integer without a cast drivers/crypto/hifn_795x.c: In function 'ablkcipher_walk': drivers/crypto/hifn_795x.c:1336: warning: passing argument 1 of 'kmap_atomic' makes pointer from integer without a cast drivers/crypto/hifn_795x.c: In function 'hifn_setup_session': drivers/crypto/hifn_795x.c:1465: warning: assignment makes pointer from integer without a cast drivers/crypto/hifn_795x.c:1469: warning: assignment makes pointer from integer without a cast drivers/crypto/hifn_795x.c:1472: warning: assignment makes pointer from integer without a cast drivers/crypto/hifn_795x.c: In function 'ablkcipher_get': drivers/crypto/hifn_795x.c:1593: warning: passing argument 1 of 'kmap_atomic' makes pointer from integer without a cast {standard input}: Assembler messages: {standard input}:7: Warning: setting incorrect section attributes for .got drivers/crypto/hifn_795x.c: In function 'hifn_process_ready': drivers/crypto/hifn_795x.c:1653: warning: passing argument 1 of 'kmap_atomic' makes pointer from integer without a cast drivers/crypto/hifn_795x.c: In function 'hifn_probe': drivers/crypto/hifn_795x.c:2438: error: 'DMA_32BIT_MASK' undeclared (first use in this function) drivers/crypto/hifn_795x.c:2438: error: (Each undeclared identifier is reported only once drivers/crypto/hifn_795x.c:2438: error: for each function it appears in.) drivers/crypto/hifn_795x.c:2443: warning: format '%d' expects type 'int', but argument 4 has type 'long int' drivers/crypto/hifn_795x.c:2443: warning: format '%d' expects type 'int', but argument 4 has type 'long int' Signed-off-by: Andrew Morton Signed-off-by: Herbert Xu commit 2707b937f322ba6b437f3dd1de05b9bb9756d803 Author: Jan Glauber Date: Mon Nov 12 21:56:38 2007 +0800 [CRYPTO] hifn: Make Kconfig option depend on PCI The HIFN driver is currently selectable on s390 but wont compile. Since it looks like HIFN needs PCI make the Kconfig dependent on PCI, which is not available on s390. Signed-off-by: Jan Glauber Acked-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit a1e6ef2f1e01f2aa9ed930e1089fc85dc745bf7a Author: Evgeniy Polyakov Date: Sat Nov 10 20:24:18 2007 +0800 [CRYPTO] hifn: Schedule callback invocation to tasklet. This patch forces HIFN driver to invoke crypto request callbacks from tasklet (softirq context) instead of hardirq context, since network stack expects it to be called from bottom halves. It is done by simply scheduling callback invocation via dedicated tasklet. Workqueue solution was dropped because of tooo slow rescheduling performance (7 times slower than tasklet, for mode details one can check this link: http://tservice.net.ru/~s0mbre/blog/devel/other/2007_11_09.html). Driver passed all AES and DES tests in tcryt.c module. Signed-off-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit cd12fb906d2591e80da9edcbd4794b9b916d7489 Author: Jonathan Lynch Date: Sat Nov 10 20:08:25 2007 +0800 [CRYPTO] sha256-generic: Extend sha256_generic.c to support SHA-224 Resubmitting this patch which extends sha256_generic.c to support SHA-224 as described in FIPS 180-2 and RFC 3874. HMAC-SHA-224 as described in RFC4231 is then supported through the hmac interface. Patch includes test vectors for SHA-224 and HMAC-SHA-224. SHA-224 chould be chosen as a hash algorithm when 112 bits of security strength is required. Patch generated against the 2.6.24-rc1 kernel and tested against 2.6.24-rc1-git14 which includes fix for scatter gather implementation for HMAC. Signed-off-by: Jonathan Lynch Signed-off-by: Herbert Xu commit cd7c3bfe54270f41ac52be6b725a7194d99175b4 Author: Sebastian Siewior Date: Sat Nov 10 19:29:33 2007 +0800 [CRYPTO] geode: Add fallback for unsupported modes The Geode AES crypto engine supports only 128 bit long key. This patch adds fallback for other key sizes which are required by the AES standard. Signed-off-by: Sebastian Siewior Acked-by: Jordan Crouse Signed-off-by: Herbert Xu commit 5157dea8139cf0edc4834d528531e642c0d27e37 Author: Sebastian Siewior Date: Sat Nov 10 19:07:16 2007 +0800 [CRYPTO] aes-i586: Remove setkey The setkey() function can be shared with the generic algorithm. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit b345cee90a3ffec5eca6d6c1c59bd0d1feb453d4 Author: Sebastian Siewior Date: Thu Nov 8 21:27:05 2007 +0800 [CRYPTO] ctr: Remove default M NO other block mode is M by default. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 81190b321548bb0bf2d6e1f172695275b0fd1363 Author: Sebastian Siewior Date: Thu Nov 8 21:25:04 2007 +0800 [CRYPTO] aes-x86-64: Remove setkey The setkey() function can be shared with the generic algorithm. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 96e82e4551d38e0863b366a7b61185bc4a9946cc Author: Sebastian Siewior Date: Thu Nov 8 21:20:30 2007 +0800 [CRYPTO] aes-generic: Make key generation exportable This patch exports four tables and the set_key() routine. This ressources can be shared by other AES implementations (aes-x86_64 for instance). The decryption key has been turned around (deckey[0] is the first piece of the key instead of deckey[keylen+20]). The encrypt/decrypt functions are looking now identical (except they are using different tables and key). Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit be5fb270125729b7bca7879967f1dfadff0d9841 Author: Sebastian Siewior Date: Thu Nov 8 20:39:26 2007 +0800 [CRYPTO] aes-generic: Coding style cleanup Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 41fdab3dd385dde36caae60ed2df82aecb7a32f0 Author: Joy Latten Date: Wed Nov 7 22:59:47 2007 +0800 [CRYPTO] ctr: Add countersize This patch adds countersize to CTR mode. The template is now ctr(algo,noncesize,ivsize,countersize). For example, ctr(aes,4,8,4) indicates the counterblock will be composed of a salt/nonce that is 4 bytes, an iv that is 8 bytes and the counter is 4 bytes. When noncesize + ivsize < blocksize, CTR initializes the last block - ivsize - noncesize portion of the block to zero. Otherwise the counter block is composed of the IV (and nonce if necessary). If noncesize + ivsize == blocksize, then this indicates that user is passing in entire counterblock. Thus countersize indicates the amount of bytes in counterblock to use as the counter for incrementing. CTR will increment counter portion by 1, and begin encryption with that value. Note that CTR assumes the counter portion of the block that will be incremented is stored in big endian. Signed-off-by: Joy Latten Signed-off-by: Herbert Xu commit d3e7480572bf882dee5baa2891bccbfa3db0b1a1 Author: Denys Vlasenko Date: Tue Nov 6 22:15:19 2007 +0800 [CRYPTO] camellia: De-unrolling Move huge unrolled pieces of code (3 screenfuls) at the end of 128/256 key setup routines into common camellia_setup_tail(), convert it to loop there. Loop is still unrolled six times, so performance hit is very small, code size win is big. Signed-off-by: Denys Vlasenko Acked-by: Noriaki TAKAMIYA Signed-off-by: Herbert Xu commit 1ce73e8d6d95ceb860184c34fa1a91a82e51cbb3 Author: Denys Vlasenko Date: Tue Nov 6 22:13:40 2007 +0800 [CRYPTO] camellia: Code cleanup Optimize GETU32 to use 4-byte memcpy (modern gcc will convert such memcpy to single move instruction on i386). Original GETU32 did four byte fetches, and shifted/XORed those. Signed-off-by: Denys Vlasenko Acked-by: Noriaki TAKAMIYA Signed-off-by: Herbert Xu commit 3a5e5f8108fe440657e8041afd973d2fe72180bb Author: Denys Vlasenko Date: Tue Nov 6 22:05:36 2007 +0800 [CRYPTO] camellia: Code cleanup Rename some macros to shorter names: CAMELLIA_RR8 -> ROR8, making it easier to understand that it is just a right rotation, nothing camellia-specific in it. CAMELLIA_SUBKEY_L() -> SUBKEY_L() - just shorter. Move be32 <-> cpu conversions out of en/decrypt128/256 and into camellia_en/decrypt - no reason to have that code duplicated twice. Signed-off-by: Denys Vlasenko Acked-by: Noriaki TAKAMIYA Signed-off-by: Herbert Xu commit 1721a81256ed7f7bfdd1a721f3a6c9c85efeac53 Author: Denys Vlasenko Date: Tue Nov 6 22:01:20 2007 +0800 [CRYPTO] camellia: Code cleanup Move code blocks around so that related pieces are closer together: e.g. CAMELLIA_ROUNDSM macro does not need to be separated from the rest of the code by huge array of constants. Remove unused macros (COPY4WORD, SWAP4WORD, XOR4WORD[2]) Drop SUBL(), SUBR() macros which only obscure things. Same for CAMELLIA_SP1110() macro and KEY_TABLE_TYPE typedef. Remove useless comments: /* encryption */ -- well it's obvious enough already! void camellia_encrypt128(...) Combine swap with copying at the beginning/end of encrypt/decrypt. Signed-off-by: Denys Vlasenko Acked-by: Noriaki TAKAMIYA Signed-off-by: Herbert Xu commit e2b21b5002a2bf21ca73c7448309a7288a984ddf Author: Denys Vlasenko Date: Fri Oct 26 16:22:57 2007 +0800 [CRYPTO] twofish: Do not unroll big stuff in twofish key setup Currently twofish cipher key setup code has unrolled loops - approximately 70-100 instructions are repeated 40 times. As a result, twofish module is the biggest module in crypto/*. Unrolling produces x2.5 more code (+18k on i386), and speeds up key setup by 7%: unrolled: twofish_setkey/sec: 41128 loop: twofish_setkey/sec: 38148 CALC_K256: ~100 insns each CALC_K192: ~90 insns CALC_K: ~70 insns Attached patch removes this unrolling. $ size */twofish_common.o text data bss dec hex filename 37920 0 0 37920 9420 crypto.org/twofish_common.o 13209 0 0 13209 3399 crypto/twofish_common.o Run tested (modprobe tcrypt reports ok). Please apply. Signed-off-by: Denys Vlasenko Signed-off-by: Herbert Xu commit b7a30da61adc5f252ee97b2a4f3fc23c9d06a08a Author: Sebastian Siewior Date: Sun Oct 21 16:21:25 2007 +0800 [CRYPTO] geode: move defines into a headerfile This patch moves macros in geode-aes.c into geode-aes.h. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 1f4e4773761d0aa622411469b54d6570005a66b1 Author: Sebastian Siewior Date: Sun Oct 21 16:18:12 2007 +0800 [CRYPTO] geode: relax in busy loop and care about return value The code waits in a busy loop until the hardware finishes the encryption or decryption process. This wants a cpu_relax() :) The busy loop finishes either if the encryption is done or if the counter is zero. If the latter is true than the hardware failed. Since this should not happen, leave sith a BUG(). Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 2d506d4fa1df18aa9505820722f834426edc907f Author: Sebastian Siewior Date: Sun Oct 21 16:04:23 2007 +0800 [CRYPTO] geode: use consistent IV copy It is enough if the IV is copied before and after the while loop. With DM-Crypt is seems not be required to save the IV after encrytion because a new one is used in the request (dunno about other users). It is not save to load the IV within while loop and not save afterwards because we mill end up with the wrong IV if the request goes consists of more than one page. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit 89e12654312dddbbdbf17b5adc95b22cb672f947 Author: Sebastian Siewior Date: Wed Oct 17 23:18:57 2007 +0800 [CRYPTO] aes: Move common defines into a header file This three defines are used in all AES related hardware. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit f1901f1fc710ec0fc482a7c98ee4552874139f39 Author: Sebastian Siewior Date: Mon Oct 15 22:09:47 2007 +0800 [CRYPTO] geode: remove alias alias isn't required because the module provides PCI ids. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu commit c3041f9c93e31159f4e321abea7c1549d271e6a7 Author: Evgeniy Polyakov Date: Thu Oct 11 19:58:16 2007 +0800 [CRYPTO] hifn_795x: Detect weak keys HIFN driver update to use DES weak key checks (exported in this patch). Signed-off-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit 16d004a2eda7be2c6a2de63eca2ad3c6b57307b3 Author: Evgeniy Polyakov Date: Thu Oct 11 19:48:58 2007 +0800 [CRYPTO] des: Create header file for common macros This patch creates include/crypto/des.h for common macros shared between DES implementations. Signed-off-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit f7d0561ea1dadec5462846520b1f4fb304294fd5 Author: Evgeniy Polyakov Date: Fri Oct 26 21:31:14 2007 +0800 [CRYPTO] hifn_795x: HIFN 795x driver This is a driver for HIFN 795x crypto accelerator chips. It passed all tests for AES, DES and DES3_EDE except weak test for DES, since hardware can not determine weak keys. Signed-off-by: Evgeniy Polyakov Signed-off-by: Herbert Xu commit 23e353c8a681cc30d42fbd4f2c2be85c44fe209b Author: Joy Latten Date: Tue Oct 23 08:50:32 2007 +0800 [CRYPTO] ctr: Add CTR (Counter) block cipher mode This patch implements CTR mode for IPsec. It is based off of RFC 3686. Please note: 1. CTR turns a block cipher into a stream cipher. Encryption is done in blocks, however the last block may be a partial block. A "counter block" is encrypted, creating a keystream that is xor'ed with the plaintext. The counter portion of the counter block is incremented after each block of plaintext is encrypted. Decryption is performed in same manner. 2. The CTR counterblock is composed of, nonce + IV + counter The size of the counterblock is equivalent to the blocksize of the cipher. sizeof(nonce) + sizeof(IV) + sizeof(counter) = blocksize The CTR template requires the name of the cipher algorithm, the sizeof the nonce, and the sizeof the iv. ctr(cipher,sizeof_nonce,sizeof_iv) So for example, ctr(aes,4,8) specifies the counterblock will be composed of 4 bytes from a nonce, 8 bytes from the iv, and 4 bytes for counter since aes has a blocksize of 16 bytes. 3. The counter portion of the counter block is stored in big endian for conformance to rfc 3686. Signed-off-by: Joy Latten Signed-off-by: Herbert Xu