commit 238c6d54830c624f34ac9cf123ac04aebfca5013 Merge: 8e128ce... a159c1a... Author: Linus Torvalds Date: Mon Jan 5 19:20:59 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm * git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: dm snapshot: extend exception store functions dm snapshot: split out exception store implementations dm snapshot: rename struct exception_store dm snapshot: separate out exception store interface dm mpath: move trigger_event to system workqueue dm: add name and uuid to sysfs dm table: rework reference counting dm: support barriers on simple devices dm request: extend target interface dm request: add caches dm ioctl: allow dm_copy_name_and_uuid to return only one field dm log: ensure log bitmap fits on log device dm log: move region_size validation dm log: avoid reinitialising io_req on every operation dm: consolidate target deregistration error handling dm raid1: fix error count dm log: fix dm_io_client leak on error paths dm snapshot: change yield to msleep dm table: drop reference at unbind commit a159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46 Author: Jonathan Brassow Date: Tue Jan 6 03:05:19 2009 +0000 dm snapshot: extend exception store functions Supply dm_add_exception as a callback to the read_metadata function. Add a status function ready for a later patch and name the functions consistently. Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon commit 4db6bfe02bdc7dc5048f46dd682a94801d029adc Author: Alasdair G Kergon Date: Tue Jan 6 03:05:17 2009 +0000 dm snapshot: split out exception store implementations Move the existing snapshot exception store implementations out into separate files. Later patches will place these behind a new interface in preparation for alternative implementations. Signed-off-by: Alasdair G Kergon commit 1ae25f9c933d1432fbffdf3e126051a974608abf Author: Jonathan Brassow Date: Tue Jan 6 03:05:16 2009 +0000 dm snapshot: rename struct exception_store Rename struct exception_store to dm_exception_store. Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon commit aea53d92f70eeb00ae480e399a997dd55fd5055d Author: Jonathan Brassow Date: Tue Jan 6 03:05:15 2009 +0000 dm snapshot: separate out exception store interface Pull structures that bridge the gap between snapshot and exception store out of dm-snap.h and put them in a new .h file - dm-exception-store.h. This file will define the API for new exception stores. Ultimately, dm-snap.h is unnecessary, since only dm-snap.c should be using it. Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon commit fe9cf30eb8186ef267d1868dc9f12f2d0f40835a Author: Alasdair G Kergon Date: Tue Jan 6 03:05:13 2009 +0000 dm mpath: move trigger_event to system workqueue The same workqueue is used both for sending uevents and processing queued I/O. Deadlock has been reported in RHEL5 when sending a uevent was blocked waiting for the queued I/O to be processed. Use scheduled_work() for the asynchronous uevents instead. Signed-off-by: Alasdair G Kergon commit 784aae735d9b0bba3f8b9faef4c8b30df3bf0128 Author: Milan Broz Date: Tue Jan 6 03:05:12 2009 +0000 dm: add name and uuid to sysfs Implement simple read-only sysfs entry for device-mapper block device. This patch adds a simple sysfs directory named "dm" under block device properties and implements - name attribute (string containing mapped device name) - uuid attribute (string containing UUID, or empty string if not set) The kobject is embedded in mapped_device struct, so no additional memory allocation is needed for initializing sysfs entry. During the processing of sysfs attribute we need to lock mapped device which is done by a new function dm_get_from_kobj, which returns the md associated with kobject and increases the usage count. Each 'show attribute' function is responsible for its own locking. Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon commit d58168763f74d1edbc296d7038c60efe6493fdd4 Author: Mikulas Patocka Date: Tue Jan 6 03:05:10 2009 +0000 dm table: rework reference counting Rework table reference counting. The existing code uses a reference counter. When the last reference is dropped and the counter reaches zero, the table destructor is called. Table reference counters are acquired/released from upcalls from other kernel code (dm_any_congested, dm_merge_bvec, dm_unplug_all). If the reference counter reaches zero in one of the upcalls, the table destructor is called from almost random kernel code. This leads to various problems: * dm_any_congested being called under a spinlock, which calls the destructor, which calls some sleeping function. * the destructor attempting to take a lock that is already taken by the same process. * stale reference from some other kernel code keeps the table constructed, which keeps some devices open, even after successful return from "dmsetup remove". This can confuse lvm and prevent closing of underlying devices or reusing device minor numbers. The patch changes reference counting so that the table destructor can be called only at predetermined places. The table has always exactly one reference from either mapped_device->map or hash_cell->new_map. After this patch, this reference is not counted in table->holders. A pair of dm_create_table/dm_destroy_table functions is used for table creation/destruction. Temporary references from the other code increase table->holders. A pair of dm_table_get/dm_table_put functions is used to manipulate it. When the table is about to be destroyed, we wait for table->holders to reach 0. Then, we call the table destructor. We use active waiting with msleep(1), because the situation happens rarely (to one user in 5 years) and removing the device isn't performance-critical task: the user doesn't care if it takes one tick more or not. This way, the destructor is called only at specific points (dm_table_destroy function) and the above problems associated with lazy destruction can't happen. Finally remove the temporary protection added to dm_any_congested(). Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon commit ab4c1424882be9cd70b89abf2b484add355712fa Author: Andi Kleen Date: Tue Jan 6 03:05:09 2009 +0000 dm: support barriers on simple devices Implement barrier support for single device DM devices This patch implements barrier support in DM for the common case of dm linear just remapping a single underlying device. In this case we can safely pass the barrier through because there can be no reordering between devices. NB. Any DM device might cease to support barriers if it gets reconfigured so code must continue to allow for a possible -EOPNOTSUPP on every barrier bio submitted. - agk Signed-off-by: Andi Kleen Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon commit 7d76345da6ed3927c9cbf5d3f7a7021e8bba7374 Author: Kiyoshi Ueda Date: Tue Jan 6 03:05:07 2009 +0000 dm request: extend target interface This patch adds the following target interfaces for request-based dm. map_rq : for mapping a request rq_end_io : for finishing a request busy : for avoiding performance regression from bio-based dm. Target can tell dm core not to map requests now, and that may help requests in the block layer queue to be bigger by I/O merging. In bio-based dm, this behavior is done by device drivers managing the block layer queue. But in request-based dm, dm core has to do that since dm core manages the block layer queue. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Signed-off-by: Alasdair G Kergon commit 8fbf26ad5b16ad3a826ca7fe3e86700420abed1f Author: Kiyoshi Ueda Date: Tue Jan 6 03:05:06 2009 +0000 dm request: add caches This patch prepares some kmem_caches for request-based dm. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Signed-off-by: Alasdair G Kergon commit 23d39f63aa87e812fd879b8bc32ee6ccfe733de3 Author: Milan Broz Date: Tue Jan 6 03:05:04 2009 +0000 dm ioctl: allow dm_copy_name_and_uuid to return only one field Allow NULL buffer in dm_copy_name_and_uuid if you only want to return one of the fields. (Required by a following patch that adds these fields to sysfs.) Signed-off-by: Milan Broz Reviewed-by: Alasdair G Kergon Signed-off-by: Alasdair G Kergon commit ac1f0ac22c7be908fd33407273b9808bfaedada4 Author: Milan Broz Date: Tue Jan 6 03:05:02 2009 +0000 dm log: ensure log bitmap fits on log device Check that the log bitmap will fit within the log device. Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon commit 2045e88edb4e0c9ce62d317f77dc59d27d9c530e Author: Milan Broz Date: Tue Jan 6 03:05:01 2009 +0000 dm log: move region_size validation Move log size validation from mirror target to log constructor. Removed PAGE_SIZE restriction we no longer think necessary. Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon commit 6f3af01cb0eda0ec50fe1e4cbdf028269dc396fe Author: Takahiro Yasui Date: Tue Jan 6 03:04:59 2009 +0000 dm log: avoid reinitialising io_req on every operation rw_header function updates three members of io_req data every time when I/O is processed. bi_rw and notify.fn are never modified once they get initialized, and so they can be set in advance. header_to_disk() can also be pulled out of write_header() since only one caller needs it and write_header() can be replaced by rw_header() directly. Signed-off-by: Takahiro Yasui Signed-off-by: Alasdair G Kergon commit 10d3bd09a3c25df114f74f7f86e1b58d070bef32 Author: Mikulas Patocka Date: Tue Jan 6 03:04:58 2009 +0000 dm: consolidate target deregistration error handling Change dm_unregister_target to return void and use BUG() for error reporting. dm_unregister_target can only fail because of programming bug in the target driver. It can't fail because of user's behavior or disk errors. This patch changes unregister_target to return void and use BUG if someone tries to unregister non-registered target or unregister target that is in use. This patch removes code duplication (testing of error codes in all dm targets) and reports bugs in just one place, in dm_unregister_target. In some target drivers, these return codes were ignored, which could lead to a situation where bugs could be missed. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon commit d460c65a6a9ec9e0d284864ec3a9a2d1b73f0e43 Author: Jonathan Brassow Date: Tue Jan 6 03:04:57 2009 +0000 dm raid1: fix error count Always increase the error count when I/O on a leg of a mirror fails. The error count is used to decide whether to select an alternative mirror leg. If the target doesn't use the "handle_errors" feature, the error count is not updated and the bio can get requeued forever by the read callback. Fix it by increasing error_count before the handle_errors feature checking. Cc: stable@kernel.org Signed-off-by: Milan Broz Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon commit c7a2bd19b7c1e0bd2c7604c53d2583e91e536948 Author: Takahiro Yasui Date: Tue Jan 6 03:04:56 2009 +0000 dm log: fix dm_io_client leak on error paths In create_log_context function, dm_io_client_destroy function needs to be called, when memory allocation of disk_header, sync_bits and recovering_bits failed, but dm_io_client_destroy is not called. Cc: stable@kernel.org Signed-off-by: Takahiro Yasui Acked-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon commit 90fa1527bddc7147dc0d590ee6184ca88bc50ecf Author: Mikulas Patocka Date: Tue Jan 6 03:04:54 2009 +0000 dm snapshot: change yield to msleep Change yield() to msleep(1). If the thread had realtime priority, yield() doesn't really yield, so the yielding process would loop indefinitely and cause machine lockup. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon commit a1b51e98676932d031f5eec1325b2df4bbdc8f26 Author: Mikulas Patocka Date: Tue Jan 6 03:04:53 2009 +0000 dm table: drop reference at unbind Move one dm_table_put() so that the last reference in the thread gets dropped in __unbind(). This is required for a following patch, dm-table-rework-reference-counting.patch, which will change the logic in such a way that table destructor is called only at specific points in the code. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon commit 8e128ce3318a147903c893de1891f6c2306f8a61 Merge: 0bbb275... 3f874b6... Author: Linus Torvalds Date: Mon Jan 5 19:04:09 2009 -0800 Merge branch 'for-next' of git://git.o-hand.com/linux-mfd * 'for-next' of git://git.o-hand.com/linux-mfd: (30 commits) mfd: Fix section mismatch in da903x mfd: move drivers/i2c/chips/menelaus.c to drivers/mfd mfd: move drivers/i2c/chips/tps65010.c to drivers/mfd mfd: dm355evm msp430 driver mfd: Add missing break from wm3850-core mfd: Add WM8351 support mfd: Support configurable numbers of DCDCs and ISINKs on WM8350 mfd: Handle missing WM8350 platform data mfd: Add WM8352 support mfd: Use irq_to_desc in twl4030 code power_supply: Add Dialog DA9030 battery charger driver mfd: Dialog DA9030 battery charger MFD driver mfd: Register WM8400 codec device mfd: Pass driver_data onto child devices mfd: Fix twl4030-core.c build error mfd: twl4030 regulator bug fixes mfd: twl4030: create some regulator devices mfd: twl4030: cleanup symbols and OMAP dependency mfd: twl4030: simplified child creation code power_supply: Add battery health reporting for WM8350 ... commit 0bbb2753584231db364b624bf8cf82551b94da7d Merge: 0578c3b... 9e01892... Author: Linus Torvalds Date: Mon Jan 5 19:03:39 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: module: convert to stop_machine_create/destroy. stop_machine: introduce stop_machine_create/destroy. parisc: fix module loading failure of large kernel modules module: fix module loading failure of large kernel modules for parisc module: fix warning of unused function when !CONFIG_PROC_FS kernel/module.c: compare symbol values when marking symbols as exported in /proc/kallsyms. remove CONFIG_KMOD commit 0578c3b4d44c34e499e1fd5916ed6c63635b25cf Merge: 7d8a804... 52942b6... Author: Linus Torvalds Date: Mon Jan 5 19:03:11 2009 -0800 Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: swiotlb: Don't include linux/swiotlb.h twice in lib/swiotlb.c intel-iommu: fix build error with INTR_REMAP=y and DMAR=n swiotlb: add missing __init annotations commit 7d8a804c594b61a05c698126165b5dc417d94a0f Merge: c58bd34... 722d742... Author: Linus Torvalds Date: Mon Jan 5 19:02:09 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm: dlm: fs/dlm/ast.c: fix warning dlm: add new debugfs entry dlm: add time stamp of blocking callback dlm: change lock time stamping dlm: improve how bast mode handling dlm: remove extra blocking callback check dlm: replace schedule with cond_resched dlm: remove kmap/kunmap dlm: trivial annotation of be16 value dlm: fix up memory allocation flags commit c58bd34d00e04df9a0691732086cf8102b20d907 Merge: 8606ab6... 88f60f6... Author: Linus Torvalds Date: Mon Jan 5 18:58:06 2009 -0800 Merge branch 'i2c-next' of git://aeryn.fluff.org.uk/bjdooks/linux * 'i2c-next' of git://aeryn.fluff.org.uk/bjdooks/linux: i2c-omap: fix type of irq handler function i2c-s3c2410: Change IRQ to be plain integer. i2c-s3c2410: Allow more than one i2c-s3c2410 adapter i2c-s3c2410: Remove default platform data. i2c-s3c2410: Use platform data for gpio configuration i2c-s3c2410: Fixup style problems from checkpatch.pl i2c-omap: Enable I2C wakeups for 34xx i2c-omap: reprogram OCP_SYSCONFIG register after reset i2c-omap: convert 'rev1' flag to generic 'rev' u8 i2c-omap: fix I2C timeouts due to recursive omap_i2c_{un,}idle() i2c-omap: Clean-up i2c-omap i2c-omap: Don't compile in OMAP15xx I2C ISR for non-OMAP15xx builds i2c-omap: Mark init-only functions as __init i2c-omap: Add support for omap34xx i2c-omap: FIFO handling support and broken hw workaround for i2c-omap i2c-omap: Add high-speed support to omap-i2c i2c-omap: Close suspected race between omap_i2c_idle() and omap_i2c_isr() i2c-omap: Do not use interruptible wait call in omap_i2c_xfer_msg Fix up apparently-trivial conflict in drivers/i2c/busses/i2c-s3c2410.c commit 8606ab6d30dbaaafff985bd462bf33c36997eae9 Merge: c54feba... ed42350... Author: Linus Torvalds Date: Mon Jan 5 18:53:34 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (22 commits) HID: fix error condition propagation in hid-sony driver HID: fix reference count leak hidraw HID: add proper support for pensketch 12x9 tablet HID: don't allow DealExtreme usb-radio be handled by usb hid driver HID: fix default Kconfig setting for TopSpeed driver HID: driver for TopSeed Cyberlink quirky remote HID: make boot protocol drivers depend on EMBEDDED HID: avoid sparse warning in HID_COMPAT_LOAD_DRIVER HID: hiddev cleanup -- handle all error conditions properly HID: force feedback driver for GreenAsia 0x12 PID HID: switch specialized drivers from "default y" to !EMBEDDED HID: set proper dev.parent in hidraw HID: add dynids facility HID: use GFP_KERNEL in hid_alloc_buffers HID: usbhid, use usb_endpoint_xfer_int HID: move usbhid flags to usbhid.h HID: add n-trig digitizer support HID: add phys and name ioctls to hidraw HID: struct device - replace bus_id with dev_name(), dev_set_name() HID: automatically call usbhid_set_leds in usbhid driver ... commit c54febae996d36c630f09209cd9983ecfda3fcad Merge: e42e4ba... eb8374e... Author: Linus Torvalds Date: Mon Jan 5 18:52:54 2009 -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: (27 commits) GFS2: Use DEFINE_SPINLOCK GFS2: Fix use-after-free bug on umount (try #2) Revert "GFS2: Fix use-after-free bug on umount" GFS2: Streamline alloc calculations for writes GFS2: Send useful information with uevent messages GFS2: Fix use-after-free bug on umount GFS2: Remove ancient, unused code GFS2: Move four functions from super.c GFS2: Fix bug in gfs2_lock_fs_check_clean() GFS2: Send some sensible sysfs stuff GFS2: Kill two daemons with one patch GFS2: Move gfs2_recoverd into recovery.c GFS2: Fix "truncate in progress" hang GFS2: Clean up & move gfs2_quotad GFS2: Add more detail to debugfs glock dumps GFS2: Banish struct gfs2_rgrpd_host GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd GFS2: Move rg_igeneration into struct gfs2_rgrpd GFS2: Banish struct gfs2_dinode_host GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize ... commit e42e4ba07bc72c0eb7c7ab3bf9e5076db90d0f37 Author: Linus Torvalds Date: Mon Jan 5 18:47:12 2009 -0800 igb: fix anoying type mismatch warning on rx/tx queue sizing When using "min()", the types of both sides should match. With the cpu mask changes, the type of num_online_cpus() will now depend on config options. Use "min_t()" with an explicit type instead. And make the rx/tx case look the same too, just for sanity. Signed-off-by: Linus Torvalds commit 7a1fcd5f5130f173b5e824135735ec58f245563e Merge: 15b0669... 4696b64... Author: Linus Torvalds Date: Mon Jan 5 18:45:06 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: (30 commits) sparc: Fix minor SPARC32 compile error sparc: Remove reg*.h from Kbuild sparc: Clean arch-specific code in prom_common.c sparc: Kill asm/reg*.h sparc: Use 64BIT config entry MAINTAINERS: update sparc maintainer sparc: unify ipcbuf.h sparc: Update 64-bit defconfig. sparc: remove NO_PROC_ID - it is no longer used sparc: drop get_tbr() in traps.h sparc: fix warning in userspace header traps.h sparc: fix warnings in userspace header byteorder.h sparc: fix warning in userspace header jsflash.h sparc: unify openprom.h sparc64: delete unused linux_prom64_ranges from openprom_64.h sparc: prepare openprom for unification sparc: remove linux_prom_pci_assigned_addresses from openprom_32.h sparc: remove ebus definitions from openprom*.h sparc: unify siginfo.h sparc: unify ptrace.h ... commit 15b0669072127f282896b3bef2e9df4ec5d7264f Merge: c155b91... 3537d54... Author: Linus Torvalds Date: Mon Jan 5 18:44:59 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (44 commits) qlge: Fix sparse warnings for tx ring indexes. qlge: Fix sparse warning regarding rx buffer queues. qlge: Fix sparse endian warning in ql_hw_csum_setup(). qlge: Fix sparse endian warning for inbound packet control block flags. qlge: Fix sparse warnings for byte swapping in qlge_ethool.c myri10ge: print MAC and serial number on probe failure pkt_sched: cls_u32: Fix locking in u32_change() iucv: fix cpu hotplug af_iucv: Free iucv path/socket in path_pending callback af_iucv: avoid left over IUCV connections from failing connects af_iucv: New error return codes for connect() net/ehea: bitops work on unsigned longs Revert "net: Fix for initial link state in 2.6.28" tcp: Kill extraneous SPLICE_F_NONBLOCK checks. tcp: don't mask EOF and socket errors on nonblocking splice receive dccp: Integrate the TFRC library with DCCP dccp: Clean up ccid.c after integration of CCID plugins dccp: Lockless integration of CCID congestion-control plugins qeth: get rid of extra argument after printk to dev_* conversion qeth: No large send using EDDP for HiperSockets. ... commit c155b914651753f843445d2f860bc00137df5d52 Merge: e9af797... 3a5e1d1... Author: Linus Torvalds Date: Mon Jan 5 18:34:12 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: ice1724 - Fix a typo in IEC958 PCM name ASoC: fix davinci-sffsdr buglet ALSA: sound/usb: Use negated usb_endpoint_xfer_control, etc ALSA: hda - cxt5051 report jack state ALSA: hda - add basic jack reporting functions to patch_conexant.c ALSA: Use usb_set/get_intfdata ASoC: Clean up kerneldoc warnings ASoC: Fix pxa2xx-pcm checks for invalid DMA channels LSA: hda - Add HP Acacia detection ALSA: hda - fix name for ALC1200 ALSA: sound/usb: use USB API functions rather than constants ASoC: TWL4030: DAPM based capture implementation ASoC: TWL4030: Make the enum filter generic for twl4030 commit e9af797d757d358f60130de6ca59ee658d666561 Merge: 10cc04f... 187d9f4... Author: Linus Torvalds Date: Mon Jan 5 18:33:38 2009 -0800 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Fix on resume, now preserves user policy min/max. [CPUFREQ] Add Celeron Core support to p4-clockmod. [CPUFREQ] add to speedstep-lib additional fsb values for core processors [CPUFREQ] Disable sysfs ui for p4-clockmod. [CPUFREQ] p4-clockmod: reduce noise [CPUFREQ] clean up speedstep-centrino and reduce cpumask_t usage commit 10cc04f5a01041ffff068b3f9b195bfdc5290c45 Merge: 520c853... 9047bea... Author: Linus Torvalds Date: Mon Jan 5 18:32:43 2009 -0800 Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: (138 commits) ocfs2: Access the right buffer_head in ocfs2_merge_rec_left. ocfs2: use min_t in ocfs2_quota_read() ocfs2: remove unneeded lvb casts ocfs2: Add xattr support checking in init_security ocfs2: alloc xattr bucket in ocfs2_xattr_set_handle ocfs2: calculate and reserve credits for xattr value in mknod ocfs2/xattr: fix credits calculation during index create ocfs2/xattr: Always updating ctime during xattr set. ocfs2/xattr: Remove extend_trans call and add its credits from the beginning ocfs2/dlm: Fix race during lockres mastery ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list ocfs2/dlm: Hold off sending lockres drop ref message while lockres is migrating ocfs2/dlm: Clean up errors in dlm_proxy_ast_handler() ocfs2/dlm: Fix a race between migrate request and exit domain ocfs2: One more hamming code optimization. ocfs2: Another hamming code optimization. ocfs2: Don't hand-code xor in ocfs2_hamming_encode(). ocfs2: Enable metadata checksums. ocfs2: Validate superblock with checksum and ecc. ocfs2: Checksum and ECC for directory blocks. ... commit 520c85346666d4d9a6fcaaa8450542302dc28b91 Merge: e8c82c2... 4ae8978... Author: Linus Torvalds Date: Mon Jan 5 18:32:06 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: inotify: fix type errors in interfaces fix breakage in reiserfs_new_inode() fix the treatment of jfs special inodes vfs: remove duplicate code in get_fs_type() add a vfs_fsync helper sys_execve and sys_uselib do not call into fsnotify zero i_uid/i_gid on inode allocation inode->i_op is never NULL ntfs: don't NULL i_op isofs check for NULL ->i_op in root directory is dead code affs: do not zero ->i_op kill suid bit only for regular files vfs: lseek(fd, 0, SEEK_CUR) race condition commit e8c82c2e23e3527e0c9dc195e432c16784d270fa Author: Nick Piggin Date: Tue Jan 6 03:05:50 2009 +0100 mm lockless pagecache barrier fix An XFS workload showed up a bug in the lockless pagecache patch. Basically it would go into an "infinite" loop, although it would sometimes be able to break out of the loop! The reason is a missing compiler barrier in the "increment reference count unless it was zero" case of the lockless pagecache protocol in the gang lookup functions. This would cause the compiler to use a cached value of struct page pointer to retry the operation with, rather than reload it. So the page might have been removed from pagecache and freed (refcount==0) but the lookup would not correctly notice the page is no longer in pagecache, and keep attempting to increment the refcount and failing, until the page gets reallocated for something else. This isn't a data corruption because the condition will be detected if the page has been reallocated. However it can result in a lockup. Linus points out that ACCESS_ONCE is also required in that pointer load, even if it's absence is not causing a bug on our particular build. The most general way to solve this is just to put an rcu_dereference in radix_tree_deref_slot. Assembly of find_get_pages, before: .L220: movq (%rbx), %rax #* ivtmp.1162, tmp82 movq (%rax), %rdi #, prephitmp.1149 .L218: testb $1, %dil #, prephitmp.1149 jne .L217 #, testq %rdi, %rdi # prephitmp.1149 je .L203 #, cmpq $-1, %rdi #, prephitmp.1149 je .L217 #, movl 8(%rdi), %esi # ._count.counter, c testl %esi, %esi # c je .L218 #, after: .L212: movq (%rbx), %rax #* ivtmp.1109, tmp81 movq (%rax), %rdi #, ret testb $1, %dil #, ret jne .L211 #, testq %rdi, %rdi # ret je .L197 #, cmpq $-1, %rdi #, ret je .L211 #, movl 8(%rdi), %esi # ._count.counter, c testl %esi, %esi # c je .L212 #, (notice the obvious infinite loop in the first example, if page->count remains 0) Signed-off-by: Nick Piggin Reviewed-by: Paul E. McKenney Signed-off-by: Linus Torvalds commit f1b11e505463fd597ab7963df26dd1f446dcceae Author: Alan Cox Date: Mon Jan 5 14:04:40 2009 +0000 i2o: Update my address Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 3537d54c0c39de5738bba8d19f128478b0b96a71 Author: Ron Mercer Date: Mon Jan 5 18:19:59 2009 -0800 qlge: Fix sparse warnings for tx ring indexes. Warnings: drivers/net/qlge/qlge_main.c:1474:34: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1475:36: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1592:51: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1941:20: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:1941:20: expected restricted unsigned int [usertype] tid drivers/net/qlge/qlge_main.c:1941:20: got int [signed] index drivers/net/qlge/qlge_main.c:1945:24: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:1945:24: expected restricted unsigned int [usertype] txq_idx drivers/net/qlge/qlge_main.c:1945:24: got unsigned int [unsigned] [usertype] tx_ring_idx Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 2c9a0d41e944807bf763f42e4a3526210e98c741 Author: Ron Mercer Date: Mon Jan 5 18:19:20 2009 -0800 qlge: Fix sparse warning regarding rx buffer queues. Warnings: drivers/net/qlge/qlge_main.c:909:17: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:909:17: expected unsigned int [unsigned] [usertype] addr_lo drivers/net/qlge/qlge_main.c:909:17: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:911:17: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:911:17: expected unsigned int [unsigned] [usertype] addr_hi drivers/net/qlge/qlge_main.c:911:17: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:974:17: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:974:17: expected unsigned int [unsigned] [usertype] addr_lo drivers/net/qlge/qlge_main.c:974:17: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:975:17: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:975:17: expected unsigned int [unsigned] [usertype] addr_hi drivers/net/qlge/qlge_main.c:975:17: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:2132:16: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:2132:16: expected unsigned int [unsigned] [usertype] addr_lo drivers/net/qlge/qlge_main.c:2132:16: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:2133:16: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:2133:16: expected unsigned int [unsigned] [usertype] addr_hi drivers/net/qlge/qlge_main.c:2133:16: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:2212:15: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:2212:15: expected unsigned int [unsigned] [usertype] addr_lo drivers/net/qlge/qlge_main.c:2212:15: got restricted unsigned int [usertype] drivers/net/qlge/qlge_main.c:2214:15: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:2214:15: expected unsigned int [unsigned] [usertype] addr_hi drivers/net/qlge/qlge_main.c:2214:15: got restricted unsigned int [usertype] Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit fd2df4f7439cd3e87090e067d5aec8f1336f4f0e Author: Ron Mercer Date: Mon Jan 5 18:18:45 2009 -0800 qlge: Fix sparse endian warning in ql_hw_csum_setup(). Changed u16 to __sum16 usage. Warnings: drivers/net/qlge/qlge_main.c:1897:9: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:1897:9: expected unsigned short [usertype] *check drivers/net/qlge/qlge_main.c:1897:9: got restricted unsigned short * drivers/net/qlge/qlge_main.c:1903:9: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:1903:9: expected unsigned short [usertype] *check drivers/net/qlge/qlge_main.c:1903:9: got restricted unsigned short * drivers/net/qlge/qlge_main.c:1909:9: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_main.c:1909:9: expected unsigned short [unsigned] [short] [usertype] Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit a303ce0972d04036316e85568682a2b89fe123d9 Author: Ron Mercer Date: Mon Jan 5 18:18:22 2009 -0800 qlge: Fix sparse endian warning for inbound packet control block flags. Changed flags element from __le32 to 3 reserved bytes and one byte of flags. Changed flags bit definitions to reflect byte width instead of __le32 width. Warnings: drivers/net/qlge/qlge_main.c:1206:16: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1207:16: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1233:17: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1276:17: warning: restricted degrades to integer drivers/net/qlge/qlge_main.c:1349:19: warning: restricted degrades to integer Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 8306c952a523ad2f87c101427c3ece91176b822c Author: Ron Mercer Date: Mon Jan 5 18:17:33 2009 -0800 qlge: Fix sparse warnings for byte swapping in qlge_ethool.c drivers/net/qlge/qlge_ethtool.c:59:23: warning: cast to restricted type drivers/net/qlge/qlge_ethtool.c:59:21: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_ethtool.c:59:21: expected restricted unsigned short [usertype] irq_delay drivers/net/qlge/qlge_ethtool.c:59:21: got unsigned short [unsigned] [usertype] drivers/net/qlge/qlge_ethtool.c:61:8: warning: cast to restricted type drivers/net/qlge/qlge_ethtool.c:60:21: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_ethtool.c:60:21: expected restricted unsigned short [usertype] pkt_delay drivers/net/qlge/qlge_ethtool.c:60:21: got unsigned short [unsigned] [usertype] drivers/net/qlge/qlge_ethtool.c:82:23: warning: cast to restricted type drivers/net/qlge/qlge_ethtool.c:82:21: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_ethtool.c:82:21: expected restricted unsigned short [usertype] irq_delay drivers/net/qlge/qlge_ethtool.c:82:21: got unsigned short [unsigned] [usertype] drivers/net/qlge/qlge_ethtool.c:84:8: warning: cast to restricted type drivers/net/qlge/qlge_ethtool.c:83:21: warning: incorrect type in assignment (different base types) drivers/net/qlge/qlge_ethtool.c:83:21: expected restricted unsigned short [usertype] pkt_delay drivers/net/qlge/qlge_ethtool.c:83:21: got unsigned short [unsigned] [usertype] Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 0f840011f0396dcb97ca82c64fd43f6990a574dd Author: Brice Goglin Date: Mon Jan 5 18:16:14 2009 -0800 myri10ge: print MAC and serial number on probe failure To help board identification and diagnosis, print the MAC and serial number on probe failure if they are available. Signed-off-by: Brice Goglin Signed-off-by: David S. Miller commit 6f57321422e0d359e83c978c2b03db77b967b7d5 Author: Jarek Poplawski Date: Mon Jan 5 18:14:19 2009 -0800 pkt_sched: cls_u32: Fix locking in u32_change() New nodes are inserted in u32_change() under rtnl_lock() with wmb(), so without tcf_tree_lock() like in other classifiers (e.g. cls_fw). This isn't enough without rmb() on the read side, but on the other hand adding such barriers doesn't give any savings, so the lock is added instead. Reported-by: m0sia Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller commit 4696b64d234b84b5b70ffd49a76833aa5c49cb61 Author: Julian Calaby Date: Mon Jan 5 18:13:49 2009 -0800 sparc: Fix minor SPARC32 compile error When CONFIG_PROC_FS is unset, include/linux/interrupt.h defines init_irq_proc() as an empty function. arch/sparc/kernel/irq_32.c defines this function unconditionally. Fix the latter so that it only defines this function when CONFIG_PROC_FS is set. This fixes the following error: arch/sparc/kernel/irq_32.c:672: error: redefinition of 'init_irq_proc' include/linux/interrupt.h:461: error: previous definition of 'init_irq_proc' was here This was found using randconfig builds. Signed-off-by: Julian Calaby Signed-off-by: David S. Miller commit f1d3e4dca3f8d4f55656477e83d0afe0ea7cbaed Author: Heiko Carstens Date: Mon Jan 5 18:09:02 2009 -0800 iucv: fix cpu hotplug If the iucv module is compiled in/loaded but no user is registered cpu hot remove doesn't work. Reason for that is that the iucv cpu hotplug notifier on CPU_DOWN_PREPARE checks if the iucv_buffer_cpumask would be empty after the corresponding bit would be cleared. However the bit was never set since iucv wasn't enable. That causes all cpu hot unplug operations to fail in this scenario. To fix this use iucv_path_table as an indicator wether iucv is enabled or not. Signed-off-by: Heiko Carstens Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 65dbd7c2778f1921ef1ee2a73e47a2a126fed30f Author: Hendrik Brueckner Date: Mon Jan 5 18:08:23 2009 -0800 af_iucv: Free iucv path/socket in path_pending callback Free iucv path after iucv_path_sever() calls in iucv_callback_connreq() (path_pending() iucv callback). If iucv_path_accept() fails, free path and free/kill newly created socket. Signed-off-by: Hendrik Brueckner Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 18becbc5479f88d5adc218374ca62b8b93ec2545 Author: Ursula Braun Date: Mon Jan 5 18:07:46 2009 -0800 af_iucv: avoid left over IUCV connections from failing connects For certain types of AFIUCV socket connect failures IUCV connections are left over. Add some cleanup-statements to avoid cluttered IUCV connections. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 55cdea9ed9cf2d76993e40ed7a1fc649a14db07c Author: Hendrik Brueckner Date: Mon Jan 5 18:07:07 2009 -0800 af_iucv: New error return codes for connect() If the iucv_path_connect() call fails then return an error code that corresponds to the iucv_path_connect() failure condition; instead of returning -ECONNREFUSED for any failure. This helps to improve error handling for user space applications (e.g. inform the user that the z/VM guest is not authorized to connect to other guest virtual machines). The error return codes are based on those described in connect(2). Signed-off-by: Hendrik Brueckner Signed-off-by: Ursula Braun Signed-off-by: David S. Miller commit 046c68842bce6b77509cf56e94a561029124b0ce Author: Alan Cox Date: Mon Jan 5 14:06:29 2009 +0000 mm: update my address Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 5641f1fde074651ce2488e93944cf05dedd9bf74 Author: Al Viro Date: Mon Jan 5 17:19:02 2009 +0000 X86_DEBUGCTLMSR won't work on uml Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit 7483cb7bbc02b9471dda28e54f41287d5374e3ac Author: Al Viro Date: Mon Jan 5 17:18:52 2009 +0000 uml got broken by commit 30742d5c2277c325fb0e9d2d817d55a19995fe8f ... if you revert a commit, revert the fixups elsewhere that had been triggered by it. Such as 8c56250f48347750c82ab18d98d647dcf99ca674 (lockdep, UML: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set). Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit 22409f9c80d0a742ff98d1cfe1bf60fce1927be1 Author: Al Viro Date: Mon Jan 5 17:18:42 2009 +0000 get rid of the last symlink in uml build We need to make asm-offsets.h contents visible for objects built with userland headers. Instead of creating a symlink, just have the file with equivalent include (relative to location of header) created once. That kills the last symlink used in arch/um builds. Additionally, both generated headers can become dependencies of archprepare now, killing the misuse of prepare. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit 48e4cc777c091b037acaf39036a77ece43fe1ab9 Author: Stephen Rothwell Date: Mon Jan 5 16:06:02 2009 -0800 net/ehea: bitops work on unsigned longs The flags field of struct ehea_port is only used with test_bit(), clear_bit() and set_bit() and these interfaces only work on "unsigned long"s, so change the field to be an "unsigned long". Also, this field only has two bits defined for it (0 and 1) so will still be fine if someone builds this driver for a 32 bit arch (at least as far as this flags field is concerned). Also note that ehea_driver_flags is only used in ehca_main.c, so make it static in there. Signed-off-by: Stephen Rothwell Signed-off-by: David S. Miller commit c276e098d3ee33059b4a1c747354226cec58487c Author: David S. Miller Date: Mon Jan 5 16:01:51 2009 -0800 Revert "net: Fix for initial link state in 2.6.28" This reverts commit 22604c866889c4b2e12b73cbf1683bda1b72a313. We can't fix this issue in this way, because we now can try to take the dev_base_lock rwlock as a writer in software interrupt context and that is not allowed without major surgery elsewhere. This initial link state problem needs to be solved in some other way. Signed-off-by: David S. Miller commit 3a5e1d1792729f384c10db966feb8bab76c991ed Merge: 9d7eff6... 8eca753... Author: Takashi Iwai Date: Mon Jan 5 18:34:25 2009 +0100 Merge branch 'topic/misc' into for-linus commit 9d7eff608dbccceb3a5168bd240dc6262ae42459 Merge: cd8faac... cad9d90... Author: Takashi Iwai Date: Mon Jan 5 18:34:21 2009 +0100 Merge branch 'topic/asoc' into for-linus commit cad9d90ec3f6c497dce2b163046436b6ab5cf6b6 Merge: ac11a2b... 5cf1c00... Author: Takashi Iwai Date: Mon Jan 5 18:31:38 2009 +0100 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc commit 8eca75382e012b74b98526a1679ada2a1849024b Author: Alan Horstmann Date: Mon Jan 5 18:30:04 2009 +0100 ALSA: ice1724 - Fix a typo in IEC958 PCM name Fix trivial name string typo as reported in bug 2552. Signed-off-by: Alan Horstmann Signed-off-by: Takashi Iwai commit 4ae8978cf92a96257cd8998a49e781be83571d64 Author: Michael Kerrisk Date: Mon Jan 5 07:19:16 2009 -0500 inotify: fix type errors in interfaces The problems lie in the types used for some inotify interfaces, both at the kernel level and at the glibc level. This mail addresses the kernel problem. I will follow up with some suggestions for glibc changes. For the sys_inotify_rm_watch() interface, the type of the 'wd' argument is currently 'u32', it should be '__s32' . That is Robert's suggestion, and is consistent with the other declarations of watch descriptors in the kernel source, in particular, the inotify_event structure in include/linux/inotify.h: struct inotify_event { __s32 wd; /* watch descriptor */ __u32 mask; /* watch mask */ __u32 cookie; /* cookie to synchronize two events */ __u32 len; /* length (including nulls) of name */ char name[0]; /* stub for possible name */ }; The patch makes the changes needed for inotify_rm_watch(). Signed-off-by: Michael Kerrisk Cc: Robert Love Cc: Vegard Nossum Cc: Ulrich Drepper Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit 2f1169e2dc0c70e213f79ada88a10912cc2fbe94 Author: Al Viro Date: Fri Jan 2 08:16:51 2009 -0500 fix breakage in reiserfs_new_inode() now that we use ih.key earlier, we need to do all its setup early enough Signed-off-by: Al Viro commit 5b45d96bf963afeb931a75faf02fb424e446e5a9 Author: Al Viro Date: Mon Dec 29 07:40:31 2008 -0500 fix the treatment of jfs special inodes We used to put them on a single list, without any locking. Racy. Signed-off-by: Al Viro commit d8e9650dff48055057253ca30933605bd7d0733b Author: Li Zefan Date: Thu Dec 25 13:32:15 2008 +0800 vfs: remove duplicate code in get_fs_type() save 14 bytes: text data bss dec hex filename 1354 32 4 1390 56e fs/filesystems.o.before text data bss dec hex filename 1340 32 4 1376 560 fs/filesystems.o Signed-off-by: Li Zefan Signed-off-by: Al Viro commit 4c728ef583b3d82266584da5cb068294c09df31e Author: Christoph Hellwig Date: Mon Dec 22 21:11:15 2008 +0100 add a vfs_fsync helper Fsync currently has a fdatawrite/fdatawait pair around the method call, and a mutex_lock/unlock of the inode mutex. All callers of fsync have to duplicate this, but we have a few and most of them don't quite get it right. This patch adds a new vfs_fsync that takes care of this. It's a little more complicated as usual as ->fsync might get a NULL file pointer and just a dentry from nfsd, but otherwise gets afile and we want to take the mapping and file operations from it when it is there. Notes on the fsync callers: - ecryptfs wasn't calling filemap_fdatawrite / filemap_fdatawait on the lower file - coda wasn't calling filemap_fdatawrite / filemap_fdatawait on the host file, and returning 0 when ->fsync was missing - shm wasn't calling either filemap_fdatawrite / filemap_fdatawait nor taking i_mutex. Now given that shared memory doesn't have disk backing not doing anything in fsync seems fine and I left it out of the vfs_fsync conversion for now, but in that case we might just not pass it through to the lower file at all but just call the no-op simple_sync_file directly. [and now actually export vfs_fsync] Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 6110e3abbff8b785907d4db50240e63c1be726e3 Author: Eric Paris Date: Wed Dec 17 13:53:20 2008 -0500 sys_execve and sys_uselib do not call into fsnotify sys_execve and sys_uselib do not call into fsnotify so inotify does not get open events for these types of syscalls. This patch simply makes the requisite fsnotify calls. Signed-off-by: Eric Paris Signed-off-by: Al Viro commit 56ff5efad96182f4d3cb3dc6b07396762c658f16 Author: Al Viro Date: Tue Dec 9 09:34:39 2008 -0500 zero i_uid/i_gid on inode allocation ... and don't bother in callers. Don't bother with zeroing i_blocks, while we are at it - it's already been zeroed. i_mode is not worth the effort; it has no common default value. Signed-off-by: Al Viro commit acfa4380efe77e290d3a96b11cd4c9f24f4fbb18 Author: Al Viro Date: Thu Dec 4 10:06:33 2008 -0500 inode->i_op is never NULL We used to have rather schizophrenic set of checks for NULL ->i_op even though it had been eliminated years ago. You'd need to go out of your way to set it to NULL explicitly _and_ a bunch of code would die on such inodes anyway. After killing two remaining places that still did that bogosity, all that crap can go away. Signed-off-by: Al Viro commit 9742df331deb3fce95b321f38d4ea0c4e75edb63 Author: Al Viro Date: Thu Dec 4 09:59:23 2008 -0500 ntfs: don't NULL i_op it's already set to empty table (and no, ntfs doesn't have any explicit checks for NULL ->i_op or NULL ->i_fop) Signed-off-by: Al Viro commit 261964c60ff6524076d439da9386d4782729c4d9 Author: Al Viro Date: Thu Dec 4 09:57:25 2008 -0500 isofs check for NULL ->i_op in root directory is dead code for one thing it never happens, for another we check that inode is a directory right after that place anyway (and we'd already checked that reading it from disk has not failed). Signed-off-by: Al Viro commit c765d479037808532310212e9b3fa95760e975f2 Author: Al Viro Date: Thu Dec 4 09:50:55 2008 -0500 affs: do not zero ->i_op it is already set to empty table and should never be NULL Signed-off-by: Al Viro commit 7f5ff766a7babd72fc192125e12ef5570effff4c Author: Dmitri Monakhov Date: Mon Dec 1 14:34:56 2008 -0800 kill suid bit only for regular files We don't have to do it because it is useless for non regular files. In fact block device may trigger this path without dentry->d_inode->i_mutex. (akpm: concerns were expressed (by me) about S_ISDIR inodes) Signed-off-by: Dmitri Monakhov Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit 5b6f1eb97d462a45be3b30759758b5fdbb562c8c Author: Alain Knaff Date: Mon Nov 10 17:08:08 2008 -0800 vfs: lseek(fd, 0, SEEK_CUR) race condition This patch fixes a race condition in lseek. While it is expected that unpredictable behaviour may result while repositioning the offset of a file descriptor concurrently with reading/writing to the same file descriptor, this should not happen when merely *reading* the file descriptor's offset. Unfortunately, the only portable way in Unix to read a file descriptor's offset is lseek(fd, 0, SEEK_CUR); however executing this concurrently with read/write may mess up the position. [with fixes from akpm] Signed-off-by: Alain Knaff Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit 9047beabb8a396f0b18de1e4a9ab920cf92054af Author: Tao Ma Date: Mon Jan 5 14:45:24 2009 +0800 ocfs2: Access the right buffer_head in ocfs2_merge_rec_left. In commit "ocfs2: Use metadata-specific ocfs2_journal_access_*() functions", the wrong buffer_head is accessed. So change it to the right buffer_head. Signed-off-by: Tao Ma Acked-by: Joel Becker Signed-off-by: Mark Fasheh commit dad7d975e4bd893c79fd122105b37b9a1776816a Author: Mark Fasheh Date: Wed Dec 24 16:33:08 2008 -0800 ocfs2: use min_t in ocfs2_quota_read() This is preferred to min(). Signed-off-by: Mark Fasheh commit a641dc2a5a1445eb4cb491080dfc41c42a9eb37d Author: Mark Fasheh Date: Wed Dec 24 16:03:48 2008 -0800 ocfs2: remove unneeded lvb casts dlmglue.c has lots of code which casts the return value of ocfs2_dlm_lvb(). This is pointless however, as ocfs2_dlm_lvb() returns void *. Signed-off-by: Mark Fasheh commit 38d59ef61c11cafc50a66787bdbbe80d58bbd9c0 Author: Tiger Yang Date: Wed Dec 17 10:22:56 2008 +0800 ocfs2: Add xattr support checking in init_security We must check whether ocfs2 volume support xattr in init_security, if not support xattr and security is enable, would cause failure of mknod. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 008aafaf0b4aa0476da483e3c6e3edbe951811ff Author: Tiger Yang Date: Tue Dec 9 16:43:08 2008 +0800 ocfs2: alloc xattr bucket in ocfs2_xattr_set_handle In extreme situation, may need xattr bucket for setting security entry and acl entries during mknod. This only happens when block size is too small. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 0e445b6fe93c723fe8093fd04ddfeb11ae2de082 Author: Tiger Yang Date: Tue Dec 9 16:42:51 2008 +0800 ocfs2: calculate and reserve credits for xattr value in mknod We extend the credits for xattr's large value in set_value_outside before, this can give rise to a credits issue when we set one security entry and two acl entries duing mknod. As we remove extend_trans form set_value_outside, we must calculate and reserve the credits for xattr's large value in mknod. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 90cb546cada68bb8c2278afdb4b65c2ac11f2877 Author: Tao Ma Date: Fri Dec 5 06:20:56 2008 +0800 ocfs2/xattr: fix credits calculation during index create When creating a xattr index block, the old calculation forget to add credits for the meta change of the alloc file. So add more credits and more comments to explain it. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 4b3f6209bf9eec46fe5ebb168718fef5c443c157 Author: Tao Ma Date: Fri Dec 5 06:20:55 2008 +0800 ocfs2/xattr: Always updating ctime during xattr set. In xattr set, we should always update ctime if the operation goes sucessfully. The old one mistakenly put it in ocfs2_xattr_set_entry which is only called when we set xattr in inode or xattr block. The side benefit is that it resolve the bug 1052 since in that scenario, ocfs2_calc_xattr_set_need only calc out the xattr set credits while ocfs2_xattr_set_entry update the inode also which isn't concerned with the process of xattr set. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 71d548a6af36fe98c95fbd0522147f842bd5f054 Author: Tao Ma Date: Fri Dec 5 06:20:54 2008 +0800 ocfs2/xattr: Remove extend_trans call and add its credits from the beginning Actually, when setting a new xattr value, we know it from the very beginning, and it isn't like the extension of bucket in which case we can't figure it out. So remove ocfs2_extend_trans in that function and calculate it before the transaction. It also relieve acl operation from the worry about the side effect of ocfs2_extend_trans. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 7b791d68562e4ce5ab57cbacb10a1ad4ee33956e Author: Sunil Mushran Date: Tue Dec 16 15:49:23 2008 -0800 ocfs2/dlm: Fix race during lockres mastery dlm_get_lock_resource() is supposed to return a lock resource with a proper master. If multiple concurrent threads attempt to lookup the lockres for the same lockid while the lock mastery in underway, one or more threads are likely to return a lockres without a proper master. This patch makes the threads wait in dlm_get_lock_resource() while the mastery is underway, ensuring all threads return the lockres with a proper master. This issue is known to be limited to users using the flock() syscall. For all other fs operations, the ocfs2 dlmglue layer serializes the dlm op for each lockid. Users encountering this bug will see flock() return EINVAL and dmesg have the following error: ERROR: Dlm error "DLM_BADARGS" while calling dlmlock on resource : bad api args Reported-by: Coly Li Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit b0d4f817ba5de8adb875ace594554a96d7737710 Author: Sunil Mushran Date: Tue Dec 16 15:49:22 2008 -0800 ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list This patch adds a new lock, dlm->tracking_lock, to protect adding/removing lockres' to/from the dlm->tracking_list. We were previously using dlm->spinlock for the same, but that proved inadequate as we could be freeing a lockres from a context that did not hold that lock. As the new lock only protects this list, we can explicitly take it when removing the lockres from the tracking list. This bug was exposed when testing multiple processes concurrently flock() the same file. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit d4f7e650e55af6b235871126f747da88600e8040 Author: Sunil Mushran Date: Tue Dec 16 15:49:21 2008 -0800 ocfs2/dlm: Hold off sending lockres drop ref message while lockres is migrating During lockres purge, o2dlm sends a drop reference message to the lockres master. This patch delays the message if the lockres is being migrated. Fixes oss bugzilla#1012 http://oss.oracle.com/bugzilla/show_bug.cgi?id=1012 Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 57dff2676eb68d805883a2204faaa5339ac44e03 Author: Sunil Mushran Date: Tue Dec 16 15:49:20 2008 -0800 ocfs2/dlm: Clean up errors in dlm_proxy_ast_handler() Patch cleans printed errors in dlm_proxy_ast_handler(). The errors now includes the node number that sent the (b)ast. Also it reduces the number of endian swaps of the cookie. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 2b83256407687613e906bee93d98a25339128a4d Author: Sunil Mushran Date: Tue Dec 16 15:49:19 2008 -0800 ocfs2/dlm: Fix a race between migrate request and exit domain Patch address a racing migrate request message and an exit domain message. Instead of blocking exit domains for the duration of the migrate, we ignore failure to deliver that message. This is because an exiting domain should not have any active locks and thus has no role to play in the migration. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 58896c4d0e5868360ea0693c607d5bf74f79da6b Author: Joel Becker Date: Tue Dec 16 13:54:40 2008 -0800 ocfs2: One more hamming code optimization. The previous optimization used a fast find-highest-bit-set operation to give us a good starting point in calc_code_bit(). This version lets the caller cache the previous code buffer bit offset. Thus, the next call always starts where the last one left off. This reduces the calculation another 39%, for a total 80% reduction from the original, naive implementation. At least, on my machine. This also brings the parity calculation to within an order of magnitude of the crc32 calculation. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 7bb458a58588f397068e4166c615e9fcc7480c16 Author: Joel Becker Date: Mon Dec 15 18:24:33 2008 -0800 ocfs2: Another hamming code optimization. In the calc_code_bit() function, we must find all powers of two beneath the code bit number, *after* it's shifted by those powers of two. This requires a loop to see where it ends up. We can optimize it by starting at its most significant bit. This shaves 32% off the time, for a total of 67.6% shaved off of the original, naive implementation. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit e798b3f8a920c82a8e556dd54df97f0d3d0f9144 Author: Joel Becker Date: Mon Dec 15 17:13:48 2008 -0800 ocfs2: Don't hand-code xor in ocfs2_hamming_encode(). When I wrote ocfs2_hamming_encode(), I was following documentation of the algorithm and didn't have quite the (possibly still imperfect) grasp of it I do now. As part of this, I literally hand-coded xor. I would test a bit, and then add that bit via xor to the parity word. I can, of course, just do a single xor of the parity word and the source word (the code buffer bit offset). This cuts CPU usage by 53% on a mostly populated buffer (an inode containing utmp.h inline). Joel Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 9d28cfb73f3abccce001daf2d247b16bf20e2248 Author: Joel Becker Date: Thu Oct 16 17:53:29 2008 -0700 ocfs2: Enable metadata checksums. Add OCFS2_FEATURE_INCOMPAT_META_ECC to the list of supported features. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit d030cc978e9e636dc39ce9a9e8282d48698a3b30 Author: Joel Becker Date: Thu Dec 11 15:04:14 2008 -0800 ocfs2: Validate superblock with checksum and ecc. The superblock is read via a raw call. Validate it after we find it from its signature. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit c175a518b4a1d514483abf61813ce5d855917164 Author: Joel Becker Date: Wed Dec 10 17:58:22 2008 -0800 ocfs2: Checksum and ECC for directory blocks. Use the db_check field of ocfs2_dir_block_trailer to crc/ecc the dirblocks. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 87d35a74b15ec703910a63e0667692fb5e267be0 Author: Mark Fasheh Date: Wed Dec 10 17:36:25 2008 -0800 ocfs2: Add directory block trailers. Future ocfs2 features metaecc and indexed directories need to store a little bit of data in each dirblock. For compatibility, we place this in a trailer at the end of the dirblock. The trailer plays itself as an empty dirent, so that if the features are turned off, it can be reused without requiring a tunefs scan. This code adds the trailer and validates it when the block is read in. [ Mark is the original author, but I reinserted this code before his dir index work. -- Joel ] Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 84008972491ca91b240f106191519781dabb8016 Author: Joel Becker Date: Tue Dec 9 16:11:49 2008 -0800 ocfs2: Use proper journal_access function in xattr.c Change the rest of the naked ocfs2_journal_access() calls in fs/ocfs2/xattr.c to use the appropriate ocfs2_journal_access_*() call for their metadata type. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4311901daabe1d0f22cfcf86c57ad450f14b4e9f Author: Joel Becker Date: Tue Dec 9 16:24:43 2008 -0800 ocfs2: Pass value buf to ocfs2_remove_value_outside(). ocfs2_remove_value_outside() needs to know the type of buffer it is looking at. Pass in an ocfs2_xattr_value_buf. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 512620f44df85df87348fc9a6fc54fcaa254b8d3 Author: Joel Becker Date: Tue Dec 9 15:58:35 2008 -0800 ocfs2: Use ocfs2_xattr_value_buf in ocfs2_xattr_set_entry(). ocfs2_xattr_set_entry is the function that knows what type of block it is setting into. This is what we wanted from ocfs2_xattr_value_buf. Plus, moving the value buf up into ocfs2_xattr_set_entry() allows us to pass it into ocfs2_xattr_set_value_outside() and ocfs2_xattr_cleanup(). Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 0c748e95327d00e9eb19d0f34b32147ecbc02137 Author: Joel Becker Date: Tue Dec 9 15:46:15 2008 -0800 ocfs2: Pass value buf to ocfs2_xattr_update_entry(). ocfs2_xattr_update_entry() updates the entry portion of an xattr buffer. This can be part of multiple metadata block types, so pass the buffer in via an ocfs2_xattr_value_buf. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit b3e5d37905730dc5ddff717f55ed830caa80ea0e Author: Joel Becker Date: Tue Dec 9 15:01:04 2008 -0800 ocfs2: Pass ocfs2_xattr_value_buf into ocfs2_xattr_value_truncate(). The callers of ocfs2_xattr_value_truncate() now pass in ocfs2_xattr_value_bufs. These callers are the ones that calculated the xv location, so they are the right starting point. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 19b801f45fa5e4840b9be3dcf1e73b08f35b04d9 Author: Joel Becker Date: Tue Dec 9 14:36:50 2008 -0800 ocfs2: Pull ocfs2_xattr_value_buf up into ocfs2_xattr_value_truncate(). Place an ocfs2_xattr_value_buf in ocfs2_xattr_value_truncate() and pass it down to ocfs2_xattr_shrink_size(). We can also pass it into ocfs2_xattr_extend_allocation(), replacing its ocfs2_xattr_value_buf. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit d72cc72d57ecaf9047da51269dabd6880c1399ac Author: Joel Becker Date: Tue Dec 9 14:30:41 2008 -0800 ocfs2: Pull ocfs2_xattr_value_buf up from __ocfs2_remove_xattr_range(). Place an ocfs2_xattr_value_buf in __ocfs2_xattr_shrink_size() and pass it down to __ocfs2_remove_xattr_range(). Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 2a50a743bdaab104155bd9e988d2ba3bb4177263 Author: Joel Becker Date: Tue Dec 9 14:24:33 2008 -0800 ocfs2: Create ocfs2_xattr_value_buf. When an ocfs2 extended attribute is large enough to require its own allocation tree, we root it with an ocfs2_xattr_value_root. However, these roots can be a part of inodes, xattr blocks, or xattr buckets. Thus, they need a different journal access function for each container. We wrap the bh, its journal access function, and the value root (xv) in a structure called ocfs2_xattr_valu_buf. This is a package that can be passed around. In this first pass, we simply pass it to the extent tree code. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4d0e214ee83185fcaa2cb97cd026d32bdc5c994a Author: Joel Becker Date: Fri Dec 5 11:19:37 2008 -0800 ocfs2: Add ecc and checksums to ocfs2 xattr buckets. The xattr bucket can span multiple blocks on disk. We have wrappers for this structure in the code. We use the new multi-block ecc calls to calculate and validate the bucket. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 13723d00e374c2a6d6ccb5af6de965e89c3e1b01 Author: Joel Becker Date: Fri Oct 17 19:25:01 2008 -0700 ocfs2: Use metadata-specific ocfs2_journal_access_*() functions. The per-metadata-type ocfs2_journal_access_*() functions hook up jbd2 commit triggers and allow us to compute metadata ecc right before the buffers are written out. This commit provides ecc for inodes, extent blocks, group descriptors, and quota blocks. It is not safe to use extened attributes and metaecc at the same time yet. The ocfs2_extent_tree and ocfs2_path abstractions in alloc.c both hide the type of block at their root. Before, it didn't matter, but now the root block must use the appropriate ocfs2_journal_access_*() function. To keep this abstract, the structures now have a pointer to the matching journal_access function and a wrapper call to call it. A few places use naked ocfs2_write_block() calls instead of adding the blocks to the journal. We make sure to calculate their checksum and ecc before the write. Since we pass around the journal_access functions. Let's typedef them in ocfs2.h. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit ffdd7a54631f07918b75e324d86713a08c11ec06 Author: Joel Becker Date: Fri Oct 17 22:32:01 2008 -0700 ocfs2: Wrap up the common use cases of ocfs2_new_path(). The majority of ocfs2_new_path() calls are: ocfs2_new_path(path_root_bh(otherpath), path_root_el(otherpath)); Let's call that ocfs2_new_path_from_path(). The rest do similar things from struct ocfs2_extent_tree. Let's call those ocfs2_new_path_from_et(). This will make the next change easier. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 50655ae9e91d272d48997bada59efe166aa5e343 Author: Joel Becker Date: Thu Sep 11 15:53:07 2008 -0700 ocfs2: Add journal_access functions with jbd2 triggers. We create wrappers for ocfs2_journal_access() that are specific to the type of metadata block. This allows us to associate jbd2 commit triggers with the block. The triggers will compute metadata ecc in a future commit. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit d6b32bbb3eae3fb787f1c33bf9f767ca1ddeb208 Author: Joel Becker Date: Fri Oct 17 14:55:01 2008 -0700 ocfs2: block read meta ecc. Add block check calls to the read_block validate functions. This is the almost all of the read-side checking of metaecc. xattr buckets are not checked yet. Writes are also unchecked, and so a read-write mount will quickly fail. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 684ef278377725d505aa23259ee673dab9b11851 Author: Joel Becker Date: Tue Dec 2 17:44:05 2008 -0800 ocfs2: Add a validation hook for quota block reads. Add a currently-returns-success hook for quota block reads. We'll be adding checks to this. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 70ad1ba7b48364d758a112df0823edc5ca6632aa Author: Joel Becker Date: Thu Oct 16 17:54:25 2008 -0700 ocfs2: Add the underlying blockcheck code. This is the code that computes crc32 and ecc for ocfs2 metadata blocks. There are high-level functions that check whether the filesystem has the ecc feature, mid-level functions that work on a single block or array of buffer_heads, and the low-level ecc hamming code that can handle multiple buffers like crc32_le(). It's not hooked up to the filesystem yet. Signed-off-by: Joel Becker Cc: Christoph Hellwig Signed-off-by: Mark Fasheh commit ab552d54673f262d7f70014003d3928d29270f22 Author: Joel Becker Date: Thu Oct 16 17:50:30 2008 -0700 ocfs2: Add the on-disk structures for metadata checksums. Define struct ocfs2_block_check, an 8-byte structure containing a 32bit crc32_le and a 16bit hamming code ecc. This will be used for metadata checksums. Add the structure to free spaces in the various metadata structures. Add the OCFS2_FEATURE_INCOMPAT_META_ECC bit. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit e06c8227fd94ec181849ba206bf032be31c4295c Author: Joel Becker Date: Thu Sep 11 15:35:47 2008 -0700 jbd2: Add buffer triggers Filesystems often to do compute intensive operation on some metadata. If this operation is repeated many times, it can be very expensive. It would be much nicer if the operation could be performed once before a buffer goes to disk. This adds triggers to jbd2 buffer heads. Just before writing a metadata buffer to the journal, jbd2 will optionally call a commit trigger associated with the buffer. If the journal is aborted, an abort trigger will be called on any dirty buffers as they are dropped from pending transactions. ocfs2 will use this feature. Initially I tried to come up with a more generic trigger that could be used for non-buffer-related events like transaction completion. It doesn't tie nicely, because the information a buffer trigger needs (specific to a journal_head) isn't the same as what a transaction trigger needs (specific to a tranaction_t or perhaps journal_t). So I implemented a buffer set, with the understanding that journal/transaction wide triggers should be implemented separately. There is only one trigger set allowed per buffer. I can't think of any reason to attach more than one set. Contrast this with a journal or transaction in which multiple places may want to watch the entire transaction separately. The trigger sets are considered static allocation from the jbd2 perspective. ocfs2 will just have one trigger set per block type, setting the same set on every bh of the same type. Signed-off-by: Joel Becker Cc: "Theodore Ts'o" Cc: Signed-off-by: Mark Fasheh commit 754938c142ae0c28360426c43f965ddc5164b21e Author: Tao Ma Date: Mon Dec 15 06:03:41 2008 +0800 ocfs2/quota: Add QUOTA in mlog_attribute. A new mlog mask has to be added into mlog_attribute before it can be really used in mlog. ML_QUOTA is only added in masklog.h, so add it to the array to enable it. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 91f2033fa997aa92607470ed1ef90685b9d77a8c Author: Joel Becker Date: Wed Nov 26 15:25:41 2008 -0800 ocfs2: Pass xs->bucket into ocfs2_add_new_xattr_bucket(). Pass the actual target bucket for insert through to ocfs2_add_new_xattr_bucket(). Now growing a bucket has no buffer_head knowledge. ocfs2_add_new_xattr_bucket() leavs xs->bucket in the proper state for insert. However, it doesn't update the rest of the search fields in xs, so we still have to relse() and re-find. That's OK, because everything is cached. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit ed29c0ca14871021fc8aced74650648dcb2c6e81 Author: Joel Becker Date: Wed Nov 26 15:08:44 2008 -0800 ocfs2: Move buckets up into ocfs2_add_new_xattr_bucket(). Lift the buckets from ocfs2_add_new_xattr_cluster() up into ocfs2_add_new_xattr_bucket(). Now ocfs2_add_new_xattr_cluster() doesn't deal with buffer_heads. In fact, we no longer have to play get_bh() tricks at all. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 012ee910876e251621705e8dea7c353fd4914e19 Author: Joel Becker Date: Wed Nov 26 14:43:31 2008 -0800 ocfs2: Move buckets up into ocfs2_add_new_xattr_cluster(). Lift the buckets from ocfs2_adjust_xattr_cross_cluster() up into ocfs2_add_new_xattr_cluster(). Now ocfs2_adjust_xattr_cross_cluster() doesn't deal with buffer_heads. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 41cb814866110b6e35dad7569ecf96163c3bb824 Author: Joel Becker Date: Wed Nov 26 14:25:21 2008 -0800 ocfs2: Pass buckets into ocfs2_mv_xattr_bucket_cross_cluster(). Now that ocfs2_adjust_xattr_cross_cluster() has buckets, it can pass them into ocfs2_mv_xattr_bucket_cross_cluster(). It no longer has to care about buffer_heads. The manipulation of first_bh and header_bh moves up to ocfs2_adjust_xattr_cross_cluster(). Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 92cf3adf48097b7561a3c83f800ed3b2b25b18d4 Author: Joel Becker Date: Wed Nov 26 14:12:09 2008 -0800 ocfs2: Start using buckets in ocfs2_adjust_xattr_cross_cluster(). We want to be passing around buckets instead of buffer_heads. Let's get them into ocfs2_adjust_xattr_cross_cluster. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit c58b6032f93358871361a92d7743dbc85d27084e Author: Joel Becker Date: Wed Nov 26 13:36:24 2008 -0800 ocfs2: Use ocfs2_mv_xattr_buckets() in ocfs2_mv_xattr_bucket_cross_cluster(). Now that ocfs2_mv_xattr_buckets() can move a partial cluster's worth of buckets, ocfs2_mv_xattr_bucket_cross_cluster() can use it. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 54ecb6b6df54bf72befb359b21f3759b2952f9d9 Author: Joel Becker Date: Wed Nov 26 13:18:31 2008 -0800 ocfs2: ocfs2_mv_xattr_buckets() can handle a partial cluster now. If you look at ocfs2_mv_xattr_bucket_cross_cluster(), you'll notice that two-thirds of the code is almost identical to ocfs2_mv_xattr_buckets(). The only difference is that ocfs2_mv_xattr_buckets() moves a whole cluster's worth, while ocfs2_mv_xattr_bucket_cross_cluster() moves half the cluster. We change ocfs2_mv_xattr_buckets() to allow moving partial clusters. The original caller of ocfs2_mv_xattr_buckets() still moves the whole cluster's worth - it just passes a start_bucket of 0. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 874d65af1c8b8f6456a934701e6828d3017be029 Author: Joel Becker Date: Wed Nov 26 13:02:18 2008 -0800 ocfs2: Rename ocfs2_cp_xattr_cluster() to ocfs2_mv_xattr_buckets(). ocfs2_cp_xattr_cluster() takes the last cluster of an xattr extent, copies its buckets to the front of a new extent, and then shrinks the bucket count of the original extent. So it's really moving the data, not copying it. While we're here, the function doesn't need a buffer_head for the old extent, just the block number. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit b5c03e746959bb005b987e9d8511df46680c3daa Author: Joel Becker Date: Tue Nov 25 19:58:16 2008 -0800 ocfs2: Use ocfs2_cp_xattr_bucket() in ocfs2_mv_xattr_bucket_cross_cluster(). The buffer copy loop of ocfs2_mv_xattr_bucket_cross_cluster() actually looks a lot like ocfs2_cp_xattr_bucket(). Let's just use that instead. We also use bucket operations to update the buckets at the start of each extent. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 2b656c1d6fc5ba7791a360766780a212faed5705 Author: Joel Becker Date: Tue Nov 25 19:00:15 2008 -0800 ocfs2: Explain t_is_new in ocfs2_cp_xattr_cluster(). I was unsure of the JOURNAL_ACCESS parameters in ocfs2_cp_xattr_cluster(). They're based on the function argument 't_is_new', but I couldn't quite figure out how t_is_new mapped to allocation. ocfs2_cp_xattr_cluster() actually overwrites the target, regardless of t_is_new. Well, I just figured it out. So I'm adding a big fat comment for those who come after me. ocfs2_divide_xattr_cluster() has the same behavior. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 15d609293d1954465a4788b9b182214323c6a2a1 Author: Joel Becker Date: Tue Nov 25 18:36:42 2008 -0800 ocfs2: Dirty the entire first bucket in ocfs2_cp_xattr_cluster(). ocfs2_cp_xattr_cluster() takes the last bucket of a full extent and copies it over to a new extent. It then updates the headers of both extents to reflect the new state. It is passed the first bh of the first bucket in order to update that first extent's bucket count. It reads and dirties the first bh of the new extent for the same reason. However, future code wants to always dirty the entire bucket when it is changed. So it is changed to read the entire bucket it is updating for both extents. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 92de109ade7999084fb0bfcc65d603252504e0d0 Author: Joel Becker Date: Tue Nov 25 17:06:40 2008 -0800 ocfs2: Dirty the entire first bucket in ocfs2_extend_xattr_bucket() ocfs2_extend_xattr_bucket() takes an extent of buckets and shifts some of them down to make room for a new xattr. It is passed the first bh of the first bucket, because that is where we store the number of buckets in the extent. However, future code wants to always dirty the entire bucket when it is changed. So let's pass the entire bucket into this function, skip any block reads (we have them), and add the access/dirty logic. We also can skip passing in the target bucket bh - we only need its block number. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 88c3b0622acf82c7c86fbc066e81e15edc7c1685 Author: Tao Ma Date: Thu Dec 11 08:54:11 2008 +0800 ocfs2: Narrow the transaction for deleting xattrs from a bucket. We move the transaction into the loop because in ocfs2_remove_extent, we will double the credits in function ocfs2_extend_rotate_transaction. So if we have a large loop number, we will soon waste much the journal space. Signed-off-by: Tao Ma Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 548b0f22bb7497ba76f91627b99f9fed53a91704 Author: Joel Becker Date: Mon Nov 24 19:32:13 2008 -0800 ocfs2: Dirty the entire bucket in ocfs2_bucket_value_truncate() ocfs2_bucket_value_truncate() currently takes the first bh of the bucket, and magically plays around with the value bh - even though the bucket structure in the calling function already has it. In addition, future code wants to always dirty the entire bucket when it is changed. So let's pass the entire bucket into this function, skip any block reads (we have them), and add the access/dirty logic. ocfs2_xattr_update_value_size() is no longer necessary, as it only did one thing other than journal access/dirty. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit df32b3343aa11e0c7f54783594b24321d17d376f Author: Tao Ma Date: Tue Nov 25 07:21:36 2008 +0800 ocfs2/quota: sparse fixes for quota Fix 2 minor things in quota. They are both found by sparse check. 1. an endian bug in ocfs2_local_quota_add_chunk. 2. change olq_alloc_dquot to static. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit e35ff98f7c37b7bc901b4b90a66a0287565e456c Author: Tao Ma Date: Wed Nov 26 16:20:19 2008 -0800 ocfs2: fix indendation in ocfs2_dquot_drop_slow Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit a5b5ee320185adc091a3a31630d278806b19d8f0 Author: Jan Kara Date: Tue Nov 25 15:31:35 2008 +0100 ext4: Add default allocation routines for quota structures Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 157091a2c3cdc71422cbc71eace205cf1b9f2200 Author: Jan Kara Date: Tue Nov 25 15:31:34 2008 +0100 ext3: Add default allocation routines for quota structures Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 4103003b3abb85af9dec9e60616ae086c2bcb4c9 Author: Jan Kara Date: Tue Nov 25 15:31:33 2008 +0100 reiserfs: Add default allocation routines for quota structures Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 7d9056ba20ebed6e3937a2e23183f6117919cb00 Author: Jan Kara Date: Tue Nov 25 15:31:32 2008 +0100 quota: Export dquot_alloc() and dquot_destroy() functions These are default functions for creating and destroying quota structures and they should be used from filesystems. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 5cd9d5bb86daf632a40f90e2321ea9379e42f073 Author: Jan Kara Date: Tue Nov 25 15:31:31 2008 +0100 quota: Unexport dqblk_v1.h and dqblk_v2.h Unexport header files dqblk_v[12].h since except for quota format ID they don't contain information userspace should be interested in. Move ID definitions to quota.h. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 9a2f3866c825c67c3a5806799cdc93fb7517f0c4 Author: Jan Kara Date: Tue Nov 25 15:31:30 2008 +0100 ocfs2: Fix build warnings (64-bit types vs long long) fs/ocfs2/quota_local.c: In function 'olq_set_dquot': fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64' fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64' fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64' fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64' fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 7 has type '__le64' fs/ocfs2/quota_local.c:844: warning: format '%lld' expects type 'long long int', but argument 8 has type '__le64' fs/ocfs2/quota_global.c: In function '__ocfs2_sync_dquot': fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64' fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64' fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64' fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64' fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 8 has type 's64' fs/ocfs2/quota_global.c:457: warning: format '%lld' expects type 'long long int', but argument 10 has type 's64' Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 53a3604610e92a5344cf8003c19975583e71a598 Author: Jan Kara Date: Tue Nov 25 15:31:29 2008 +0100 ocfs2: Make ocfs2_get_quota_block() consistent with ocfs2_read_quota_block() Make function return error status and not buffer pointer so that it's consistent with ocfs2_read_quota_block(). Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit af09e51b6810d3408db1c0e956b3b0687b0e3723 Author: Jan Kara Date: Tue Nov 25 15:31:28 2008 +0100 ocfs2: Fix oops when extending quota files We have to mark buffer as uptodate before calling ocfs2_journal_access() and ocfs2_set_buffer_uptodate() does not do this for us. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 85eb8b73d66530bb7b931789ae7a5ec9744eed34 Author: Joel Becker Date: Tue Nov 25 15:31:27 2008 +0100 ocfs2: Fix ocfs2_read_quota_block() error handling. ocfs2_bread() has become ocfs2_read_virt_blocks(), with a prototype to match ocfs2_read_blocks(). The quota code, converting from ocfs2_bread(), wraps the call to ocfs2_read_virt_blocks() in ocfs2_read_quota_block(). Unfortunately, the prototype of ocfs2_read_quota_block() matches the old prototype of ocfs2_bread(). The problem is that ocfs2_bread() returned the buffer head, and callers assumed that a NULL pointer was indicative of error. It wasn't. This is why ocfs2_bread() took an int*err argument as well. The new prototype of ocfs2_read_virt_blocks() avoids this error handling confusion. Let's change ocfs2_read_quota_block() to match. Signed-off-by: Joel Becker Acked-by: Jan Kara Signed-off-by: Mark Fasheh commit 57a09a7b3d9445a17c78d544f1e49d4d7d61705a Author: Jan Kara Date: Tue Nov 25 15:31:26 2008 +0100 ocfs2: Add missing initialization Add missing variable initialization to ocfs2_dquot_drop_slow(). Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit b86c86fa1feb50221dc16071ae5b8a4acf3bd32c Author: Mark Fasheh Date: Tue Nov 18 17:16:47 2008 -0800 ocfs2: Use BH_JBDPrivateStart instead of BH_Unshadow This is safer. We no longer have to worry about tracking changes to jbd_state_bits. Signed-off-by: Mark Fasheh commit e97fcd95a4778a8caf1980c6c72fdf68185a0838 Author: Mark Fasheh Date: Tue Nov 18 17:15:24 2008 -0800 jbd2: Add BH_JBDPrivateStart Add this so that file systems using JBD2 can safely allocate unused b_state bits. In this case, we add it so that Ocfs2 can define a single bit for tracking the validation state of a buffer. Acked-by: "Theodore Ts'o" Signed-off-by: Mark Fasheh commit 19ece546a418997226bd91552fbc41abcb05cea6 Author: Jan Kara Date: Thu Aug 21 20:13:17 2008 +0200 ocfs2: Enable quota accounting on mount, disable on umount Enable quota usage tracking on mount and disable it on umount. Also add support for quota on and quota off quotactls and usrquota and grpquota mount options. Add quota features among supported ones. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 2205363dce7447b8e85f1ead14387664c1a98753 Author: Jan Kara Date: Mon Oct 20 23:50:38 2008 +0200 ocfs2: Implement quota recovery Implement functions for recovery after a crash. Functions just read local quota file and sync info to global quota file. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 171bf93ce11f4c9929fdce6ce63df8da2f3c4475 Author: Mark Fasheh Date: Mon Oct 20 15:36:47 2008 +0200 ocfs2: Periodic quota syncing This patch creates a work queue for periodic syncing of locally cached quota information to the global quota files. We constantly queue a delayed work item, to get the periodic behavior. Signed-off-by: Mark Fasheh Acked-by: Jan Kara commit a90714c150e3ce677c57a9dac3ab1ec342c75a95 Author: Jan Kara Date: Thu Oct 9 19:38:40 2008 +0200 ocfs2: Add quota calls for allocation and freeing of inodes and space Add quota calls for allocation and freeing of inodes and space, also update estimates on number of needed credits for a transaction. Move out inode allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called outside of a transaction. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 9e33d69f553aaf11377307e8d6f82deb3385e351 Author: Jan Kara Date: Mon Aug 25 19:56:50 2008 +0200 ocfs2: Implementation of local and global quota file handling For each quota type each node has local quota file. In this file it stores changes users have made to disk usage via this node. Once in a while this information is synced to global file (and thus with other nodes) so that limits enforcement at least aproximately works. Global quota files contain all the information about usage and limits. It's mostly handled by the generic VFS code (which implements a trie of structures inside a quota file). We only have to provide functions to convert structures from on-disk format to in-memory one. We also have to provide wrappers for various quota functions starting transactions and acquiring necessary cluster locks before the actual IO is really started. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit bbbd0eb34bf801dee01e345785959a75258f6567 Author: Jan Kara Date: Thu Aug 21 18:22:30 2008 +0200 ocfs2: Mark system files as not subject to quota accounting Mark system files as not subject to quota accounting. This prevents possible recursions into quota code and thus deadlocks. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 1a224ad11eeb190da4a123e156601aad1bb67f24 Author: Jan Kara Date: Wed Aug 20 15:43:36 2008 +0200 ocfs2: Assign feature bits and system inodes to quota feature and quota files Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 90e86a63eadf1a3b2f19b68d82150dc63fe01443 Author: Jan Kara Date: Wed Aug 27 22:30:28 2008 +0200 ocfs2: Support nested transactions OCFS2 can easily support nested transactions. We just have to take care and not spoil statistics acquire semaphore unnecessarily. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 12c77527e4138bc3b17d17b0e0c909e4fc84924f Author: Jan Kara Date: Mon Oct 20 17:05:00 2008 +0200 quota: Implement function for scanning active dquots OCFS2 needs to scan all active dquots once in a while and sync quota information among cluster nodes. Provide a helper function for it so that it does not have to reimplement internally a list which VFS already has. Moreover this function is probably going to be useful for other clustered filesystems if they decide to use VFS quotas. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 3d9ea253a0e73dccaa869888ec2ceb17ea76c810 Author: Jan Kara Date: Fri Oct 10 16:12:23 2008 +0200 quota: Add helpers to allow ocfs2 specific quota initialization, freeing and recovery OCFS2 needs to peek whether quota structure is already in memory so that it can avoid expensive cluster locking in that case. Similarly when freeing dquots, it checks whether it is the last quota structure user or not. Finally, it needs to get reference to dquot structure for specified id and quota type when recovering quota file after crash. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 571b46e40bebb0d57130ca24c4a84dfd553adb91 Author: Jan Kara Date: Thu Oct 30 09:17:52 2008 +0100 quota: Update version number Increase reported version number of quota support since quota core has changed significantly. Also remove __DQUOT_NUM_VERSION__ since nobody uses it. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 4d59bce4f9eaf26d6d9046b56a2f1c0c7f20981d Author: Jan Kara Date: Thu Oct 2 16:48:10 2008 +0200 quota: Keep which entries were set by SETQUOTA quotactl Quota in a clustered environment needs to synchronize quota information among cluster nodes. This means we have to occasionally update some information in dquot from disk / network. On the other hand we have to be careful not to overwrite changes administrator did via SETQUOTA. So indicate in dquot->dq_flags which entries have been set by SETQUOTA and quota format can clear these flags when it properly propagated the changes. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit db49d2df489f727096438706a5428115e84a3f0d Author: Jan Kara Date: Wed Oct 1 18:21:39 2008 +0200 quota: Allow negative usage of space and inodes For clustered filesystems, it can happen that space / inode usage goes negative temporarily (because some node is allocating another node is freeing and they are not completely in sync). So let quota code allow this and change qsize_t so a signed type so that we don't underflow the variables. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit e3d4d56b9715e40ded2a84d0d4fa7f3b6c58983c Author: Jan Kara Date: Thu Oct 2 18:44:14 2008 +0200 quota: Convert union in mem_dqinfo to a pointer Coming quota support for OCFS2 is going to need quite a bit of additional per-sb quota information. Moreover having fs.h include all the types needed for this structure would be a pain in the a**. So remove the union from mem_dqinfo and add a private pointer for filesystem's use. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 1ccd14b9c271c1ac6eec5c5ec5def433100e7248 Author: Jan Kara Date: Mon Sep 22 05:54:49 2008 +0200 quota: Split off quota tree handling into a separate file There is going to be a new version of quota format having 64-bit quota limits and a new quota format for OCFS2. They are both going to use the same tree structure as VFSv0 quota format. So split out tree handling into a separate file and make size of leaf blocks, amount of space usable in each block (needed for checksumming) and structures contained in them configurable so that the code can be shared. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit cf770c137122b78470a67ebd5498947869a09197 Author: Jan Kara Date: Sun Sep 21 23:17:53 2008 +0200 quota: Move quotaio_v[12].h from include/linux/ to fs/ Since these include files are used only by implementation of quota formats, there's no need to have them in include/linux/. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit ca785ec66b991e9ca74dd9840fc014487ad095e1 Author: Jan Kara Date: Tue Sep 30 17:53:37 2008 +0200 quota: Introduce DQUOT_QUOTA_SYS_FILE flag If filesystem can handle quota files as system files hidden from users, we can skip a lot of cache invalidation, syncing, inode flags setting etc. when turning quotas on, off and quota_sync. Allow filesystem to indicate that it is hiding quota files from users by DQUOT_QUOTA_SYS_FILE flag. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit dcb30695f2cac86b71417629a6fe8042b4fe2ab2 Author: Jan Kara Date: Wed Aug 20 18:30:40 2008 +0200 quota: Remove compatibility function sb_any_quota_enabled() Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 6929f891241d3fe3af01d28503b645e63241e49a Author: Jan Kara Date: Wed Aug 20 18:16:36 2008 +0200 reiserfs: Use sb_any_quota_loaded() instead of sb_any_quota_enabled(). Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 17bd13b31ce4fe7f789d8848e8cbc8cb42b10544 Author: Jan Kara Date: Wed Aug 20 18:14:35 2008 +0200 ext4: Use sb_any_quota_loaded() instead of sb_any_quota_enabled() Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit ee0d5ffe0da2aa992004447113e28622621a983f Author: Jan Kara Date: Wed Aug 20 18:11:50 2008 +0200 ext3: Use sb_any_quota_loaded() instead of sb_any_quota_enabled() Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit f55abc0fb9c3189de3da829adf3220322c0da43e Author: Jan Kara Date: Wed Aug 20 17:50:32 2008 +0200 quota: Allow to separately enable quota accounting and enforcing limits Split DQUOT_USR_ENABLED (and DQUOT_GRP_ENABLED) into DQUOT_USR_USAGE_ENABLED and DQUOT_USR_LIMITS_ENABLED. This way we are able to separately enable / disable whether we should: 1) ignore quotas completely 2) just keep uptodate information about usage 3) actually enforce quota limits This is going to be useful when quota is treated as filesystem metadata - we then want to keep quota information uptodate all the time and just enable / disable limits enforcement. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit e4bc7b4b7ff783779b6928d55a9308910bf180a3 Author: Jan Kara Date: Wed Aug 20 16:21:01 2008 +0200 quota: Make _SUSPENDED just a flag Upto now, DQUOT_USR_SUSPENDED behaved like a state - i.e., either quota was enabled or suspended or none. Now allowed states are 0, ENABLED, ENABLED | SUSPENDED. This will be useful later when we implement separate enabling of quota usage tracking and limits enforcement because we need to keep track of a state which has been suspended. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 1497d3ad487b64eeea83ac203263802755438949 Author: Jan Kara Date: Wed Aug 20 15:49:59 2008 +0200 quota: Remove bogus 'optimization' in check_idq() and check_bdq() Checks like <= 0 for an unsigned type do not make much sence. The value could be only 0 and that does not happen often enough for the check to be worth it. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 12095460f7f315f8ef67a55b2194195d325d48d7 Author: Jan Kara Date: Wed Aug 20 14:45:12 2008 +0200 quota: Increase size of variables for limits and inode usage So far quota was fine with quota block limits and inode limits/numbers in a 32-bit type. Now with rapid increase in storage sizes there are coming requests to be able to handle quota limits above 4TB / more that 2^32 inodes. So bump up sizes of types in mem_dqblk structure to 64-bits to be able to handle this. Also update inode allocation / checking functions to use qsize_t and make global structure keep quota limits in bytes so that things are consistent. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 74f783af95c982aef6d3a1415275650dcf511666 Author: Jan Kara Date: Tue Aug 19 14:51:22 2008 +0200 quota: Add callbacks for allocating and destroying dquot structures Some filesystems would like to keep private information together with each dquot. Add callbacks alloc_dquot and destroy_dquot allowing filesystem to allocate larger dquots from their private slab in a similar fashion we currently allocate inodes. Signed-off-by: Jan Kara Signed-off-by: Mark Fasheh commit 9f868f16e40e9ad8e39aebff94a4be0d96520734 Author: Tao Ma Date: Wed Nov 19 16:48:42 2008 +0800 ocfs2/xattr: Restore not_found in xis During an xattr set, when we move a xattr which was stored in inode to the outside bucket, we have to delete it and it will use the old value of xis->not_found. xis->not_found is removed by ocfs2_calc_xattr_set_need though, so we must restore it. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb Author: Tao Ma Date: Wed Nov 19 16:48:41 2008 +0800 ocfs2/xattr: Fix a bug in xattr allocation estimation When we extend one xattr's value to a large size, the old value size might be smaller than the size of a value root. In those cases, we still need to guess the metadata allocation. Reported-by: Tiger Yang Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 53ef99cad9878f02f27bb30bc304fc42af8bdd6e Author: Mark Fasheh Date: Tue Nov 18 16:53:43 2008 -0800 ocfs2: Remove JBD compatibility layer JBD2 is fully backwards compatible with JBD and it's been tested enough with Ocfs2 that we can clean this code up now. Signed-off-by: Mark Fasheh commit 511308d90b53479b194cd067715f44dc99d39b08 Author: Joel Becker Date: Thu Nov 13 14:49:21 2008 -0800 ocfs2: Convert ocfs2_read_dir_block() to ocfs2_read_virt_blocks() Now that we've centralized the ocfs2_read_virt_blocks() code, let's use it in ocfs2_read_dir_block(). Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit a8549fb5abb2b372e46d5de0d23ff8b24f4a61af Author: Joel Becker Date: Thu Nov 13 14:49:20 2008 -0800 ocfs2: Wrap virtual block reads in ocfs2_read_virt_blocks() The ocfs2_read_dir_block() function really maps an inode's virtual blocks to physical ones before calling ocfs2_read_blocks(). Let's extract that to common code, because other places might want to do that. Other than the block number being virtual, ocfs2_read_virt_blocks() takes the same arguments as ocfs2_read_blocks(). It converts those virtual block numbers to physical before calling ocfs2_read_blocks() directly. If the blocks asked for are discontiguous, this can mean multiple calls to ocfs2_read_blocks(), but this is mostly hidden from the caller. Like ocfs2_read_blocks(), the caller can pass in an existing buffer_head. This is usually done to pick up some readahead I/O. ocfs2_read_virt_blocks() checks the buffer_head's block number against the extent map - it must match. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 970e4936d7d15f35d00fd15a14f5343ba78b2fc8 Author: Joel Becker Date: Thu Nov 13 14:49:19 2008 -0800 ocfs2: Validate metadata only when it's read from disk. Add an optional validation hook to ocfs2_read_blocks(). Now the validation function is only called when a block was actually read off of disk. It is not called when the buffer was in cache. We add a buffer state bit BH_NeedsValidate to flag these buffers. It must always be one higher than the last JBD2 buffer state bit. The dinode, dirblock, extent_block, and xattr_block validators are lifted to this scheme directly. The group_descriptor validator needs to be split into two pieces. The first part only needs the gd buffer and is passed to ocfs2_read_block(). The second part requires the dinode as well, and is called every time. It's only 3 compares, so it's tiny. This also allows us to clean up the non-fatal gd check used by resize.c. It now has no magic argument. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4ae1d69bedc8d174cb8a558694607e013157cde1 Author: Joel Becker Date: Thu Nov 13 14:49:18 2008 -0800 ocfs2: Wrap xattr block reads in a dedicated function We weren't consistently checking xattr blocks after we read them. Most places checked the signature, but none checked xb_blkno or xb_fs_signature. Create a toplevel ocfs2_read_xattr_block() that does the read and the validation. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit a22305cc693254a2aa651e797875669112ef8635 Author: Joel Becker Date: Thu Nov 13 14:49:17 2008 -0800 ocfs2: Wrap dirblock reads in a dedicated function. We have ocfs2_bread() as a vestige of the original ext-based dir code. It's only used by directories, though. Turn it into ocfs2_read_dir_block(), with a prototype matching the other metadata read functions. It's set up to validate dirblocks when the time comes. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 5e96581a377fc6bd76e9b112da9aeb8a7ae8bf22 Author: Joel Becker Date: Thu Nov 13 14:49:16 2008 -0800 ocfs2: Wrap extent block reads in a dedicated function. We weren't consistently checking extent blocks after we read them. Most places checked the signature, but none checked h_blkno or h_fs_signature. Create a toplevel ocfs2_read_extent_block() that does the read and the validation. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4203530613280281868b3ca36c817530bca3825c Author: Joel Becker Date: Thu Nov 13 14:49:15 2008 -0800 ocfs2: Morph the haphazard OCFS2_IS_VALID_GROUP_DESC() checks. Random places in the code would check a group descriptor bh to see if it was valid. The previous commit unified descriptor block reads, validating all block reads in the same place. Thus, these checks are no longer necessary. Rather than eliminate them, however, we change them to BUG_ON() checks. This ensures the assumptions remain true. All of the code paths to these checks have been audited to ensure they come from a validated descriptor read. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 68f64d471be38631d7196b938d9809802dd467fa Author: Joel Becker Date: Thu Nov 13 14:49:14 2008 -0800 ocfs2: Wrap group descriptor reads in a dedicated function. We have a clean call for validating group descriptors, but every place that wants the always does a read_block()+validate() call pair. Create a toplevel ocfs2_read_group_descriptor() that does the right thing. This allows us to leverage the single call point later for fancier handling. We also add validation of gd->bg_generation against the superblock and gd->bg_blkno against the block we thought we read. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 57e3e7971136003c96766346049aa73b82cab079 Author: Joel Becker Date: Thu Nov 13 14:49:13 2008 -0800 ocfs2: Consolidate validation of group descriptors. Currently the validation of group descriptors is directly duplicated so that one version can error the filesystem and the other (resize) can just report the problem. Consolidate to one function that takes a boolean. Wrap that function with the old call for the old users. This is in preparation for lifting the read+validate step into a single function. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 10995aa2451afa20b721cc7de856cae1a13dba57 Author: Joel Becker Date: Thu Nov 13 14:49:12 2008 -0800 ocfs2: Morph the haphazard OCFS2_IS_VALID_DINODE() checks. Random places in the code would check a dinode bh to see if it was valid. Not only did they do different levels of validation, they handled errors in different ways. The previous commit unified inode block reads, validating all block reads in the same place. Thus, these haphazard checks are no longer necessary. Rather than eliminate them, however, we change them to BUG_ON() checks. This ensures the assumptions remain true. All of the code paths to these checks have been audited to ensure they come from a validated inode read. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit b657c95c11088d77fc1bfc9c84d940f778bf9d12 Author: Joel Becker Date: Thu Nov 13 14:49:11 2008 -0800 ocfs2: Wrap inode block reads in a dedicated function. The ocfs2 code currently reads inodes off disk with a simple ocfs2_read_block() call. Each place that does this has a different set of sanity checks it performs. Some check only the signature. A couple validate the block number (the block read vs di->i_blkno). A couple others check for VALID_FL. Only one place validates i_fs_generation. A couple check nothing. Even when an error is found, they don't all do the same thing. We wrap inode reading into ocfs2_read_inode_block(). This will validate all the above fields, going readonly if they are invalid (they never should be). ocfs2_read_inode_block_full() is provided for the places that want to pass read_block flags. Every caller is passing a struct inode with a valid ip_blkno, so we don't need a separate blkno argument either. We will remove the validation checks from the rest of the code in a later commit, as they are no longer necessary. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit a68979b857283daf4acc405e476dcc8812a3ff2b Author: Tiger Yang Date: Fri Nov 14 11:17:52 2008 +0800 ocfs2: add mount option and Kconfig option for acl This patch adds the Kconfig option "CONFIG_OCFS2_FS_POSIX_ACL" and mount options "acl" to enable acls in Ocfs2. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 89c38bd0ade3c567707ed8fce088b253b0369c50 Author: Tiger Yang Date: Fri Nov 14 11:17:41 2008 +0800 ocfs2: add ocfs2_init_acl in mknod We need to get the parent directories acls and let the new child inherit it. To this, we add additional calculations for data/metadata allocation. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 060bc66dd5017460076d9e808e2198cd532c943d Author: Tiger Yang Date: Fri Nov 14 11:17:29 2008 +0800 ocfs2: add ocfs2_acl_chmod This function is used to update acl xattrs during file mode changes. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 23fc2702bea686569281708ad519b41a11d0a2f4 Author: Tiger Yang Date: Fri Nov 14 11:17:18 2008 +0800 ocfs2: add ocfs2_check_acl This function is used to enhance permission checking with POSIX ACLs. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 929fb014e041c6572c5e8c3686f1e32742b5b953 Author: Tiger Yang Date: Fri Nov 14 11:17:04 2008 +0800 ocfs2: add POSIX ACL API This patch adds POSIX ACL(access control lists) APIs in ocfs2. We convert struct posix_acl to many ocfs2_acl_entry and regard them as an extended attribute entry. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 4e3e9d027f63488e676bf7700ec515a192e54f69 Author: Tiger Yang Date: Fri Nov 14 11:16:53 2008 +0800 ocfs2: add ocfs2_xattr_get_nolock This function does the work of ocfs2_xattr_get under an open lock. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 534eadddc1de8754a227202c0e747af4973f82ce Author: Tiger Yang Date: Fri Nov 14 11:16:41 2008 +0800 ocfs2: add ocfs2_init_security in during file create Security attributes must be set when creating a new inode. We do this in three steps. - First, get security xattr's name and value by security_operation - Calculate and reserve the meta data and clusters needed by this security xattr before starting transaction - Finally, we set it before add_entry Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 923f7f3102b80403152e05aee3d55ecfce240440 Author: Tiger Yang Date: Fri Nov 14 11:16:27 2008 +0800 ocfs2: add security xattr API This patch add security xattr set/get/list APIs to support security attributes in Ocfs2. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit 6c3faba4421e230d77a181c260972229c542dec9 Author: Tiger Yang Date: Fri Nov 14 11:16:03 2008 +0800 ocfs2: add ocfs2_xattr_set_handle This function is used to set xattr's in a started transaction. It is only called during inode creation inode for initial security/acl xattrs of the new inode. These xattrs could be put into ibody or extent block, so xattr bucket would not be use in this case. Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit f5d362022a947e84b0a3dd656d09c6b2322e234f Author: Tiger Yang Date: Fri Nov 14 11:15:44 2008 +0800 ocfs2: move new inode allocation out of the transaction Move out inode allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called outside of a transaction. Signed-off-by: Jan Kara Signed-off-by: Tiger Yang Signed-off-by: Mark Fasheh commit fecc01126d7a244b7e9b563c80663ffdca35343b Author: Mark Fasheh Date: Wed Nov 12 15:16:38 2008 -0800 ocfs2: turn __ocfs2_remove_inode_range() into ocfs2_remove_btree_range() This patch genericizes the high level handling of extent removal. ocfs2_remove_btree_range() is nearly identical to __ocfs2_remove_inode_range(), except that extent tree operations have been used where necessary. We update ocfs2_remove_inode_range() to use the generic helper. Now extent tree based structures have an easy way to truncate ranges. Signed-off-by: Mark Fasheh Acked-by: Joel Becker commit 85db90e77806d48a19fda77dabe8897d369a1710 Author: Tao Ma Date: Wed Nov 12 08:27:01 2008 +0800 ocfs2/xattr: Merge xattr set transaction. In current ocfs2/xattr, the whole xattr set is divided into many steps are many transaction are used, this make the xattr set process isn't like a real transaction, so this patch try to merge all the transaction into one. Another benefit is that acl can use it easily now. I don't merge the transaction of deleting xattr when we remove an inode. The reason is that if we have a large number of xattrs and every xattrs has large values(large enough for outside storage), the whole transaction will be very huge and it looks like jbd can't handle it(I meet with a jbd complain once). And the old inode removal is also divided into many steps, so I'd like to leave as it is. Note: In xattr set, I try to avoid ocfs2_extend_trans since if the credits aren't enough for the extension, it will commit all the dirty blocks and create a new transaction which may lead to inconsistency in metadata. All ocfs2_extend_trans remained are safe now. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 78f30c314a74b9dc5d7368d96fe4be883d9a3a04 Author: Tao Ma Date: Wed Nov 12 08:27:00 2008 +0800 ocfs2/xattr: Reserve meta/data at the beginning of ocfs2_xattr_set. In ocfs2 xattr set, we reserve metadata and clusters in any place they are needed. It is time-consuming and ineffective, so this patch try to reserve metadata and clusters at the beginning of ocfs2_xattr_set. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit c73f60f900ddf73ec4ea2a143829ab97242c4e8c Author: Tao Ma Date: Wed Nov 12 08:26:59 2008 +0800 ocfs2/xattr: Move clusters free into dealloc. Move clusters free process into dealloc context so that they can be freed after the transaction. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 2891d290aa6eee0821f7e4ad0b1c4ae4d964b0f1 Author: Tao Ma Date: Wed Nov 12 08:26:58 2008 +0800 ocfs2: Add clusters free in dealloc_ctxt. Now in ocfs2 xattr set, the whole process are divided into many small parts and they are wrapped into diffrent transactions and it make the set doesn't look like a real transaction. So we want to integrate it into a real one. In some cases we will allocate some clusters and free some in just one transaction. e.g, one xattr is larger than inline size, so it and its value root is stored within the inode while the value is outside in a cluster. Then we try to update it with a smaller value(larger than the size of root but smaller than inline size), we may need to free the outside cluster while allocate a new bucket(one cluster) since now the inode may be full. The old solution will lock the global_bitmap(if the local alloc failed in stress test) and then the truncate log. This will cause a ABBA lock with truncate log flush. This patch add the clusters free in dealloc_ctxt, so that we can record the free clusters during the transaction and then free it after we release the global_bitmap in xattr set. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 976331d8789d4d84a11b45b87c520ade83715343 Author: Tao Ma Date: Wed Nov 12 08:26:57 2008 +0800 ocfs2/xattr: Only extend xattr bucket in need. When the first block of a bucket is filled up with xattr entries, we normally extend the bucket. But if we are just replace one xattr with small length, we don't need to extend it. This is important since we will calculate what we need before the transaction and in this situation no resources will be allocated. Signed-off-by: Tao Ma Signed-off-by: Mark Fasheh commit 757055adc5d41b910bdead925060f077dd2d9169 Author: Tao Ma Date: Thu Nov 6 08:10:48 2008 +0800 ocfs2/xattr: Only set buffer update if it doesn't exist in cache. When we call ocfs2_init_xattr_bucket, we deem that the new buffer head will be written to disk immediately, so we just use sb_getblk. But in some cases the buffer may have already been in ocfs2 uptodate cache, so we only call ocfs2_set_buffer_uptodate if the buffer head isn't in the cache. Signed-off-by: Tao Ma Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 1c32a2fd46ddc01bd86bff56a8f5d98c815750f4 Author: Tao Ma Date: Thu Nov 6 08:10:47 2008 +0800 ocfs2/xattr: Remove additional bucket allocation in bucket defragment. Joel has refactored xattr bucket and make xattr bucket a general wrapper. So in ocfs2_defrag_xattr_bucket, we have already passed the bucket in, so there is no need to allocate a new one and read it. Signed-off-by: Tao Ma Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 02dbf38d19c19016f558fe0dc0c44f8041d3eb8e Author: Joel Becker Date: Mon Oct 27 18:07:45 2008 -0700 ocfs2: Use buckets in ocfs2_xattr_set_entry_in_bucket(). The ocfs2_xattr_set_entry_in_bucket() function is already working on an ocfs2_xattr_bucket structure, so let's use the bucket API. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 161d6f30f18c4a7e2b24705b6690cce3ff276eb9 Author: Joel Becker Date: Mon Oct 27 15:25:18 2008 -0700 ocfs2: Use buckets in ocfs2_defrag_xattr_bucket(). Use the ocfs2_xattr_bucket abstraction for reading and writing the bucket in ocfs2_defrag_xattr_bucket(). Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 178eeac354ea28828d5e94a3a7b51368c171d6a5 Author: Joel Becker Date: Mon Oct 27 15:18:29 2008 -0700 ocfs2: Use buckets in ocfs2_xattr_create_index_block(). Use the ocfs2_xattr_bucket abstraction in ocfs2_xattr_create_index_block() and its helpers. We get more efficient reads, a lot less buffer_head munging, and nicer code to boot. While we're at it, ocfs2_xattr_update_xattr_search() becomes void. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit e2356a3f02cfdbce735465a2b40b6dc72a764c26 Author: Joel Becker Date: Mon Oct 27 15:01:54 2008 -0700 ocfs2: Use buckets in ocfs2_xattr_bucket_find(). Change the ocfs2_xattr_bucket_find() function to use ocfs2_xattr_bucket as its abstraction. This makes for more efficient reads, as buckets are linear blocks, and also has improved caching characteristics. It also reads better. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit ba937127596ec2c61437006741f7d29999284de4 Author: Joel Becker Date: Fri Oct 24 19:13:20 2008 -0700 ocfs2: Take ocfs2_xattr_bucket structures off of the stack. The ocfs2_xattr_bucket structure is a nice abstraction, but it is a bit large to have on the stack. Just like ocfs2_path, let's allocate it with a ocfs2_xattr_bucket_new() function. We can now store the inode on the bucket, cleaning up all the other bucket functions. While we're here, we catch another place or two that wasn't using ocfs2_read_xattr_bucket(). Updates: - No longer allocating xis.bucket, as it will never be used. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4980c6daba967124ed6420032960abd2b48412e2 Author: Joel Becker Date: Fri Oct 24 18:54:43 2008 -0700 ocfs2: Copy xattr buckets with a dedicated function. Now that the places that copy whole buckets are using struct ocfs2_xattr_bucket, we can do the copy in a dedicated function. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 1224be020f62ada3e19822feeac3840abf80de3e Author: Joel Becker Date: Fri Oct 24 18:47:33 2008 -0700 ocfs2: Wrap journal_access/journal_dirty for xattr buckets. A common action is to call ocfs2_journal_access() and ocfs2_journal_dirty() on the buffer heads of an xattr bucket. Let's create nice wrappers. While we're there, let's drop the places that try to be smart by writing only the first and last blocks of a bucket. A bucket is contiguous, so writing the whole thing is actually more efficient. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 784b816a9198dc3782c97cde8ddcf52fecdf1797 Author: Joel Becker Date: Fri Oct 24 17:33:40 2008 -0700 ocfs2: Improve ocfs2_read_xattr_bucket(). The ocfs2_read_xattr_bucket() function would read an xattr bucket into a list of buffer heads. However, we have a nice ocfs2_xattr_bucket structure. Let's have it fill that out instead. In addition, ocfs2_read_xattr_bucket() would initialize buffer heads for a bucket that's never been on disk before. That's confusing. Let's call that functionality ocfs2_init_xattr_bucket(). The functions ocfs2_cp_xattr_bucket() and ocfs2_half_xattr_bucket() are updated to use the ocfs2_xattr_bucket structure rather than raw bh lists. That way they can use the new read/init calls. In addition, they drop the wasted read of an existing target bucket. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 6dde41d9e7ba62f84cd7e91c0e993500af32ceb6 Author: Joel Becker Date: Fri Oct 24 17:16:48 2008 -0700 ocfs2: Provide a wrapper to brelse() xattr bucket buffers. A common theme is walking all the buffer heads on an ocfs2_xattr_bucket and releasing them. Let's wrap that. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 3e6329463e3a5c311e1d607ff3db735a18b6d67a Author: Joel Becker Date: Fri Oct 24 17:04:49 2008 -0700 ocfs2: Convenient access to an xattr bucket's header. The xattr code often wants to access the ocfs2_xattr_header at the start of an bucket. Rather than walk the pointer chains, let's just create another nice macro. As a side benefit, we can get rid of the mostly spurious ->bu_xh element on the bucket structure. The idea is ripped from the ocfs2_path code. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 51def39f0cabd46131c7c4df08751cb0cb9433d1 Author: Joel Becker Date: Fri Oct 24 16:57:21 2008 -0700 ocfs2: Convenient access to xattr bucket data blocks. The xattr code often wants to access the data pointer for blocks in an xattr bucket. This is usually found by dereferencing the bh array hanging off of the ocfs2_xattr_bucket structure. Rather than do this all the time, let's provide a nice little macro. The idea is ripped from the ocfs2_path code. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 9c7759aa670918a48f0c6e06779cd20f2781a2ac Author: Joel Becker Date: Fri Oct 24 16:21:03 2008 -0700 ocfs2: Convenient access to an xattr bucket's block number. The xattr code often wants to know the block number of an xattr bucket. This is usually found by dereferencing the first bh hanging off of the ocfs2_xattr_bucket structure. Rather than do this all the time, let's provide a nice little macro. The idea is ripped from the ocfs2_path code. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 4ac6032d6c92f0ac65cf5bc56b68557b3f099b66 Author: Joel Becker Date: Sat Oct 18 19:11:42 2008 -0700 ocfs2: Field prefixes for the xattr_bucket structure The ocfs2_xattr_bucket structure keeps track of the buffers for one xattr bucket. Let's prefix the fields for easier code navigation. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 5cf1c00b0ef3ba964b2ad268a55c278cf43f798f Author: David Brownell Date: Mon Jan 5 02:08:30 2009 -0800 ASoC: fix davinci-sffsdr buglet Minor bugfix: now that DaVinci kernels can support multiple boards, board-specific ASoC components need to verify they're running on the right board before initializing. Signed-off-by: David Brownell Signed-off-by: Kevin Hilman Signed-off-by: Mark Brown commit 88f60f62f31092db46aa5c71bf6da67c958bc420 Merge: e355204... e0d1ec9... Author: Ben Dooks Date: Mon Jan 5 10:54:50 2009 +0000 Merge branch 'i2c-next-s3c' into i2c-next commit cd8faac38c1c4ff2b404d808f6c623ab47e06475 Merge: 8924c67... 913ae5a... Author: Takashi Iwai Date: Mon Jan 5 10:53:58 2009 +0100 Merge branch 'topic/usbaudio' into for-linus commit 8924c671b668169289f8f4b70518b3aa96e454df Merge: ab05e29... acf26c0... Author: Takashi Iwai Date: Mon Jan 5 10:53:46 2009 +0100 Merge branch 'topic/hda' into for-linus commit ab05e290265341377187bb968575d3b7c72f9644 Merge: fe0bdec... ac11a2b... Author: Takashi Iwai Date: Mon Jan 5 10:53:43 2009 +0100 Merge branch 'topic/asoc' into for-linus commit 7945cc6464a4db0caf6dfacdfe05806051c4cb7b Author: David S. Miller Date: Mon Jan 5 00:59:00 2009 -0800 tcp: Kill extraneous SPLICE_F_NONBLOCK checks. In splice TCP receive, the SPLICE_F_NONBLOCK flag is used to compute the "timeo" value. So checking it again inside of the main receive loop to trigger -EAGAIN processing is entirely unnecessary. Noticed by Jarek P. and Lennert Buytenhek. Signed-off-by: David S. Miller commit 576b4d0cce9716a3a6c67ded27a638ef833b0a54 Author: David S. Miller Date: Mon Jan 5 00:55:24 2009 -0800 sparc: Remove reg*.h from Kbuild Forgot to commit this in previous change, noticed by Sam. Signed-off-by: David S. Miller commit 47cd5265ea8fe0b246bfd9b42ba69e13aa8b99bd Author: Julian Calaby Date: Mon Jan 5 00:07:18 2009 -0800 sparc: Clean arch-specific code in prom_common.c prom_nextprop() and prom_firstprop() have slightly different calling conventions in 32 and 64 bit SPARC. prom_common.c uses a ifdef guard to ensure that these functions are called correctly. Adjust code to eliminate this ifdef by using a calling convention that is compatible with both 32 and 64 bit SPARC. Signed-off-by: Julian Calaby Reviewed-by: Sam Ravnborg Signed-off-by: David S. Miller commit 4f7d54f59bc470f0aaa932f747a95232d7ebf8b1 Author: Lennert Buytenhek Date: Mon Jan 5 00:00:12 2009 -0800 tcp: don't mask EOF and socket errors on nonblocking splice receive Currently, setting SPLICE_F_NONBLOCK on splice from a TCP socket results in masking of EOF (RDHUP) and error conditions on the socket by an -EAGAIN return. Move the NONBLOCK check in tcp_splice_read() to be after the EOF and error checks to fix this. Signed-off-by: Lennert Buytenhek Signed-off-by: David S. Miller commit eb8374e71f941a1b3c2ed6ea19dc809e7124dc5d Author: Julia Lawall Date: Thu Dec 25 15:35:27 2008 +0100 GFS2: Use DEFINE_SPINLOCK SPIN_LOCK_UNLOCKED is deprecated. The following makes the change suggested in Documentation/spinlocks.txt The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ declarer name DEFINE_SPINLOCK; identifier xxx_lock; @@ - spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; + DEFINE_SPINLOCK(xxx_lock); // Signed-off-by: Julia Lawall Signed-off-by: Steven Whitehouse commit 88a19ad066c1aab2f9713beb670525fcc06e1c09 Author: Steven Whitehouse Date: Fri Dec 19 15:43:05 2008 +0000 GFS2: Fix use-after-free bug on umount (try #2) This should solve the issue with the previous attempt at fixing this. Signed-off-by: Steven Whitehouse commit fefc03bfedeff2002f14e848ecb7c0cd77ee0b15 Author: Steven Whitehouse Date: Fri Dec 19 15:32:06 2008 +0000 Revert "GFS2: Fix use-after-free bug on umount" This reverts commit 78802499912f1ba31ce83a94c55b5a980f250a43. The original patch is causing problems in relation to order of operations at umount in relation to jdata files. I need to fix this a different way. Signed-off-by: Steven Whitehouse commit 7ed122e42c72b3e4531f8b4a9f72159e8303ac15 Author: Steven Whitehouse Date: Wed Dec 10 10:28:10 2008 +0000 GFS2: Streamline alloc calculations for writes This patch removes some unused code, and make the calculation of the number of blocks required conditional in order to reduce the number of times this (potentially expensive) calculation is done. Signed-off-by: Steven Whitehouse commit 9a776db7371b9c77a8f4f0d2ac6374d78ac7db7d Author: Steven Whitehouse Date: Thu Nov 27 09:42:51 2008 +0000 GFS2: Send useful information with uevent messages In order to distinguish between two differing uevent messages and to avoid using the (racy) method of reading status from sysfs in future, this adds some status information to our uevent messages. Btw, before anybody says "sysfs isn't racy", I'm aware of that, but the way that GFS2 was using it (send an ambiugous uevent and then expect the receiver to read sysfs to find out the status of the reported operation) was. The additional benefit of using the new interface is that it should be possible for a node to recover multiple journals at the same time, since there is no longer any confusion as to which journal the status belongs to. At some future stage, when all the userland programs have been converted, I intend to remove the old interface. Signed-off-by: Steven Whitehouse commit 3af165ac4d099385b12e3e75a9ee3ffd02da33e0 Author: Steven Whitehouse Date: Thu Nov 27 08:27:28 2008 +0000 GFS2: Fix use-after-free bug on umount There was a use-after-free with the GFS2 super block during umount. This patch moves almost all of the umount code from ->put_super into ->kill_sb, the only bit that cannot be moved being the glock hash clearing which has to remain as ->put_super due to umount ordering requirements. As a result its now obvious that the kfree is the final operation, whereas before it was hidden in ->put_super. Also gfs2_jindex_free is then only referenced from a single file so thats moved and marked static too. Signed-off-by: Steven Whitehouse commit 2e204703a1161e9bae38ba0d3d0df04a679e6f4f Author: Steven Whitehouse Date: Wed Nov 26 14:01:26 2008 +0000 GFS2: Remove ancient, unused code Remove code that used to have something to do with initrd but has been unused for a long time. Signed-off-by: Steven Whitehouse commit 2bfb6449b7a1f29a2a63e1d869103b5811c3b69f Author: Steven Whitehouse Date: Wed Nov 26 13:30:49 2008 +0000 GFS2: Move four functions from super.c The functions which are being moved can all be marked static in their new locations, since they only have a single caller each. Their new locations are more logical than before and some of the functions are small enough that the compiler might well inline them. Signed-off-by: Steven Whitehouse commit b52896813c2f16bcc5c5b67bb3c3f75bc084439b Author: Steven Whitehouse Date: Wed Nov 26 12:49:26 2008 +0000 GFS2: Fix bug in gfs2_lock_fs_check_clean() gfs2_lock_fs_check_clean() should not be calling gfs2_jindex_hold() since it doesn't work like rindex hold, despite the comment. That allows gfs2_jindex_hold() to be moved into ops_fstype.c where it can be made static. Signed-off-by: Steven Whitehouse commit fdd1062ebaa422c5684f97fa91da06f91167d76b Author: Steven Whitehouse Date: Wed Nov 26 10:26:38 2008 +0000 GFS2: Send some sensible sysfs stuff We ought to inform the user of the locktable and lockproto for each uevent we generate. Signed-off-by: Steven Whitehouse commit 97cc1025b1a91c52e84f12478dcf0f853abc6564 Author: Steven Whitehouse Date: Thu Nov 20 13:39:47 2008 +0000 GFS2: Kill two daemons with one patch This patch removes the two daemons, gfs2_scand and gfs2_glockd and replaces them with a shrinker which is called from the VM. The net result is that GFS2 responds better when there is memory pressure, since it shrinks the glock cache at the same rate as the VFS shrinks the dcache and icache. There are no longer any time based criteria for shrinking glocks, they are kept until such time as the VM asks for more memory and then we demote just as many glocks as required. There are potential future changes to this code, including the possibility of sorting the glocks which are to be written back into inode number order, to get a better I/O ordering. It would be very useful to have an elevator based workqueue implementation for this, as that would automatically deal with the read I/O cases at the same time. This patch is my answer to Andrew Morton's remark, made during the initial review of GFS2, asking why GFS2 needs so many kernel threads, the answer being that it doesn't :-) This patch is a net loss of about 200 lines of code. Signed-off-by: Steven Whitehouse commit 9ac1b4d9b6f885ccd7d8f56bceb609003a920ff7 Author: Steven Whitehouse Date: Wed Nov 19 10:08:22 2008 +0000 GFS2: Move gfs2_recoverd into recovery.c By moving gfs2_recoverd, we can make an additional function static and it also leaves only (the already scheduled for removal) gfs2_glockd in daemon.c. At the same time the declaration of gfs2_quotad is moved to quota.h to reflect the new location of gfs2_quotad in a previous patch. Also the recovery.h and quota.h headers are cleaned up. Signed-off-by: Steven Whitehouse commit 813e0c46c9e2a0c6f0b6e774faac82afd7a2e812 Author: Steven Whitehouse Date: Tue Nov 18 13:38:48 2008 +0000 GFS2: Fix "truncate in progress" hang Following on from the recent clean up of gfs2_quotad, this patch moves the processing of "truncate in progress" inodes from the glock workqueue into gfs2_quotad. This fixes a hang due to the "truncate in progress" processing requiring glocks in order to complete. It might seem odd to use gfs2_quotad for this particular item, but we have to use a pre-existing thread since creating a thread implies a GFP_KERNEL memory allocation which is not allowed from the glock workqueue context. Of the existing threads, gfs2_logd and gfs2_recoverd may deadlock if used for this operation. gfs2_scand and gfs2_glockd are both scheduled for removal at some (hopefully not too distant) future point. That leaves only gfs2_quotad whose workload is generally fairly light and is easily adapted for this extra task. Also, as a result of this change, it opens the way for a future patch to make the reading of the inode's information asynchronous with respect to the glock workqueue, which is another improvement that has been on the list for some time now. Signed-off-by: Steven Whitehouse commit 37b2c8377c98acb60cf4d0126e385ef2153bded9 Author: Steven Whitehouse Date: Mon Nov 17 14:25:37 2008 +0000 GFS2: Clean up & move gfs2_quotad This patch is a clean up of gfs2_quotad prior to giving it an extra job to do in addition to the current portfolio of updating the quota and statfs information from time to time. As a result it has been moved into quota.c allowing one of the functions it calls to be made static. Also the clean up allows the two existing functions to have separate timeouts and also to coexist with its future role of dealing with the "truncate in progress" inode flag. The (pointless) setting of gfs2_quotad_secs is removed since we arrange to only wake up quotad when one of the two timers expires. In addition the struct gfs2_quota_data is moved into a slab cache, mainly for easier debugging. It should also be possible to use a shrinker in the future, rather than the current scheme of scanning the quota data entries from time to time. Signed-off-by: Steven Whitehouse commit fa75cedc3da5923b8ea3877be9d5bc09b02e3860 Author: Steven Whitehouse Date: Mon Nov 10 10:10:12 2008 +0000 GFS2: Add more detail to debugfs glock dumps Although the glock dumps print quite a lot of information about the glocks themselves, there are more things which can be usefully added to the dump realting to the objects themselves. This patch adds a few more fields to the inode and resource group lines, which should be useful for debugging. Signed-off-by: Steven Whitehouse commit 73f749483ed18f3b5759909cc4187b1741f54b10 Author: Steven Whitehouse Date: Tue Nov 4 10:32:57 2008 +0000 GFS2: Banish struct gfs2_rgrpd_host This patch moves the final field so that we can get rid of struct gfs2_rgrpd_host, as promised some time ago. Also by rearranging the fields slightly, we are able to reduce the size of the gfs2_rgrpd structure at the same time. Signed-off-by: Steven Whitehouse commit cfc8b54922db7b647b6d88914dc7ef8c63b6671d Author: Steven Whitehouse Date: Tue Nov 4 10:25:13 2008 +0000 GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd The second of three fields which need to move, in order to remove the struct gfs2_rgrpd_host. Signed-off-by: Steven Whitehouse commit d8b71f7381769177998acb2f59ddc73465a60fe0 Author: Steven Whitehouse Date: Tue Nov 4 10:19:03 2008 +0000 GFS2: Move rg_igeneration into struct gfs2_rgrpd This moves one of the fields of struct gfs2_rgrpd_host into the struct gfs2_rgrpd with the eventual aim of removing the struct rgrpd_host completely. Signed-off-by: Steven Whitehouse commit 383f01fbf4a701b73f5e35ea805ed1700b4b4db9 Author: Steven Whitehouse Date: Tue Nov 4 10:05:22 2008 +0000 GFS2: Banish struct gfs2_dinode_host The final field in gfs2_dinode_host was the i_flags field. Thats renamed to i_diskflags in order to avoid confusion with the existing inode flags, and moved into the inode proper at a suitable location to avoid creating a "hole". At that point struct gfs2_dinode_host is no longer needed and as promised (quite some time ago!) it can now be removed completely. Signed-off-by: Steven Whitehouse commit c9e98886776386f1f7828d9685e78cd341849867 Author: Steven Whitehouse Date: Tue Nov 4 09:47:33 2008 +0000 GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize This patch moved the i_size field from the gfs2_dinode_host and following the ext3 convention renames it i_disksize. Signed-off-by: Steven Whitehouse commit 3767ac21f471fe669a7d9f6abef682ddac8fc3d8 Author: Steven Whitehouse Date: Mon Nov 3 14:28:42 2008 +0000 GFS2: Move di_eattr into "proper" inode This moves the di_eattr field out of gfs2_inode_host and into the inode proper. Signed-off-by: Steven Whitehouse commit ad6203f2b46c2217f74b2e88299640eef5889e72 Author: Steven Whitehouse Date: Mon Nov 3 13:59:19 2008 +0000 GFS2: Move "entries" into "proper" inode This moves the directory entry count into the proper inode. Potentially we could get this to share the space used by something else in the future, but this is one more step on the way to removing the gfs2_dinode_host structure. Signed-off-by: Steven Whitehouse commit bcf0b5b348a1f49c2c878ffdb78e68c930baabb8 Author: Steven Whitehouse Date: Mon Nov 3 13:39:46 2008 +0000 GFS2: Move generation number into "proper" part of inode This moves the generation number from the gfs2_dinode_host into the gfs2_inode structure. Eventually the plan is to get rid of the gfs2_dinode_host structure completely. Signed-off-by: Steven Whitehouse commit 55ba474daed9763b2f6fe26ad762ee373554d65e Author: Harvey Harrison Date: Fri Oct 24 11:31:12 2008 -0700 GFS2: sparse annotation of gl->gl_spin fs/gfs2/glock.c:308:5: warning: context problem in 'do_promote': '_spin_unlock' expected different context fs/gfs2/glock.c:308:5: context '*gl+28': wanted >= 1, got 0 fs/gfs2/glock.c:529:2: warning: context problem in 'do_xmote': '_spin_unlock' expected different context fs/gfs2/glock.c:529:2: context '*gl+28': wanted >= 1, got 0 fs/gfs2/glock.c:925:3: warning: context problem in 'add_to_queue': '_spin_unlock' expected different context fs/gfs2/glock.c:925:3: context '*gl+28': wanted >= 1, got 0 Signed-off-by: Harvey Harrison Signed-off-by: Steven Whitehouse commit 1bb7322fd0d5abdce396de51cbc5dbc489523018 Author: Steven Whitehouse Date: Wed Oct 15 09:46:39 2008 +0100 GFS2: Fix up jdata writepage/delete_inode There is a bug in writepage and delete_inode which allows jdata files to invalidate pages from the address space without being in a transaction at the time. This causes problems in case the pages are in the journal. This patch fixes that case and prevents the resulting oops. Signed-off-by: Steven Whitehouse commit b276058371f5c2ad92f9f27373a72b219ed580ed Author: Steven Whitehouse Date: Tue Oct 14 16:05:55 2008 +0100 GFS2: Rationalise header files Move the contents of some headers which contained very little into more sensible places, and remove the original header files. This should make it easier to find things. Signed-off-by: Steven Whitehouse commit e9079cce201784632aed4b1a3121ee38c1ced0b6 Author: Steven Whitehouse Date: Tue Oct 14 14:43:29 2008 +0100 GFS2: Support for FIEMAP ioctl This patch implements the FIEMAP ioctl for GFS2. We can use the generic code (aside from a lock order issue, solved as per Ted Tso's suggestion) for which I've introduced a new variant of the generic function. We also have one exception to deal with, namely stuffed files, so we do that "by hand", setting all the required flags. This has been tested with a modified (I could only find an old version) of Eric's test program, and appears to work correctly. This patch does not currently support FIEMAP of xattrs, but the plan is to add that feature at some future point. Signed-off-by: Steven Whitehouse Cc: Theodore Tso Cc: Eric Sandeen commit 192eee8ef535cfdbdd0c93390e34f27ad7c02084 Author: David S. Miller Date: Sun Jan 4 23:17:21 2009 -0800 sparc: Kill asm/reg*.h As noticed by Sam Ravnborg, these aren't use for anything. Neither the kernel nor userland make a reference to this family of header files. So just get rid of them. Signed-off-by: David S. Miller commit 761b602620b4627dbd8f1b0bd2896022dc168a6d Author: Bastian Blank Date: Sun Jan 4 23:03:10 2009 -0800 sparc: Use 64BIT config entry Use 64BIT config entry to distinguish between 32 and 64bit builds instead of relying on the ARCH setting. Using sparc64 as ARCH still forces 64BIT on. Inspired by the x86 and s390 configs. [ Integrated CONFIG_64BIT help text suggestions from Sam -DaveM ] Signed-off-by: Bastian Blank Tested-by: Sam Ravnborg Signed-off-by: David S. Miller commit 129fa44785a399248ae2466b6cb5c655e96668f7 Author: Gerrit Renker Date: Sun Jan 4 21:45:33 2009 -0800 dccp: Integrate the TFRC library with DCCP This patch integrates the TFRC library, which is a dependency of CCID-3 (and CCID-4), with the new use of CCIDs in the DCCP module. Signed-off-by: Gerrit Renker Signed-off-by: David S. Miller commit e5fd56ca4eb3a130882bbef69d6952ef6aca5c8d Author: Gerrit Renker Date: Sun Jan 4 21:43:23 2009 -0800 dccp: Clean up ccid.c after integration of CCID plugins This patch cleans up after integrating the CCID modules and, in addition, * moves the if/else cases from ccid_delete() into ccid_hc_{tx,rx}_delete(); * removes the 'gfp' argument to ccid_new() - since it is always gfp_any(). Signed-off-by: Gerrit Renker Signed-off-by: David S. Miller commit ddebc973c56b51b4e5d84d606f0430d81b895d67 Author: Gerrit Renker Date: Sun Jan 4 21:42:53 2009 -0800 dccp: Lockless integration of CCID congestion-control plugins Based on Arnaldo's earlier patch, this patch integrates the standardised CCID congestion control plugins (CCID-2 and CCID-3) of DCCP with dccp.ko: * enables a faster connection path by eliminating the need to always go through the CCID registration lock; * updates the implementation to use only a single array whose size equals the number of configured CCIDs instead of the maximum (256); * since the CCIDs are now fixed array elements, synchronization is no longer needed, simplifying use and implementation. CCID-2 is suggested as minimum for a basic DCCP implementation (RFC 4340, 10); CCID-3 is a standards-track CCID supported by RFC 4342 and RFC 5348. Signed-off-by: Gerrit Renker Signed-off-by: David S. Miller commit 6ea2fde13abd3444008ab5e9585f9ed249e6047e Author: Heiko Carstens Date: Sun Jan 4 17:36:32 2009 -0800 qeth: get rid of extra argument after printk to dev_* conversion drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_setadapter_parms': drivers/s390/net/qeth_l3_main.c:1049: warning: too many arguments for format Signed-off-by: Heiko Carstens Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit 015e691cfef02f41aa4deb8aa7efc394bb6d85f0 Author: Klaus-Dieter Wacker Date: Sun Jan 4 17:36:05 2009 -0800 qeth: No large send using EDDP for HiperSockets. From: Klaus-Dieter Wacker The device driver qeth dos not support large send using EDDP for HiperSockets. Signed-off-by: Klaus-Dieter Wacker Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit 5b54e16f1a54cee8e590cb039b5c067914ae5081 Author: Frank Blaschka Date: Sun Jan 4 17:35:44 2009 -0800 qeth: do not spin for SETIP ip assist command The ip assist hw command for setting an IP address last unacceptable long so we can not spin while we waiting for the irq. Since we can ensure process context for all occurrences of this command we can use wait. Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit fc9c24603c4b93d84160e14c0a98a754d4328d15 Author: Ursula Braun Date: Sun Jan 4 17:35:18 2009 -0800 qeth: avoid crash in case of layer mismatch for VSWITCH For z/VM GuestLAN or VSWITCH devices the transport layer is configured in z/VM. The layer2 attribute of a participating Linux device has to match the z/VM definition. In case of a mismatch Linux currently crashes in qeth recovery due to a reference to the not yet existing net_device. Solution: add a check for existence of net_device and add a message pointing to the mismatch of layer definitions in Linux and z/VM. Signed-off-by: Ursula Braun Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit fe94e2e0a63a49d23753f56eacb446c4f73c1dea Author: Ursula Braun Date: Sun Jan 4 17:34:52 2009 -0800 qeth: exploit source MAC address for inbound layer3 packets OSA-devices operating in layer3 mode offer adding of the source MAC address to the QDIO header of inbound packets. The qeth driver can exploit this functionality to replace FAKELL-entries in the ethernet header of received packets. Signed-off-by: Ursula Braun Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit 906f1f0768c736368244ac8fe6023c2b0c31b9ea Author: Klaus-Dieter Wacker Date: Sun Jan 4 17:34:10 2009 -0800 qeth: HiperSockets mcl string conversion (pre z9 mach) The pre z9 machines provide an mcl string in EBCDIC format, z9 or later provide string in ASCII format. Signed-off-by: Klaus-Dieter Wacker Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller commit 6e5c172cf7ca1ab878cc6a6a4c1d52fef60f3ee0 Author: Oliver Hartkopp Date: Sun Jan 4 17:31:18 2009 -0800 can: update can-bcm for hrtimer hardirq callbacks Since commit ca109491f612aab5c8152207631c0444f63da97f ("hrtimer: removing all ur callback modes") the hrtimer callbacks are processed only in hardirq context. This patch moves some functionality into tasklets to run in softirq context. Additionally some duplicated code was removed in bcm_rx_thr_flush() and an avoidable memcpy was removed from bcm_rx_handler(). Signed-off-by: Oliver Hartkopp Signed-off-by: David S. Miller commit 858eb711ba64f8a001d7003295b8078bcab33b6d Author: Roel Kluin Date: Sun Jan 4 17:29:21 2009 -0800 DCB: fix kfree(skb) Use kfree_skb instead of kfree for struct sk_buff pointers. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller commit 914d11647b6d6fe81bdf0c059612ee36282b8cee Author: Ilpo Järvinen Date: Sun Jan 4 17:27:31 2009 -0800 ipv6: IPV6_PKTINFO relied userspace providing correct length Signed-off-by: Ilpo Järvinen Reported-by: Eric Sesterhenn Signed-off-by: David S. Miller commit 22604c866889c4b2e12b73cbf1683bda1b72a313 Author: Michael Marineau Date: Sun Jan 4 17:18:51 2009 -0800 net: Fix for initial link state in 2.6.28 From: Michael Marineau Commit b47300168e770b60ab96c8924854c3b0eb4260eb "Do not fire linkwatch events until the device is registered." was made as a workaround for drivers that call netif_carrier_off before registering the device. Unfortunately this causes these drivers to incorrectly report their link status as IF_OPER_UNKNOWN which can falsely set the IFF_RUNNING flag when the interface is first brought up. This issues was previously pointed out[1] but was dismissed saying that IFF_RUNNING is not related to the link status. From my digging IFF_RUNNING, as reported to userspace, is based on the link state. It is set based on __LINK_STATE_START and IF_OPER_UP or IF_OPER_UNKNOWN. See [2], [3], and [4]. (Whether or not the kernel has IFF_RUNNING set in flags is not reported to user space so it may well be independent of the link, I don't know if and when it may get set.) The end result depends slightly depending on the driver. The the two I tested were e1000e and b44. With e1000e if the system is booted without a network cable attached the interface will falsely report RUNNING when it is brought up causing NetworkManager to attempt to start it and eventually time out. With b44 when the system is booted with a network cable attached and brought up with dhcpcd it will time out the first time. The attached patch that will still set the operstate variable correctly to IF_OPER_UP/DOWN/etc when linkwatch_fire_event is called but then return rather than skipping the linkwatch_fire_event call entirely as the previous fix did. (sorry it isn't inline, I don't have a patch friendly email client at the moment) Signed-off-by: David S. Miller commit 745417e20684e4951afcabfe74583a3884e54980 Author: Gerrit Renker Date: Sun Jan 4 17:14:46 2009 -0800 tun: Eliminate sparse signedness warning register_pernet_gen_device() expects 'int*', found via sparse. CHECK drivers/net/tun.c drivers/net/tun.c:1245:36: warning: incorrect type in argument 1 (different signedness) drivers/net/tun.c:1245:36: expected int *id drivers/net/tun.c:1245:36: got unsigned int static [toplevel] * Signed-off-by: Gerrit Renker Signed-off-by: David S. Miller commit f26251eb68ea766a98fed922593c154d15127621 Author: Bruce Allan Date: Sun Jan 4 17:12:04 2009 -0800 e100: cosmetic cleanup Add missing space after if, switch, for and while keywords. Signed-off-by: Bruce Allan Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller commit f32f8b72e02e851972a0172603104046aa5fec96 Author: Simon Holm Thøgersen Date: Sun Jan 4 17:11:24 2009 -0800 net/rfkill/rfkill.c: fix unused rfkill_led_trigger() warning commit 4dec9b807be757780ca3611a959ac22c28d292a7 ("rfkill: strip pointless notifier chain") removed the only user of rfkill_led_trigger() that was not guarded by #ifdef CONFIG_RFKILL_LEDS. Therefore, move rfkill_led_trigger() completely inside #ifdef CONFIG_RFKILL_LEDS and avoid the compile time warning: net/rfkill/rfkill.c:59: warning: 'rfkill_led_trigger' defined but not used Signed-off-by: Simon Holm Thøgersen Signed-off-by: David S. Miller commit 939678f81a55c839ae58c9cc3d4ec6d0f60e7dc7 Author: Ron Mercer Date: Sun Jan 4 17:08:29 2009 -0800 qlge: bugfix: Fix register access error checking. Some indexed registers do not have error bits. In these cases a value of zero should be used for error checking. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 459caf5a99cd066598192a86f8f63d73f0b423a6 Author: Ron Mercer Date: Sun Jan 4 17:08:11 2009 -0800 qlge: bugfix: Fix ring length setting for rx ring, large/small The length field for these rings is 16-bits. If the length is the max supported 65536 then the setting should be zero. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 2b72c7849f9a091c1e5d7255732faf14ac7d5123 Author: Ron Mercer Date: Sun Jan 4 17:07:50 2009 -0800 qlge: bugfix: Fix shadow register endian issue. Shadow registers are consistent memory locations to which the chip echos ring indexes in little endian format. These values need to be endian swapped before referencing. Note: The register pointer declaration uses the volatile modifier which causes warnings in checkpatch. Per Documentation/volatile-considered-harmful.txt: - Pointers to data structures in coherent memory which might be modified by I/O devices can, sometimes, legitimately be volatile. A ring buffer used by a network adapter, where that adapter changes pointers to indicate which descriptors have been processed, is an example of this type of situation. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit 4055c7d495f2502718bbbea871e6504ae95add14 Author: Ron Mercer Date: Sun Jan 4 17:07:09 2009 -0800 qlge: bugfix: Add missing pci_unmap_page call in receive path. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit c907a35acf0e964dfd0753519b3dc7689727e175 Author: Ron Mercer Date: Sun Jan 4 17:06:46 2009 -0800 qlge: bugfix: Add missing pci_mapping_err checking. Signed-off-by: Ron Mercer Signed-off-by: David S. Miller commit fe0bdec68b77020281dc814805edfe594ae89e0f Merge: 099e657... 5af75d8... Author: Linus Torvalds Date: Sun Jan 4 16:32:11 2009 -0800 Merge branch 'audit.b61' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current * 'audit.b61' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current: audit: validate comparison operations, store them in sane form clean up audit_rule_{add,del} a bit make sure that filterkey of task,always rules is reported audit rules ordering, part 2 fixing audit rule ordering mess, part 1 audit_update_lsm_rules() misses the audit_inode_hash[] ones sanitize audit_log_capset() sanitize audit_fd_pair() sanitize audit_mq_open() sanitize AUDIT_MQ_SENDRECV sanitize audit_mq_notify() sanitize audit_mq_getsetattr() sanitize audit_ipc_set_perm() sanitize audit_ipc_obj() sanitize audit_socketcall don't reallocate buffer in every audit_sockaddr() commit 22692018b93f0782cda5a843cecfffda1854eb8d Author: Baruch Siach Date: Sun Jan 4 16:23:01 2009 -0800 enc28j60: fix RX buffer overflow The enc28j60 driver doesn't check whether the length of the packet as reported by the hardware fits into the preallocated buffer. When stressed, the hardware may report insanely large packets even tough the "Receive OK" bit is set. Fix this. Signed-off-by: Baruch Siach Signed-off-by: David S. Miller commit fecc7036e73a71231045e03ff524b5f8bd892a84 Author: Roel Kluin Date: Sun Jan 4 16:22:04 2009 -0800 isdn: capi: &&/|| typos Correct two typos. Signed-off-by: Roel Kluin Acked-by: Karsten Keil Signed-off-by: David S. Miller commit 5d38a079ce3971f932bbdc0dc5b887806fabd5dc Author: Herbert Xu Date: Sun Jan 4 16:13:40 2009 -0800 gro: Add page frag support This patch allows GRO to merge page frags (skb_shinfo(skb)->frags) in one skb, rather than using the less efficient frag_list. It also adds a new interface, napi_gro_frags to allow drivers to inject page frags directly into the stack without allocating an skb. This is intended to be the GRO equivalent for LRO's lro_receive_frags interface. The existing GSO interface can already handle page frags with or without an appended frag_list so nothing needs to be changed there. The merging itself is rather simple. We store any new frag entries after the last existing entry, without checking whether the first new entry can be merged with the last existing entry. Making this check would actually be easy but since no existing driver can produce contiguous frags anyway it would just be mental masturbation. If the total number of entries would exceed the capacity of a single skb, we simply resort to using frag_list as we do now. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit b530256d2e0f1a75fab31f9821129fff1bb49faa Author: Herbert Xu Date: Sun Jan 4 16:13:19 2009 -0800 gro: Use gso_size to store MSS In order to allow GRO packets without frag_list at all, we need to store the MSS in the packet itself. The obvious place is gso_size. The only thing to watch out for is if the packet ends up not being GRO then we need to clear gso_size before pushing the packet into the stack. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller commit cfc3a44c3c32abe48898398d9a92e8524c976803 Author: Jaswinder Singh Rajput Date: Sun Jan 4 16:12:11 2009 -0800 starfire: use request_firmware() Firmware blob is big endian Signed-off-by: Jaswinder Singh Rajput Signed-off-by: David S. Miller commit 077f849de42e58172e25ccb24df4c1a13e82420c Author: Jaswinder Singh Rajput Date: Sun Jan 4 16:11:25 2009 -0800 firmware: convert tg3 driver to request_firmware() Firmware blob looks like this... u8 firmware_major u8 firmware_minor u8 firmware_fix u8 pad __be32 start_address __be32 length (total, including BSS sections to be zeroed) data... (in __be32 words, which is native for the firmware) Signed-off-by: Jaswinder Singh Rajput Signed-off-by: David S. Miller commit 949b42544a20fb22800e244a004ff45bd359a21b Author: Jaswinder Singh Date: Sun Jan 4 16:09:40 2009 -0800 firmware: convert acenic driver to request_firmware() We store the firmware in its native big-endian form now, so the loop in ace_copy() is modified to use be32_to_cpup() when writing it out. We can forget the BSS,SBSS sections of the firmware, since we were clearing all the device's RAM anyway. And the text,rodata,data sections can all be loaded as a single chunk since they're contiguous (give or take a few dozen bytes in between). Signed-off-by: Jaswinder Singh Signed-off-by: David Woodhouse Acked-by: Jes Sorensen Signed-off-by: David S. Miller commit 14deae41566b5cdd992c01d0069518ced5227c83 Author: David S. Miller Date: Sun Jan 4 16:04:39 2009 -0800 ipv6: Fix sporadic sendmsg -EINVAL when sending to multicast groups. Thanks to excellent diagnosis by Eduard Guzovsky. The core problem is that on a network with lots of active multicast traffic, the neighbour cache can fill up. If we try to allocate a new route and thus neighbour cache entry, the bog-standard GC attempt the neighbour layer does in ineffective because route entries hold a reference to the existing neighbour entries and GC can only liberate entries with no references. IPV4 already has a way to handle this, by doing a route cache GC in such situations (when neigh attach returns -ENOBUFS). So simply mimick this on the ipv6 side. Tested-by: Eduard Guzovsky Signed-off-by: David S. Miller commit 473321fc373e712fbb9b88e2c0736e55fddadab8 Author: Sam Ravnborg Date: Sun Jan 4 15:47:49 2009 -0800 MAINTAINERS: update sparc maintainer Reflect the current situation where David Miller is the sparc maintainer. I have tried to contact Bill on following adresses: wli@holomorphy.com wlirwin@us.ibm.com with no success and Bill has not been active on the sparclinux mailing list for a long time. As sparc and sparc64 are unified I unified the two entries in the MAINTAINERS file too. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 83c86984bff2d793c91eb710af7857828b9ddb49 Author: Sam Ravnborg Date: Sun Jan 4 15:44:22 2009 -0800 sparc: unify ipcbuf.h The ony difference is the size of the mode. sparc has extra padding to compensate for this. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 9e01892c4234070bbcf3a9f582514c8b91464375 Author: Heiko Carstens Date: Mon Dec 22 12:36:31 2008 +0100 module: convert to stop_machine_create/destroy. The module code relies on a non-failing stop_machine call. So we create the kstop threads in advance and with that make sure the call won't fail. Signed-off-by: Heiko Carstens Signed-off-by: Rusty Russell commit 9ea09af3bd3090e8349ca2899ca2011bd94cda85 Author: Heiko Carstens Date: Mon Dec 22 12:36:30 2008 +0100 stop_machine: introduce stop_machine_create/destroy. Introduce stop_machine_create/destroy. With this interface subsystems that need a non-failing stop_machine environment can create the stop_machine machine threads before actually calling stop_machine. When the threads aren't needed anymore they can be killed with stop_machine_destroy again. When stop_machine gets called and the threads aren't present they will be created and destroyed automatically. This restores the old behaviour of stop_machine. This patch also converts cpu hotplug to the new interface since it is special: cpu_down calls __stop_machine instead of stop_machine. However the kstop threads will only be created when stop_machine gets called. Changing the code so that the threads would be created automatically on __stop_machine is currently not possible: when __stop_machine gets called we hold cpu_add_remove_lock, which is the same lock that create_rt_workqueue would take. So the workqueue needs to be created before the cpu hotplug code locks cpu_add_remove_lock. Signed-off-by: Heiko Carstens Signed-off-by: Rusty Russell commit c298be74492bece102f3379d14015638f1fd1fac Author: Helge Deller Date: Thu Jan 1 22:25:30 2009 +0100 parisc: fix module loading failure of large kernel modules On 32bit (and sometimes 64bit) and with big kernel modules like xfs or ipv6 the relocation types R_PARISC_PCREL17F and R_PARISC_PCREL22F may fail to reach their PLT stub if we only create one big stub array for all sections at the beginning of the core or init section. With this patch we now instead add individual PLT stub entries directly in front of the code sections where the stubs are actually called. This reduces the distance between the PCREL location and the stub entry so that the relocations can be fulfilled. While calculating the final layout of the kernel module in memory, the kernel module loader calls arch_mod_section_prepend() to request the to be reserved amount of memory in front of each individual section. Tested with 32- and 64bit kernels. Signed-off-by: Helge Deller Signed-off-by: Rusty Russell commit 088af9a6e05d51e7c3dc85d45d8b7a52c3ee08d7 Author: Helge Deller Date: Wed Dec 31 12:31:18 2008 +0100 module: fix module loading failure of large kernel modules for parisc When creating the final layout of a kernel module in memory, allow the module loader to reserve some additional memory in front of a given section. This is currently only needed for the parisc port which needs to put the stub entries there to fulfill the 17/22bit PCREL relocations with large kernel modules like xfs. Signed-off-by: Helge Deller Signed-off-by: Rusty Russell (renamed fn) commit d1e99d7ae4e6bbd1ebb5e81ecd3af2b8793efee0 Author: Jianjun Kong Date: Mon Dec 8 14:26:29 2008 +0800 module: fix warning of unused function when !CONFIG_PROC_FS Fix this warning: kernel/module.c:824: warning: ‘print_unload_info’ defined but not used print_unload_info() just was used when CONFIG_PROC_FS was defined. This patch mark print_unload_info() inline to solve the problem. Signed-off-by: Jianjun Kong Signed-off-by: Rusty Russell CC: Ingo Molnar CC: Américo Wang commit ca4787b779dd698a2a33a328aa5fa90a3e954077 Author: Tim Abbott Date: Mon Jan 5 08:40:10 2009 -0600 kernel/module.c: compare symbol values when marking symbols as exported in /proc/kallsyms. When there are two symbols in a module with the same name, one of which is exported, both will be marked as exported in /proc/kallsyms. There aren't any instances of this in the current kernel, but it is easy to construct a simple module with two compilation units that exhibits the problem. $ objdump -j .text -t testmod.ko | grep foo 00000000 l F .text 00000032 foo 00000080 g F .text 00000001 foo $ sudo insmod testmod.ko $ grep "T foo" /proc/kallsyms c28e8000 T foo [testmod] c28e8080 T foo [testmod] Fix this by comparing the symbol values once we've found the exported symbol table entry matching the symbol name. Tested using Ksplice: $ ksplice-create --patch=this_commit.patch --id=bar . $ sudo ksplice-apply ksplice-bar.tar.gz Done! $ grep "T foo" /proc/kallsyms c28e8080 T foo [testmod] Signed-off-by: Tim Abbott Cc: Rusty Russell Signed-off-by: Andrew Morton Signed-off-by: Rusty Russell commit a327ca2c2674c5a9a0073421df19bfc362698136 Author: Johannes Berg Date: Tue Jul 8 19:00:26 2008 +0200 remove CONFIG_KMOD Now that nothing depends on it any more, remove CONFIG_KMOD. Signed-off-by: Johannes Berg Signed-off-by: Rusty Russell commit 099e657625e801adf82054c8050dde5aceb68452 Author: Alessandro Zummo Date: Sun Jan 4 12:00:54 2009 -0800 rtc: add alarm/update irq interfaces Add standard interfaces for alarm/update irqs enabling. Drivers are no more required to implement equivalent ioctl code as rtc-dev will provide it. UIE emulation should now be handled correctly and will work even for those RTC drivers who cannot be configured to do both UIE and AIE. Signed-off-by: Alessandro Zummo Cc: David Brownell Cc: Atsushi Nemoto Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 54566b2c1594c2326a645a3551f9d989f7ba3c5e Author: Nick Piggin Date: Sun Jan 4 12:00:53 2009 -0800 fs: symlink write_begin allocation context fix With the write_begin/write_end aops, page_symlink was broken because it could no longer pass a GFP_NOFS type mask into the point where the allocations happened. They are done in write_begin, which would always assume that the filesystem can be entered from reclaim. This bug could cause filesystem deadlocks. The funny thing with having a gfp_t mask there is that it doesn't really allow the caller to arbitrarily tinker with the context in which it can be called. It couldn't ever be GFP_ATOMIC, for example, because it needs to take the page lock. The only thing any callers care about is __GFP_FS anyway, so turn that into a single flag. Add a new flag for write_begin, AOP_FLAG_NOFS. Filesystems can now act on this flag in their write_begin function. Change __grab_cache_page to accept a nofs argument as well, to honour that flag (while we're there, change the name to grab_cache_page_write_begin which is more instructive and does away with random leading underscores). This is really a more flexible way to go in the end anyway -- if a filesystem happens to want any extra allocations aside from the pagecache ones in ints write_begin function, it may now use GFP_KERNEL (rather than GFP_NOFS) for common case allocations (eg. ocfs2_alloc_write_ctxt, for a random example). [kosaki.motohiro@jp.fujitsu.com: fix ubifs] [kosaki.motohiro@jp.fujitsu.com: fix fuse] Signed-off-by: Nick Piggin Reviewed-by: KOSAKI Motohiro Cc: [2.6.28.x] Signed-off-by: KOSAKI Motohiro Signed-off-by: Andrew Morton [ Cleaned up the calling convention: just pass in the AOP flags untouched to the grab_cache_page_write_begin() function. That just simplifies everybody, and may even allow future expansion of the logic. - Linus ] Signed-off-by: Linus Torvalds commit e687d691cb3790d25e31c74f5941fd7c565e9df5 Author: Bruno Prémont Date: Sun Jan 4 13:11:54 2009 -0800 viafb: fix crashes due to 4k stack overflow The function viafb_cursor() uses 2 stack-variables of CURSOR_SIZE bits; CURSOR_SIZE is defined as (8 * 1024). Using up twice 1k on stack is too much for 4k-stack (though it works with 8k-stacks). Make those two variables kzalloc'ed to preserve stack space. Also merge the whole lot of local struct's in viafb_ioctl into a union so the stack usage gets minimized here as well. (struct's are only accessed in their indicidual IOCTL case) This second part is only compile-tested as I know of no userspace app using the IOCTLs. Signed-off-by: Bruno Prémont Cc: Cc: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c644f0e4b56f9a2fc066cd0d75a18074d130e4a3 Author: Pekka Enberg Date: Sun Jan 4 12:00:48 2009 -0800 fs: introduce bgl_lock_ptr() As suggested by Andreas Dilger, introduce a bgl_lock_ptr() helper in and add separate sb_bgl_lock() helpers to filesystem specific header files to break the hidden dependency to struct ext[234]_sb_info. Also, while at it, convert the macros to static inlines to try make up for all the times I broke Andrew Morton's tree. Acked-by: Andreas Dilger Signed-off-by: Pekka Enberg Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a30c5cefa53cbac429dcb2de906c0637b646253 Author: Randy Dunlap Date: Sun Jan 4 12:00:47 2009 -0800 spi.h uses/needs device.h Include header files as used/needed: In file included from drivers/leds/leds-dac124s085.c:16: include/linux/spi/spi.h:66: error: field 'dev' has incomplete type include/linux/spi/spi.h: In function 'to_spi_device': include/linux/spi/spi.h:100: warning: type defaults to 'int' in declaration of '__mptr' ... Signed-off-by: Randy Dunlap Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2e4e27c7d082b2198b63041310609d7191185a9d Author: Adam Lackorzynski Date: Sun Jan 4 12:00:46 2009 -0800 vmalloc.c: fix flushing in vmap_page_range() The flush_cache_vmap in vmap_page_range() is called with the end of the range twice. The following patch fixes this for me. Signed-off-by: Adam Lackorzynski Cc: Nick Piggin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b574b7b0124ed344911f5d581e9bc2d83bbeb19 Author: Li Zefan Date: Sun Jan 4 12:00:45 2009 -0800 cgroups: fix a race between cgroup_clone and umount The race is calling cgroup_clone() while umounting the ns cgroup subsys, and thus cgroup_clone() might access invalid cgroup_fs, or kill_sb() is called after cgroup_clone() created a new dir in it. The BUG I triggered is BUG_ON(root->number_of_cgroups != 1); ------------[ cut here ]------------ kernel BUG at kernel/cgroup.c:1093! invalid opcode: 0000 [#1] SMP ... Process umount (pid: 5177, ti=e411e000 task=e40c4670 task.ti=e411e000) ... Call Trace: [] ? deactivate_super+0x3f/0x51 [] ? mntput_no_expire+0xb3/0xdd [] ? sys_umount+0x265/0x2ac [] ? sys_oldumount+0xd/0xf [] ? sysenter_do_call+0x12/0x31 ... EIP: [] cgroup_kill_sb+0x23/0xe0 SS:ESP 0068:e411ef2c ---[ end trace c766c1be3bf944ac ]--- Cc: Serge E. Hallyn Signed-off-by: Li Zefan Cc: Paul Menage Cc: "Serge E. Hallyn" Cc: Balbir Singh Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5af75d8d58d0f9f7b7c0515b35786b22892d5f12 Author: Al Viro Date: Tue Dec 16 05:59:26 2008 -0500 audit: validate comparison operations, store them in sane form Don't store the field->op in the messy (and very inconvenient for e.g. audit_comparator()) form; translate to dense set of values and do full validation of userland-submitted value while we are at it. ->audit_init_rule() and ->audit_match_rule() get new values now; in-tree instances updated. Signed-off-by: Al Viro commit 36c4f1b18c8a7d0adb4085e7f531860b837bb6b0 Author: Al Viro Date: Mon Dec 15 01:50:28 2008 -0500 clean up audit_rule_{add,del} a bit Signed-off-by: Al Viro commit e048e02c89db7bd49d1a5fac77a11c8fb3603087 Author: Al Viro Date: Tue Dec 16 03:51:22 2008 -0500 make sure that filterkey of task,always rules is reported Signed-off-by: Al Viro commit e45aa212ea81d39b38ba158df344dc3a500153e5 Author: Al Viro Date: Mon Dec 15 01:17:50 2008 -0500 audit rules ordering, part 2 Fix the actual rule listing; add per-type lists _not_ used for matching, with all exit,... sitting on one such list. Simplifies "do something for all rules" logics, while we are at it... Signed-off-by: Al Viro commit 0590b9335a1c72a3f0defcc6231287f7817e07c8 Author: Al Viro Date: Sun Dec 14 23:45:27 2008 -0500 fixing audit rule ordering mess, part 1 Problem: ordering between the rules on exit chain is currently lost; all watch and inode rules are listed after everything else _and_ exit,never on one kind doesn't stop exit,always on another from being matched. Solution: assign priorities to rules, keep track of the current highest-priority matching rule and its result (always/never). Signed-off-by: Al Viro commit 1a9d0797b8977d413435277bf9661efbbd584693 Author: Al Viro Date: Sun Dec 14 12:04:02 2008 -0500 audit_update_lsm_rules() misses the audit_inode_hash[] ones Signed-off-by: Al Viro commit 57f71a0af4244d9ba3c0bce74b1d2e66e8d520bd Author: Al Viro Date: Sun Jan 4 14:52:57 2009 -0500 sanitize audit_log_capset() * no allocations * return void * don't duplicate checked for dummy context Signed-off-by: Al Viro commit 157cf649a735a2f7e8dba0ed08e6e38b6c30d886 Author: Al Viro Date: Sun Dec 14 04:57:47 2008 -0500 sanitize audit_fd_pair() * no allocations * return void Signed-off-by: Al Viro commit 564f6993ffef656aebaf46cf2f1f6cb4f5c97207 Author: Al Viro Date: Sun Dec 14 04:02:26 2008 -0500 sanitize audit_mq_open() * don't bother with allocations * don't do double copy_from_user() * don't duplicate parts of check for audit_dummy_context() Signed-off-by: Al Viro commit c32c8af43b9adde8d6f938d8e6328c13b8de79ac Author: Al Viro Date: Sun Dec 14 03:46:48 2008 -0500 sanitize AUDIT_MQ_SENDRECV * logging the original value of *msg_prio in mq_timedreceive(2) is insane - the argument is write-only (i.e. syscall always ignores the original value and only overwrites it). * merge __audit_mq_timed{send,receive} * don't do copy_from_user() twice * don't mess with allocations in auditsc part * ... and don't bother checking !audit_enabled and !context in there - we'd already checked for audit_dummy_context(). Signed-off-by: Al Viro commit 20114f71b27cafeb7c7e41d2b0f0b68c3fbb022b Author: Al Viro Date: Wed Dec 10 07:16:12 2008 -0500 sanitize audit_mq_notify() * don't copy_from_user() twice * don't bother with allocations * don't duplicate parts of audit_dummy_context() * make it return void Signed-off-by: Al Viro commit 7392906ea915b9a2c14dea32b3604b4e178f82f7 Author: Al Viro Date: Wed Dec 10 06:58:59 2008 -0500 sanitize audit_mq_getsetattr() * get rid of allocations * make it return void * don't duplicate parts of audit_dummy_context() Signed-off-by: Al Viro commit e816f370cbadd2afea9f1a42f232d0636137d563 Author: Al Viro Date: Wed Dec 10 03:47:15 2008 -0500 sanitize audit_ipc_set_perm() * get rid of allocations * make it return void * simplify callers Signed-off-by: Al Viro commit a33e6751003c5ade603737d828b1519d980ce392 Author: Al Viro Date: Wed Dec 10 03:40:06 2008 -0500 sanitize audit_ipc_obj() * get rid of allocations * make it return void * simplify callers Signed-off-by: Al Viro commit f3298dc4f2277874d40cb4fc3a6e277317d6603b Author: Al Viro Date: Wed Dec 10 03:16:51 2008 -0500 sanitize audit_socketcall * don't bother with allocations * now that it can't fail, make it return void Signed-off-by: Al Viro commit 4f6b434fee2402b3decdeae9d16eb648725ae426 Author: Al Viro Date: Tue Dec 9 19:50:34 2008 -0500 don't reallocate buffer in every audit_sockaddr() No need to do that more than once per process lifetime; allocating/freeing on each sendto/accept/etc. is bloody pointless. Signed-off-by: Al Viro commit 3f874b6643e189d3d07618928ceed0013d71593e Author: Mark Brown Date: Sun Jan 4 15:31:49 2009 +0100 mfd: Fix section mismatch in da903x The subdevice removal functions are marked __devexit but are referenced from the error handling path when probing so are needed even when __devexit functions are removed. Signed-off-by: Mark Brown Acked-by: Eric Miao Signed-off-by: Samuel Ortiz commit 52942b6b16c6ebb25f4dd4df0208d840ba0cbc5c Author: Jesper Juhl Date: Sat Jan 3 00:16:03 2009 +0100 swiotlb: Don't include linux/swiotlb.h twice in lib/swiotlb.c There's no point in including the linux/swiotlb.h header twice in lib/swiotlb.c - this patch gets rid of the unneeded include. Signed-off-by: Jesper Juhl Signed-off-by: Ingo Molnar commit 88e75cc347f66bc20e3c2b920431fc07253d69be Author: David Brownell Date: Mon Dec 22 12:18:02 2008 +0100 mfd: move drivers/i2c/chips/menelaus.c to drivers/mfd ove the menelaus driver from drivers/i2c/chips to drivers/mfd since it's more of a multi-function device than anything else, and since Jean is trying to vanish drivers/i2c/chips ASAP. One way to think of these chips are as the PMIC family most used with OMAP2 generation chips. Signed-off-by: David Brownell Signed-off-by: Samuel Ortiz commit 87c13493e6a59c0da55c2824f0205f9ef941b760 Author: David Brownell Date: Mon Dec 22 12:16:27 2008 +0100 mfd: move drivers/i2c/chips/tps65010.c to drivers/mfd Move the tps65010 driver from drivers/i2c/chips to drivers/mfd since it's more of a multi-function device than anything else, and since Jean is trying to vanish drivers/i2c/chips ASAP. One way to think of these chips are as the PMIC family most used with OMAP1 generation chips. Signed-off-by: David Brownell Signed-off-by: Samuel Ortiz commit 0931a4c6dbfab03f2bfd22a9170130f7b155d53a Author: David Brownell Date: Mon Dec 22 12:05:27 2008 +0100 mfd: dm355evm msp430 driver Basic MFD framework for the MSP430 microcontroller firmware used on the dm355evm board: - Provides an interface for other drivers: register read/write utilities, and register declarations. - Directly exports: * Many signals through the GPIO framework + LEDs + SW6 through gpio sysfs + NTSC/nPAL jumper through gpio sysfs + ... more could be added later, e.g. MMC signals * Child devices: + LEDs, via leds-gpio child (and default triggers) + RTC, via rtc-dm355evm child device + Buttons and IR control, via dm355evm_keys - Supports power-off system call. Use the reset button to power the board back up; the power supply LED will be on, but the MSP430 waits to re-activate the regulators. - On probe() this: * Announces firmware revision * Turns off the banked LEDs * Exports the resources noted above * Hooks the power-off support * Muxes tvp5146 -or- imager for video input Unless the new tvp514x driver (tracked for mainline) is configured, this assumes that some custom imager driver handles video-in. This completely ignores the registers reporting the output voltages on the various power supplies. Someone could add a hwmon interface if that seems useful. Signed-off-by: David Brownell Signed-off-by: Samuel Ortiz commit 4331bb32339a55fd88fbfb0581ed5132207bf9a2 Author: Mark Brown Date: Thu Dec 18 23:20:14 2008 +0100 mfd: Add missing break from wm3850-core Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit ca23f8c1b0aa15dc69565244fc5dffa67a72dd02 Author: Mark Brown Date: Thu Dec 18 23:12:28 2008 +0100 mfd: Add WM8351 support The WM8351 is a WM8350 variant. As well as register default changes the WM8351 has fewer voltage and current regulators than the WM8350. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 645524a9c6e1e42dc4fe03217befb20e2fc4d43e Author: Mark Brown Date: Thu Dec 18 23:12:16 2008 +0100 mfd: Support configurable numbers of DCDCs and ISINKs on WM8350 Some WM8350 variants have fewer DCDCs and ISINKs. Identify these at probe and refuse to use the absent DCDCs when running on these chips. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 53a0d99b1ef14f56baec06eec1e3dad031672b3a Author: Mark Brown Date: Thu Dec 18 23:12:08 2008 +0100 mfd: Handle missing WM8350 platform data Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 96920630624868add3f63f596523e70dbb64549a Author: Mark Brown Date: Thu Dec 18 23:09:50 2008 +0100 mfd: Add WM8352 support The WM8352 is a variant of the WM8350. Aside from the register defaults there are no software visible differences to the WM8350. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 94964f96a6b7018d68b7386cd8c0b8505d3cf69f Author: Samuel Ortiz Date: Thu Dec 18 11:38:02 2008 +0100 mfd: Use irq_to_desc in twl4030 code The global irq_desc array is soon going to be accessible only with !CONFIG_SPARSE_IRQ. We should start using the generic irq_to_desc() routines instead. Signed-off-by: Samuel Ortiz commit 342d765e011f9cbe4292119a9164f76ccf0b922a Author: Mike Rapoport Date: Tue Dec 30 22:44:53 2008 +0100 power_supply: Add Dialog DA9030 battery charger driver Driver for battery charger integrated into Dialog Semiconductor DA9030 PMIC Signed-off-by: Mike Rapoport Acked-by: Anton Vorontsov Signed-off-by: Samuel Ortiz commit 856f6fd119411d5701d5db96e1aae1dd69923887 Author: Mike Rapoport Date: Thu Dec 18 10:54:27 2008 +0100 mfd: Dialog DA9030 battery charger MFD driver This patch amends DA903x MFD driver with definitions and methods needed for battery charger driver. Signed-off-by: Mike Rapoport Signed-off-by: Samuel Ortiz commit b8380c1a661f1f853418ff2eb798f27a11cade57 Author: Mark Brown Date: Thu Dec 18 10:54:22 2008 +0100 mfd: Register WM8400 codec device Register a child device for the codec in the WM8400. Also switch the unregistration of the MFD devices to use the MFD core since the current code is hand rolling the same thing. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 44faac3155247d9cb9aec5a53832014e1f807c78 Author: Mark Brown Date: Thu Dec 18 10:54:12 2008 +0100 mfd: Pass driver_data onto child devices The MFD cell structure provides a driver_data field but doesn't pass it on to the child devices when instantiating them - do that. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 6354ab5c63bc986bf539026a1b289cc142f6e87c Author: Samuel Ortiz Date: Sun Dec 7 20:50:25 2008 +0100 mfd: Fix twl4030-core.c build error This is a fix for: twl4030-core.c:(.text+0x16a797): undefined reference to `clk_get_rate' twl4030-core.c:(.text+0x16a797): undefined reference to `clk_put' on x86 and x86_64, as the clock API is not defined on those platforms. Signed-off-by: Samuel Ortiz commit b73eac7871d002835be17d4602cced2c15c0db4b Author: David Brownell Date: Sun Dec 7 19:10:58 2008 +0100 mfd: twl4030 regulator bug fixes This contains two bugfixes to the initial twl4030 regulator support patch related to USB: (a) always overwrite the old list of consumers ... else the regulator handles all use the same "usb1v5" name; (b) don't set up the "usbcp" regulator, which turns out to be managed through separate controls, usually ULPI directly from the OTG controller. Signed-off-by: David Brownell Signed-off-by: Samuel Ortiz commit dad759ff8ba79927766e3f0159bfc5fb6de0f982 Author: David Brownell Date: Mon Dec 1 00:43:58 2008 +0100 mfd: twl4030: create some regulator devices Initial code to create twl4030 voltage regulator devices, using the new regulator framework. Note that this now starts to care what name is used to declare the TWL chip: - TWL4030 is the "old" chip; newer ones have a bigger variety of VAUX2 voltages. - TWL5030 is the core "new" chip; TPS65950 is its catalog version. - The TPS65930 and TPS65920 are cost-reduced catalog versions of TWL5030 parts ... fewer regulators, no battery charger, etc. Board-specific regulator configuration should be provided, listing which regulators are used and their constraints (e.g. 1.8V only). Code that could ("should"?) leverage the regulator stuff includes TWL4030 USB transceiver support and MMC glue, LCD support for the 3430SDP and Labrador boards, and S-Video output. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren Signed-off-by: Samuel Ortiz commit 67460a7c26271fd7a32e5d51b2c806a84ce78a62 Author: David Brownell Date: Mon Dec 1 00:35:33 2008 +0100 mfd: twl4030: cleanup symbols and OMAP dependency Finish removing dependency of TWL driver stack on platform-specific IRQ definitions ... and remove the build dependency on OMAP. This lets the TWL4030 code be included in test builds for most platforms, and will make it easier for non-OMAP folk to update most of this code for new APIs etc. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren Signed-off-by: Samuel Ortiz commit 5725d66b9d18e630bb63e3b76bedf25fd1027265 Author: David Brownell Date: Mon Dec 1 00:31:04 2008 +0100 mfd: twl4030: simplified child creation code Minor cleanup to twl4030-core: define a helper function to populate a single child node, and use it to replace six inconsistent versions of the same logic. Both object and source code shrink. As part of this, some devices now have more IRQ resources: battery charger, keypad, ADC, and USB transceiver. That helps to remove some irq #defines that block the children's drivers code from compiling on non-OMAP platforms. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren Signed-off-by: Samuel Ortiz commit 4008e879e1325c29362aa2c3fa4b527273ae15a8 Author: Mark Brown Date: Sun Nov 30 22:45:14 2008 +0100 power_supply: Add battery health reporting for WM8350 Implement support for reporting battery health in the WM8350 battery interface. Since we are now able to report this via the classs remove the diagnostics from the interrupt handler. Signed-off-by: Mark Brown Acked-by: Anton Vorontsov Signed-off-by: Samuel Ortiz commit 7e386e6e0e4f34f0545e8923e22fe4dd61ef9d48 Author: Mark Brown Date: Sun Nov 30 22:43:21 2008 +0100 power_supply: Add cold to the POWER_SUPPLY_HEALTH report values Some systems are able to report problems with batteries being under temperature. Signed-off-by: Mark Brown Acked-by: Anton Vorontsov Signed-off-by: Samuel Ortiz commit b797a5551979da22b0a35632198ffc8a330d9537 Author: Mark Brown Date: Mon Nov 24 20:22:58 2008 +0100 mfd: Refactor WM8350 chip identification Since the WM8350 driver was originally written the semantics for the identification registers of the chip have been clarified, allowing us to do an exact match on all the fields. This avoids mistakenly running on unsupported hardware. Also change to using the datasheet names more consistently for legibility and fix a printk() that should be dev_err(). Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit d756f4a4446227ca9626087939a6769ca55ab036 Author: Mark Brown Date: Mon Nov 24 20:20:30 2008 +0100 mfd: Switch WM8350 revision detection to a feature based model Rather than check for chip revisions in the WM8350 drivers have the core code set flags for relevant differences. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 14431aa0c5a443d13d24e6f865a8838f97dab973 Author: Mark Brown Date: Sun Nov 16 20:16:47 2008 +0100 power_supply: Add support for WM8350 PMU This patch adds support for the PMU provided by the WM8350 which implements battery, line and USB supplies including a battery charger. The hardware functions largely autonomously, with minimal software control required to initiate fast charging. Support for configuration of the USB supply is not yet implemented. This means that the hardware will remain in the mode configured at startup, by default limiting the current drawn from USB to 100mA. This driver was originally written by Liam Girdwood with subsequent updates for submission by Mark Brown. Signed-off-by: Mark Brown Acked-by: Anton Vorontsov Signed-off-by: Samuel Ortiz commit 3fba19ec1ae5b460c73a7f32efed8d3b3300b246 Author: David Brownell Date: Sat Nov 8 01:13:16 2008 +0100 mfd: allow reading entire register banks on twl4030 Minor change to the TWL4030 utility interface: support reads of all 256 bytes in each register bank (vs just 255). This can help when debugging, but is otherwise a NOP. Signed-off-by: David Brownell Signed-off-by: Samuel Ortiz commit 67488526349d043372d141c054f4dc6313780b3c Author: Mark Brown Date: Sat Nov 8 01:10:21 2008 +0100 mfd: Add AUXADC support for WM8350 The auxiliary ADC in the WM8350 is shared between several subdevices so access to it needs to be arbitrated by the core driver. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 0c8a601678960fbcc1c1185a283d6d107575810b Author: Mark Brown Date: Sat Nov 8 01:10:16 2008 +0100 mfd: Add WM8350 revision H support No other software changes are required. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 858e674466427b1236eb5ef9568999a7df286b1e Author: Mark Brown Date: Sat Nov 8 00:57:33 2008 +0100 mfd: Add some documentation for WM8350 register lock Hopefully this will make the purpose of these functions a bit clearer, it's not immediately obvious that the lock is a hardware feature. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 2c5212279a89224512e421fa9f8bd0fabbab77d8 Author: Mark Brown Date: Sat Nov 8 00:52:54 2008 +0100 mfd: Remove i.MX31ism from WM8350 i2c driver Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 6cd99b7828445dc18e9004c81067c36e8d9caa01 Author: Mark Brown Date: Fri Oct 24 19:25:27 2008 +0200 mfd: Don't mark WM8350 security register as volatile There's no need to read this back from the chip each time. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz commit 913ae5a24efd27deef4fc154953871b62d0d99cd Author: Julia Lawall Date: Sat Jan 3 17:54:53 2009 +0100 ALSA: sound/usb: Use negated usb_endpoint_xfer_control, etc This patch extends 42a6e66f1e40a930d093c33ba0bb9d8d8e4555ed by using usb_endpoint_xfer_control, usb_endpoint_xfer_isoc, usb_endpoint_xfer_bulk, and usb_endpoint_xfer_int in the negated case as well. This patch also rewrites some calls to usb_endpoint_dir_in as negated calls to !usb_endpoint_dir_out, and vice versa, to better correspond to the intent of the original code. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct usb_endpoint_descriptor *epd; @@ - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_CONTROL\|0\)) + !usb_endpoint_xfer_control(epd) @@ struct usb_endpoint_descriptor *epd; @@ - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_ISOC\|1\)) + !usb_endpoint_xfer_isoc(epd) @@ struct usb_endpoint_descriptor *epd; @@ - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_BULK\|2\)) + !usb_endpoint_xfer_bulk(epd) @@ struct usb_endpoint_descriptor *epd; @@ - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_INT\|3\)) + !usb_endpoint_xfer_int(epd) // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai commit c66b9906f863696159e05890bb7123269bb9a9de Author: Ingo Molnar Date: Sun Jan 4 10:55:02 2009 +0100 intel-iommu: fix build error with INTR_REMAP=y and DMAR=n dmar.o can be built in the CONFIG_INTR_REMAP=y case but iommu_calculate_agaw() is only available if VT-d is built as well. So create an inline version of iommu_calculate_agaw() for the !CONFIG_DMAR case. The iommu->agaw value wont be used in this case, but the code is cleaner (has less #ifdefs) if we have it around unconditionally. Signed-off-by: Ingo Molnar commit 4010b0192ddf6ec7ec1b9feb9b0953692aeb7329 Merge: 79ff56e... 7d3b56b... Author: Ingo Molnar Date: Sun Jan 4 10:59:36 2009 +0100 Merge branch 'linus' into core/urgent commit ed42350e02bfcb333024949e9653d06916135cc5 Merge: 1db489b... 4dfdc46... Author: Jiri Kosina Date: Sun Jan 4 01:04:09 2009 +0100 Merge branch 'upstream-fixes' into for-next Conflicts: drivers/hid/hid-ids.h commit 4dfdc46468a142216b284eea66040f49df3f7191 Author: Jiri Kosina Date: Tue Dec 30 00:49:59 2008 +0100 HID: fix error condition propagation in hid-sony driver sony_set_operational() only propagates return value from usb_control_msg(), which returns negative on error and number of transferred bytes otherwise. Reported-by: Marcin Tolysz Signed-off-by: Jiri Kosina commit b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34 Author: Oliver Neukum Date: Mon Dec 15 13:12:08 2008 +0100 HID: fix reference count leak hidraw The hidraw subsystem has a bug that prevents the close syscall from ever reaching the low level driver, leading to a resource leak. Fix by replacing postdecrement with predecrement. Signed-off-by: Oliver Neukum Signed-off-by: Jiri Kosina commit 25e61613cf3ca7f6d5f89a707b20c9eed6b74455 Author: Matt Helsley Date: Sat Dec 13 14:28:54 2008 +0100 HID: add proper support for pensketch 12x9 tablet The Genius PenSketch 12x9 tablet has a puck (labeled a "Tablet Mouse") in addition to a pen. Without registering a quirk the tablet appears to be a single input device that reports the wrong axis information in /proc/bus/input/devices, and sends incorrect events (e.g. ABS_Z instead of ABS_Y). This information confuses the X evdev driver and makes the device impossible to use. The quirk fixes events and splits the device into multiple input event devices so that at least the puck is useful. Signed-off-by: Matt Helsley Signed-off-by: Jiri Kosina commit 5f6108cf9be4a77d6bee96750aa4fe18b6b97dee Author: Alexey Klimov Date: Mon Dec 8 12:40:14 2008 +0100 HID: don't allow DealExtreme usb-radio be handled by usb hid driver This device is already handled by radio-si470x driver, and we therefore want usbhid to ignore it. Patch places usb ids of that device in ignore section of hid-core.c Signed-off-by: Alexey Klimov Signed-off-by: Andrew Morton Signed-off-by: Jiri Kosina commit 1db489b2953799d41098a891c85dea02e3c4721a Author: Jiri Kosina Date: Sun Jan 4 00:39:08 2009 +0100 HID: fix default Kconfig setting for TopSpeed driver Make default setting for TopSpeed driver compliant with the defaults of the other specialized HID drivers. Signed-off-by: Jiri Kosina commit f14f526d02b14fd0b8c1ac4ec413e4577ad5f62e Author: Lev Babiev Date: Sun Jan 4 00:36:56 2009 +0100 HID: driver for TopSeed Cyberlink quirky remote I recently picked up a Cyberlink branded remote control produced by TopSeed Tech Corp. Alas, it appears that this device is using non-standard mappings for some of it's keys (Usage page 0xffbc). Signed-off-by: Lev Babiev Signed-off-by: Jiri Kosina commit ac09952babed8e2ac6999127b7f95d7a2bbfd7af Author: Parag Warudkar Date: Mon Dec 22 22:50:52 2008 +0100 HID: make boot protocol drivers depend on EMBEDDED The usbmouse and usbkbd modules are not supposed to be used with regular USB mice and keyboards. Make them depend on EMBEDDED to prevent them from being built and loaded on non-EMBEDDED configs. Signed-off-by: Parag Warudkar Signed-off-by: Jiri Kosina commit 725cf0f47dbb02e0482f081828cff73f55479b79 Author: Hannes Eder Date: Tue Dec 16 14:20:23 2008 +0100 HID: avoid sparse warning in HID_COMPAT_LOAD_DRIVER Impact: include a prototype for the exported function in the macro Fix about 20 of this warnings: drivers/hid/hid-a4tech.c:162:1: warning: symbol 'hid_compat_a4tech' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: Jiri Kosina commit 079034073faf974973baa0256b029451f6e768ad Author: Oliver Neukum Date: Tue Dec 16 10:55:15 2008 +0100 HID: hiddev cleanup -- handle all error conditions properly This is a cleanup of hiddev and fixes the following issues: - thread safety by locking in read & ioctl, introducing a per device mutex - race between ioctl and disconnect, introducing a flag and locking in form of a per low level device mutex - race between open and other methods, making sure only successfully opened devices are put on the list, changing order of events - range checking both upper and lower limits of the minor range - make sure further calls to open fail for unplugged devices even if the device still has opened files - error checking for low level open - possible loss of wakeup events, using standard waiting macros - race in initialisation by moving registration after full initialisation Signed-off-by: Oliver Neukum Signed-off-by: Jiri Kosina commit 42859e0bd21daba9974757fcfe4a4dde265fe28d Author: Lukasz Lubojanski Date: Thu Dec 11 22:07:59 2008 +0100 HID: force feedback driver for GreenAsia 0x12 PID I have implemented Force Feedback driver for another "GreeAsia" based device (0e8f:0012 "GreenAsia Inc. USB Joystick"). The functionality was tested with MANTA Warior MM816 and SpeedLink Strike2 SL-6635 and fftest software - everything seems to work right. Signed-off-by: Lukasz Lubojanski Signed-off-by: Jiri Kosina commit d04b431e3d769fbbf26c4f4072002375c8cc4ed9 Author: David Brownell Date: Thu Dec 11 14:54:07 2008 +0100 HID: switch specialized drivers from "default y" to !EMBEDDED Fix the obnoxious "default y" for all the "special" HID code, which forces folk with EMBEDDED defined to manually override that inappropriate default for almost 20 choices. The general policy is against "default y"; it should apply here too. Signed-off-by: David Brownell Signed-off-by: Jiri Kosina commit aae6c286dad33c7f2c6992b9e310a371f2ae377e Author: Jiri Kosina Date: Thu Dec 4 16:16:46 2008 +0100 HID: set proper dev.parent in hidraw We need to properly set parent of the hidraw device (which is the corresponding physical device itself) in order to hidraw devices not end up under virtual device tree. Reported-by: Kay Sievers Signed-off-by: Jiri Kosina commit 3a6f82f7a22cf19687f556997c6978b31c109360 Author: Jiri Slaby Date: Mon Nov 24 16:20:09 2008 +0100 HID: add dynids facility Allow adding new devices to the hid drivers on the fly without a need of kernel recompilation. Now, one can test a driver e.g. by: echo 0003:045E:00F0.0003 > ../generic-usb/unbind echo 0003 045E 00F0 > new_id from some driver subdir. Signed-off-by: Jiri Slaby Signed-off-by: Jiri Kosina commit 898089d08f983ef0fdb176267620543a7929826a Author: Jiri Slaby Date: Mon Nov 24 16:20:06 2008 +0100 HID: use GFP_KERNEL in hid_alloc_buffers We might sleep, so no problem to use GFP_KERNEL. While at it bring the function to coding style. Signed-off-by: Jiri Slaby Signed-off-by: Jiri Kosina commit 581a2739607b5fdfb6b22d6083fc7f83c441077f Author: Jiri Slaby Date: Mon Nov 24 16:20:08 2008 +0100 HID: usbhid, use usb_endpoint_xfer_int Use usb_endpoint_xfer_int() instead of direct use of constants. Signed-off-by: Jiri Slaby Signed-off-by: Jiri Kosina commit 0ed94b334265b6ee3e3336b4fedacfa9cb2ccaba Author: Jiri Slaby Date: Mon Nov 24 16:20:07 2008 +0100 HID: move usbhid flags to usbhid.h Move usbhid specific flags from global hid.h into local usbhid.h. Signed-off-by: Jiri Slaby Signed-off-by: Jiri Kosina commit 94011f93f2cd7410401e22390cf7a14fe5495a22 Author: Rafi Rubin Date: Wed Nov 19 15:54:46 2008 +0100 HID: add n-trig digitizer support Added quirks for the N-Trig digitizer. Signed-off-by: Rafi Rubin Signed-off-by: Jiri Kosina commit 9188e79ec3fd43a0a605274324aecfb731baa88b Author: Jiri Kosina Date: Wed Nov 12 16:14:08 2008 +0100 HID: add phys and name ioctls to hidraw The hiddev interface provides ioctl() calls which can be used to obtain phys and raw name of the underlying device. Add the corresponding support also into hidraw. Signed-off-by: Jiri Kosina commit 6bbe586fd4d94439f3960e200056ff057f7db5c6 Author: Kay Sievers Date: Fri Oct 31 00:12:32 2008 +0100 HID: struct device - replace bus_id with dev_name(), dev_set_name() This patch is part of a larger patch series which will remove the "char bus_id[20]" name string from struct device. The device name is managed in the kobject anyway, and without any size limitation, and just needlessly copied into "struct device". To set and read the device name dev_name(dev) and dev_set_name(dev) must be used. If your code uses static kobjects, which it shouldn't do, "const char *init_name" can be used to statically provide the name the registered device should have. At registration time, the init_name field is cleared, to enforce the use of dev_name(dev) to access the device name at a later time. We need to get rid of all occurrences of bus_id in the entire tree to be able to enable the new interface. Please apply this patch, and possibly convert any remaining remaining occurrences of bus_id. We want to submit a patch to -next, which will remove bus_id from "struct device", to find the remaining pieces to convert, and finally switch over to the new api, which will remove the 20 bytes array and does no longer have a size limitation. CC: Jiri Kosina Acked-by: Greg Kroah-Hartman Signed-off-by: Kay Sievers Signed-off-by: Jiri Kosina commit 08ef08ee8c5a8d538ca9a3c433d4213c128af863 Author: Alan Stern Date: Thu Oct 30 23:58:51 2008 +0100 HID: automatically call usbhid_set_leds in usbhid driver This patch (as1146c) makes usbhid automatically call usbhid_set_leds() for any device that supports the keyboard boot protocol. In theory this should be perfectly safe. BIOSes send the LED output report as part of their normal device initialization, so any keyboard device supporting the boot protocol has to be able to handle it. As a side effect, the hid-dell and hid-bright drivers are no longer needed, and the Logitech keyboard driver can be removed from hid-lg. CC: Mauro Carvalho Chehab Signed-off-by: Alan Stern Signed-off-by: Jiri Kosina commit efc7ce18d9037aa947c1aad5eb712ecc47520126 Author: Jiri Kosina Date: Fri Oct 17 15:01:15 2008 +0200 HID: non-input reports can also be numbered When computing the maximal buffer size needed, we must take into account that not only input reports can be numbered. Pointed out in bugzilla #10467 Signed-off-by: Jiri Kosina commit ac26fca3e14c8882e382daa7e96ab73e0186cf03 Author: Jiri Kosina Date: Thu Nov 20 11:27:02 2008 +0100 HID: ignore mouse interface for unibody macbooks The mouse interface on unibody macbooks is going to be handled by bcm59743 driver in 2.6.29. Reported-by: Henrik Rydberg Signed-off-by: Jiri Kosina commit 7d3b56ba37a95f1f370f50258ed3954c304c524b Merge: 269b012... ab14398... Author: Linus Torvalds Date: Sat Jan 3 12:04:39 2009 -0800 Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits) x86: setup_per_cpu_areas() cleanup cpumask: fix compile error when CONFIG_NR_CPUS is not defined cpumask: use alloc_cpumask_var_node where appropriate cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t x86: use cpumask_var_t in acpi/boot.c x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids sched: put back some stack hog changes that were undone in kernel/sched.c x86: enable cpus display of kernel_max and offlined cpus ia64: cpumask fix for is_affinity_mask_valid() cpumask: convert RCU implementations, fix xtensa: define __fls mn10300: define __fls m32r: define __fls h8300: define __fls frv: define __fls cris: define __fls cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS cpumask: zero extra bits in alloc_cpumask_var_node cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/ cpumask: convert mm/ ... commit 269b012321f2f1f8e4648c43a93bf432b42c6668 Merge: f60a0a7... 065a6d6... Author: Linus Torvalds Date: Sat Jan 3 12:03:52 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu: (89 commits) AMD IOMMU: remove now unnecessary #ifdefs AMD IOMMU: prealloc_protection_domains should be static kvm/iommu: fix compile warning AMD IOMMU: add statistics about total number of map requests AMD IOMMU: add statistics about allocated io memory AMD IOMMU: add stats counter for domain tlb flushes AMD IOMMU: add stats counter for single iommu domain tlb flushes AMD IOMMU: add stats counter for cross-page request AMD IOMMU: add stats counter for free_coherent requests AMD IOMMU: add stats counter for alloc_coherent requests AMD IOMMU: add stats counter for unmap_sg requests AMD IOMMU: add stats counter for map_sg requests AMD IOMMU: add stats counter for unmap_single requests AMD IOMMU: add stats counter for map_single requests AMD IOMMU: add stats counter for completion wait events AMD IOMMU: add init code for statistic collection AMD IOMMU: add necessary header defines for stats counting AMD IOMMU: add Kconfig entry for statistic collection code AMD IOMMU: use dev_name in iommu_enable function AMD IOMMU: use calc_devid in prealloc_protection_domains ... commit f60a0a79846abed04ad5abddb5dafd14b66e1ab0 Merge: 2f98357... b15dd79... Author: Linus Torvalds Date: Sat Jan 3 12:02:18 2009 -0800 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits) V4L/DVB (10173): Missing v4l2_prio_close in radio_release V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent V4L/DVB (10171): Use usb_set_intfdata V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2 V4L/DVB (10167): sms1xxx: add support for inverted gpio V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2 V4L/DVB (10164): Add missing S2 caps flag to S2API V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev V4L/DVB (10162): tuner-simple: Fix tuner type set message V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus V4L/DVB (10160): em28xx: update chip id for em2710 V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus V4L/DVB (10155): Add TEA5764 radio driver V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources. V4L/DVB (10152): Change configuration of the Beholder H6 card V4L/DVB (10151): Fix I2C bridge error in zl10353 ... commit 2f983570010a0dcb26d988da02d7ccfad00c807c Author: Yinghai Lu Date: Sat Jan 3 00:06:34 2009 -0800 sparseirq: move set/get_timer_rand_state back to .c those two functions only used in that C file Signed-off-by: Yinghai Lu Signed-off-by: Linus Torvalds commit e9e67a8b579d9605a3d06f7430dbb40465c97bf1 Merge: ad6b646... 418f19e... Author: Linus Torvalds Date: Sat Jan 3 12:00:07 2009 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: mmc: warn about voltage mismatches mmc_spi: Add support for OpenFirmware bindings pxamci: fix dma_unmap_sg length mmc_block: ensure all sectors that do not have errors are read drivers/mmc: Move a dereference below a NULL test sdhci: handle built-in sdhci with modular leds class mmc: balanc pci_iomap with pci_iounmap mmc_block: print better error messages mmc: Add mmc_vddrange_to_ocrmask() helper function ricoh_mmc: Handle newer models of Ricoh controllers mmc: Add 8-bit bus width support sdhci: activate led support also when module mmc: trivial annotation of 'blocks' pci: use pci_ioremap_bar() in drivers/mmc sdricoh_cs: Add support for Bay Controller devices mmc: at91_mci: reorder timer setup and mmc_add_host() call commit ad6b646fe55c40ec193240b974561f0a3775d68d Merge: 61420f5... 006948b... Author: Linus Torvalds Date: Sat Jan 3 11:59:13 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: [WATCHDOG] Add support for the WM8350 watchdog [WATCHDOG] Add SMSC SCH311x Watchdog Timer. [WATCHDOG] ib700wdt - add timeout parameter commit 61420f59a589c0668f70cbe725785837c78ece90 Merge: d97106a... c742b31... Author: Linus Torvalds Date: Sat Jan 3 11:56:24 2009 -0800 Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 * 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID [PATCH] improve idle cputime accounting [PATCH] improve precision of idle time detection. [PATCH] improve precision of process accounting. [PATCH] idle cputime accounting [PATCH] fix scaled & unscaled cputime accounting commit d97106ab53f812910a62d18afb9dbe882819c1ba Author: Linus Torvalds Date: Sat Jan 3 11:46:17 2009 -0800 Make %p print '(null)' for NULL pointers Before, when we only ever printed out the pointer value itself, a NULL pointer would never cause issues and might as well be printed out as just its numeric value. However, with the extended %p formats, especially %pR, we might validly want to print out resources for debugging. And sometimes they don't even exist, and the resource pointer is just NULL. Print it out as such, rather than oopsing. This is a more generic version of a patch done by Trent Piepho (catching all %p cases rather than just %pR, and using "(null)" instead of "[NULL]" to match glibc). Requested-by: Trent Piepho Acked-by: Harvey Harrison Signed-off-by: Linus Torvalds commit 3bfacef412b4bc993a8992217e50f1245f2fd3a6 Author: Al Viro Date: Sat Jan 3 07:16:33 2009 +0000 get rid of special-casing the /sbin/loader on alpha ... just make it a binfmt handler like #! one. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit 17580d7f2f632ff8c9786d609508c35c9f56e1f3 Author: Al Viro Date: Sat Jan 3 07:16:23 2009 +0000 sanitize ifdefs in binfmt_aout They are actually alpha vs. i386/arm/m68k i.e. ecoff vs. aout. In the only place where we actually tried to handle arm and i386/m68k in different ways (START_DATA() in coredump handling), the arm variant works for all of them (i386 and m68k have u.start_code set to 0). Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit fe30af971d896c144ef4708f97cf9d3186303c42 Author: Al Viro Date: Sat Jan 3 07:16:13 2009 +0000 remove the rudiment of a.out for sparc it's been used only in sunos compat Signed-off-by: Al Viro Signed-off-by: Linus Torvalds commit e0b685d39a0404e7f87fb7b7808c3b37a115fe11 Author: Hugh Blemings Date: Sat Jan 3 16:48:44 2009 +1100 Updated contact info for CREDITS file This updates some personal info in the CREDITS file. I'm no longer actively involved in Keyspan driver work so shouldn't really be listed as a Maintainer here. I do however field the occasional question on them and as I'm dropping the misc.nu domain, want to ensure people can find me should they need to. Signed-off-by: Hugh Blemings Signed-off-by: Linus Torvalds commit ab14398abd195af91a744c320a52a1bce814dd1e Author: Cyrill Gorcunov Date: Fri Jan 2 21:51:32 2009 +0300 x86: setup_per_cpu_areas() cleanup Impact: cleanup __alloc_bootmem and __alloc_bootmem_node do panic for us in case of fail so no need for additional checks here. Also lets use pr_*() macros for printing. Signed-off-by: Cyrill Gorcunov Signed-off-by: Ingo Molnar commit 8fd2d2d5aaf086cfa3b2e2e58cab96b7afdc9e51 Author: Mike Travis Date: Wed Dec 31 18:08:48 2008 -0800 cpumask: fix compile error when CONFIG_NR_CPUS is not defined CONFIG_NR_CPUS will be defined for all arch's whether SMP or not, but it may not have made it into all arches yet. Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar commit 80855f7361eb68205e6bc1981928629d9b02d5c9 Author: Mike Travis Date: Wed Dec 31 18:08:47 2008 -0800 cpumask: use alloc_cpumask_var_node where appropriate Impact: Reduce inter-node memory traffic. Reduces inter-node memory traffic (offloading the global system bus) by allocating referenced struct cpumasks on the same node as the referring struct. Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar commit 2fdf66b491ac706657946442789ec644cc317e1a Author: Rusty Russell Date: Wed Dec 31 18:08:47 2008 -0800 cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t Impact: Reduce memory usage, use new API. This is part of an effort to reduce structure sizes for machines configured with large NR_CPUS. cpumask_t gets replaced by cpumask_var_t, which is either struct cpumask[1] (small NR_CPUS) or struct cpumask * (large NR_CPUS). (Changes to powernow-k* by .) Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar commit ee943a82b697456f9d2ac46f1e6d230beedb4b6c Author: Rusty Russell Date: Wed Dec 31 18:08:47 2008 -0800 x86: use cpumask_var_t in acpi/boot.c Impact: reduce stack size, use new API. Replace cpumask_t with cpumask_var_t. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar commit 9628937d5b37169151c5f6bbd40919c6ac958a46 Author: Mike Travis Date: Wed Dec 31 18:08:46 2008 -0800 x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids Impact: Reduce future system panics due to cpumask operations using NR_CPUS Insure that code does not look at bits >= nr_cpu_ids as when cpumasks are allocated based on nr_cpu_ids, these extra bits will not be defined. Also some other minor updates: * change in to use cpu accessor function set_cpu_present() instead of directly accessing cpu_present_map w/cpu_clear() [arch/x86/kernel/reboot.c] * use cpumask_of() instead of &cpumask_of_cpu() [arch/x86/kernel/reboot.c] * optimize some cpu_mask_to_apicid_and functions. Signed-off-by: Mike Travis Acked-by: Rusty Russell Signed-off-by: Ingo Molnar commit 6ca09dfc9f180d038dcef93c167a833f43a8246f Author: Mike Travis Date: Wed Dec 31 18:08:45 2008 -0800 sched: put back some stack hog changes that were undone in kernel/sched.c Impact: prevents panic from stack overflow on numa-capable machines. Some of the "removal of stack hogs" changes in kernel/sched.c by using node_to_cpumask_ptr were undone by the early cpumask API updates, and causes a panic due to stack overflow. This patch undoes those changes by using cpumask_of_node() which returns a 'const struct cpumask *'. In addition, cpu_coregoup_map is replaced with cpu_coregroup_mask further reducing stack usage. (Both of these updates removed 9 FIXME's!) Also: Pick up some remaining changes from the old 'cpumask_t' functions to the new 'struct cpumask *' functions. Optimize memory traffic by allocating each percpu local_cpu_mask on the same node as the referring cpu. Signed-off-by: Mike Travis Acked-by: Rusty Russell Signed-off-by: Ingo Molnar commit 730cf27246225d56ca1603b2f3c4fdbf882d4e51 Author: Mike Travis Date: Wed Dec 31 18:08:45 2008 -0800 x86: enable cpus display of kernel_max and offlined cpus Impact: enables /sys/devices/system/cpu/{kernel_max,offline} user interface By setting total_cpus, the drivers/base/cpu.c will display the values of kernel_max (NR_CPUS-1) and the offlined cpu map. Signed-off-by: Mike Travis Acked-by: Rusty Russell Signed-off-by: Ingo Molnar commit 6bdf197b04b3ae7c85785bc5a9576f1bcb0ac7c0 Author: Ingo Molnar Date: Sat Jan 3 12:50:46 2009 +0100 ia64: cpumask fix for is_affinity_mask_valid() Impact: build fix on ia64 ia64's default_affinity_write() still had old cpumask_t usage: /home/mingo/tip/kernel/irq/proc.c: In function `default_affinity_write': /home/mingo/tip/kernel/irq/proc.c:114: error: incompatible type for argument 1 of `is_affinity_mask_valid' make[3]: *** [kernel/irq/proc.o] Error 1 make[3]: *** Waiting for unfinished jobs.... update it to cpumask_var_t. Signed-off-by: Ingo Molnar commit 263ec6457bb23d57b575ede18ff6c3d11e0b4e96 Author: Ingo Molnar Date: Sat Jan 3 13:16:09 2009 +0100 cpumask: convert RCU implementations, fix Impact: cleanup This warning: kernel/rcuclassic.c: In function ‘rcu_start_batch’: kernel/rcuclassic.c:397: warning: passing argument 1 of ‘cpumask_andnot’ from incompatible pointer type triggers because one usage site of rcp->cpumask was not converted to to_cpumask(rcp->cpumask). There's no ill effects of this bug. Signed-off-by: Ingo Molnar commit e465b535ce5b2318798c68e1454917204494bfe3 Merge: 7eb1955... 5ece5c5... Author: Ingo Molnar Date: Sat Jan 3 18:54:51 2009 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into cpus4096-v2 commit 7eb19553369c46cc1fa64caf120cbcab1b597f7c Merge: 6092848... 8c384cd... Author: Mike Travis Date: Wed Dec 31 17:34:16 2008 -0800 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask Conflicts: arch/x86/kernel/io_apic.c kernel/rcuclassic.c kernel/sched.c kernel/time/tick-sched.c Signed-off-by: Mike Travis [ mingo@elte.hu: backmerged typo fix for io_apic.c ] Signed-off-by: Ingo Molnar commit 065a6d68c71af2a3bdd080fa5aa353b76eede8f5 Author: Joerg Roedel Date: Sat Jan 3 14:16:35 2009 +0100 AMD IOMMU: remove now unnecessary #ifdefs The #ifdef's are no longer necessary when the iommu-api and the amd iommu updates are merged together. Signed-off-by: Joerg Roedel commit b0a11f44aba631fd4b898b620c93cc2096f3f15c Merge: 7398ca7... 0e93dd8... Author: Joerg Roedel Date: Sat Jan 3 16:43:44 2009 +0100 Merge branches 'iommu/api' and 'iommu/amd' into for-linus commit 0e93dd883537e628b809a2120854cd591c8935f1 Author: Jaswinder Singh Rajput Date: Mon Dec 29 21:45:22 2008 +0530 AMD IOMMU: prealloc_protection_domains should be static Impact: cleanup, reduce kernel size a bit, avoid sparse warning Fixes sparse warning: arch/x86/kernel/amd_iommu.c:1299:6: warning: symbol 'prealloc_protection_domains' was not declared. Should it be static? Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Joerg Roedel commit 7398ca79d227f7cd7f2ce23f08624e30081dcb4e Author: Joerg Roedel Date: Sat Jan 3 16:37:53 2009 +0100 kvm/iommu: fix compile warning This fixes a compile warning about a variable thats maybe used uninitialized in the function. Signed-off-by: Joerg Roedel commit 8ecaf8f19f0f0627d6ac6d69ed9472e7d307f35b Author: Joerg Roedel Date: Fri Dec 12 16:13:04 2008 +0100 AMD IOMMU: add statistics about total number of map requests Impact: see total number of map requests in debugfs Signed-off-by: Joerg Roedel commit 5774f7c5fef2526bfa58eab628fbe91dce5e07b1 Author: Joerg Roedel Date: Fri Dec 12 15:57:30 2008 +0100 AMD IOMMU: add statistics about allocated io memory Impact: see amount of allocated io memory in debugfs Signed-off-by: Joerg Roedel commit 18811f55d48e5f3ee70c4744c592f940022fa592 Author: Joerg Roedel Date: Fri Dec 12 15:48:28 2008 +0100 AMD IOMMU: add stats counter for domain tlb flushes Impact: see number of domain tlb flushes in debugfs Signed-off-by: Joerg Roedel commit f57d98ae6979f7bcbf758023b4716f485385f903 Author: Joerg Roedel Date: Fri Dec 12 15:46:29 2008 +0100 AMD IOMMU: add stats counter for single iommu domain tlb flushes Impact: see number of single iommu domain tlb flushes in debugfs Signed-off-by: Joerg Roedel commit c1858976f5ef05122bb671f678beaf7e1fe1dd74 Author: Joerg Roedel Date: Fri Dec 12 15:42:39 2008 +0100 AMD IOMMU: add stats counter for cross-page request Impact: see number of requests for more than one page in debugfs Signed-off-by: Joerg Roedel commit 5d31ee7e08b7713596b999a42e67491bdf3665b3 Author: Joerg Roedel Date: Fri Dec 12 15:16:38 2008 +0100 AMD IOMMU: add stats counter for free_coherent requests Impact: see number of free_coherent requests in debugfs Signed-off-by: Joerg Roedel commit c8f0fb36bffa9e21d214a2910b825567d52bfc2c Author: Joerg Roedel Date: Fri Dec 12 15:14:21 2008 +0100 AMD IOMMU: add stats counter for alloc_coherent requests Impact: see number of alloc_coherent requests in debugfs Signed-off-by: Joerg Roedel commit 55877a6bcdf0843414eecc658550c6551f5b5e1d Author: Joerg Roedel Date: Fri Dec 12 15:12:14 2008 +0100 AMD IOMMU: add stats counter for unmap_sg requests Impact: see number of unmap_sg requests in debugfs Signed-off-by: Joerg Roedel commit d03f067a9d0a1cc09529427af9a15e15d32ba1de Author: Joerg Roedel Date: Fri Dec 12 15:09:48 2008 +0100 AMD IOMMU: add stats counter for map_sg requests Impact: see number of map_sg requests in debugfs Signed-off-by: Joerg Roedel commit 146a6917fc30616401a090f55cff2b855ee5b2ab Author: Joerg Roedel Date: Fri Dec 12 15:07:12 2008 +0100 AMD IOMMU: add stats counter for unmap_single requests Impact: see number of unmap_single requests in debugfs Signed-off-by: Joerg Roedel commit 0f2a86f200bc97ae6cefc5d3ac879094b3fcde48 Author: Joerg Roedel Date: Fri Dec 12 15:05:16 2008 +0100 AMD IOMMU: add stats counter for map_single requests Impact: see number of map_single requests in debugfs Signed-off-by: Joerg Roedel commit da49f6df726ecaaee87757e8b65a560679d32f99 Author: Joerg Roedel Date: Fri Dec 12 14:59:58 2008 +0100 AMD IOMMU: add stats counter for completion wait events Impact: see number of completion wait events in debugfs Signed-off-by: Joerg Roedel commit 7f26508bbb76ce86aad1130ef6b7f1a4bb7de0c2 Author: Joerg Roedel Date: Fri Dec 12 13:50:21 2008 +0100 AMD IOMMU: add init code for statistic collection Impact: create a new debugfs directory Signed-off-by: Joerg Roedel commit a9dddbe0497ab0df7ee729e8d4cb0ee2dec3e4ba Author: Joerg Roedel Date: Fri Dec 12 12:33:06 2008 +0100 AMD IOMMU: add necessary header defines for stats counting Impact: add defines to make iommu stats collection configurable Signed-off-by: Joerg Roedel commit 2e117604a4e8f3f9cee4aec3373b0382159e152a Author: Joerg Roedel Date: Thu Dec 11 19:00:12 2008 +0100 AMD IOMMU: add Kconfig entry for statistic collection code Impact: adds new Kconfig entry Signed-off-by: Joerg Roedel commit a4e267c88b4acfc87ff2ab0cc8e9509878e9aaba Author: Joerg Roedel Date: Wed Dec 10 20:04:18 2008 +0100 AMD IOMMU: use dev_name in iommu_enable function Impact: cleanup Signed-off-by: Joerg Roedel commit edcb34da259c503a2ffd37e51a658672ba3bc7a2 Author: Joerg Roedel Date: Wed Dec 10 20:01:45 2008 +0100 AMD IOMMU: use calc_devid in prealloc_protection_domains Impact: cleanup Signed-off-by: Joerg Roedel commit c226f853091577e665ebc02c064af4834d8d4f28 Author: Joerg Roedel Date: Fri Dec 12 13:53:54 2008 +0100 AMD IOMMU: convert amd_iommu_isolate to bool Impact: cleanup Signed-off-by: Joerg Roedel commit 0cfd7aa90be83a4d278810d231f9ef03f189b4f0 Author: Joerg Roedel Date: Wed Dec 10 19:58:00 2008 +0100 AMD IOMMU: convert iommu->need_sync to bool Impact: use bool instead of int for iommu->need_sync Signed-off-by: Joerg Roedel commit ab896722867602eb0e836717e8b857ad513800d8 Author: Joerg Roedel Date: Wed Dec 10 19:43:07 2008 +0100 AMD IOMMU: use dev_name instead of self-build print_devid Impact: use generic dev_name instead of own function Signed-off-by: Joerg Roedel commit 1ac4cbbc5eb56de96d264d10f464ba5222815b1b Author: Joerg Roedel Date: Wed Dec 10 19:33:26 2008 +0100 AMD IOMMU: allocate a new protection for hotplugged devices Impact: also hotplug devices benefit from device isolation Signed-off-by: Joerg Roedel commit e2dc14a2a6c9a83baaafc51f06b7e73cec2167be Author: Joerg Roedel Date: Wed Dec 10 18:48:59 2008 +0100 AMD IOMMU: add a domain flag for default domains Impact: adds a new protection domain flag Signed-off-by: Joerg Roedel commit 26961efe0dab9ca73f8fc3b6137b814252e04972 Author: Joerg Roedel Date: Wed Dec 3 17:00:17 2008 +0100 AMD IOMMU: register functions for the IOMMU API Signed-off-by: Joerg Roedel commit 645c4c8d7289a718c9c828ec217f2b94e3b3e6ff Author: Joerg Roedel Date: Tue Dec 2 20:05:50 2008 +0100 AMD IOMMU: add domain address lookup function for IOMMU API Impact: add a generic function to lockup addresses in protection domains Signed-off-by: Joerg Roedel commit eb74ff6cc0080c7f6270fdfffba65c4eff23d3ad Author: Joerg Roedel Date: Tue Dec 2 19:59:10 2008 +0100 AMD IOMMU: add domain unmap function for IOMMU API Impact: add a generic function to unmap pages into protection domains Signed-off-by: Joerg Roedel commit c6229ca649aa9b312d1f1de20af8d2603b14eead Author: Joerg Roedel Date: Tue Dec 2 19:48:43 2008 +0100 AMD IOMMU: add domain map function for IOMMU API Impact: add a generic function to map pages into protection domains Signed-off-by: Joerg Roedel commit 01106066a6900b518debe990ddaadf376d433bd6 Author: Joerg Roedel Date: Tue Dec 2 19:34:11 2008 +0100 AMD IOMMU: add device attach function for IOMMU API Impact: add a generic function to attach devices to protection domains Signed-off-by: Joerg Roedel commit 684f2888847b896faafed87ce4733501d2cc283c Author: Joerg Roedel Date: Mon Dec 8 12:07:44 2008 +0100 AMD IOMMU: add device detach function for IOMMU API Impact: add a generic function to detach devices from protection domains Signed-off-by: Joerg Roedel commit 98383fc301c6546af0f3a8a1d3cb8bf218f7e940 Author: Joerg Roedel Date: Tue Dec 2 18:34:12 2008 +0100 AMD IOMMU: add domain destroy function for IOMMU API Impact: add a generic function for releasing protection domains Signed-off-by: Joerg Roedel commit c156e347d6d3c36b6843c3b168eda61b9a02c827 Author: Joerg Roedel Date: Tue Dec 2 18:13:27 2008 +0100 AMD IOMMU: add domain init function for IOMMU API Impact: add a generic function for allocation protection domains Signed-off-by: Joerg Roedel commit 6d98cd8043c13438e4ca8a9464893f0224198a30 Author: Joerg Roedel Date: Mon Dec 8 12:05:55 2008 +0100 AMD IOMMU: add domain cleanup helper function Impact: add a function to remove all devices from a domain Signed-off-by: Joerg Roedel commit e275a2a0fc9e2168b15f6c7814e30b7ad58b1c7c Author: Joerg Roedel Date: Wed Dec 10 18:27:25 2008 +0100 AMD IOMMU: add device notifier callback Impact: inform IOMMU about state change of a device in the driver core Signed-off-by: Joerg Roedel commit 355bf553edb7fe21ada51f62c849180bec6da877 Author: Joerg Roedel Date: Mon Dec 8 12:02:41 2008 +0100 AMD IOMMU: add device detach helper functions Impact: add helper functions to detach a device from a domain Signed-off-by: Joerg Roedel commit f1179dc005ee2b0e55c3f74f3552c3e9ef852265 Author: Joerg Roedel Date: Wed Dec 10 14:39:51 2008 +0100 AMD IOMMU: rename set_device_domain function Impact: rename set_device_domain() to attach_device() Signed-off-by: Joerg Roedel commit 863c74ebd0152b21bc4b11c1447b5d1429287d37 Author: Joerg Roedel Date: Tue Dec 2 17:56:36 2008 +0100 AMD IOMMU: add device reference counting for protection domains Impact: know how many devices are assigned to a domain Signed-off-by: Joerg Roedel commit 5b28df6f43ac9878f310ad0cb7f11ddb262a7ac6 Author: Joerg Roedel Date: Tue Dec 2 17:49:42 2008 +0100 AMD IOMMU: add checks for dma_ops domain to dma_ops functions Impact: detect when a driver uses a device assigned otherwise Signed-off-by: Joerg Roedel commit 9fdb19d64c0247f23343b51fc85f438f8e7a2f3c Author: Joerg Roedel Date: Tue Dec 2 17:46:25 2008 +0100 AMD IOMMU: add protection domain flags Imapct: add a new struct member to 'struct protection_domain' When using protection domains for dma_ops and KVM its better to know for which subsystem it was allocated. Add a flags member to struct protection domain for that purpose. Signed-off-by: Joerg Roedel commit 43f4960983a309568a6c4375f081e63fb2ff24a3 Author: Joerg Roedel Date: Tue Dec 2 21:01:12 2008 +0100 AMD IOMMU: add iommu_flush_domain function Impact: add a function to flush a domain id on every IOMMU Signed-off-by: Joerg Roedel commit 9e919012e33c481991e46aa4cb13d807cd47b798 Author: Joerg Roedel Date: Wed Dec 10 20:05:52 2008 +0100 AMD IOMMU: don't remove protection domain from iommu_pd_list Impact: save unneeded logic to add and remove domains to the list The removal of a protection domain from the iommu_pd_list is not necessary. Another benefit is that we save complexity because we don't have to readd it later when the device no longer uses the domain. Signed-off-by: Joerg Roedel commit 237b6f33291394c337ae84e2d3782d5605803af2 Author: Joerg Roedel Date: Tue Dec 2 20:54:37 2008 +0100 AMD IOMMU: move invalidation command building to a separate function Impact: refactoring of iommu_queue_inv_iommu_pages Signed-off-by: Joerg Roedel commit 8d201968e15f56ae2837b0d0b64d3fff098857b0 Author: Joerg Roedel Date: Tue Dec 2 20:34:41 2008 +0100 AMD IOMMU: refactor completion wait handling into separate functions Impact: split one function into three The separate functions are required synchronize commands across all hardware IOMMUs in the system. Signed-off-by: Joerg Roedel commit a2acfb75792511a35586db80a38b8e4701a97730 Author: Joerg Roedel Date: Tue Dec 2 18:28:53 2008 +0100 AMD IOMMU: add domain id free function Impact: add code to release a domain id Signed-off-by: Joerg Roedel commit 86db2e5d47bfa61a151d6ac83263f4bde4d52290 Author: Joerg Roedel Date: Tue Dec 2 18:20:21 2008 +0100 AMD IOMMU: make dma_ops_free_pagetable generic Impact: change code to free pagetables from protection domains The dma_ops_free_pagetable function can only free pagetables from dma_ops domains. Change that to free pagetables of pure protection domains. Signed-off-by: Joerg Roedel commit 38e817febe2f12bd2fbf92a1df36f41946d0c223 Author: Joerg Roedel Date: Tue Dec 2 17:27:52 2008 +0100 AMD IOMMU: rename iommu_map to iommu_map_page Impact: function rename The iommu_map function maps only one page. Make this clear in the function name. Signed-off-by: Joerg Roedel commit cdc7b83726297b43deed0455d8732163cc59802a Author: Mike Day Date: Fri Dec 12 17:16:30 2008 +0100 intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES Signed-off-by: Mike Day Signed-off-by: Joerg Roedel commit e4754c96cf8b82a754dc5ba791d6c0bf1fbe8e8e Author: Joerg Roedel Date: Wed Dec 3 15:26:42 2008 +0100 VT-d: remove now unused intel_iommu_found function Signed-off-by: Joerg Roedel commit a8bcbb0de4a52f07fef7412ddc877348311ebf2a Author: Joerg Roedel Date: Wed Dec 3 15:14:02 2008 +0100 VT-d: register functions for the IOMMU API Signed-off-by: Joerg Roedel commit d14d65777c2491dd5baf1e17f444b8f653f3cbb1 Author: Joerg Roedel Date: Wed Dec 3 15:06:57 2008 +0100 VT-d: adapt domain iova_to_phys function for IOMMU API Signed-off-by: Joerg Roedel commit dde57a210dcdce85e2813bab8f88687761d9f6a6 Author: Joerg Roedel Date: Wed Dec 3 15:04:09 2008 +0100 VT-d: adapt domain map and unmap functions for IOMMU API Signed-off-by: Joerg Roedel commit 4c5478c94eb29e6101f1f13175f7455bc8b5d953 Author: Joerg Roedel Date: Wed Dec 3 14:58:24 2008 +0100 VT-d: adapt device attach and detach functions for IOMMU API Signed-off-by: Joerg Roedel commit 5d450806eb0e569c5846a5825e7f535980b0da32 Author: Joerg Roedel Date: Wed Dec 3 14:52:32 2008 +0100 VT-d: adapt domain init and destroy functions for IOMMU API Signed-off-by: Joerg Roedel commit 19de40a8472fa64693eab844911eec277d489f6c Author: Joerg Roedel Date: Wed Dec 3 14:43:34 2008 +0100 KVM: change KVM to use IOMMU API Signed-off-by: Joerg Roedel commit 1aaf118352b85bb359ce28070bcc478f659a7031 Author: Joerg Roedel Date: Wed Nov 26 17:25:13 2008 +0100 select IOMMU_API when DMAR and/or AMD_IOMMU is selected These two IOMMUs can implement the current version of this API. So select the API if one or both of these IOMMU drivers is selected. Signed-off-by: Joerg Roedel commit fc2100eb4d0960b56c2c705a97941c08fb1c0fd4 Author: Joerg Roedel Date: Wed Nov 26 17:21:24 2008 +0100 add frontend implementation for the IOMMU API This API can be used by KVM for accessing different types of IOMMUs to do device passthrough to guests. Beside that this API can also be used by device drivers to map non-linear host memory into dma-linear addresses to prevent sgather-gather DMA. UIO may be another user for this API. Signed-off-by: Joerg Roedel Acked-by: Greg Kroah-Hartman commit 4a77a6cf6d9bf9f5c74b27f62bd2bfe6dcc88392 Author: Joerg Roedel Date: Wed Nov 26 17:02:33 2008 +0100 introcude linux/iommu.h for an iommu api This patch introduces the API to abstract the exported VT-d functions for KVM into a generic API. This way the AMD IOMMU implementation can plug into this API later. Signed-off-by: Joerg Roedel commit c4fa3864281c7d88b7262cbc6cbd5c90bb59860e Author: Joerg Roedel Date: Wed Nov 26 15:51:19 2008 +0100 KVM: rename vtd.c to iommu.c Impact: file renamed The code in the vtd.c file can be reused for other IOMMUs as well. So rename it to make it clear that it handle more than VT-d. Signed-off-by: Joerg Roedel commit b653574a7d14b663cc812cb20be6a114939ba186 Author: Weidong Han Date: Mon Dec 8 23:29:53 2008 +0800 Deassign device in kvm_free_assgined_device In kvm_iommu_unmap_memslots(), assigned_dev_head is already empty. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 0a920356748df4fb06e86c21c23d2ed6d31d37ad Author: Weidong Han Date: Tue Dec 2 21:24:23 2008 +0800 KVM: support device deassignment Support device deassignment, it can be used in device hotplug. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 260782bcfdaaa7850f29d6bb2ec6603019168c57 Author: Weidong Han Date: Tue Dec 2 21:03:39 2008 +0800 KVM: use the new intel iommu APIs intel iommu APIs are updated, use the new APIs. In addition, change kvm_iommu_map_guest() to just create the domain, let kvm_iommu_assign_device() assign device. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit fe40f1e020d0923f5f35ca15f02a206c75a28053 Author: Weidong Han Date: Mon Dec 8 23:10:23 2008 +0800 Check agaw is sufficient for mapped memory When domain is related to multiple iommus, need to check if the minimum agaw is sufficient for the mapped memory Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit faa3d6f5ffe7bf60ebfd0d36513fbcda0eb0ea1a Author: Weidong Han Date: Mon Dec 8 23:09:29 2008 +0800 Change intel iommu APIs of virtual machine domain These APIs are used by KVM to use VT-d Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit ea6606b02fc3192f2edab2db669fa0b9756b4e67 Author: Weidong Han Date: Mon Dec 8 23:08:15 2008 +0800 Change domain_context_mapping_one for virtual machine domain vm_domid won't be set in context, find available domain id for a device from its iommu. For a virtual machine domain, a default agaw will be set, and skip top levels of page tables for iommu which has less agaw than default. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 5e98c4b1d6e89676193c355e430eddf369bcf195 Author: Weidong Han Date: Mon Dec 8 23:03:27 2008 +0800 Allocation and free functions of virtual machine domain virtual machine domain is different from native DMA-API domain, implement separate allocation and free functions for virtual machine domain. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 5331fe6f5627e06eec7d0dc154a0a3a9c27813c5 Author: Weidong Han Date: Mon Dec 8 23:00:00 2008 +0800 Add domain_flush_cache Because virtual machine domain may have multiple devices from different iommus, it cannot use __iommu_flush_cache. In some common low level functions, use domain_flush_cache instead of __iommu_flush_cache. On the other hand, in some functions, iommu can is specified or domain cannot be got, still use __iommu_flush_cache Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit c7151a8dfefd11108de5b4293af2390962bcff71 Author: Weidong Han Date: Mon Dec 8 22:51:37 2008 +0800 Add/remove domain device info for virtual machine domain Add iommu reference count in domain, and add a lock to protect iommu setting including iommu_bmp, iommu_count and iommu_coherency. virtual machine domain may have multiple devices from different iommus, so it needs to do more things when add/remove domain device info. Thus implement separate these functions for virtual machine domain. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 1ce28feb22833645a0f3843cd873a0b56ed19ef0 Author: Weidong Han Date: Mon Dec 8 16:35:39 2008 +0800 Add domain flag DOMAIN_FLAG_VIRTUAL_MACHINE Add this flag for VT-d used in virtual machine, like KVM. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 8e604097ddc483eb1e6e99564953e4e937fe439a Author: Weidong Han Date: Mon Dec 8 15:49:06 2008 +0800 iommu coherency In dmar_domain, more than one iommus may be included in iommu_bmp. Due to "Coherency" capability may be different across iommus, set this variable to indicate iommu access is coherent or not. Only when all related iommus in a dmar_domain are all coherent, iommu access of this domain is coherent. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 1b5736839ae13dadc5947940144f95dd0f4a4a8c Author: Weidong Han Date: Mon Dec 8 15:34:06 2008 +0800 calculate agaw for each iommu "SAGAW" capability may be different across iommus. Use a default agaw, but if default agaw is not supported in some iommus, choose a less supported agaw. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 8c11e798eee2ce4475134eaf61302b28ea4f205d Author: Weidong Han Date: Mon Dec 8 15:29:22 2008 +0800 iommu bitmap instead of iommu pointer in dmar_domain In order to support assigning multiple devices from different iommus to a domain, iommu bitmap is used to keep all iommus the domain are related to. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit a2bb8459fe46e5aaad6637b31b5593d740097cba Author: Weidong Han Date: Mon Dec 8 11:24:12 2008 +0800 Get iommu from g_iommus for deferred flush deferred_flush[] uses the iommu seq_id to index, so its iommu is fixed and can get it from g_iommus. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit d9630fe941769dd050fbc38fbbac20a708ab9461 Author: Weidong Han Date: Mon Dec 8 11:06:32 2008 +0800 Add global iommu list Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit 3b5410e735b093060b96664230c6f9f4fe80b251 Author: Weidong Han Date: Mon Dec 8 09:17:15 2008 +0800 change P2P domain flags Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit d71a2f33ac466a437f316e7bb024d0175a7f3cd9 Author: Weidong Han Date: Sun Dec 7 21:13:41 2008 +0800 Initialize domain flags to 0 It's random number after the domain is allocated by kmem_cache_alloc Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel commit b15dd79ea06b04a7ecee95f62ce7b6a3547dbb0a Author: Udo Steinberg Date: Fri Jan 2 17:34:28 2009 -0300 V4L/DVB (10173): Missing v4l2_prio_close in radio_release The radio_release function of the BTTV driver is missing a call to v4l2_prio_close. As a result, after the radio device has been opened at least once (e.g., by HAL during bootup), v4l2_priority will never drop below V4L2_PRIORITY_INTERACTIVE again. With the following patch against 2.6.28, applications that run with V4L2_PRIORITY_BACKGROUND are able to open devices again. Previous Linux versions are affected as well. Signed-off-by: Udo Steinberg Signed-off-by: Mauro Carvalho Chehab commit 763d19bb90a005a339b7d5ba70a710bb17db2bab Author: Kay Sievers Date: Wed Dec 31 23:35:24 2008 -0300 V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent Signed-off-by: Kay Sievers Signed-off-by: Mauro Carvalho Chehab commit 03fb02c604d68156c0828e3950094f18ce529385 Author: Julia Lawall Date: Thu Jan 1 17:14:58 2009 -0300 V4L/DVB (10171): Use usb_set_intfdata This code had calls to both usb_set_intfdata and dev_set_drvdata, doing the same thing. The semantic patch that lead to finding this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @header@ @@ @same depends on header@ position p; @@ usb_set_intfdata@p(...) { ... } @depends on header@ position _p!=same.p; identifier _f; struct usb_interface *intf; expression data; @@ _f@_p(...) { <+... - dev_set_drvdata(&intf->dev, data); + usb_set_intfdata(intf, data); ...+> } // Signed-off-by: Julia Lawall Signed-off-by: Mauro Carvalho Chehab commit 2e824f79240476d57a8589f46232cabf151efe90 Author: Yu Zhao Date: Mon Dec 22 16:54:58 2008 +0800 VT-d: fix segment number being ignored when searching DRHD On platforms with multiple PCI segments, any of the segments can have a DRHD with INCLUDE_PCI_ALL flag. So need to check the DRHD's segment number against the PCI device's when searching its DRHD. Signed-off-by: Yu Zhao Signed-off-by: David Woodhouse Signed-off-by: Joerg Roedel commit 19c239ce3d089fee339d1ab7e97b43d6f0557ce5 Author: Mark McLoughlin Date: Fri Nov 21 16:56:53 2008 +0000 intel-iommu: trivially inline DMA PTE macros Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit c07e7d217bef198422b7eface456ecfd4bb1ab87 Author: Mark McLoughlin Date: Fri Nov 21 16:54:46 2008 +0000 intel-iommu: trivially inline context entry macros Some macros were unused, so I just dropped them: context_fault_disable context_translation_type context_address_root context_address_width context_domain_id Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 2abd7e167c1b281f99bb58d302225872bfae9123 Author: Mark McLoughlin Date: Thu Nov 20 15:49:50 2008 +0000 intel-iommu: move iommu_prepare_gfx_mapping() out of dma_remapping.h Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 58fa7304a2c2bfd46e505c293ef779aa1d9715c2 Author: Mark McLoughlin Date: Thu Nov 20 15:49:49 2008 +0000 intel-iommu: kill off duplicate def of dmar_disabled This is only used in dmar.c and intel-iommu.h, so dma_remapping.h seems like the appropriate place for it. Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit a647dacbb1389aa6a5fa631766c1eaea35905890 Author: Mark McLoughlin Date: Thu Nov 20 15:49:48 2008 +0000 intel-iommu: move struct device_domain_info out of dma_remapping.h Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 99126f7ce14aff5f9371b2fa81fddb82be815794 Author: Mark McLoughlin Date: Thu Nov 20 15:49:47 2008 +0000 intel-iommu: move struct dmar_domain def out dma_remapping.h Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 622ba12a4c2148999bda9b891bfd0c6ddcb6c57e Author: Mark McLoughlin Date: Thu Nov 20 15:49:46 2008 +0000 intel-iommu: move DMA PTE defs out of dma_remapping.h DMA_PTE_READ/WRITE are needed by kvm. Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 7a8fc25e0cc6e75fa6fdb0a856490e324218550b Author: Mark McLoughlin Date: Thu Nov 20 15:49:45 2008 +0000 intel-iommu: move context entry defs out from dma_remapping.h Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 46b08e1a76b758193b0e7b889c6486a16eb1e9e2 Author: Mark McLoughlin Date: Thu Nov 20 15:49:44 2008 +0000 intel-iommu: move root entry defs from dma_remapping.h We keep the struct root_entry forward declaration for the pointer in struct intel_iommu. Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit f27be03b271851fd54529f292c0f25b4c1f1a553 Author: Mark McLoughlin Date: Thu Nov 20 15:49:43 2008 +0000 intel-iommu: move DMA_32/64BIT_PFN into intel-iommu.c Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 519a05491586dad04e687660e54c57882315b22b Author: Mark McLoughlin Date: Thu Nov 20 14:21:13 2008 +0000 intel-iommu: make init_dmars() static init_dmars() is not used outside of drivers/pci/intel-iommu.c Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit 015ab17dc2e9de805c26e74f498b12ee5e8de07e Author: Mark McLoughlin Date: Thu Nov 20 14:04:20 2008 +0000 intel-iommu: remove some unused struct intel_iommu fields The seg, saved_msg and sysdev fields appear to be unused since before the code was first merged. linux/msi.h is not needed in linux/intel-iommu.h anymore since there is no longer a reference to struct msi_msg. The MSI code in drivers/pci/intel-iommu.c still has linux/msi.h included via linux/dmar.h. linux/sysdev.h isn't needed because there is no reference to struct sys_device. Signed-off-by: Mark McLoughlin Signed-off-by: David Woodhouse commit acf26c0cad5ba00dcafa633805e4660e90c1eac0 Author: Ulrich Dangel Date: Fri Jan 2 19:30:14 2009 +0100 ALSA: hda - cxt5051 report jack state Signed-off-by: Ulrich Dangel Signed-off-by: Takashi Iwai commit bc7a166dd1530965aa80966f267235f067c5fddf Author: Ulrich Dangel Date: Fri Jan 2 19:30:13 2009 +0100 ALSA: hda - add basic jack reporting functions to patch_conexant.c Added functions to report jack sense. As CXT5051_PORTB_EVENT has the same value as CONEXANT_MIC_EVENT two input devices for the microphone will be created if using CXT5051. Signed-off-by: Ulrich Dangel Signed-off-by: Takashi Iwai commit fa8efd50b353a36dbcd2c47a55335f002af4deb0 Author: David S. Miller Date: Fri Jan 2 21:54:25 2009 -0800 sparc: Update 64-bit defconfig. Signed-off-by: David S. Miller commit 5ece5c5192d065c229da01e7b347c1d3877b59fa Author: Rusty Russell Date: Sat Jan 3 16:21:08 2009 +1030 xtensa: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit 5c134dad43443aa9c9606eaf47c378a6b9c5c597 Author: Rusty Russell Date: Sat Jan 3 16:19:03 2009 +1030 mn10300: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit 16a206260ee70f181de6a3672678545859589ef2 Author: Rusty Russell Date: Sat Jan 3 16:16:54 2009 +1030 m32r: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit 9ddabc2a29163e4b243d10c5e06fc5584073d7ad Author: Rusty Russell Date: Sat Jan 3 16:16:04 2009 +1030 h8300: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit ee38e5140bafbf40e1bd25ab917ac8db54a27799 Author: Rusty Russell Date: Sat Jan 3 16:14:05 2009 +1030 frv: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit f54c88cb6c6928f259b95abb4477970df2bd3d55 Author: Sam Ravnborg Date: Fri Jan 2 21:33:54 2009 -0800 sparc: remove NO_PROC_ID - it is no longer used Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 65579f3cfbc55a6d5ed0469a6f069ada6f810a3e Author: Sam Ravnborg Date: Fri Jan 2 21:33:05 2009 -0800 sparc: drop get_tbr() in traps.h get_tbr() has no users in the whole tree -drop it. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 220483fec0cbc3710c828a236c9f1099d5de537a Author: Sam Ravnborg Date: Fri Jan 2 21:32:34 2009 -0800 sparc: fix warning in userspace header traps.h Fix following warning: traps.h:23: extern's make no sense in userspace Add an ifdef __KERNEL__ block that cover the extern definition and a few related things that neither is for userspace. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit fffeeb413704b742dd1d08a3b5a0070a72ab52e1 Author: Sam Ravnborg Date: Fri Jan 2 21:31:58 2009 -0800 sparc: fix warnings in userspace header byteorder.h Fix following warnings in byteorder.h: byteorder.h:4: include of is preferred over byteorder.h:9: leaks CONFIG_SPARC32 to userspace where it is not valid byteorder.h:13: leaks CONFIG_SPARC64 to userspace where it is not valid byteorder.h:14: found __[us]{8,16,32,64} type without #include byteorder.h:47: leaks CONFIG_SPARC64 to userspace where it is not valid - changed to use include as suggested - use preprocessor defined symbols to distingush between 32 and 64 bit Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 2ef4c01e180902a0197f959f84d4ae1d8eb18888 Author: Sam Ravnborg Date: Fri Jan 2 21:31:13 2009 -0800 sparc: fix warning in userspace header jsflash.h Fix following warnings in jsflash.h: jsflash.h:11: include of is preferred over jsflash.h:24: found __[us]{8,16,32,64} type without #include Fixed by changing the include to Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 7c59d28d0e798fff1ebfedcf7821cbd5513091bd Author: Sam Ravnborg Date: Fri Jan 2 21:15:25 2009 -0800 sparc: unify openprom.h After the preparational steps the unification was simple. The linux_prom_pci_registers definition did not look like it could be unified at first look since the structure is assigned using prop_getproperty() / of_get_property() so the structure is assumed to come direct form the prom. The LINUX_OPPROM_MAGIC was kept even if it is not used by the kernel on the assumption that userspace may require it. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 640cc590bd6112424f4c248fe839af28a06b54c4 Author: Sam Ravnborg Date: Fri Jan 2 21:14:35 2009 -0800 sparc64: delete unused linux_prom64_ranges from openprom_64.h It was not used over the whole tree - so drop it. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit bb5b52bbd5e2cd40b193f34c11eec19864080dcf Author: Sam Ravnborg Date: Fri Jan 2 21:13:52 2009 -0800 sparc: prepare openprom for unification Align the sparc and sparc64 versions so differences are minimal. A few data types are changed to better reflect there actual usage. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit b608c3fe3cffcb3ebc87ffdec134286859d4a44e Author: Sam Ravnborg Date: Fri Jan 2 21:12:40 2009 -0800 sparc: remove linux_prom_pci_assigned_addresses from openprom_32.h It is not used anywhere in the tree so drop it. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 3011618d9a010b33b7e67cb26df9bc79c948f67b Author: Sam Ravnborg Date: Fri Jan 2 21:10:48 2009 -0800 sparc: remove ebus definitions from openprom*.h Looks like leftovers from the removal of the special ebus layer. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 1eae29bcc25b8a12bd6f416304c8aea1d576807e Author: Sam Ravnborg Date: Fri Jan 2 21:10:04 2009 -0800 sparc: unify siginfo.h Trivial unification where the sparc64 specific parts are protected using a signle ifdef/endif pair. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 0999769e6cad9b0e5abb7c513c0c3f16821f0884 Author: Rusty Russell Date: Sat Jan 3 15:37:14 2009 +1030 cris: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell commit f3ec38d5135ca4bff0132c0782da6da4663ae0e5 Author: Sam Ravnborg Date: Fri Jan 2 19:42:12 2009 -0800 sparc: unify ptrace.h The two ptrace.h implementations are very alike but the small differences required two set of ifdef/else/endif pairs. The definition of reg_window32 could have been shared but that would have required several updates in sparc32 code as all printk formatting for example assume it is longs. sparc_stackf looked like anohter candidate to share if the 32 bit was renamed to sparc_stackf32. But it contains two pointers in the sparc32 version which would have been 64 bit in the sparc64 version so it was non-trivial. Using a set of accessor macros could do the trick if pursued later. The sparc64 specific definitions are not protected by ifdef - as it should not be required to do so. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit bd703d88a2dbeb6c7945345de427eedf78ef89c6 Author: Sam Ravnborg Date: Fri Jan 2 19:34:46 2009 -0800 sparc: unify sigcontext.h With the renamed types in place the unification was straightforward. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 4d7b92ad572b4bd4d92fc80911641bb6cba3b99c Author: Sam Ravnborg Date: Fri Jan 2 19:32:59 2009 -0800 sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t Renaming a few types to contain a 32 suffix makes the type names compatible with sparc64 and thus makes sharing between the two a lot easier. Note: None of these definitions are expected part of the stable ABI towards userspace. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit ece93487c31607558f4b91f378fcee4b43956dbc Author: Sam Ravnborg Date: Fri Jan 2 19:21:06 2009 -0800 sparc: unify signal.h They were almost identical and with the preapration patch nothing was needed to be added. The unified version contains a few sparc64 only definitions but they are kept as is and not protected by ifdef/endif. The unified version exports a bit more to userspace then the 32 bit version did. This is not considered fatal. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 55d646feee9c0ced63f4189aca4ba7c9508b75f9 Author: Sam Ravnborg Date: Fri Jan 2 19:17:47 2009 -0800 sparc64: prepare signal_64 for unification o add a sparc32 only definition o fix a few style issues (white space errors etc). o include compiler.h (for __user) Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit a0381a9480fffc6269d06f79da5fa5c511621c29 Author: David S. Miller Date: Fri Jan 2 19:12:46 2009 -0800 sparc: Kill bogus comment about IRQF_SHARED in pci_psycho.c Noticed by Geert Uytterhoeven. Signed-off-by: David S. Miller commit 12aa0b17328a01490c9e53904767ca59596f9ea1 Author: Sam Ravnborg Date: Fri Jan 2 18:48:21 2009 -0800 sparc: unify stat.h To my suprise struct stat64 was not equal on sparc 32 and sparc64, so there was really nothing to share here. Unify the files by adding their respective content to stat.h. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 085219f79cad89291699bd2bfb21c9fdabafe65f Author: Sam Ravnborg Date: Fri Jan 2 18:47:34 2009 -0800 sparc32: use proper types in struct stat Like sparc64 use proper types in struct stat Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 104e28059d771274b545b4772a27c5c8f9af2767 Author: Sam Ravnborg Date: Fri Jan 2 18:39:10 2009 -0800 sparc32: drop __old_kernel_stat sparc32 does not define __ARCH_WANT_OLD_STAT so we do not use this structure neither do we support it. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit a508228a9ed2c2b582cec7833b60f55d12789219 Author: Sam Ravnborg Date: Fri Jan 2 18:34:50 2009 -0800 sparc: unify posix_types.h The posix types differed so much in their definition that they are kept in separate blocks. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit a66963a966881238d2738185e6f1adae1447f830 Author: Sam Ravnborg Date: Fri Jan 2 18:14:04 2009 -0800 sparc: delete unused config symbols There is no need to define a config symbol if it is never set to any value. Undefined symbols equal to 'n'. GENERIC_GPIO looks like it is similar but it is set using select in some other file so it must be kept. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller commit 8e3bda0863c1578ddf47a015eac7dc6efb1ef48b Merge: 574c3fd... 8e5033a... Author: Linus Torvalds Date: Fri Jan 2 15:57:47 2009 -0800 Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6 * 'linux-next' of git://git.infradead.org/ubifs-2.6: (33 commits) UBIFS: add more useful debugging prints UBIFS: print debugging messages properly UBIFS: fix numerous spelling mistakes UBIFS: allow mounting when short of space UBIFS: fix writing uncompressed files UBIFS: fix checkpatch.pl warnings UBIFS: fix sparse warnings UBIFS: simplify make_free_space UBIFS: do not lie about used blocks UBIFS: restore budg_uncommitted_idx UBIFS: always commit on unmount UBIFS: use ubi_sync UBIFS: always commit in sync_fs UBIFS: fix file-system synchronization UBIFS: fix constants initialization UBIFS: avoid unnecessary calculations UBIFS: re-calculate min_idx_size after the commit UBIFS: use nicer 64-bit math UBIFS: fix available blocks count UBIFS: various comment improvements and fixes ... commit 574c3fdae3890e60f8bc59e8107686944ba1e446 Merge: 56635f7... f2863c5... Author: Linus Torvalds Date: Fri Jan 2 15:57:26 2009 -0800 Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 * 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6: UBI: fix checkpatch.pl warnings UBI: simplify PEB protection code UBI: prepare for protection tree improvements UBI: return -ENOMEM upon failing vmalloc UBI: document UBI ioctls UBI: handle write errors in WL worker UBI: fix error path UBI: some code re-structuring UBI: fix deadlock UBI: fix warnings when debugging is enabled commit 56635f7e6197404d7363f8dcaa7a97abf57276fb Merge: a8e7823... b67ff8c... Author: Linus Torvalds Date: Fri Jan 2 15:56:54 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: kbuild: ignore a few files in headers_check kbuild: add checks for include of linux/types in userspace headers kbuild: drop debugging leftover in tags.sh kbuild: document environment variables kbuild: make *config usage docs kbuild: disable sparse warning "returning void-valued expression" kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__ kbuild: check for leaked CONFIG_ symbols to userspace headers_check.pl: disallow extern's kconfig: improve error messages for bad source statements kconfig: struct property commented kconfig: add comments to symbol flags kconfig: explain symbol value defaults m68k: fix recursive dependency in Kconfig commit a8e782348d9f0dc64f6adb81f5f6959921949f13 Merge: 6680598... 47dabdc... Author: Linus Torvalds Date: Fri Jan 2 15:33:12 2009 -0800 Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (27 commits) x86: mpparse.c fix style problems x86: nmi.c fix style problems x86: ldt.c fix style problems x86: cpuid.c fix style problems x86, UV: remove erroneous BAU initialization x86: fix incorrect __read_mostly on _boot_cpu_pda x86: convert permanent_kmaps_init() from macro to inline x86: early_printk - use sizeof instead of hardcoded number x86: xsave.c: restore_user_xstate should be static x86: uv_bau.h: fix dubious bitfield x86: apic.c: xapic_icr_read and x2apic_icr_read should be static x86: bios_uv.c: uv_systab should be static x86: genx2apic_phys.c: x2apic_send_IPI_self and init_x2apic_ldr should be static x86: amd_iommu.c: prealloc_protection_domains should be static x86: amd_iommu_init.c: iommu_enable and iommu_enable_event_logging should be static x86, pci: move arch/x86/pci/pci.h to arch/x86/include/asm/pci_x86.h x86_64: pci-gart_64.c iommu_fullflush should be static x86: efi.c declare add_efi_memmap before they get used x86: io_apic.c io_apic_sync should be static x86: apic.c declare pic_mode before they get used ... commit 47dabdc7fcd4daa52dcda72a1f18603dd168355d Merge: 923a789... 46814dd... Author: Ingo Molnar Date: Fri Jan 2 22:41:52 2009 +0100 Merge branches 'x86/cleanups', 'x86/fpu' and 'x86/urgent' into x86/core commit 923a789b49c7269a0245d5af6afe486188d940df Merge: 103ceff... b840d79... Author: Ingo Molnar Date: Fri Jan 2 22:41:36 2009 +0100 Merge branch 'linus' into x86/cleanups Conflicts: arch/x86/kernel/reboot.c commit 79ff56ebd3edfb16f8badc558cb439b203a3298f Author: Roland Dreier Date: Tue Dec 30 20:18:00 2008 -0800 swiotlb: add missing __init annotations Impact: cleanup, reduce kernel size a bit The current kernel build warns: WARNING: vmlinux.o(.text+0x11458): Section mismatch in reference from the function swiotlb_alloc_boot() to the function .init.text:__alloc_bootmem_low() The function swiotlb_alloc_boot() references the function __init __alloc_bootmem_low(). This is often because swiotlb_alloc_boot lacks a __init annotation or the annotation of __alloc_bootmem_low is wrong. WARNING: vmlinux.o(.text+0x1011f2): Section mismatch in reference from the function swiotlb_late_init_with_default_size() to the function .init.text:__alloc_bootmem_low() The function swiotlb_late_init_with_default_size() references the function __init __alloc_bootmem_low(). This is often because swiotlb_late_init_with_default_size lacks a __init annotation or the annotation of __alloc_bootmem_low is wrong. and indeed the functions calling __alloc_bootmem_low() can be marked __init as well. Signed-off-by: Roland Dreier Signed-off-by: Ingo Molnar commit 6680598b44ed3c0052d155522eb21fc5a00de5f3 Author: Ingo Molnar Date: Fri Jan 2 18:53:14 2009 +0100 Disallow gcc versions 3.{0,1} GCC 3.0 and 3.1 are too old to build a working kernel. Signed-off-by: Ingo Molnar [ This check got dropped as obsolete when I simplified the gcc header inclusion mess in f153b82121b0366fe0e5f9553545cce237335175, but Willy Tarreau reports actually having those old versions still.. -Linus ] Signed-off-by: Linus Torvalds commit b840d79631c882786925303c2b0f4fefc31845ed Merge: 597b0d2... c3d8000... Author: Linus Torvalds Date: Fri Jan 2 11:44:09 2009 -0800 Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits) x86: export vector_used_by_percpu_irq x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and() sched: nominate preferred wakeup cpu, fix x86: fix lguest used_vectors breakage, -v2 x86: fix warning in arch/x86/kernel/io_apic.c sched: fix warning in kernel/sched.c sched: move test_sd_parent() to an SMP section of sched.h sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0 sched: activate active load balancing in new idle cpus sched: bias task wakeups to preferred semi-idle packages sched: nominate preferred wakeup cpu sched: favour lower logical cpu number for sched_mc balance sched: framework for sched_mc/smt_power_savings=N sched: convert BALANCE_FOR_xx_POWER to inline functions x86: use possible_cpus=NUM to extend the possible cpus allowed x86: fix cpu_mask_to_apicid_and to include cpu_online_mask x86: update io_apic.c to the new cpumask code x86: Introduce topology_core_cpumask()/topology_thread_cpumask() x86: xen: use smp_call_function_many() x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c ... Fixed up trivial conflict in kernel/time/tick-sched.c manually commit b67ff8ce122f3353bd741db48ce1756c12fb5f2d Author: Sam Ravnborg Date: Wed Dec 31 09:32:30 2008 +0100 kbuild: ignore a few files in headers_check The new check for asm/types.h and linux/types.h had a few false positives. o We cannot let linux/types.h include linux/types.h o The int-ll64.h and int-ll64.h define the types and are included by linux/types.h Handle this by hardcoding the filenames in the headers_check script. Signed-off-by: Sam Ravnborg commit 483b41218fa9d5172312a9e294aaf78e22b266e6 Author: Sam Ravnborg Date: Tue Dec 30 11:34:58 2008 +0100 kbuild: add checks for include of linux/types in userspace headers If we see __[us](8|16|32|64) then we must include If wee see include of then we recommend Original script from Mike but modified by me. Cc: Mike Frysinger Signed-off-by: Sam Ravnborg commit 521b0c774d1350aac18f5cd35831469a4e879d72 Author: Sam Ravnborg Date: Tue Dec 30 10:20:08 2008 +0100 kbuild: drop debugging leftover in tags.sh Noticed by Jike. Reported-by: "Jike Song" Signed-off-by: Sam Ravnborg commit acc08b516f25b79cfcff310e51d95048bfcf7b0d Author: Sam Ravnborg Date: Mon Dec 29 13:45:52 2008 +0100 kbuild: document environment variables Add kbuild.txt to Documentation/kbuild More stuff can be added later - at least we have som of the varous environment variables documented now. Signed-off-by: Sam Ravnborg commit 2af238e455ef5fd31c2f7a06c2db3f13d843b9bf Author: Randy Dunlap Date: Fri Feb 29 14:21:53 2008 -0800 kbuild: make *config usage docs Create a kconfig user assistance guide, with a few tips and hints about using menuconfig, xconfig, and gconfig. Mostly contains user interface, environment variables, and search topics, along with mini.config/custom.config usage. Signed-off-by: Randy Dunlap Signed-off-by: Sam Ravnborg commit 80a7d1d991e35b0370c0396f36f6a076869a6bac Author: Hannes Eder Date: Sat Dec 27 22:38:44 2008 +0100 kbuild: disable sparse warning "returning void-valued expression" The sparse warning -Wreturn-void ("returning void-valued expression") is off by default, but it is enabled with -Wall, so add -Wno-return-void to CHECKFLAGS to disable it. Signed-off-by: Hannes Eder Signed-off-by: Sam Ravnborg commit 4307184f2b9240d0443bdf944c7b9eac044fe67b Author: Mike Frysinger Date: Sat Dec 27 03:23:15 2008 -0500 kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__ Headers in userspace should be using the __xxx__ form of the asm, inline, and volatile keywords. Since people like to revert these things without realizing what's going on, have the headers install step autoconvert these keywords. Signed-off-by: Mike Frysinger Signed-off-by: Sam Ravnborg commit 7e557a2509f9e1477c10295b74e29e4e93fa2392 Author: Sam Ravnborg Date: Sat Dec 27 19:52:20 2008 +0100 kbuild: check for leaked CONFIG_ symbols to userspace Signed-off-by: Sam Ravnborg commit 46b8af50ba5c072b74740c5fa8ba08e6eabb22f8 Author: Mike Frysinger Date: Sat Dec 27 02:43:36 2008 -0500 headers_check.pl: disallow extern's Since prototypes with "extern" refer to kernel functions, they make no sense in userspace, so reject them automatically. Signed-off-by: Mike Frysinger [sam: made it into a warning] Signed-off-by: Sam Ravnborg commit 7826005e5a53645d7aab7c13eda76126eadebf0b Author: Sam Ravnborg Date: Sat Dec 27 21:51:59 2008 +0100 kconfig: improve error messages for bad source statements We now say where we detect the second source of a file, and where we detect a recursively source of the same file. This makes it easier to fix such errors. Signed-off-by: Sam Ravnborg Cc: Roman Zippel commit cf82607a904d3b2ed3d66f8799f00d1099c1849c Author: Sam Ravnborg Date: Fri Dec 26 21:32:31 2008 +0100 kconfig: struct property commented No functional changes Signed-off-by: Sam Ravnborg commit 5b2cf365a8e9bbf781939e941ed548c9743fdeea Author: Sam Ravnborg Date: Fri Dec 26 21:25:00 2008 +0100 kconfig: add comments to symbol flags No functional changes - only comments. Signed-off-by: Sam Ravnborg commit eaa2a87460eca27ce725d63bbcf3b2da053828b7 Author: Sam Ravnborg Date: Fri Dec 26 21:07:57 2008 +0100 kconfig: explain symbol value defaults Added a few comments - no functional change. Signed-off-by: Sam Ravnborg commit cfb2a494bb7dca9cf8d1632fbed14b34db051980 Author: Sam Ravnborg Date: Fri Dec 26 22:41:18 2008 +0100 m68k: fix recursive dependency in Kconfig We had a recursive dependency between MMU_MOTOROLA and MMU_SUN3 Fix it by dropping the unused dependencies on MMU_MOTOROLA. MMU_MOTOROLA is set to y only using select so any dependencies are anyway ignored. Signed-off-by: Sam Ravnborg Acked-by: Geert Uytterhoeven Cc: Roman Zippel commit 597b0d21626da4e6f09f132442caf0cc2b0eb47c Merge: 2640c9a... 8791723... Author: Linus Torvalds Date: Fri Jan 2 11:41:11 2009 -0800 Merge branch 'kvm-updates/2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm * 'kvm-updates/2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (140 commits) KVM: MMU: handle large host sptes on invlpg/resync KVM: Add locking to virtual i8259 interrupt controller KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared MAINTAINERS: Maintainership changes for kvm/ia64 KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs() KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMI KVM: VMX: Fix pending NMI-vs.-IRQ race for user space irqchip KVM: fix handling of ACK from shared guest IRQ KVM: MMU: check for present pdptr shadow page in walk_shadow KVM: Consolidate userspace memory capability reporting into common code KVM: Advertise the bug in memory region destruction as fixed KVM: use cpumask_var_t for cpus_hardware_enabled KVM: use modern cpumask primitives, no cpumask_t on stack KVM: Extract core of kvm_flush_remote_tlbs/kvm_reload_remote_mmus KVM: set owner of cpu and vm file operations anon_inodes: use fops->owner for module refcount x86: KVM guest: kvm_get_tsc_khz: return khz, not lpj KVM: MMU: prepopulate the shadow on invlpg KVM: MMU: skip global pgtables on sync due to cr3 switch KVM: MMU: collapse remote TLB flushes on root sync ... commit 6b55009e1dc7c2a66c8f5fad67045f0536c9bbd8 Author: Michael Krufky Date: Fri Jan 2 15:55:29 2009 -0300 V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error A user reported the following OOPS with his pcHDTV HD5500 card, which uses a cx88 PCI bridge with a LG-TDVS-H06xF frontend module, made up of a TUA6034 tuner, TDA988x IF demod, and LG DT3303 ATSC/QAM demod. Somehow, tuner-core gets loaded before the digital driver configures the tuner, and tuner-core somehow incorrectly sets the tuner type to LG NTSC (TAPE series) instead of LG TDVS-H06xF. This tuner type does not have the tuning stepsize defined, so an OOPS occurs during the digital tune function. We still dont know how the type gets set incorrectly in the first place. The user has a tainted kernel with a binary nividia module, which COULD have something to do with this, but it's hard to say for sure. Nevertheless, to avoid this division by zero, we should check that stepsize is defined. If stepsize is not defined, print an error and bail out on the tune request. cx8800 0000:05:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19 cx88[0]: subsystem: 7063:5500, board: pcHDTV HD5500 HDTV [card=47,autodetected], frontend(s): 1 cx88[0]: TV tuner type 47, Radio tuner type -1 tuner' 2-0043: chip found @ 0x86 (cx88[0]) tda9887 2-0043: creating new instance tda9887 2-0043: tda988[5/6/7] found tuner' 2-0061: chip found @ 0xc2 (cx88[0]) tuner-simple 2-0061: creating new instance tuner-simple 2-0061: type set to 47 (LG NTSC (TAPE series)) cx88[0]/0: found at 0000:05:01.0, rev: 5, irq: 19, latency: 32, mmio: 0xea000000 cx88[0]/0: registered device video1 [v4l2] cx88[0]/0: registered device vbi1 cx88_audio 0000:05:01.1: PCI INT A -> GSI 19 (level, low) -> IRQ 19 cx88[0]/1: CX88x/0: ALSA support for cx2388x boards cx88[0]/2: cx2388x 8802 Driver Manager cx88-mpeg driver manager 0000:05:01.2: PCI INT A -> GSI 19 (level, low) -> IRQ 19 cx88[0]/2: found at 0000:05:01.2, rev: 5, irq: 19, latency: 32, mmio: 0xec000000 cx8802_probe() allocating 1 frontend(s) cx88/2: cx2388x dvb driver version 0.0.6 loaded cx88/2: registering cx8802 driver, type: dvb access: shared cx88[0]/2: subsystem: 7063:5500, board: pcHDTV HD5500 HDTV [card=47] cx88[0]/2: cx2388x based DVB/ATSC card tuner-simple 2-0061: attaching existing instance tuner-simple 2-0061: type set to 64 (LG NTSC (TAPE series)) tda9887 2-0043: attaching existing instance DVB: registering new adapter (cx88[0]) DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3303 VSB/QAM Frontend)... [snip] stepsize=0 divide error: 0000 [1] SMP CPU 1 Modules linked in: nls_utf8 fuse sco bridge stp bnep l2cap bluetooth sunrpc nf_conntrack_netbios_ns nf_conntrack_ftp ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 cpufreq_ondemand acpi_cpufreq freq_table xfs lgdt330x dm_multipath cx88_dvb cx88_vp3054_i2c uinput tda9887 tda8290 snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul tuner_simple tuner_types tuner msp3400 cx8800 cx88_alsa cx8802 snd_emu10k1 cx88xx snd_rawmidi snd_ac97_codec ir_common ac97_bus saa7115 snd_seq_dummy snd_seq_oss snd_seq_midi_event videobuf_dvb snd_seq dvb_core snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_device videobuf_dma_sg ppdev parport_pc snd_timer videobuf_core snd_page_alloc btcx_risc emu10k1_gp ivtv i2c_algo_bit cx2341x snd_util_mem snd_hwdep nvidia(P) gameport v4l2_common i2c_i801 snd soundcore parport videodev v4l1_compat v4l2_compat_ioctl32 tveeprom i2c_core pcspkr iTCO_wdt iTCO_vendor_support sky2 joydev floppy shpchp ata_generic pata_acpi pata_jmicron [last unloaded: microcode] Pid: 3553, comm: kdvb-ad-0-fe-0 Tainted: P 2.6.27.9-159.fc10.x86_64 #1 RIP: 0010:[] [] simple_dvb_calc_regs+0xab/0x281 [tuner_simple] RSP: 0018:ffff8800605dfd30 EFLAGS: 00010246 RAX: 000000000365c040 RBX: ffff8800605dfdb0 RCX: ffff88007acb8c10 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000246 RBP: ffff8800605dfda0 R08: ffff8800605dfba0 R09: 0000000000000082 R10: 00000010e73c9df1 R11: 0000000100000000 R12: ffff88007ac29c00 R13: ffff88007ac29c00 R14: ffff88007acbb408 R15: ffffffffa09b6fb0 FS: 0000000000000000(0000) GS:ffff88007f804880(0000) knlGS:0000000000000000 CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b CR2: 00000000004e8f40 CR3: 000000007114e000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process kdvb-ad-0-fe-0 (pid: 3553, threadinfo ffff8800605de000, task ffff88006fca0000) Stack: ffff8800605dfd40 00000000ffffffa1 ffff88007c055860 0000000000000001 ffff8800605dfda0 ffff8800605dfda0 ffff88007acb8c10 ffffffffa004e48c 8e01880000000390 ffff88007acb8c10 ffff88007ac29c00 0000000000000000 Call Trace: [] ? i2c_transfer+0x80/0x8b [i2c_core] [] simple_dvb_set_params+0x3e/0x9b [tuner_simple] [] lgdt330x_set_parameters+0x188/0x1b9 [lgdt330x] [] dvb_frontend_swzigzag_autotune+0x18e/0x1b5 [dvb_core] [] dvb_frontend_swzigzag+0x1bc/0x21e [dvb_core] [] dvb_frontend_thread+0x528/0x62b [dvb_core] [] ? autoremove_wake_function+0x0/0x38 [] ? dvb_frontend_thread+0x0/0x62b [dvb_core] [] kthread+0x49/0x76 [] child_rip+0xa/0x11 [] ? restore_args+0x0/0x30 [] ? kthread+0x0/0x76 [] ? child_rip+0x0/0x11 Code: 48 8b 05 2a 4e 00 00 41 8b 77 1c 31 d2 0f b7 40 0a 89 f1 03 45 d0 d1 e9 03 0d 23 4e 00 00 69 c0 24 f4 00 00 8d 04 01 48 8b 4d c0 f6 8a 55 d6 88 53 04 41 89 c4 c1 e8 08 88 43 01 8a 45 d7 44 RIP [] simple_dvb_calc_regs+0xab/0x281 [tuner_simple] RSP Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab commit f4c82548d4fa86fb3606f6ee219b070b88592a1e Author: Michael Krufky Date: Mon Dec 15 17:28:41 2008 -0300 V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2 The GPIO logic for LNA control on the Tiger r2 devices was inverted. This patch corrects the problem. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab commit dd72f31b4fa87c68e16484a3ed3e4d1843ad7f06 Author: Michael Krufky Date: Fri Nov 28 01:02:56 2008 -0300 V4L/DVB (10167): sms1xxx: add support for inverted gpio negative gpio values signify inverted polarity Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab commit e4cda3e0728156c6be1d03e72ef20ea811da4ad5 Author: Mauro Carvalho Chehab Date: Wed Dec 31 14:26:57 2008 -0300 V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments Signed-off-by: Mauro Carvalho Chehab commit faed4aa586f0c16020676481033665e959916c6a Author: Klaus Schmidinger Date: Wed Dec 31 14:13:56 2008 -0300 V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2 Report to userspace that cx24116 and stv0899 drivers support DVB-S2. Signed-off by: Klaus Schmidinger Acked-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab commit cb889a2f3515b140bef193cf6ffcdb099349b8aa Author: Klaus Schmidinger Date: Wed Dec 31 14:11:23 2008 -0300 V4L/DVB (10164): Add missing S2 caps flag to S2API The attached patch adds a capability flag that allows an application to determine whether a particular device can handle "second generation modulation" transponders. This is necessary in order for applications to be able to decide which device to use for a given channel in a multi device environment, where DVB-S and DVB-S2 devices are mixed. It is assumed that a device capable of handling "second generation modulation" can implicitly handle "first generation modulation". The flag is not named anything with DVBS2 in order to allow its use with future DVBT2 devices as well (should they ever come). Signed-off by: Klaus Schmidinger Acked-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab commit 9baed99ee7a834b1f2599e13f219087f01c63f38 Author: Mauro Carvalho Chehab Date: Wed Dec 31 09:37:33 2008 -0300 V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev Some devices require different setups on struct_audio. Due to that, we may need to change some fields at dev.adev during device probe. So, this patch moves the dynamic memory allocation of adev at em28xx-alsa to the dynamic allocation of struct em28xx dev that happens during device probe. Signed-off-by: Mauro Carvalho Chehab commit 0b82c5d6748a15758875f78ac772c6d48ebead2a Author: Mauro Carvalho Chehab Date: Wed Dec 31 09:34:18 2008 -0300 V4L/DVB (10162): tuner-simple: Fix tuner type set message Signed-off-by: Mauro Carvalho Chehab commit 4a87d7c4f259efa89ae6627c49e403eef51a3058 Author: Pham Thanh Nam Date: Wed Dec 31 06:57:19 2008 -0300 V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus This patch fixes autodetection for Avermedia AVerTV GO 007 FM Plus (M15C) (PCI ID 1461:f31d). Signed-off-by: Pham Thanh Nam Signed-off-by: Mauro Carvalho Chehab commit 87ea5f9d389717ff6da60dc014ce79ae14b7947c Author: Mauro Carvalho Chehab Date: Wed Dec 31 06:37:50 2008 -0300 V4L/DVB (10160): em28xx: update chip id for em2710 em2710 uses the same chip ID as em2820 (0x12). Signed-off-by: Mauro Carvalho Chehab commit 5e6de7d9a1a373414a41a7441100f90b71c6119f Author: Mark Lord Date: Wed Dec 3 15:26:15 2008 -0300 V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme Signed-off-by: Mark Lord Cc: Greg KH Signed-off-by: Andrew Morton [tobias.lorenz@gmx.net: Code beautifications and documentation added] Signed-off-by: Tobias Lorenz Signed-off-by: Mauro Carvalho Chehab commit 6a2d802ca01bd83b860145e7497a7a049c354cd7 Author: Pham Thanh Nam Date: Tue Dec 30 23:26:09 2008 -0300 V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus This patch adds support for Avermedia AVer TV GO 007 FM Plus (M15C) on saa7134 driver (PCI ID 1461:f31d). Signed-off-by: Pham Thanh Nam Signed-off-by: Mauro Carvalho Chehab commit 46a60cfef581307d8273919182ae939d44ff7cca Author: Fabio Belavenuto Date: Tue Dec 30 19:27:09 2008 -0300 V4L/DVB (10155): Add TEA5764 radio driver Add support for radio driver TEA5764 from NXP. This chip is connected in pxa I2C bus in EZX phones from Motorola, the chip is used in phone model A1200. This driver is for OpenEZX project (www.openezx.org) Tested with A1200 phone, openezx kernel and fm-tools [mchehab@redhat.com: Fixed CodingStyle and solved some merge conflicts] Signed-off-by: Fabio Belavenuto Signed-off-by: Mauro Carvalho Chehab commit b0c4be8cffb3f466759ddf621a74a10093537521 Author: Mauro Carvalho Chehab Date: Tue Dec 30 19:10:09 2008 -0300 V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board Signed-off-by: Mauro Carvalho Chehab commit 47aeba5addd88b178438ba9000600b9844ca0ee1 Author: Dmitri Belimov Date: Tue Dec 23 03:53:03 2008 -0300 V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov Signed-off-by: Mauro Carvalho Chehab commit f204ae40ad79bbf50d85427a5cf39fcebdb4a993 Author: Dmitri Belimov Date: Tue Dec 23 03:51:38 2008 -0300 V4L/DVB (10152): Change configuration of the Beholder H6 card Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov Signed-off-by: Mauro Carvalho Chehab commit 899a6f67b90206c330bd93c7c8f3f8bb8b80397a Author: Dmitri Belimov Date: Tue Dec 23 03:50:09 2008 -0300 V4L/DVB (10151): Fix I2C bridge error in zl10353 Fix I2C bridge error in zl10353 if no tunner attached to internal I2C bus of zl10353 chip. When set enable bridge from internal I2C bus to the main I2C bus (saa7134) the main I2C bus stopped very hardly. No any communication. In our next board we solder additional resistors to internal I2C bus. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov Signed-off-by: Mauro Carvalho Chehab commit 91f7c130c277a08ebef92ac23ed60adc62e505e0 Author: Mike Frysinger Date: Wed Nov 12 12:04:28 2008 -0300 V4L/DVB (10150): ttusb-dec: make it depend on PCI Since ttusb_dec.c relies on pci_alloc_consistent and pci_free_consistent, make it depend on PCI in Kconfig. Signed-off-by: Mike Frysinger Signed-off-by: Mauro Carvalho Chehab commit fbe9834a4a67a21a405043af727073acd103f842 Author: Mike Frysinger Date: Wed Nov 12 12:00:18 2008 -0300 V4L/DVB (10149): ttusb-budget: make it depend on PCI Since dvb-ttusb-budget.c relies on pci_alloc_consistent and pci_free_consistent, make it depend on PCI in Kconfig. Signed-off-by: Mike Frysinger Signed-off-by: Mauro Carvalho Chehab commit f347535a6065be6f9e65526fa82c088d68040f42 Author: roel kluin Date: Wed Nov 26 22:03:18 2008 -0300 V4L/DVB (10148): cx23885: unsigned cx23417_mailbox cannot be negative Unsigned cx23417_mailbox cannot be negative Signed-off-by: Roel Kluin Signed-off-by: Mauro Carvalho Chehab commit 9ed55375919bc30c448c6dd5107e8d593f96856f Author: Cyrill Gorcunov Date: Tue Dec 30 16:40:00 2008 -0300 V4L/DVB (10144): cx24116: build fix Add missed MODULE check to eliminate inapropriate declaration being choosed which causes a build error. Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab commit aecde8b53b8ee1330a5a8206200f0d6b8845a6e0 Author: Hans Verkuil Date: Tue Dec 30 07:14:19 2008 -0300 V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit da1b5c95e49bb564ae8c61ed135d34ed09acbb66 Author: Hans Verkuil Date: Tue Dec 30 07:07:53 2008 -0300 V4L/DVB (10140): gp8psk: fix incorrect return code (EINVAL instead of -EINVAL) Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9bb7cde793f0637cfbdd21c04050ffcef33a5624 Author: Hans Verkuil Date: Tue Dec 30 06:42:40 2008 -0300 V4L/DVB (10139): v4l: rename v4l_compat_ioctl32 to v4l2_compat_ioctl32 This rename prevents conflicts with the older compat_ioctl32 module. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 069b747931f13eda289c1d59a09ecc8162281a76 Author: Hans Verkuil Date: Tue Dec 30 07:04:34 2008 -0300 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. Since internal to v4l2 the ioctl prototype is the same regardless of it being called through .ioctl or .unlocked_ioctl, we need to convert it all to the long return type of unlocked_ioctl. Thanks to Jean-Francois Moine for posting an initial patch for this and thus bringing it to our attention. Cc: Jean-Francois Moine Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4ab9203b1b7e45f1beae7eb0c67d663a26257a69 Author: Hans Verkuil Date: Tue Dec 23 15:02:16 2008 -0300 V4L/DVB (10137): v4l2-compat32: only build if needed Add CONFIG_COMPAT check in Makefile. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c7dd09dabc278b03980c8e93d0eee3843b5ad514 Author: Hans Verkuil Date: Tue Dec 23 13:42:25 2008 -0300 V4L/DVB (10136): v4l2 doc: update v4l2-framework.txt Mention the new v4l2_file_operations struct. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bec43661b1dc0075b7445223ba775674133b164d Author: Hans Verkuil Date: Tue Dec 30 06:58:20 2008 -0300 V4L/DVB (10135): v4l2: introduce v4l2_file_operations. Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dfa9a5ae679ff2d23caa995d0f55a19abaf0596e Author: Hans Verkuil Date: Tue Dec 23 12:17:23 2008 -0300 V4L/DVB (10134): v4l2 doc: set v4l2_dev instead of parent. Update the documentation now that the v4l2_dev field is in. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 50a2a8b35edec09aff900a9b1c629776e11c5c88 Author: Hans Verkuil Date: Mon Dec 22 09:13:11 2008 -0300 V4L/DVB (10133): v4l2-framework: use correct comment style. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7943ecf161753ae92af74e7587c8438f221d55a5 Author: Hans Verkuil Date: Tue Dec 23 14:37:43 2008 -0300 V4L/DVB (10132): v4l2-compat-ioctl32: remove dependency on videodev. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2640c9a90fa596871e142f42052608864335f102 Merge: 80618fa... b16aabc... Author: Linus Torvalds Date: Fri Jan 2 10:32:18 2009 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (32 commits) ide-atapi: start dma in a drive-specific way ide-atapi: put the rest of non-ide-cd code into the else-clause of ide_transfer_pc ide-atapi: remove timeout arg to ide_issue_pc ide-cd: remove handler wrappers ide-cd: remove xferlen arg to cdrom_start_packet_command ide-atapi: split drive-specific functionality in ide_issue_pc ide-atapi: assign expiry and timeout based on device type ide-atapi: compute cmd_len based on device type in ide_transfer_pc ide: remove the last ide-scsi remnants ide-atapi: remove ide-scsi remnants from ide_pc_intr() ide-atapi: remove ide-scsi remnants from ide_transfer_pc() ide-atapi: remove ide-scsi remnants from ide_issue_pc ide-cd: move cdrom_timer_expiry to ide-atapi.c ide-atapi: teach ide atapi about drive->waiting_for_dma ide-atapi: accomodate transfer length calculation for ide-cd ide-atapi: setup dma for ide-cd ide-atapi: combine drive-specific assignments ide-atapi: add a dev_is_idecd-inline remove ide-scsi ide-floppy: allocate only toplevel packet commands ... commit 80618fa83a34a26199fa99cfd06476a81ddf57df Merge: 92cde4d... b21a207... Author: Linus Torvalds Date: Fri Jan 2 10:31:04 2009 -0800 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb * 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb: (31 commits) uwb: remove beacon cache entry after calling uwb_notify() uwb: remove unused include/linux/uwb/debug.h uwb: use print_hex_dump() uwb: use dev_dbg() for debug messages uwb: fix memory leak in uwb_rc_notif() wusb: fix oops when terminating a non-existant reservation uwb: fix oops when terminating an already terminated reservation uwb: improved MAS allocator and reservation conflict handling wusb: add debug files for ASL, PZL and DI to the whci-hcd driver uwb: fix oops in debug PAL's reservation callback uwb: clean up whci_wait_for() timeout error message wusb: whci-hcd shouldn't do ASL/PZL updates while channel is inactive uwb: remove unused beacon group join/leave events wlp: start/stop radio on network interface up/down uwb: add basic radio manager uwb: add pal parameter to new reservation callback uwb: fix races between events and neh timers uwb: don't unbind the radio controller driver when resetting uwb: per-radio controller event thread and beacon cache uwb: add commands to add/remove IEs to the debug interface ... commit 92cde4d5396c3b6cbf3192286b687f97a889dffe Author: Paul Mackerras Date: Fri Jan 2 15:40:55 2009 +1100 Update powerpc maintainers Ben Herrenschmidt is taking over as the primary powerpc architecture maintainer. I'll still be around as his backup/deputy. Signed-off-by: Paul Mackerras Acked-by: Grant Likely Signed-off-by: Linus Torvalds commit f0f0ce97e128569d07fae98c62d8cff1e042fa1e Merge: e8e3232... bef2a50... Author: Linus Torvalds Date: Fri Jan 2 10:28:41 2009 -0800 Merge branch 'i8k-updates' from Alan * i8k-updates: i8k: Add Dell Vostro systems i8k: Enable i8k on Dell Precision Systems commit bef2a508b4276fd7897b2cb27df037d26361842c Author: Federico Heinz Date: Fri Jan 2 16:19:23 2009 +0000 i8k: Add Dell Vostro systems This trivial patch adds support for i8k on the new Dell Vostro models. I tested it on my Vostro 1400, and it works. It does print a warning when loading the module: i8k: unable to get SMM BIOS version But I couldn't figure out how to fix that. The module seems to work fine, anyway... Signed-off-by: Federico Heinz Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 7ab21a8692094872298df172f54d55cba72fd308 Author: Andy Spencer Date: Fri Jan 2 16:19:13 2009 +0000 i8k: Enable i8k on Dell Precision Systems Patch to enable i8k on Dell Precisions. Signed-off-by: Andy Spencer Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit e8e32326279cba3d049b4325111f76618953195c Author: Ingo Brueckl Date: Fri Jan 2 14:42:00 2009 +0100 Fix compiler warning in arch/x86/mm/init_32.c Signed-off-by: Ingo Brueckl Signed-off-by: Linus Torvalds commit d2fde28ce793c09c1ea36d981cb6765174fd1eea Merge: 609e5b7... e65f0f8... Author: Linus Torvalds Date: Fri Jan 2 10:25:51 2009 -0800 Merge branch 'tty-updates' from Alan * tty-updates: (75 commits) serial_8250: support for Sealevel Systems Model 7803 COMM+8 hso maintainers update patch hso modem detect fix patch against Alan Cox'es tty tree tty: Fix an ircomm warning and note another bug drivers/char/cyclades.c: cy_pci_probe: fix error path Serial: UART driver changes for Cavium OCTEON. Serial: Allow port type to be specified when calling serial8250_register_port. 8250: Serial driver changes to support future Cavium OCTEON serial patches. 8250: Don't clobber spinlocks. fix for tty-serial-move-port tty: We want the port object to be persistent __FUNCTION__ is gcc-specific, use __func__ serial: RS485 ioctl structure uses __u32 include linux/types.h tty: Drop the lock_kernel in the private ioctl hook synclink_cs: Convert to tty_port tty: use port methods for the rocket driver tty: kref the rocket driver tty: make rocketport use standard port->flags tty: Redo the rocket driver locking tty: Make epca use the port helpers ... commit 103ceffb9501531f6931df6aebc11a05189201f0 Author: Jaswinder Singh Rajput Date: Fri Jan 2 23:43:25 2009 +0530 x86: mpparse.c fix style problems Impact: cleanup, fix style problems, more readable Fixes style problems: WARNING: Use #include instead of WARNING: Use #include instead of WARNING: suspect code indent for conditional statements (8, 17) WARNING: space prohibited between function name and open parenthesis '(' total: 0 errors, 5 warnings Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Ingo Molnar commit e65f0f8271b1b0452334e5da37fd35413a000de4 Author: Flavio Leitner Date: Fri Jan 2 13:50:43 2009 +0000 serial_8250: support for Sealevel Systems Model 7803 COMM+8 Add support for Sealevel Systems Model 7803 COMM+8 Signed-off-by: Flavio Leitner Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 11cd29b028be88b13717401496fe4953fb96be03 Author: Denis Joseph Barrow Date: Fri Jan 2 13:50:36 2009 +0000 hso maintainers update patch Added D.J. Barrow as maintainer of hso driver. Signed-off-by: Denis Joseph Barrow Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 58eb17f155704062d76729d1fb7e23d3559ca86a Author: Denis Joseph Barrow Date: Fri Jan 2 13:50:29 2009 +0000 hso modem detect fix patch against Alan Cox'es tty tree Fixed incorrect check for the modem port, this prevents crashes caused by issueing a tiocmget_submit_urb on endpoints which don't exist for non modem devices. Signed-off-by: Denis Joseph Barrow Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit ad36b88e2d22e9ef42797581d3ecea9feadd9488 Author: Alan Cox Date: Fri Jan 2 13:50:20 2009 +0000 tty: Fix an ircomm warning and note another bug Roel Kluin noted that line is unsigned so one test is unneccessary. Also add a warning for another flaw I noticed while making this change. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit c847d47cb7b2fa78b17c9e17ed3fbd010ee3d3ca Author: Andrew Morton Date: Fri Jan 2 13:50:07 2009 +0000 drivers/char/cyclades.c: cy_pci_probe: fix error path We forgot to release resources in one case. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12137 Reported-by: Florian Lohoff Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 6b06f19151c335ee0c5b61839fa4e6838182ebb8 Author: David Daney Date: Fri Jan 2 13:50:00 2009 +0000 Serial: UART driver changes for Cavium OCTEON. Cavium UART implementation is not covered by existing uart_configS. Define a new uart_config (PORT_OCTEON) which is specified by OCTEON platform device registration code. Signed-off-by: Tomaso Paoletti Signed-off-by: David Daney Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 8e23fcc89c8091790903927449f8efb9b4e23960 Author: David Daney Date: Fri Jan 2 13:49:54 2009 +0000 Serial: Allow port type to be specified when calling serial8250_register_port. Add flag value UPF_FIXED_TYPE which specifies that the UART type is known and should not be probed. For this case the UARTs properties are just copied out of the uart_config entry. This allows us to keep SOC specific 8250 probe code out of 8250.c. In this case we know the serial hardware will not be changing as it is on the same silicon as the CPU, and we can specify it with certainty in the board/cpu setup code. The alternative is to load up 8250.c with a bunch of OCTEON specific special cases in the probing code. Signed-off-by: David Daney Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 7d6a07d123b62bf4fa71867420c23da3ca36c995 Author: David Daney Date: Fri Jan 2 13:49:47 2009 +0000 8250: Serial driver changes to support future Cavium OCTEON serial patches. In order to use Cavium OCTEON specific serial i/o drivers, we first patch the 8250 driver to use replaceable I/O functions. Compatible I/O functions are added for existing iotypeS. An added benefit of this change is that it makes it easy to factor some of the existing special cases out to board/SOC specific support code. The alternative is to load up 8250.c with a bunch of OCTEON specific iotype code and bug work-arounds. Signed-off-by: David Daney Signed-off-by: Tomaso Paoletti Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit b430428a188e8a434325e251d0704af4b88b4711 Author: David Daney Date: Fri Jan 2 13:49:41 2009 +0000 8250: Don't clobber spinlocks. In serial8250_isa_init_ports(), the port's lock is initialized. We should not overwrite it. In early_serial_setup(), only copy in the fields we need. Since the early console code only uses a subset of the fields, these are sufficient. Signed-off-by: David Daney Signed-off-by: Tomaso Paoletti Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit bc3256288b8ff9787623805e53cf7c6d5a2b4591 Author: Alexander Beregalov Date: Fri Jan 2 13:49:32 2009 +0000 fix for tty-serial-move-port Hi Alan next-20081204 crashes with the following message: BUG: unable to handle kernel paging request at ffff88007d320248 IP: [] uart_remove_one_port+0xef/0x111 kfree(info); 393: 49 8d 7d 10 lea 0x10(%r13),%rdi 397: e8 00 00 00 00 callq 39c Signed-off-by: Alexander Beregalov Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit f751928e0ddf54ea4fe5546f35e99efc5b5d9938 Author: Alan Cox Date: Fri Jan 2 13:49:21 2009 +0000 tty: We want the port object to be persistent Move the tty_port and uart_info bits around a little. By embedding the uart_info into the uart_port we get rid of lots of corner case testing and also get the ability to go port<->state<->info which is a bit more elegant than the current data structures. Downsides - we allocate a tiny bit more memory for unused ports, upside we've removed as much code as it saved for most users.. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 6ef53066ff7991d5f9670340e92d42ee1776bbe4 Author: Harvey Harrison Date: Fri Jan 2 13:49:13 2009 +0000 __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 60c20fb8c00a2b23308ae4517f145383bc66d291 Author: Andy Whitcroft Date: Fri Jan 2 13:49:04 2009 +0000 serial: RS485 ioctl structure uses __u32 include linux/types.h In the commit below a new struct serial_rs485 was introduced for a new ioctl: commit c26c56c0f40e200e61d1390629c806f6adaffbcc Author: Alan Cox Date: Mon Oct 13 10:37:48 2008 +0100 tty: Cris has a nice RS485 ioctl so we should steal it This structure uses the __u32 types for some of its members, which leads to the following compile error: $ cc -I.../include -c X.c In file included from X.c:2: .../include/linux/serial.h:185: error: expected specifier-qualifier-list before ‘__u32’ $ It seems that these types are appropriate for this structure as it is to be exposed to userspace. These types are available via linux/types.h so move the include of that outside the __KERNEL__ section. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 6b447f04a9aecdf2a30c1a97e4b034ac7931bb70 Author: Alan Cox Date: Fri Jan 2 13:48:56 2009 +0000 tty: Drop the lock_kernel in the private ioctl hook We don't need the BKL here any more so it can go. In a couple of spots the driver requirements are not clear so push the lock down into the driver. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit eeb4613436f0f19a38f667ea3078821040559c68 Author: Alan Cox Date: Fri Jan 2 13:48:47 2009 +0000 synclink_cs: Convert to tty_port Use the tty port operations, add refcounting, and refactor a bit to make the refcounting work cleanly. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit fba85e013f106a44e91ef5edec899fc56a7e61ee Author: Alan Cox Date: Fri Jan 2 13:48:39 2009 +0000 tty: use port methods for the rocket driver Now we have our ducks in order we can begin switching to the port operations Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 47b01b3a5fc7239f3e8d5d5cadc88afbea24d0c3 Author: Alan Cox Date: Fri Jan 2 13:48:30 2009 +0000 tty: kref the rocket driver We will need this kref fitted to make full use of the port operations. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 21bed701da009b4192d9e86b3596cf210ac7369c Author: Alan Cox Date: Fri Jan 2 13:48:23 2009 +0000 tty: make rocketport use standard port->flags We need to this ready for using the standard helpers Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit c1314a49d7907b96d72f2c41f8927fc3c738e956 Author: Alan Cox Date: Fri Jan 2 13:48:17 2009 +0000 tty: Redo the rocket driver locking Bring this driver into the port locking model Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 6ed1dbaeadd62a026a93aa3ac8680d2dfe9f96b3 Author: Alan Cox Date: Fri Jan 2 13:48:11 2009 +0000 tty: Make epca use the port helpers Now the locking is straight and the port kref usage is straight we can replace lots of chunks of code with the standard port helpers Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 3969ffba71d39ced700d09d9cfde83174396299e Author: Alan Cox Date: Fri Jan 2 13:48:04 2009 +0000 tty: refcount the epca driver Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit d1c815e549ff40f9e9db65654855118e6bdff6a4 Author: Alan Cox Date: Fri Jan 2 13:47:58 2009 +0000 tty: relock epca Bring epca into line with the port locking. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 542f54823614915780c3459b0e6062f06c0c0f99 Author: Denis Joseph Barrow Date: Fri Jan 2 13:47:52 2009 +0000 tty: Modem functions for the HSO driver Makes TIOCM ioctls for Data Carrier Detect & related functions work like /drivers/serial/serial-core.c potentially needed for pppd & similar user programs. Signed-off-by: Denis Joseph Barrow Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit ac9720c37e8795317e8be3adad63cb0d5522a640 Author: Alan Cox Date: Fri Jan 2 13:47:45 2009 +0000 tty: Fix the HSO termios handling a bit Init the tty structure once Don't set ->low_latency twice in a row Don't force bits we should be leaving to the user Don't allocate termios arrays as these are in fact allocated by the tty layer for you and just overwrite the ones allocated in the driver Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit e136e3036bf27569dbfeae245cc09c7167cdc749 Author: Alan Cox Date: Fri Jan 2 13:47:39 2009 +0000 hso: net driver using tty without locking Checking tty == NULL doesn't help us unless we have a clear semantic for the locking of the tty object in the driver. Use the tty kref objects so that we can take references to the tty in the USB event handling paths. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 33dd474ae712dc435eb586b44cb771cc8d24e2bd Author: Alan Cox Date: Fri Jan 2 13:47:32 2009 +0000 tty: kref nozomi Update the nozomi driver to use krefs Signed-off-by: Linus Torvalds commit c9f19e96a2f33cd56c2bd19f87a0c4982d011c2b Author: Alan Cox Date: Fri Jan 2 13:47:26 2009 +0000 tty: Remove some pointless casts disc_data and driver_data are void * Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 0ac6053c4db9369d7b0f9b39c30f4fb04405666b Author: Alan Cox Date: Fri Jan 2 13:47:20 2009 +0000 tty: PTYs set TTY_DO_WRITE_WAKEUP when they don't need to The write wakeup is done anyway for the poll while DO_WRITE_WAKUP is cleared, set and managed by the ldisc layer and is no business of the pty code. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit ff8cb0fd6f195389aefe55d5dac9927d09a9de54 Author: Thomas Pfaff Date: Fri Jan 2 13:47:13 2009 +0000 tty: N_TTY SIGIO only works for read The N_TTY ldisc layer does not send SIGIO POLL_OUTs correctly when output is possible due to flawed handling of the TTY_DO_WRITE_WAKEUP bit. It will either send no SIGIOs at all or on every tty wakeup. The fix is to set the bit when the tty driver write would block and test and clear it on write wakeup. [Merged with existing N_TTY patches and a small buglet fixed -- Alan] Signed-off-by: Thomas Pfaff Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit eff6937a46e096eb35c16a391617b7a5e098a30c Author: Alan Cox Date: Fri Jan 2 13:47:06 2009 +0000 tty: USB tty devices can block in tcdrain when unplugged The underlying problem is that the device methods don't all correctly handle disconnected status and some keep reporting bytes pending which causes tcdrain to stall. When the cable is unplugged they are definitely gone, and as this is true for all USB cables we can fix it in the core usb serial code. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 39aced68d664291db3324d0fcf0985ab5626aac2 Author: Niels de Vos Date: Fri Jan 2 13:46:58 2009 +0000 serial: set correct baud_base for Oxford Semiconductor Ltd EXSYS EX-41092 Dual 16950 Serial adapter The PCI-card identified as "Oxford Semiconductor Ltd EXSYS EX-41092 Dual 16950 Serial adapter" is only usable with other devices (i.e. not the same card) after doing a "setserial /dev/ttyS baud_base 115200". This baud_base should be default for this card. Signed-off-by: Niels de Vos Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit a6614999e800cf3a134ce93ea46ef837e3c0e76e Author: Alan Cox Date: Fri Jan 2 13:46:50 2009 +0000 tty: Introduce some close helpers for ports Again this is a lot of common code we can unify Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 7834909f1eb96ba7c49ca2b9e3a69b500a2cff76 Author: Alan Cox Date: Fri Jan 2 13:46:43 2009 +0000 tty: tty port zero baud open If we have no speed set at some point then we should not raise DTR/RTS at that point when opening as the tty is not ready Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 0fdeceb88df7f4d9e4734859bcd650e8584cc0e4 Author: Alan Cox Date: Fri Jan 2 13:46:34 2009 +0000 tty: ESP has been broken for locking etc forver Mark it broken Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 4350f3ffec7a7e70770a7369186b3db7d97acfdf Author: Alan Cox Date: Fri Jan 2 13:46:24 2009 +0000 tty: rework stallion to use the tty_port bits Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 2a6eadbd5a2ae8f458e421f3614f1ad13c0f9a1c Author: Alan Cox Date: Fri Jan 2 13:46:18 2009 +0000 tty: Rework istallion to use the tty port changes Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 36c621d82b956ff6ff72273f848af53e6c581aba Author: Alan Cox Date: Fri Jan 2 13:46:10 2009 +0000 tty: Introduce a tty_port generic block_til_ready Start sucking more commonality out of the drivers into a single piece of core code. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 3b6826b250633361f08a6427a4ac0035e5d88c72 Author: Alan Cox Date: Fri Jan 2 13:45:58 2009 +0000 tty: relock the mxser driver Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit c2ba38cd76df770a253f0cab4b6abe514c265a85 Author: Alan Cox Date: Fri Jan 2 13:45:50 2009 +0000 tty: relock riscom8 using port locks Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit a129909ca910d086b8536c790338504878489a95 Author: Alan Cox Date: Fri Jan 2 13:45:44 2009 +0000 tty: rocketport uses different port flags to everyone else Normalise them so we can use the common helpers later on Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 510a3049573868d3d77414bfa55d293f44d0dbbe Author: Alan Cox Date: Fri Jan 2 13:45:36 2009 +0000 tty: relock generic_serial Switch generic_serial to do port count locking via the tty_port structure ready for moving to a common port wait routine. Keep the old driver lock for internal calling so we don't risk messing up the drivers below until we are ready. Still needs kref conversions Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 3e61696bdc2103107674b06d0daf30b76193e922 Author: Alan Cox Date: Fri Jan 2 13:45:26 2009 +0000 isicom: redo locking to use tty port locks This helps set the basis for moving block_til_ready into common code. We also introduce a tty_port_hangup helper as this will also be generally needed. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 5d951fb458f847e5485b5251597fbf326000bb3b Author: Alan Cox Date: Fri Jan 2 13:45:19 2009 +0000 tty: Pull the dtr raise into tty port This moves another per device special out of what should be shared open wait paths into private methods Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit d0c9873addc1f18e7becb50094dad07df8cc4694 Author: Alan Cox Date: Fri Jan 2 13:45:12 2009 +0000 rio: Kill off ckmalloc This was an alloc/clear wrapper but makes even less sense now it uses kzalloc. Kill it off. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 31f35939d1d9bcfb3099b32c67b896d2792603f9 Author: Alan Cox Date: Fri Jan 2 13:45:05 2009 +0000 tty_port: Add a port level carrier detect operation This is the first step to generalising the various pieces of waiting logic duplicated in all sorts of serial drivers. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit c9b3976e3fec266be25c5001a70aa0a890b6c476 Author: Alan Cox Date: Fri Jan 2 13:44:56 2009 +0000 tty: Fix PPP hang under load Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit d0eafc7db8f170d534a16b5f04617e98ae2025de Author: David Howells Date: Fri Jan 2 13:44:49 2009 +0000 CRED: Wrap task credential accesses in the devpts filesystem Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 39efd191d01b5f1efc3d604baf74233dc525e6a8 Author: Kevin Hao Date: Fri Jan 2 13:44:34 2009 +0000 Add device function for USB serial console Add device funtion for usb serial console, so we can open /dev/console when we use a usb serial device as console. (Typecast removed as noted by Sergei Shtylyov) Signed-off-by: Kevin Hao Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 975a1a7d887048d4afc9201383e11b7af991866b Author: Russell King Date: Fri Jan 2 13:44:27 2009 +0000 And here's a patch (to be applied on top of the last) which prevents this happening again by making use of 'const'. Signed-off-by: Russell King Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 9f2a036aaac8f29bb7c68303b52a9263238b63d2 Author: Russell King Date: Fri Jan 2 13:44:20 2009 +0000 Convert the oxsemi tornado special cases to use the quirk interface and not scribble on its own reference structures. Signed-off-by: Russell King Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 8c056e5b148498192832678cf2957760945e8c71 Author: Andrew Morton Date: Fri Jan 2 13:44:12 2009 +0000 devpts: fix unused function warning fs/devpts/inode.c:324: warning: 'compare_init_pts_sb' defined but not used Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 4bd43f2c31848d751f63e8753cd2788d48fb5f30 Author: Alan Cox Date: Fri Jan 2 13:44:04 2009 +0000 tty: Fix close races in USB serial USB serial has always had races where the tty port usage count can hit zero during a receive event. The internal locking is a mutex so we can't use that in the IRQ handlers. With krefs we can tackle this differently but we still need to be careful. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 7e94b1d9bffc18dca3b45554d9d118a3ffcc4d1b Author: Joe Peterson Date: Fri Jan 2 13:43:40 2009 +0000 n_tty: Output bells immediately on a full buffer This patch causes "bell" (^G) characters (invoked when the input buffer is full) to be immediately output rather than filling the echo buffer. This is especially a problem when the tty is stopped and buffers fill, since the bells do not serve their purpose of immediate notification that the buffer cannot take further input, and they will flush all at once when the tty is restarted. Signed-off-by: Joe Peterson Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit acc71bbad33478973dbed68ebbc2d76dac9a51bd Author: Joe Peterson Date: Fri Jan 2 13:43:32 2009 +0000 n_tty: Fix hanfling of buffer full corner cases Fix the handling of input characters when the tty buffer is full or nearly full. This includes tests that are done in n_tty_receive_char() and handling of PARMRK. Problems with the buffer-full tests done in receive_char() caused characters to be lost at times when the buffer(s) filled. Also, these full conditions would often only be detected with echo on, and PARMRK was not accounted for properly in all cases. One symptom of these problems, in addition to lost characters, was early termination from unix commands like tr and cat when ^Q was used to break from a stopped tty with full buffers (note that breaking out was often previously not possible, due to the pty getting in "gridlock", which will be addressed in another patch). Note space is always reserved at the end of the buffer for a newline (or EOF/EOL) in canonical mode. Signed-off-by: Joe Peterson Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit a59c0d6f14315a3f300f6f3786137213727e4c47 Author: Joe Peterson Date: Fri Jan 2 13:43:25 2009 +0000 n_tty: Fix handling of control characters and continuations Fix process_output_block to detect continuation characters correctly and to handle control characters even when O_OLCUC is enabled. Make similar change to do_output_char(). Signed-off-by: Joe Peterson Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit fc6f6238226e6d1248e1967eae2bf556eaf3ac17 Author: Alan Cox Date: Fri Jan 2 13:43:17 2009 +0000 pty: simplify resize We have special case logic for resizing pty/tty pairs. We also have a per driver resize method so for the pty case we should use it. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit a47d545f5782cbde871b50bdf4a83379ed2da222 Author: Jason Wessel Date: Fri Jan 2 13:43:04 2009 +0000 tty: Fix sparse static warning for tty_driver_lookup_tty Fixed sparse warning: drivers/char/tty_io.c:1216:19: warning: symbol 'tty_driver_lookup_tty' was not declared. Should it be static? Signed-off-by: Jason Wessel Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit d95186d1f455b4b901121ba69d0680800fb4b57b Author: Alan Cox Date: Fri Jan 2 13:42:56 2009 +0000 sierra: Fix formatting Andrew Morton wrote: in drivers/usb/serial/sierra.c: } else { if (urb->actual_length) { + tty = tty_port_tty_get(&port->port); tty_buffer_request_room(tty, urb->actual_length); it's missing a tab. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 835aa440f1c3fe16a622015bc1b52dffedf6d90e Author: Alan Cox Date: Fri Jan 2 13:42:48 2009 +0000 devpts: Coding style clean up Just nail the oddments now while this code is being touched Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 784c4d8b1b1e66f8c45e8b889613f4982f525b2b Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:42:34 2009 +0000 Document usage of multiple-instances of devpts Changelog [v2]: - Add note indicating strict isolation is not possible unless all mounts of devpts use the 'newinstance' mount option. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 2a1b2dc0c83bbfc24d72cafd5e69810a149b44e4 Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:42:27 2009 +0000 Enable multiple instances of devpts To support containers, allow multiple instances of devpts filesystem, such that indices of ptys allocated in one instance are independent of ptys allocated in other instances of devpts. But to preserve backward compatibility, enable this support for multiple instances only if: - CONFIG_DEVPTS_MULTIPLE_INSTANCES is set to Y, and - '-o newinstance' mount option is specified while mounting devpts To use multi-instance mount, a container startup script could: $ ns_exec -cm /bin/bash $ umount /dev/pts $ mount -t devpts -o newinstance lxcpts /dev/pts $ mount -o bind /dev/pts/ptmx /dev/ptmx $ /usr/sbin/sshd -p 1234 where 'ns_exec -cm /bin/bash' is calls clone() with CLONE_NEWNS flag and execs /bin/bash in the child process. A pty created by the sshd is not visible in the original mount of /dev/pts. USER-SPACE-IMPACT: - See Documentation/fs/devpts.txt (included in next patch) for user- space impact in multi-instance and mixed-mode operation. TODO: - Update mount(8), pts(4) man pages. Highlight impact of not redirecting /dev/ptmx to /dev/pts/ptmx after a multi-instance mount. Changelog[v6]: - [Dave Hansen] Use new get_init_pts_sb() interface - [Serge Hallyn] Don't bother displaying 'newinstance' in show_options - [Serge Hallyn] Use macros (PARSE_REMOUNT/PARSE_MOUNT) instead of 0/1. - [Serge Hallyn] Check error return from get_sb_single() (now get_init_pts_sb()) - devpts_pty_kill(): don't dput error dentries Changelog[v5]: - Move get_sb_ref() definition to earlier patch - Move usage info to Documentation/filesystems/devpts.txt (next patch) - Make ptmx node even in init_pts_ns, now that default mode is 0000 (defined in earlier patch, enabled here). - Cache ptmx dentry and use to update mode during remount (defined in earlier patch, enabled here). - Bugfix: explicitly ignore newinstance on remount (if newinstance was specified on remount of initial mount, it would be ignored but /proc/mounts would imply that the option was set) Changelog[v4]: - Update patch description to address H. Peter Anvin's comments - Consolidate multi-instance mode code under new config token, CONFIG_DEVPTS_MULTIPLE_INSTANCE. - Move usage-details from patch description to Documentation/fs/devpts.txt Changelog[v3]: - Rename new mount option to 'newinstance' - Create ptmx nodes only in 'newinstance' mounts - Bugfix: parse_mount_options() modifies @data but since we need to parse the @data twice (once in devpts_get_sb() and once during do_remount_sb()), parse a local copy of @data in devpts_get_sb(). (restructured code in devpts_get_sb() to fix this) Changelog[v2]: - Support both single-mount and multiple-mount semantics and provide '-onewmnt' option to select the semantics. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit d4076ac55bf8755ce6c5706478631c1726cf0179 Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:42:19 2009 +0000 Define get_init_pts_sb() See comments in the function header for details. The new interface will be used in a follow-on patch. Changelog [v2]: [Dave Hansen] Replace get_sb_ref() in fs/super.c with get_init_pts_sb() and make the new interface private to devpts Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 1f8f1e296583f9f832c2fe7b5a219675b74bf43e Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:42:02 2009 +0000 Define mknod_ptmx() /dev/ptmx is closely tied to the devpts filesystem. An open of /dev/ptmx, allocates the next pty index and the associated device shows up in the devpts fs as /dev/pts/n. Wih multiple instancs of devpts filesystem, during an open of /dev/ptmx we would be unable to determine which instance of the devpts is being accessed. So we move the 'ptmx' node into /dev/pts and use the inode of the 'ptmx' node to identify the superblock and hence the devpts instance. This patch adds ability for the kernel to internally create the [ptmx, c, 5:2] device when mounting devpts filesystem. Since the ptmx node in devpts is new and may surprise some userspace scripts, the default permissions for the new node is 0000. These permissions can be changed either using chmod or by remounting with the new '-o ptmxmode=0666' mount option. Changelog[v5]: - [Serge Hallyn bugfix]: Letting new_inode() assign inode number to ptmx can collide with hand-assigning inode numbers to ptys. So, hand-assign specific inode number to ptmx node also. - [Serge Hallyn]: Maybe safer to grab root dentry mutex while creating ptmx node - [Bugfix with Serge Hallyn] Replace lookup_one_len() in mknod_ptmx() wih d_alloc_name() (lookup during ->get_sb() locks up system). To simplify patchset, fold the ptmx_dentry patch into this. Changelog[v4]: - Change default permissions of pts/ptmx node to 0000. - Move code for ptmxmode under #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES. Changelog[v3]: - Rename ptmx_mode to ptmxmode (for consistency with 'newinstance') Changelog[v2]: - [H. Peter Anvin] Remove mknod() system call support and create the ptmx node internally. Changelog[v1]: - Earlier version of this patch enabled creating /dev/pts/tty as well. As pointed out by Al Viro and H. Peter Anvin, that is not really necessary. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit e4adca27bcbb8a73c4cf1dfa71392654cfa33345 Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:41:54 2009 +0000 Add DEVPTS_MULTIPLE_INSTANCES config token Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 53af8ee4094d80ddaac7efefb572b1c22ae49367 Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:41:47 2009 +0000 Extract option parsing to new function Move code to parse mount options into a separate function so it can (later) be shared between mount and remount operations. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 31af0abbdafb66ad8e27e3df878faec2ebe1132e Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:41:33 2009 +0000 Per-mount 'config' object With support for multiple mounts of devpts, the 'config' structure really represents per-mount options rather than config parameters. Rename 'config' structure to 'pts_mount_opts' and store it in the super-block. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit e76b7c01e598d2d14ddfdb6ae5c6afe45245d0de Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:41:21 2009 +0000 Per-mount allocated_ptys To enable multiple mounts of devpts, 'allocated_ptys' must be a per-mount variable rather than a global variable. Move 'allocated_ptys' into the super_block's s_fs_info. Changelog[v2]: Define and use DEVPTS_SB() wrapper. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 59e55e6cf86eb472e8373831c4234252916c53ef Author: Sukadev Bhattiprolu Date: Fri Jan 2 13:41:11 2009 +0000 Remove devpts_root global Remove the 'devpts_root' global variable and find the root dentry using the super_block. The super-block can be found from the device inode, using the new wrapper, pts_sb_from_inode(). Changelog: This patch is based on an earlier patchset from Serge Hallyn and Matt Helsley. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 300a6204b4d45dc70359b24384ad04ae899179c3 Author: Alan Cox Date: Fri Jan 2 13:41:04 2009 +0000 n_tty: clean up coding style Now the main work is done its polishing time Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit a88a69c91256418c5907c2f1f8a0ec0a36f9e6cc Author: Joe Peterson Date: Fri Jan 2 13:40:53 2009 +0000 n_tty: Fix loss of echoed characters and remove bkl from n_tty Fixes the loss of echoed (and other ldisc-generated characters) when the tty is stopped or when the driver output buffer is full (happens frequently for input during continuous program output, such as ^C) and removes the Big Kernel Lock from the N_TTY line discipline. Adds an "echo buffer" to the N_TTY line discipline that handles all ldisc-generated output (including echoed characters). Along with the loss of characters, this also fixes the associated loss of sync between tty output and the ldisc state when characters cannot be immediately written to the tty driver. The echo buffer stores (in addition to characters) state operations that need to be done at the time of character output (like management of the column position). This allows echo to cooperate correctly with program output, since the ldisc state remains consistent with actual characters written. Since the echo buffer code now isolates the tty column state code to the process_out* and process_echoes functions, we can remove the Big Kernel Lock (BKL) and replace it with mutex locks. Highlights are: * Handles echo (and other ldisc output) when tty driver buffer is full - continuous program output can block echo * Saves echo when tty is in stopped state (e.g. ^S) - (e.g.: ^Q will correctly cause held characters to be released for output) * Control character pairs (e.g. "^C") are treated atomically and not split up by interleaved program output * Line discipline state is kept consistent with characters sent to the tty driver * Remove the big kernel lock (BKL) from N_TTY line discipline Signed-off-by: Joe Peterson Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit e482a2378f3d1aef7fa8942f8f163078f01bb456 Author: Sonic Zhang Date: Fri Jan 2 13:40:45 2009 +0000 Blackfin Serial Driver: Remove BI status for known_good_char Signed-off-by: Sonic Zhang Signed-off-by: Bryan Wu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 68a784cb1add52543644a879ef601f3b52d18623 Author: Sonic Zhang Date: Fri Jan 2 13:40:38 2009 +0000 Blackfin Serial Driver: Fix bug - BF527-EZKIT unable to receive large files over UART in DMA mode Add spin_lock_irqsave() when receive and transfer data. Signed-off-by: Sonic Zhang Signed-off-by: Bryan Wu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit b6efa1eabbe8d23fd7dcad1eed8ce945f4adea83 Author: Sonic Zhang Date: Fri Jan 2 13:40:31 2009 +0000 Blackfin Serial Driver: Clean serial console and early prink code. Signed-off-by: Sonic Zhang Signed-off-by: Bryan Wu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 80d5c474b87da88eca8e1ab034e26daa9f688130 Author: Graf Yang Date: Fri Jan 2 13:40:22 2009 +0000 Blackfin Serial Driver: fix bug - SIR driver stop receiving randomly Bug description: The IRDA receiver may can't receiving any more after processed some signals. To duplicate this issue is put three IRDA devices together, one blackfin, two none blackfin, they will detect each other. Let one none blackfin devices irdaping the blackfin devices, when it stopped print out ping information, it is the time that blackfin stoped receiving, the time is random. The related register bit is OK, the other devices is sending data continuously. But no interrupt come. Fixing: I tried Michael's suggestion that request the UARTx error interrupt, and reset the IRDA when found FE error. This method helps much, but it can't completely avoid stop. Reset the IRDA before every time sending the data is more safe. Signed-off-by: Graf Yang Signed-off-by: Bryan Wu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 52e15f0eae193a8e4ca31c1520179b8d65c79811 Author: Sonic Zhang Date: Fri Jan 2 13:40:14 2009 +0000 Blackfin Serial Driver: updates kgdb over Blackfin serial driver with kgdb framework Signed-off-by: Sonic Zhang Signed-off-by: Bryan Wu Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds commit 609e5b71d0eca163df017ecfcf917b149875e744 Author: Ingo Molnar Date: Fri Jan 2 16:16:16 2009 +0100 kbuild: Remove gcc 4.1.0 quirk from init/main.c Impact: cleanup We now have a cleaner check for gcc 4.1.0/4.1.1 trouble in include/linux/compiler-gcc4.h, so remove the 4.1.0 quirk from init/main.c. Reported-by: Bartlomiej Zolnierkiewicz Signed-off-by: Ingo Molnar Acked-by: Sam Ravnborg Signed-off-by: Linus Torvalds commit dceb4521c8ed24b9fe4230e0d385cf4770260383 Author: Jaswinder Singh Rajput Date: Wed Dec 31 17:35:02 2008 +0530 x86: nmi.c fix style problems Impact: cleanup, fix style problems Fixes style problems: WARNING: Use #include instead of WARNING: Use #include instead of total: 0 errors, 2 warnings Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Ingo Molnar commit f9d14250071eda9972e4c9cea745a11185952114 Author: Linus Torvalds Date: Fri Jan 2 09:29:43 2009 -0800 Disallow gcc versions 4.1.{0,1} These compiler versions are known to miscompile __weak functions and thus generate kernels that don't necessarily work correctly. If a weak function is int he same compilation unit as a caller, gcc may end up inlining it, and thus binding the weak function too early. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781 for details. Cc: Adrian Bunk Cc: Helge Deller Cc: Rusty Russell Cc: Ingo Molnar Signed-off-by: Linus Torvalds commit f153b82121b0366fe0e5f9553545cce237335175 Author: Linus Torvalds Date: Fri Jan 2 09:23:03 2009 -0800 Sanitize gcc version header includes - include the gcc version-dependent header files from the generic gcc header file, rather than the other way around (iow: don't make the non-gcc header file have to know about gcc versions) - don't include compiler-gcc4.h for gcc 5 (for whenever it gets released). That's just confusing and made us do odd things in the gcc4 header file (testing that we really had version 4!) - generate the name from the __GNUC__ version directly, rather than having a mess of #if conditionals. Signed-off-by: Linus Torvalds commit 423a54058f746579aff1430877dbc82f17442b34 Author: Jaswinder Singh Rajput Date: Wed Dec 31 16:42:20 2008 +0530 x86: ldt.c fix style problems Impact: cleanup Fixes style problems: WARNING: Use #include instead of ERROR: space required before the open parenthesis '(' total: 1 errors, 1 warnings Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Ingo Molnar commit f634fa941188a91dbf1dab961fe7a4509852fd6e Author: Jaswinder Singh Rajput Date: Wed Dec 31 16:29:48 2008 +0530 x86: cpuid.c fix style problems Impact: cleanup Fixes style problems: WARNING: Use #include instead of ERROR: "foo * bar" should be "foo *bar" ERROR: trailing whitespace WARNING: usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc total: 2 errors, 2 warnings Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Ingo Molnar commit 46814dded1b972a07b1609d81632eef3009fbb10 Author: Cliff Wickman Date: Wed Dec 31 13:20:50 2008 -0600 x86, UV: remove erroneous BAU initialization Impact: fix crash on x86/UV UV is the SGI "UltraViolet" machine, which is x86_64 based. BAU is the "Broadcast Assist Unit", used for TLB shootdown in UV. This patch removes the allocation and initialization of an unused table. This table is left over from a development test mode. It is unused in the present code. And it was incorrectly initialized: 8 entries allocated but 17 initialized, causing slab corruption. This patch should go into 2.6.27 and 2.6.28 as well as the current tree. Diffed against 2.6.28 (linux-next, 12/30/08) Signed-off-by: Cliff Wickman Cc: Signed-off-by: Ingo Molnar commit 26799a63110dcbe81291ea53178f6b4810d07424 Author: Ravikiran G Thirumalai Date: Wed Dec 31 13:44:46 2008 -0800 x86: fix incorrect __read_mostly on _boot_cpu_pda The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209) to remove static boot cpu pdas introduced a performance bug. _boot_cpu_pda is the actual pda used by the boot cpu and is definitely not "__read_mostly" and ended up polluting the read mostly section with writes. This bug caused regression of about 8-10% on certain syscall intensive workloads. Signed-off-by: Ravikiran Thirumalai Acked-by: Mike Travis Cc: Signed-off-by: Ingo Molnar commit b16aabc9374217fa2d28e72fd9a6e6d60905e1b9 Author: Borislav Petkov Date: Fri Jan 2 16:12:56 2009 +0100 ide-atapi: start dma in a drive-specific way There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 06cc2778a1744b79edcfa394ce2d41f09134b2b1 Author: Borislav Petkov Date: Fri Jan 2 16:12:56 2009 +0100 ide-atapi: put the rest of non-ide-cd code into the else-clause of ide_transfer_pc There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 28ad91db77755f1c49d79652de11b28ee2cfbf03 Author: Borislav Petkov Date: Fri Jan 2 16:12:56 2009 +0100 ide-atapi: remove timeout arg to ide_issue_pc There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 65a3309e552585c4908e50e3c9736afb764c97c0 Author: Borislav Petkov Date: Fri Jan 2 16:12:55 2009 +0100 ide-cd: remove handler wrappers Remove cdrom_do_newpc_cont and cdrom_start_rw_cont wrappers and pass cdrom_transfer_packet_command to ide_execute_command directly. There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov [bart: don't move cdrom_start_packet_command() around, remove newlines] Signed-off-by: Bartlomiej Zolnierkiewicz commit 563d993153ab16d829ba373c5c070a118eb1eba4 Author: Borislav Petkov Date: Fri Jan 2 16:12:55 2009 +0100 ide-cd: remove xferlen arg to cdrom_start_packet_command There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit d77612ab0ad7515623b084b952dfefd547073ada Author: Borislav Petkov Date: Fri Jan 2 16:12:55 2009 +0100 ide-atapi: split drive-specific functionality in ide_issue_pc There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit def860d061d0fcab7fbbe193c0b8b8f0b9b4c828 Author: Borislav Petkov Date: Fri Jan 2 16:12:55 2009 +0100 ide-atapi: assign expiry and timeout based on device type There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 8c662852d1aa35ed370942ef2740759cd334d2d5 Author: Borislav Petkov Date: Fri Jan 2 16:12:54 2009 +0100 ide-atapi: compute cmd_len based on device type in ide_transfer_pc There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov [bart: move cmd_len check closer to ->output_data() call] Signed-off-by: Bartlomiej Zolnierkiewicz commit 5317464dccd0c03026d60f1e9968de4f9cd23f69 Author: Borislav Petkov Date: Fri Jan 2 16:12:54 2009 +0100 ide: remove the last ide-scsi remnants Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 5d655a03b847fbe5353a8a74bbeb75e18708dca3 Author: Borislav Petkov Date: Fri Jan 2 16:12:54 2009 +0100 ide-atapi: remove ide-scsi remnants from ide_pc_intr() As a result, remove now unused ide_scsi_get_timeout and ide_scsi_expiry. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 5fe3110431ccf437607bdc11ac3677bf3eeee6e3 Author: Borislav Petkov Date: Fri Jan 2 16:12:53 2009 +0100 ide-atapi: remove ide-scsi remnants from ide_transfer_pc() Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 152fe1cc38ebebb81724663e3b1e1e10272a729e Author: Borislav Petkov Date: Fri Jan 2 16:12:53 2009 +0100 ide-atapi: remove ide-scsi remnants from ide_issue_pc Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 4cad085efbce8dcc5006b0d1034089758b4fc7ba Author: Borislav Petkov Date: Fri Jan 2 16:12:53 2009 +0100 ide-cd: move cdrom_timer_expiry to ide-atapi.c - cdrom_timer_expiry -> ide_cd_expiry - remove expiry-arg to ide_issue_pc as it is redundant now - ide_debug_log -> debug_log Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 5f25843fa79b7c35097b0ffe8b2c5cc2428d6495 Author: Borislav Petkov Date: Fri Jan 2 16:12:53 2009 +0100 ide-atapi: teach ide atapi about drive->waiting_for_dma In addition, we wait for DRQ to be asserted by repeatedly polling device status no matter what DRQ type each device implements. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 392de1d53dd40e2eebee3a0a26aa647a3865ca78 Author: Borislav Petkov Date: Fri Jan 2 16:12:52 2009 +0100 ide-atapi: accomodate transfer length calculation for ide-cd ... by factoring it out of ide_cd_do_request() into a helper, as suggested by Bart. There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov [bart: BLK_DEV_IDECD needs to select IDE_ATAPI now] Signed-off-by: Bartlomiej Zolnierkiewicz commit 4f02ff06b4d33aba50ce5157c23e99cd21d447ee Author: Borislav Petkov Date: Fri Jan 2 16:12:52 2009 +0100 ide-atapi: setup dma for ide-cd There should be no functional change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit ed48554fad7091b9613b967462f082bf1a9cb035 Author: Borislav Petkov Date: Fri Jan 2 16:12:52 2009 +0100 ide-atapi: combine drive-specific assignments There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 991cb26a6ad287c3bc6555c41e830590a23910c4 Author: Borislav Petkov Date: Fri Jan 2 16:12:52 2009 +0100 ide-atapi: add a dev_is_idecd-inline There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 93c164af19f608c5f737eb9bed8cb4de3a872329 Author: FUJITA Tomonori Date: Fri Jan 2 16:12:51 2009 +0100 remove ide-scsi As planed, this removes ide-scsi. The 2.6 kernel supports direct writing to ide CD drives, which eliminates the need for ide-scsi. ide-scsi has been unmaintained and marked as deprecated. Signed-off-by: FUJITA Tomonori Cc: James.Bottomley@HansenPartnership.com Signed-off-by: Bartlomiej Zolnierkiewicz commit 07bd3f4731f9c7ebcbab90905ca4ad6fc6825f96 Author: Linus Torvalds Date: Fri Jan 2 16:12:51 2009 +0100 ide-floppy: allocate only toplevel packet commands This makes the top-level function just allocate a single pc entry, and then pass it down as a pointer to all the helper functions that also need one of those "struct ide_atapi_pc" things. As far as I can tell, the use of these things never overlaps each other, BUT I DID NOT CHECK VERY CLOSELY! So I'm not guaranteeing this is correct, and I don't have the hardware. It would be good for somebody who knows the code more, and has the hardware, could please test this? With this, ide-floppy still has fairly big stack usage, but instead of idefloppy_ioctl [vmlinux]: 1208 ide_floppy_get_capacity [vmlinux]: 872 idefloppy_release [vmlinux]: 408 idefloppy_open [vmlinux]: 408 where those two first ones are at the very top of the list of stack users for me, it's now ide_floppy_get_capacity [vmlinux]: 404 ide_floppy_ioctl [vmlinux]: 364 ie they are still high, but they are no longer at the top. Borislav: Since ide_floppy_get_capacity is passed as a function pointer to other parts of the kernel (e.g., block layer) we need that ide_atapi_pc to be created on stack. Also, redid stack users numbers above. The two functions missing from Linus' original 'make stackusage' output are due to ide being rewritten/reorganized atm. Signed-off-by: Linus Torvalds Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit bf64741fe89280bd81a9e3a1beadec1570861848 Author: Borislav Petkov Date: Fri Jan 2 16:12:50 2009 +0100 ide: make IDE_AFLAG_.. numbering continuous again Signed-off-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz commit 0f38aaa4980fdf5de215e0a8bf6d6032164a6c4b Author: Borislav Petkov Date: Fri Jan 2 16:12:50 2009 +0100 ide-cd: move debug defines into header While at it: - disable compiling-in debug support by default Signed-off-by: Borislav Petkov [bart: fixup patch description] Signed-off-by: Bartlomiej Zolnierkiewicz commit 201bffa46466b4afdf7d29db8eca3fa5decb39c8 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:50 2009 +0100 ide: use per-device request queue locks (v2) * Move hack for flush requests from choose_drive() to do_ide_request(). * Add ide_plug_device() helper and convert core IDE code from using per-hwgroup lock as a request lock to use the ->queue_lock instead. * Remove no longer needed: - choose_drive() function - WAKEUP() macro - 'sleeping' flag from ide_hwif_t - 'service_{start,time}' fields from ide_drive_t This patch results in much simpler and more maintainable code (besides being a scalability improvement). v2: * Fixes/improvements based on review from Elias: - take as many requests off the queue as possible - remove now redundant BUG_ON() Cc: Elias Oltmanns Signed-off-by: Bartlomiej Zolnierkiewicz commit 631de3708d595d153e8a510a3608689290f4c0ed Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:50 2009 +0100 ide: add ide_[un]lock_hwgroup() helpers Add ide_[un]lock_hwgroup() inline helpers for obtaining exclusive access to the given hwgroup and update the core code accordingly. [ This change besides making code saner results in more efficient use of ide_{get,release}_lock(). ] Cc: Michael Schmitz Cc: Geert Uytterhoeven Cc: Elias Oltmanns Signed-off-by: Bartlomiej Zolnierkiewicz commit b2cfb05a701809abee591265a198afa029d68bff Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:49 2009 +0100 ide: remove "paranoia" checks for hwgroup->busy Remove "paranoia" checks for hwgroup->busy from ide_timer_expiry() and ide_intr(). This is a preparation for future changes. Cc: Michael Schmitz Cc: Geert Uytterhoeven Cc: Elias Oltmanns Signed-off-by: Bartlomiej Zolnierkiewicz commit 2fb211502e2c0513e12d677ed4d7891f3c5e1413 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:49 2009 +0100 ide: remove IDE PM hack from do_ide_request() We now tell block layer that there is still work to do using blk_plug_device() so hack for IDE Power Management can be removed (it was buggy for hwgroups having more than 4 devices anyway). Signed-off-by: Bartlomiej Zolnierkiewicz commit 295f00042aaf6b553b5f37348f89bab463d4a469 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:48 2009 +0100 ide: don't execute the next queued command from the hard-IRQ context (v2) * Tell the block layer that we are not done handling requests by using blk_plug_device() in ide_do_request() (request handling function) and ide_timer_expiry() (timeout handler) if the queue is not empty. * Remove optimization which directly calls ide_do_request() for the next queued command from the ide_intr() (IRQ handler) and ide_timer_expiry(). * Remove no longer needed IRQ masking from ide_do_request() - in case of IDE ports needing serialization disable_irq_nosync()/enable_irq() was used for the (possibly shared) IRQ of the other IDE port. * Put the misplaced comment in the right place in ide_do_request(). * Drop no longer needed 'int masked_irq' argument from ide_do_request(). * Merge ide_do_request() into do_ide_request(). * Remove no longer needed IDE_NO_IRQ define. While at it: * Don't use HWGROUP() macro in do_ide_request(). * Use __func__ in ide_intr(). This patch reduces IRQ hadling latency for IDE and improves the system-wide handling of shared IRQs (which should result in more timeout resistant and stable IDE systems). It also makes it possible to do some further changes later (i.e. replace some busy-waiting delays with sleeping equivalents). v2: Changes per review from Elias Oltmanns: - fix wrong goto statement in 'if (startstop == ide_stopped)' block - use spin_unlock_irq() - don't use obsolete HWIF() macro Cc: Elias Oltmanns Signed-off-by: Bartlomiej Zolnierkiewicz commit ebdab07dad3d3a008e519b0a028e1e1ad5ecaef0 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:48 2009 +0100 ide: move sysfs support to ide-sysfs.c While at it: - media_string() -> ide_media_string() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz commit 24630dc68a499baec367d24285bc6b92207cc100 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:47 2009 +0100 ide: factor out device type classifying from do_identify() Factor out device type classifying from do_identify() to ide_classify_ata_dev() and ide_classify_atapi_dev(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz commit 96d40941236722777c259775640b8880b7dc6f33 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:47 2009 +0100 ide: small ide_register_port() cleanup Signed-off-by: Bartlomiej Zolnierkiewicz commit b1d249e845efb07975183c62b4f75576c4a8d467 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:47 2009 +0100 ide: remove chipset type fixup from ide_host_register() * Set chipset type explicitly in tx4938ide and tx4939ide host drivers (all other host drivers were updated already). * Remove no longer used chipset type fixup from ide_host_register(). Acked-by: Atsushi Nemoto Cc: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz commit 3ee86dcdd273aa91cb9b4fe1e3d4f69035750a12 Author: Bartlomiej Zolnierkiewicz Date: Fri Jan 2 16:12:46 2009 +0100 tx493x: fix indentation Trivial CodingStyle fixup for tx4938ide and tx4939ide drivers. Acked-by: Atsushi Nemoto Acked-by: Sergei Shtyltov Signed-off-by: Bartlomiej Zolnierkiewicz commit a9067d537615d534dcef06c0d819472e43a0d152 Author: Ingo Brueckl Date: Fri Jan 2 14:42:00 2009 +0100 x86: convert permanent_kmaps_init() from macro to inline Impact: cleanup This compiler warning: arch/x86/mm/init_32.c:515: warning: unused variable 'pgd_base' triggers because permanent_kmaps_init() is a CPP macro in the !CONFIG_HIGHMEM case, that does not tell the compiler that the 'pgd_base' parameter is used. Convert permanent_kmaps_init() (and set_highmem_pages_init()) to C inline functions - which gives the parameter a proper type and which gets rid of the compiler warning as well. Signed-off-by: Ingo Brueckl Signed-off-by: Ingo Molnar commit b21a207141d83a06abc5f492b80204602e02ca44 Merge: 3af3730... b58602a... Author: David Vrabel Date: Fri Jan 2 13:17:13 2009 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream Conflicts: drivers/uwb/wlp/eda.c commit f4e9749f451747f7cdd334eae951357f839c57f2 Author: Julia Lawall Date: Thu Jan 1 18:14:35 2009 +0100 ALSA: Use usb_set/get_intfdata Use the USB functions usb_get_intfdata and usb_set_intfdata instead of dev_get_drvdata and dev_set_drvdata, respectively. The semantic patch that makes this change for the usb_get_intfdata case is as follows: (http://www.emn.fr/x-info/coccinelle/) // @header@ @@ #include @same depends on header@ position p; @@ usb_get_intfdata@p(...) { ... } @depends on header@ position _p!=same.p; identifier _f; struct usb_interface*intf; @@ _f@_p(...) { <+... - dev_get_drvdata(&intf->dev) + usb_get_intfdata(intf) ...+> } // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai commit c64d8996bd758cedc2ddc04b86ca66fa1d8599cf Author: Cyrill Gorcunov Date: Fri Jan 2 11:27:18 2009 +0300 x86: early_printk - use sizeof instead of hardcoded number Impact: cleanup Signed-off-by: Cyrill Gorcunov Signed-off-by: Ingo Molnar commit ac11a2b35cc25c77d28218aaf60e7f7c6c7ee5d3 Author: Mark Brown Date: Thu Jan 1 12:18:17 2009 +0000 ASoC: Clean up kerneldoc warnings Almost all parameters that have been misnamed in the comments. Signed-off-by: Mark Brown commit 9bef6489d72abd8f598aede92be3854a69324c50 Author: Stephen Ware Date: Wed Dec 31 14:39:23 2008 -0800 ASoC: Fix pxa2xx-pcm checks for invalid DMA channels Set the invalid dma channel to -1 (and check properly for it) in pxa2xx_pcm_hw_free(). Was assuming 0 is an invalid channel number but 0 is a valid pxa dma channel num. Signed-off-by: stephen Signed-off-by: Mark Brown commit 06bf3e15f64aacfb068fed5002b6544f870cc638 Author: Chris Bagwell Date: Thu Jan 1 10:32:08 2009 +0100 LSA: hda - Add HP Acacia detection Add automatic mapping of HP Acacia motherboards to 3stack-hp. Allows for greater then 2 channel audio by enabling Channel Mode option in mixer. Motherboard specs: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01321559&lc=en&dlc=en&cc=us&product=3829353&os=2093&lang=en# Signed-off-by: Chris Bagwell Signed-off-by: Takashi Iwai commit 3fea2cb0451b9009af32d1418ea77cc674fe7e02 Author: Wu Fengguang Date: Fri Dec 26 12:20:43 2008 +0800 ALSA: hda - fix name for ALC1200 Move the more specific preset for ALC1200 above the general one for ALC888, so that it will have the chance to get matched and selected. Reported-by: Thomas Schneider Signed-off-by: Wu Fengguang Signed-off-by: Takashi Iwai commit 42a6e66f1e40a930d093c33ba0bb9d8d8e4555ed Author: Julia Lawall Date: Mon Dec 29 11:23:02 2008 +0100 ALSA: sound/usb: use USB API functions rather than constants This set of patches introduces calls to the following set of functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) In some cases, introducing one of these functions is not possible, and it just replaces an explicit integer value by one of the following constants: USB_ENDPOINT_XFER_BULK USB_ENDPOINT_XFER_CONTROL USB_ENDPOINT_XFER_INT USB_ENDPOINT_XFER_ISOC An extract of the semantic patch that makes these changes is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r1@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == - \(USB_ENDPOINT_XFER_CONTROL\|0\)) + usb_endpoint_xfer_control(epd) @r5@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == - \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) @inc@ @@ #include @depends on !inc && (r1||r5)@ @@ + #include #include // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai commit b58602a4bac012b5f4fc12fe6b46ab237b610d5d Merge: db200df... 1f3403f... Author: Linus Torvalds Date: Wed Dec 31 15:57:56 2008 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (34 commits) nfsd race fixes: jfs nfsd race fixes: reiserfs nfsd race fixes: ext4 nfsd race fixes: ext3 nfsd race fixes: ext2 nfsd/create race fixes, infrastructure filesystem notification: create fs/notify to contain all fs notification fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization kill ->dir_notify() filp_cachep can be static in fs/file_table.c fix f_count description in Documentation/filesystems/files.txt make INIT_FS use the __RW_LOCK_UNLOCKED initialization take init_fs to saner place kill vfs_permission pass a struct path * to may_open kill walk_init_root remove incorrect comment in inode_permission expand some comments (d_path / seq_path) correct wrong function name of d_put in kernel document and source comment fix switch_names() breakage in short-to-short case ... commit 8c384cdee3e04d6194a2c2b192b624754f990835 Author: Rusty Russell Date: Thu Jan 1 10:12:30 2009 +1030 cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS Impact: new debug CONFIG options This helps find unconverted code. It currently breaks compile horribly, but we never wanted a flag day so that's expected. Signed-off-by: Rusty Russell commit 2a53008033189ed09bfe241c6b33811ba4ce980d Author: Rusty Russell Date: Thu Jan 1 10:12:30 2009 +1030 cpumask: zero extra bits in alloc_cpumask_var_node Impact: extra safety checks during transition When CONFIG_CPUMASKS_OFFSTACK is set, the new cpumask_ operators only use bits up to nr_cpu_ids, not NR_CPUS. Using the old cpus_ operators on these masks can mean accessing undefined bits. After some discussion, Mike and I decided to err on the side of caution; we zero the "undefined" bits in alloc_cpumask_var_node() until all the old cpumask functions are removed. Signed-off-by: Rusty Russell commit 5db0e1e9e0f30f160b832a0b5cd1131954bf4f6e Author: Rusty Russell Date: Thu Jan 1 10:12:29 2009 +1030 cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/ Impact: cleanup Simple replacement, now the _nr is redundant. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Cc: Ingo Molnar commit 174596a0b9f21e8844d70566a6bb29bf48a87750 Author: Rusty Russell Date: Thu Jan 1 10:12:29 2009 +1030 cpumask: convert mm/ Impact: Use new API Convert kernel mm functions to use struct cpumask. We skip include/linux/percpu.h and mm/allocpercpu.c, which are in flux. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Reviewed-by: Christoph Lameter commit 41c7bb9588904eb060a95bcad47bd3804a1ece25 Author: Rusty Russell Date: Thu Jan 1 10:12:28 2009 +1030 cpumask: convert rest of files in kernel/ Impact: Reduce stack usage, use new cpumask API. Mainly changing cpumask_t to 'struct cpumask' and similar simple API conversion. Two conversions worth mentioning: 1) we use cpumask_any_but to avoid a temporary in kernel/softlockup.c, 2) Use cpumask_var_t in taskstats_user_cmd(). Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Cc: Balbir Singh Cc: Ingo Molnar commit e0b582ec56f1a1d8b30ebf340a7b91fb09f26c8c Author: Rusty Russell Date: Thu Jan 1 10:12:28 2009 +1030 cpumask: convert kernel/cpu.c Impact: Reduce kernel stack and memory usage, use new cpumask API. Use cpumask_var_t for take_cpu_down() stack var, and frozen_cpus. Note that notify_cpu_starting() can be called before core_initcall allocates frozen_cpus, but the NULL check is optimized out by gcc for the CONFIG_CPUMASK_OFFSTACK=n case. Signed-off-by: Rusty Russell commit c309b917cab55799ea489d7b5f1b77025d9f8462 Author: Rusty Russell Date: Thu Jan 1 10:12:27 2009 +1030 cpumask: convert kernel/profile.c Impact: Reduce kernel memory usage, use new cpumask API. Avoid a static cpumask_t for prof_cpu_mask, and an on-stack cpumask_t in prof_cpu_mask_write_proc. Both become cpumask_var_t. prof_cpu_mask is only allocated when profiling is on, but the NULL checks are optimized out by gcc for the !CPUMASK_OFFSTACK case. Also removed some strange and unnecessary casts. Signed-off-by: Rusty Russell commit bd232f97b30f6bb630efa136a777647545db3039 Author: Rusty Russell Date: Thu Jan 1 10:12:26 2009 +1030 cpumask: convert RCU implementations Impact: use new cpumask API. rcu_ctrlblk contains a cpumask, and it's highly optimized so I don't want a cpumask_var_t (ie. a pointer) for the CONFIG_CPUMASK_OFFSTACK case. It could use a dangling bitmap, and be allocated in __rcu_init to save memory, but for the moment we use a bitmap. (Eventually 'struct cpumask' will be undefined for CONFIG_CPUMASK_OFFSTACK, so we use a bitmap here to show we really mean it). We remove on-stack cpumasks, using cpumask_var_t for rcu_torture_shuffle_tasks() and for_each_cpu_and in force_quiescent_state(). Signed-off-by: Rusty Russell commit d036e67b40f52bdd95392390108defbac7e53837 Author: Rusty Russell Date: Thu Jan 1 10:12:26 2009 +1030 cpumask: convert kernel/irq Impact: Reduce stack usage, use new cpumask API. ALPHA mod! Main change is that irq_default_affinity becomes a cpumask_var_t, so treat it as a pointer (this effects alpha). Signed-off-by: Rusty Russell commit 6b954823c24f04ed026a8517f6bab5abda279db8 Author: Rusty Russell Date: Thu Jan 1 10:12:25 2009 +1030 cpumask: convert kernel time functions Impact: Use new APIs Convert kernel/time functions to use struct cpumask *. Note the ugly bitmap declarations in tick-broadcast.c. These should be cpumask_var_t, but there was no obvious initialization function to put the alloc_cpumask_var() calls in. This was safe. (Eventually 'struct cpumask' will be undefined for CONFIG_CPUMASK_OFFSTACK, so we use a bitmap here to show we really mean it). Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit e7577c50f2fb2d1c167e2c04a4b4c2cc042acb82 Author: Rusty Russell Date: Thu Jan 1 10:12:25 2009 +1030 cpumask: convert kernel/workqueue.c Impact: Reduce memory usage, use new cpumask API. cpu_populated_map becomes a cpumask_var_t, and cpu_singlethread_map is simply a cpumask pointer: it's simply the cpumask containing the first possible CPU anyway. Signed-off-by: Rusty Russell commit a45185d2d7108b01b90b9e0293377be4d6346dde Author: Rusty Russell Date: Thu Jan 1 10:12:24 2009 +1030 cpumask: convert kernel/compat.c Impact: Reduce stack usage, use new cpumask API. Straightforward conversion; cpumasks' size is given by cpumask_size() (now a variable rather than fixed) and on-stack cpu masks use cpumask_var_t. Signed-off-by: Rusty Russell commit 3e597945384dee1457240158eb81e3afb90b68c2 Author: Rusty Russell Date: Thu Jan 1 10:12:24 2009 +1030 cpumask: remove any_online_cpu() users: mm/ Impact: Remove obsolete API usage any_online_cpu() is a good name, but it takes a cpumask_t, not a pointer. There are several places where any_online_cpu() doesn't really want a mask arg at all. Replace all callers with cpumask_any() and cpumask_any_and(). Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit f1fc057c79cb2d27602fb3ad08a031f13459ef27 Author: Rusty Russell Date: Thu Jan 1 10:12:23 2009 +1030 cpumask: remove any_online_cpu() users: kernel/ Impact: Remove obsolete API usage any_online_cpu() is a good name, but it takes a cpumask_t, not a pointer. There are several places where any_online_cpu() doesn't really want a mask arg at all. Replace all callers with cpumask_any() and cpumask_any_and(). Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit 4462344ee9ea9224d026801b877887f2f39774a3 Author: Rusty Russell Date: Thu Jan 1 10:12:23 2009 +1030 cpumask: convert kernel trace functions further Impact: Reduce future memory usage, use new cpumask API. Since the last patch was created and acked, more old cpumask users slipped into kernel/trace. Mostly trivial conversions, except struct trace_iterator's "started" member becomes a cpumask_var_t. Signed-off-by: Rusty Russell commit 9e01c1b74c9531e301c900edaa92a99fcb7738f2 Author: Rusty Russell Date: Thu Jan 1 10:12:22 2009 +1030 cpumask: convert kernel trace functions Impact: Reduce future memory usage, use new cpumask API. (Eventually, cpumask_var_t will be allocated based on nr_cpu_ids, not NR_CPUS). Convert kernel trace functions to use struct cpumask API: 1) Use cpumask_copy/cpumask_test_cpu/for_each_cpu. 2) Use cpumask_var_t and alloc_cpumask_var/free_cpumask_var everywhere. 3) Use on_each_cpu instead of playing with current->cpus_allowed. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Acked-by: Steven Rostedt commit 333af15341b2f6cd813c054e1b441d7b6d8e9318 Author: Rusty Russell Date: Thu Jan 1 10:12:21 2009 +1030 cpumask: Introduce topology_core_cpumask()/topology_thread_cpumask(): ia64 Impact: New API The old topology_core_siblings() and topology_thread_siblings() return a cpumask_t; these new ones return a (const) struct cpumask *. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit 9150641dd17fe9e213ab3391c8ebfc228daa2d9d Author: Rusty Russell Date: Thu Jan 1 10:12:21 2009 +1030 cpumask: Introduce topology_core_cpumask()/topology_thread_cpumask(): powerpc Impact: New API The old topology_core_siblings() and topology_thread_siblings() return a cpumask_t; these new ones return a (const) struct cpumask *. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit 2bb23a63f22f0e2d91fee93ff5ca9c29e180b146 Author: Rusty Russell Date: Thu Jan 1 10:12:20 2009 +1030 cpumask: Introduce topology_core_cpumask()/topology_thread_cpumask(): s390 Impact: New API The old topology_core_siblings() and topology_thread_siblings() return a cpumask_t; these new ones return a (const) struct cpumask *. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit 78fd744f827586615da5b387fa9f0af1888601b6 Author: Rusty Russell Date: Thu Jan 1 10:12:20 2009 +1030 cpumask: Introduce topology_core_cpumask()/topology_thread_cpumask(): sparc Impact: New API The old topology_core_siblings() and topology_thread_siblings() return a cpumask_t; these new ones return a (const) struct cpumask *. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit e0c0ba736547e81c4f986ce192307c549d214167 Author: Rusty Russell Date: Thu Jan 1 10:12:19 2009 +1030 cpumask: Use find_last_bit() Impact: cleanup There's one obvious place to use it: to find the highest possible cpu. Signed-off-by: Rusty Russell commit ab53d472e785e51fdfc08fc1d66252c1153e6c0f Author: Rusty Russell Date: Thu Jan 1 10:12:19 2009 +1030 bitmap: find_last_bit() Impact: New API As the name suggests. For the moment everyone uses the generic one. Signed-off-by: Rusty Russell commit 0db5d3d2f58804edb394e8008c7d9744110338a2 Author: Rusty Russell Date: Thu Jan 1 10:12:18 2009 +1030 m68knommu: define __fls Like fls, but can't be handed 0 and returns the bit number. (I broke this arch in linux-next by using __fls in generic code). Signed-off-by: Rusty Russell commit 434ae514c23047db87a8bbf39cebc9e1767aea44 Author: Rusty Russell Date: Thu Jan 1 10:12:18 2009 +1030 m68k: define __fls Like fls, but can't be handed 0 and returns the bit number. (I broke this arch in linux-next by using __fls in generic code). Signed-off-by: Rusty Russell commit ccec25ff69d5f48c7a088c16fe2dc7e11d9e87fe Author: Rusty Russell Date: Thu Jan 1 10:12:17 2009 +1030 blackfin: define __fls Like fls, but can't be handed 0 and returns the bit number. (I broke this arch in linux-next by using __fls in generic code). Signed-off-by: Rusty Russell Acked-by: Mike Frysinger commit 96b8d4c19d797200b973caab57ca842531184c13 Author: Rusty Russell Date: Thu Jan 1 10:12:16 2009 +1030 avr32: define __fls Like fls, but can't be handed 0 and returns the bit number. (I broke this arch in linux-next by using __fls in generic code). Signed-off-by: Rusty Russell commit 165ac433fa3f01ba99b29972f3adc283d03b0f17 Author: Rusty Russell Date: Thu Jan 1 10:12:16 2009 +1030 parisc: remove gratuitous cpu_online_map declaration. This is defined in linux/cpumask.h (included in this file already), and this is now defined differently. Signed-off-by: Rusty Russell Cc: linux-parisc@vger.kernel.org commit 915441b601e6662e79f6c958e7be307967a96977 Author: Rusty Russell Date: Thu Jan 1 10:12:15 2009 +1030 cpumask: Use accessors code in core Impact: use new API cpu_*_map are going away in favour of cpu_*_mask, but const pointers. So we have accessors where we really do want to frob them. Archs will also need the (trivial) conversion before we can finally remove cpu_*_map. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis commit 4f4b6c1a94a8735bbdc030a2911cf395495645b6 Author: Rusty Russell Date: Thu Jan 1 10:12:15 2009 +1030 cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.: core Impact: cleanup In future, all cpumask ops will only be valid (in general) for bit numbers < nr_cpu_ids. So use that instead of NR_CPUS in iterators and other comparisons. This is always safe: no cpu number can be >= nr_cpu_ids, and nr_cpu_ids is initialized to NR_CPUS at boot. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Acked-by: Ingo Molnar Acked-by: James Morris Cc: Eric Biederman commit 9e2f913df70b378379a358a44e7d286f7b765e8e Author: Rusty Russell Date: Thu Jan 1 10:12:14 2009 +1030 percpu: fix percpu accessors to potentially !cpu_possible() cpus: m32r Impact: CPU iterator bugfixes Percpu areas are only allocated for possible cpus. In general, you shouldn't access random cpu's percpu areas. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Acked-by: Ingo Molnar Acked-by: Hirokazu Takata commit 6aaa8ce523c7ce954b81b8c0b3e32c8be599af8d Author: Rusty Russell Date: Thu Jan 1 10:12:14 2009 +1030 percpu: fix percpu accessors to potentially !cpu_possible() cpus: pnpbios Impact: CPU iterator bugfixes Percpu areas are only allocated for possible cpus. In general, you shouldn't access random cpu's percpu areas. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Acked-by: Ingo Molnar Cc: Adam Belay commit e9690a6e4b1615cb0102e425e04b7ce29e7858e2 Author: Li Zefan Date: Wed Dec 31 16:45:50 2008 +0800 cpumask: fix bogus kernel-doc Impact: fix kernel-doc alloc_bootmem_cpumask_var() returns avoid. Signed-off-by: Li Zefan Signed-off-by: Rusty Russell commit f320786063a9d1f885d2cf34ab44aa69c1d88f43 Author: Rusty Russell Date: Thu Jan 1 10:12:13 2009 +1030 cpumask: Remove IA64 definition of total_cpus now it's in core code Impact: fix IA64 compile Fortunately, they have exactly the same semantics. Signed-off-by: Rusty Russell commit 1f3403fa640f9f7b135dee79f2d39d01c8ad4a08 Author: Dave Kleikamp Date: Tue Dec 30 22:08:37 2008 -0600 nfsd race fixes: jfs jfs version of Al Viro's nfsd race patches Signed-off-by: Dave Kleikamp Signed-off-by: Al Viro commit c1eaa26b671299b3ec01d40c6c71ee19a4f81517 Author: Al Viro Date: Tue Dec 30 02:03:58 2008 -0500 nfsd race fixes: reiserfs ... and the same for reiserfs. The difference here is that we need insert_inode_locked4() to match iget5_locked(). Signed-off-by: Al Viro commit 6b38e842bb832a3dbeb17e382404aef3c40ac5f9 Author: Al Viro Date: Tue Dec 30 02:03:31 2008 -0500 nfsd race fixes: ext4 Signed-off-by: Al Viro commit c38012daa7ad902a39a4213ba2b3fe50e81157ea Author: Al Viro Date: Tue Dec 30 02:02:50 2008 -0500 nfsd race fixes: ext3 ext3 analog of the previous patch Signed-off-by: Al Viro commit 41080b5a240113328c607f22b849f653373db0ce Author: Al Viro Date: Tue Dec 30 01:52:35 2008 -0500 nfsd race fixes: ext2 * make ext2_new_inode() put the inode into icache in locked state * do not unlock until the inode is fully set up; otherwise nfsd might pick it in half-baked state. * make sure that ext2_new_inode() does *not* lead to two inodes with the same inumber hashed at the same time; otherwise a bogus fhandle coming from nfsd might race with inode creation: nfsd: iget_locked() creates inode nfsd: try to read from disk, block on that. ext2_new_inode(): allocate inode with that inumber ext2_new_inode(): insert it into icache, set it up and dirty ext2_write_inode(): get the relevant part of inode table in cache, set the entry for our inode (and start writing to disk) nfsd: get CPU again, look into inode table, see nice and sane on-disk inode, set the in-core inode from it oops - we have two in-core inodes with the same inumber live in icache, both used for IO. Welcome to fs corruption... Signed-off-by: Al Viro commit 261bca86ed4f7f391d1938167624e78da61dcc6b Author: Al Viro Date: Tue Dec 30 01:48:21 2008 -0500 nfsd/create race fixes, infrastructure new helpers - insert_inode_locked() and insert_inode_locked4(). Hash new inode, making sure that there's no such inode in icache already. If there is and it does not end up unhashed (as would happen if we have nfsd trying to resolve a bogus fhandle), fail. Otherwise insert our inode into hash and succeed. In either case have i_state set to new+locked; cleanup ends up being simpler with such calling conventions. Signed-off-by: Al Viro commit 272eb01485dda98e3b8910c7c1a53d597616b0a0 Author: Eric Paris Date: Wed Dec 17 13:59:41 2008 -0500 filesystem notification: create fs/notify to contain all fs notification Creating a generic filesystem notification interface, fsnotify, which will be used by inotify, dnotify, and eventually fanotify is really starting to clutter the fs directory. This patch simply moves inotify and dnotify into fs/notify/inotify and fs/notify/dnotify respectively to make both current fs/ and future notification tidier. Signed-off-by: Eric Paris Signed-off-by: Al Viro commit c2acf7b90821785fe812cc0aa05148e5a1f84204 Author: Denis ChengRq Date: Mon Dec 1 14:34:56 2008 -0800 fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization - iget5_locked in bdget really needs blockdev_superblock, instead of bd_mnt, so bd_mnt could be just a local variable; - blockdev_superblock really needs __read_mostly, while local var bd_mnt not; - make use of sb_is_blkdev_sb in bd_forget, instead of direct reference to blockdev_superblock. Signed-off-by: Denis ChengRq Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit 6badd79bd002788aaec27b50a74ab69ef65ab8ee Author: Al Viro Date: Fri Dec 26 00:57:40 2008 -0500 kill ->dir_notify() Remove the hopelessly misguided ->dir_notify(). The only instance (cifs) has been broken by design from the very beginning; the objects it creates are never destroyed, keep references to struct file they can outlive, nothing that could possibly evict them exists on close(2) path *and* no locking whatsoever is done to prevent races with close(), should the previous, er, deficiencies someday be dealt with. Signed-off-by: Al Viro commit b6b3fdead251d432f32f2cfce2a893ab8a658110 Author: Eric Dumazet Date: Wed Dec 10 09:35:45 2008 -0800 filp_cachep can be static in fs/file_table.c Instead of creating the "filp" kmem_cache in vfs_caches_init(), we can do it a litle be later in files_init(), so that filp_cachep is static to fs/file_table.c Acked-by: Paul E. McKenney Signed-off-by: Eric Dumazet Signed-off-by: Al Viro commit fd659fd6275d3426d7967da1f0e3638bbbd2fedb Author: Eric Dumazet Date: Wed Dec 10 09:35:45 2008 -0800 fix f_count description in Documentation/filesystems/files.txt Documentation/filesystems/files.txt was not updated when f_count became an atomic_long_t. atomic_long_inc_not_zero() is now used instead of atomic_inc_not_zero() Signed-off-by: Al Viro commit 1239f26c05899f1f3c541b41e719c59d58038786 Author: Steven Rostedt Date: Wed Dec 10 18:37:28 2008 -0500 make INIT_FS use the __RW_LOCK_UNLOCKED initialization [AV: rediffed on top of unification of init_fs] Initialization of init_fs still uses the deprecated RW_LOCK_UNLOCKED macro. This patch updates it to use the __RW_LOCK_UNLOCKED(lock) macro. Signed-off-by: Steven Rostedt Signed-off-by: Al Viro commit 18d8fda7c3c9439be04d7ea2e82da2513b121acb Author: Al Viro Date: Fri Dec 26 00:35:37 2008 -0500 take init_fs to saner place Signed-off-by: Al Viro commit cb23beb55100171646e69e248fb45f10db6e99a4 Author: Christoph Hellwig Date: Fri Oct 24 09:59:29 2008 +0200 kill vfs_permission With all the nameidata removal there's no point anymore for this helper. Of the three callers left two will go away with the next lookup series anyway. Also add proper kerneldoc to inode_permission as this is the main permission check routine now. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 3fb64190aa3c23c10e6e9fd0124ac030115c99bf Author: Christoph Hellwig Date: Fri Oct 24 09:58:10 2008 +0200 pass a struct path * to may_open No need for the nameidata in may_open - a struct path is enough. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit b4091d5f6fde28ab762e1094a1a26d81f3badfa5 Author: Christoph Hellwig Date: Wed Nov 5 15:07:21 2008 +0100 kill walk_init_root walk_init_root is a tiny helper that is marked __always_inline, has just one caller and an unused argument. Just merge it into the caller. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 66f221875dc10813aa2f06c83ad60d0eb1356406 Author: Christoph Hellwig Date: Wed Nov 5 15:04:29 2008 +0100 remove incorrect comment in inode_permission We now pass on all MAY_ flags to the filesystems permission routines, so remove the comment stating the contrary. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro commit 52afeefb9dac9287429642189996426a2bfd6a25 Author: Arjan van de Ven Date: Mon Dec 1 14:35:00 2008 -0800 expand some comments (d_path / seq_path) Explain that you really need to use the return value of d_path rather than the buffer you passed into it. Also fix the comment for seq_path(), the function arguments changed recently but the comment hadn't been updated in sync. Signed-off-by: Arjan van de Ven Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit be42c4c433c2c0d3f1583c08908fead00d36d222 Author: Zhaolei Date: Mon Dec 1 14:34:58 2008 -0800 correct wrong function name of d_put in kernel document and source comment no function named d_put(), it should be dput(). Impact: fix document and comment, no functionality changed Signed-off-by: Zhao Lei Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit dc711ca35f9d95a1eec02118e0c298b5e3068315 Author: Al Viro Date: Mon Nov 3 15:03:50 2008 -0500 fix switch_names() breakage in short-to-short case We want ->name.len to match the resulting name on *both* source and target Signed-off-by: Al Viro commit 7df5fa06de89a4ac311957e0cb9c1d87552b4325 Author: Duane Griffin Date: Fri Dec 19 20:47:18 2008 +0000 befs: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Sergey S. Kostyliov Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit a63d0ff31a136bdf52350c4e6c2929eaf47ea2b2 Author: Duane Griffin Date: Fri Dec 19 20:47:17 2008 +0000 freevxfs: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Christoph Hellwig Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit 21acaf8e8da00235be59a3e489d5fa2a8721cafc Author: Duane Griffin Date: Fri Dec 19 20:47:16 2008 +0000 sysv: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit e83c1397cafc4e44f868289db5e417463c0d09a4 Author: Duane Griffin Date: Fri Dec 19 20:47:15 2008 +0000 ext4: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Andrew Morton Cc: Theodore Ts'o Cc: adilger@sun.com Cc: linux-ext4@vger.kernel.org Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit b5ed3112b5f74c8ec1c7aa03a76c596635e85197 Author: Duane Griffin Date: Fri Dec 19 20:47:14 2008 +0000 ext3: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Andrew Morton Cc: Stephen Tweedie Cc: linux-ext4@vger.kernel.org Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit 8d6d0c4da2dbbe0a69fea3692146af39f139f8b4 Author: Duane Griffin Date: Fri Dec 19 20:47:13 2008 +0000 ext2: ensure fast symlinks are NUL-terminated Ensure fast symlink targets are NUL-terminated, even if corrupted on-disk. Cc: Andrew Morton Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit ebd09abbd9699f328165aee50a070403fbf55a37 Author: Duane Griffin Date: Fri Dec 19 20:47:12 2008 +0000 vfs: ensure page symlinks are NUL-terminated On-disk data corruption could cause a page link to have its i_size set to PAGE_SIZE (or a multiple thereof) and its contents all non-NUL. NUL-terminate the link name to ensure this doesn't cause further problems for the kernel. Cc: Al Viro Cc: Andrew Morton Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit 035146851cfa2fe24c1d9dc7637bb009ad06b2f7 Author: Duane Griffin Date: Fri Dec 19 20:47:11 2008 +0000 vfs: introduce helper function to safely NUL-terminate symlinks A number of filesystems were potentially triggering kernel bugs due to corrupted symlink names on disk. This function helps safely terminate the names. Cc: Al Viro Cc: Andrew Morton Signed-off-by: Duane Griffin Signed-off-by: Al Viro commit a17d5232de7b53d34229de79ec22f4bb04adb7e4 Author: Duane Griffin Date: Fri Dec 19 20:47:10 2008 +0000 eCryptfs: check readlink result was not an error before using it The result from readlink is being used to index into the link name buffer without checking whether it is a valid length. If readlink returns an error this will fault or cause memory corruption. Cc: Tyler Hicks Cc: Dustin Kirkland Cc: ecryptfs-devel@lists.launchpad.net Signed-off-by: Duane Griffin Acked-by: Michael Halcrow Acked-by: Tyler Hicks Signed-off-by: Al Viro commit 5cc4a0341a1295ea56b2e62eb70d96d8fdb94ded Author: Julia Lawall Date: Mon Dec 1 14:34:51 2008 -0800 fs/namespace.c: drop code after return The extra semicolon serves no purpose. Signed-off-by: Julia Lawall Reviewed-by: Richard Genoud Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit dded4f4d5048e64a01cf52eed4d27c8cb2600525 Author: Jan Engelhardt Date: Mon Dec 1 14:34:50 2008 -0800 include: linux/fs.h: put declarations in __KERNEL__ include/linux/fs.h contains externs for a bunch of variables. That obviously belongs under ifdef __KERNEL__. Signed-off-by: Jan Engelhardt Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Al Viro commit c2452f32786159ed85f0e4b21fec09258f822fc8 Author: Nick Piggin Date: Mon Dec 1 09:33:43 2008 +0100 shrink struct dentry struct dentry is one of the most critical structures in the kernel. So it's sad to see it going neglected. With CONFIG_PROFILING turned on (which is probably the common case at least for distros and kernel developers), sizeof(struct dcache) == 208 here (64-bit). This gives 19 objects per slab. I packed d_mounted into a hole, and took another 4 bytes off the inline name length to take the padding out from the end of the structure. This shinks it to 200 bytes. I could have gone the other way and increased the length to 40, but I'm aiming for a magic number, read on... I then got rid of the d_cookie pointer. This shrinks it to 192 bytes. Rant: why was this ever a good idea? The cookie system should increase its hash size or use a tree or something if lookups are a problem. Also the "fast dcookie lookups" in oprofile should be moved into the dcookie code -- how can oprofile possibly care about the dcookie_mutex? It gets dropped after get_dcookie() returns so it can't be providing any sort of protection. At 192 bytes, 21 objects fit into a 4K page, saving about 3MB on my system with ~140 000 entries allocated. 192 is also a multiple of 64, so we get nice cacheline alignment on 64 and 32 byte line systems -- any given dentry will now require 3 cachelines to touch all fields wheras previously it would require 4. I know the inline name size was chosen quite carefully, however with the reduction in cacheline footprint, it should actually be just about as fast to do a name lookup for a 36 character name as it was before the patch (and faster for other sizes). The memory footprint savings for names which are <= 32 or > 36 bytes long should more than make up for the memory cost for 33-36 byte names. Performance is a feature... Signed-off-by: Al Viro commit e2b689d82c0394e5239a3557a217f19e2f47f1be Author: Richard Kennedy Date: Thu Dec 4 11:17:47 2008 +0000 fs: reorder struct inotify_device on 64bits to remove padding Reorder struct inotify_device to remove 8 bytes of padding on 64bit builds, reducing size to 128 bytes . Therefore allocating from a smaller slab & using one fewer cachelines. Signed-off-by: Richard Kennedy ---- Hi, patch against 2.6.28-rc7. built & tested on AMDX2 desktop. I've not been able to send this to the listed inotify maintainers, I just get mail failures. So I guessed filesystem was the best home for it, hope that's ok. regards Richard Signed-off-by: Al Viro commit be6d3e56a6b9b3a4ee44a0685e39e595073c6f0d Author: Kentaro Takeda Date: Wed Dec 17 13:24:15 2008 +0900 introduce new LSM hooks where vfsmount is available. Add new LSM hooks for path-based checks. Call them on directory-modifying operations at the points where we still know the vfsmount involved. Signed-off-by: Kentaro Takeda Signed-off-by: Tetsuo Handa Signed-off-by: Toshiharu Harada Signed-off-by: Al Viro commit 418f19ea17a99421b22a64e101e14b6a16bed66d Merge: 98444d3... f6e10b8... Author: Pierre Ossman Date: Wed Dec 31 19:56:05 2008 +0100 Merge branch 'master' of ../mmc commit f6e10b865c3ea56bdaa8c6ecfee313b997900dbb Author: David Brownell Date: Wed Dec 31 09:50:30 2008 -0800 mmc: warn about voltage mismatches Get rid of a silent failure mode when the MMC/SD host doesn't support the voltages needed to operate a given card, by adding a warning. A 3.3V host and a 3.0V card, for example, no longer need to mysteriously just not work at all. This isn't the best diagnostic; ideally it would also tell what voltage the card and host support (and not just by dumping the bitmasks). Signed-off-by: David Brownell Signed-off-by: Pierre Ossman commit 9c43df57910bbba540a6cb5c9132302a9ea5f41a Author: Anton Vorontsov Date: Tue Dec 30 18:15:28 2008 +0300 mmc_spi: Add support for OpenFirmware bindings The support is implemented via platform data accessors, new module (of_mmc_spi) will be created automatically when the driver compiles on OpenFirmware platforms. Link-time dependency will load the module automatically. Signed-off-by: Anton Vorontsov Signed-off-by: Pierre Ossman commit c00a46abd4d45a67ff62f4ff6d4f839dff38b877 Author: Vernon Sauder Date: Mon Dec 29 19:21:28 2008 -0500 pxamci: fix dma_unmap_sg length dma_unmap_sg should be given the same length as dma_map_sg, not the value returned from dma_map_sg Signed-off-by: Vernon Sauder Signed-off-by: Pierre Ossman commit 6a79e391df295bd7c2aa1309ea5031f361c197fd Author: Adrian Hunter Date: Wed Dec 31 18:21:17 2008 +0100 mmc_block: ensure all sectors that do not have errors are read If a card encounters an ECC error while reading a sector it will timeout. Instead of reporting the entire I/O request as having an error, redo the I/O one sector at a time so that all readable sectors are provided to the upper layers. Signed-off-by: Adrian Hunter Signed-off-by: Pierre Ossman commit a0d045cac9bcb3e9a9796d596415f7ffb64852e2 Author: Julia Lawall Date: Tue Dec 16 16:13:09 2008 +0100 drivers/mmc: Move a dereference below a NULL test In each case, if the NULL test is necessary, then the dereference should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; expression E; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E when != i if (E == NULL) S + i = E->fld; // Signed-off-by: Julia Lawall Signed-off-by: Pierre Ossman commit f9134319c81c6c56e0ddf38e7adac2492b243d9b Author: Pierre Ossman Date: Sun Dec 21 17:01:48 2008 +0100 sdhci: handle built-in sdhci with modular leds class As reported by Randy Dunlap, having sdhci built-in and LEDs class as a module resulted in undefined symbols. Change the code to handle that case properly (by not having LEDs class support in sdhci). Signed-off-by: Pierre Ossman commit ca4f10563929b932ed8970fda41a7f99385e4b0b Author: Roel Kluin Date: Sat Dec 13 21:21:33 2008 +0100 mmc: balanc pci_iomap with pci_iounmap balance pci_iomap with pci_iounmap, not iounmap Signed-off-by: Roel Kluin Signed-off-by: Pierre Ossman commit 504f191f25b1671802246bac06c9f59f94f0b7de Author: Adrian Hunter Date: Thu Oct 16 12:55:25 2008 +0300 mmc_block: print better error messages Add command response and card status to error messages. Signed-off-by: Adrian Hunter Signed-off-by: Pierre Ossman commit 86e8286a0e48663e1e86a5884b30a6d05de2993a Author: Anton Vorontsov Date: Wed Nov 26 22:54:17 2008 +0300 mmc: Add mmc_vddrange_to_ocrmask() helper function This function sets the OCR mask bits according to provided voltage ranges. Will be used by the mmc_spi OpenFirmware bindings. Signed-off-by: Anton Vorontsov Signed-off-by: Pierre Ossman commit 0527a60c2b6bd7ab20e82cc5e488659e20eaaacd Author: philipl@overt.org Date: Sun Nov 30 20:27:50 2008 -0500 ricoh_mmc: Handle newer models of Ricoh controllers The latest generation of laptops are shipping with a newer model of Ricoh chip where the firewire controller is the primary PCI function but a cardbus controller is also present. The existing code assumes that if a cardbus controller is, present, then it must be the one to manipulate - but the real rule is that you manipulate PCI function 0. This patch adds an additional constraint that the target must be function 0. Signed-off-by: Philip Langdale Signed-off-by: Pierre Ossman commit b30f8af3358b5c66be223e3a9f3d11b3d02b4a8f Author: Jarkko Lavinen Date: Mon Nov 17 14:35:21 2008 +0200 mmc: Add 8-bit bus width support Signed-off-by: Jarkko Lavinen Signed-off-by: Pierre Ossman commit 35ff8554d12ecc80a46ea0d9bce34fe28733ff38 Author: Éric Piel Date: Sat Nov 22 19:29:29 2008 +0100 sdhci: activate led support also when module CONFIG_LEDS_CLASS is defined only if led-class is built-in, otherwise when it is a module the option is called CONFIG_LEDS_CLASS_MODULE. Led support should also be activated in this case. Signed-off-by: Eric Piel Signed-off-by: Pierre Ossman commit b7a03210b7b381e06f71751cb9addfae7704489c Author: Harvey Harrison Date: Wed Oct 22 17:09:00 2008 -0700 mmc: trivial annotation of 'blocks' sg_init_one is reading a be32, annotate as such. Signed-off-by: Harvey Harrison Signed-off-by: Pierre Ossman commit 092f82edbe96d0a08e1d10436927e89fa101fe0d Author: Arjan van de Ven Date: Sun Sep 28 16:15:56 2008 -0700 pci: use pci_ioremap_bar() in drivers/mmc Use the new pci_ioremap_bar() function in drivers/mmc. pci_ioremap_bar() just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks. Signed-off-by: Arjan van de Ven Signed-off-by: Pierre Ossman commit db200df0b3530f673d8e9f5bd535e9e10305842a Merge: ec270e5... 43a2563... Author: Linus Torvalds Date: Wed Dec 31 09:00:59 2008 -0800 Merge branch 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sparseirq: move __weak symbols into separate compilation unit sparseirq: work around __weak alias bug sparseirq: fix hang with !SPARSE_IRQ sparseirq: set lock_class for legacy irq when sparse_irq is selected sparseirq: work around compiler optimizing away __weak functions sparseirq: fix desc->lock init sparseirq: do not printk when migrating IRQ descriptors sparseirq: remove duplicated arch_early_irq_init() irq: simplify for_each_irq_desc() usage proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c irq: for_each_irq_desc() move to irqnr.h hrtimer: remove #include commit 006948bafece27265dce72d3158b12af3ff67fce Author: Mark Brown Date: Thu Nov 6 10:56:21 2008 +0000 [WATCHDOG] Add support for the WM8350 watchdog This driver implements support for the watchdog functionality provided by the Wolfson Microelectronics WM8350, a multi-function audio and power management subsystem intended for use in embedded systems. It is based on a driver originally written by Graeme Gregory, though it has been extensively modified since then. Use of a GPIO to kick the watchdog is not yet supported. Signed-off-by: Mark Brown Signed-off-by: Wim Van Sebroeck Signed-off-by: Andrew Morton commit 4c6e63bd177a28ca9154ae8c1bab00a387c350c4 Author: Wim Van Sebroeck Date: Wed Oct 22 08:59:25 2008 +0000 [WATCHDOG] Add SMSC SCH311x Watchdog Timer. Add a watchdog driver for the hardware watchdog timer on the SMSC SCH3112, SCH3114 and SCH3116 Super IO chipset. Tested-by: Marco Chiappero Signed-off-by: Wim Van Sebroeck commit 794db26f20b7dbb879f4e1911221e1959818dfdb Author: Wim Van Sebroeck Date: Wed Oct 15 11:44:40 2008 +0000 [WATCHDOG] ib700wdt - add timeout parameter Add the timeout module parameter to ib700wdt.c Signed-off-by: Wim Van Sebroeck commit 87917239204d67a316cb89751750f86c9ed3640b Author: Marcelo Tosatti Date: Mon Dec 22 18:49:30 2008 -0200 KVM: MMU: handle large host sptes on invlpg/resync The invlpg and sync walkers lack knowledge of large host sptes, descending to non-existant pagetable level. Stop at directory level in such case. Fixes SMP Windows XP with hugepages. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit 3f353858c98dbe0240dac558a89870f4600f81bb Author: Avi Kivity Date: Sun Dec 21 22:48:32 2008 +0200 KVM: Add locking to virtual i8259 interrupt controller While most accesses to the i8259 are with the kvm mutex taken, the call to kvm_pic_read_irq() is not. We can't easily take the kvm mutex there since the function is called with interrupts disabled. Fix by adding a spinlock to the virtual interrupt controller. Since we can't send an IPI under the spinlock (we also take the same spinlock in an irq disabled context), we defer the IPI until the spinlock is released. Similarly, we defer irq ack notifications until after spinlock release to avoid lock recursion. Signed-off-by: Avi Kivity commit 25e2343246fe135fce672f41abe61e9d2c38caac Author: Avi Kivity Date: Sun Dec 21 18:31:10 2008 +0200 KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared The pte.g bit is meaningless if global pages are disabled; deferring mmu page synchronization on these ptes will lead to the guest using stale shadow ptes. Fixes Vista x86 smp bootloader failure. Signed-off-by: Avi Kivity commit fe634fd46ff643d98fdbcd153847e08c3c076e6e Author: Xiantao Zhang Date: Wed Dec 17 09:38:14 2008 +0800 MAINTAINERS: Maintainership changes for kvm/ia64 Anthony Xu no longer works on kvm. Cc: "Luck, Tony" Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit 042b26edf0bc1b0f03238a71aed71cca4593848c Author: Jes Sorensen Date: Tue Dec 16 16:45:47 2008 +0100 KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs() Fix kvm_arch_vcpu_ioctl_[gs]et_regs() to do something meaningful on ia64. Old versions could never have worked since they required pointers to be set in the ioctl payload which were never being set by the ioctl handler for get_regs. In addition reserve extra space for future extensions. The change of layout of struct kvm_regs doesn't require adding a new CAP since get/set regs never worked on ia64 until now. This version doesn't support copying the KVM kernel stack in/out of the kernel. This should be implemented in a seperate ioctl call if ever needed. Signed-off-by: Jes Sorensen Acked-by : Xiantao Zhang Signed-off-by: Avi Kivity commit 4531220b71f0399e71cda0c4cf749e7281a7416a Author: Jan Kiszka Date: Thu Dec 11 16:54:54 2008 +0100 KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMI There is no point in doing the ready_for_nmi_injection/ request_nmi_window dance with user space. First, we don't do this for in-kernel irqchip anyway, while the code path is the same as for user space irqchip mode. And second, there is nothing to loose if a pending NMI is overwritten by another one (in contrast to IRQs where we have to save the number). Actually, there is even the risk of raising spurious NMIs this way because the reason for the held-back NMI might already be handled while processing the first one. Therefore this patch creates a simplified user space NMI injection interface, exporting it under KVM_CAP_USER_NMI and dropping the old KVM_CAP_NMI capability. And this time we also take care to provide the interface only on archs supporting NMIs via KVM (right now only x86). Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity commit 264ff01d55b456932cef03082448b41d2edeb6a1 Author: Jan Kiszka Date: Mon Nov 24 12:26:19 2008 +0100 KVM: VMX: Fix pending NMI-vs.-IRQ race for user space irqchip As with the kernel irqchip, don't allow an NMI to stomp over an already injected IRQ; instead wait for the IRQ injection to be completed. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity commit defaf1587c5d7dff828f6f11c8941e5bcef00f50 Author: Mark McLoughlin Date: Tue Dec 2 12:16:33 2008 +0000 KVM: fix handling of ACK from shared guest IRQ If an assigned device shares a guest irq with an emulated device then we currently interpret an ack generated by the emulated device as originating from the assigned device leading to e.g. "Unbalanced enable for IRQ 4347" from the enable_irq() in kvm_assigned_dev_ack_irq(). The fix is fairly simple - don't enable the physical device irq unless it was previously disabled. Of course, this can still lead to a situation where a non-assigned device ACK can cause the physical device irq to be reenabled before the device was serviced. However, being level sensitive, the interrupt will merely be regenerated. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit eb64f1e8cd5c3cae912db30a77d062367f7a11a6 Author: Marcelo Tosatti Date: Tue Dec 9 16:07:22 2008 +0100 KVM: MMU: check for present pdptr shadow page in walk_shadow walk_shadow assumes the caller verified validity of the pdptr pointer in question, which is not the case for the invlpg handler. Fixes oops during Solaris 10 install. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit ca9edaee1aea34ebd9adb48910aba0b3d64b1b22 Author: Avi Kivity Date: Mon Dec 8 18:29:29 2008 +0200 KVM: Consolidate userspace memory capability reporting into common code Signed-off-by: Avi Kivity commit 1a811b6167089bcdb84284f2dc9fd0b4d0f1899d Author: Avi Kivity Date: Mon Dec 8 18:25:27 2008 +0200 KVM: Advertise the bug in memory region destruction as fixed Userspace might need to act differently. Signed-off-by: Avi Kivity commit 7f59f492da722eb3551bbe1f8f4450a21896f05d Author: Rusty Russell Date: Sun Dec 7 21:25:45 2008 +1030 KVM: use cpumask_var_t for cpus_hardware_enabled This changes cpus_hardware_enabled from a cpumask_t to a cpumask_var_t: equivalent for CONFIG_CPUMASKS_OFFSTACK=n, otherwise dynamically allocated. Signed-off-by: Rusty Russell Signed-off-by: Avi Kivity commit 6ef7a1bc45f80fe0a263119d404688c596ea5031 Author: Rusty Russell Date: Mon Dec 8 20:28:04 2008 +1030 KVM: use modern cpumask primitives, no cpumask_t on stack We're getting rid on on-stack cpumasks for large NR_CPUS. 1) Use cpumask_var_t/alloc_cpumask_var. 2) smp_call_function_mask -> smp_call_function_many 3) cpus_clear, cpus_empty, cpu_set -> cpumask_clear, cpumask_empty, cpumask_set_cpu. This actually generates slightly smaller code than the old one with CONFIG_CPUMASKS_OFFSTACK=n. (gcc knows that cpus cannot be NULL in that case, where cpumask_var_t is cpumask_t[1]). Signed-off-by: Rusty Russell Signed-off-by: Avi Kivity commit 498468961ed6f62a306eb90c49125776c526fa40 Author: Rusty Russell Date: Mon Dec 8 20:26:24 2008 +1030 KVM: Extract core of kvm_flush_remote_tlbs/kvm_reload_remote_mmus Avi said: > Wow, code duplication from Rusty. Things must be bad. Something about glass houses comes to mind. But instead, a patch. Signed-off-by: Rusty Russell Signed-off-by: Avi Kivity commit 3d3aab1b973b01bd2a1aa46307e94a1380b1d802 Author: Christian Borntraeger Date: Tue Dec 2 11:17:32 2008 +0100 KVM: set owner of cpu and vm file operations There is a race between a "close of the file descriptors" and module unload in the kvm module. You can easily trigger this problem by applying this debug patch: >--- kvm.orig/virt/kvm/kvm_main.c >+++ kvm/virt/kvm/kvm_main.c >@@ -648,10 +648,14 @@ void kvm_free_physmem(struct kvm *kvm) > kvm_free_physmem_slot(&kvm->memslots[i], NULL); > } > >+#include > static void kvm_destroy_vm(struct kvm *kvm) > { > struct mm_struct *mm = kvm->mm; > >+ printk("off1\n"); >+ msleep(5000); >+ printk("off2\n"); > spin_lock(&kvm_lock); > list_del(&kvm->vm_list); > spin_unlock(&kvm_lock); and killing the userspace, followed by an rmmod. The problem is that kvm_destroy_vm can run while the module count is 0. That means, you can remove the module while kvm_destroy_vm is running. But kvm_destroy_vm is part of the module text. This causes a kerneloops. The race exists without the msleep but is much harder to trigger. This patch requires the fix for anon_inodes (anon_inodes: use fops->owner for module refcount). With this patch, we can set the owner of all anonymous KVM inodes file operations. The VFS will then control the KVM module refcount as long as there is an open file. kvm_destroy_vm will be called by the release function of the last closed file - before the VFS drops the module refcount. Signed-off-by: Christian Borntraeger Signed-off-by: Avi Kivity commit e3a2a0d4e5ace731e60e2eff4fb7056ecb34adc1 Author: Christian Borntraeger Date: Tue Dec 2 11:16:03 2008 +0100 anon_inodes: use fops->owner for module refcount There is an imbalance for anonymous inodes. If the fops->owner field is set, the module reference count of owner is decreases on release. ("filp_close" --> "__fput" ---> "fops_put") On the other hand, anon_inode_getfd does not increase the module reference count of owner. This causes two problems: - if owner is set, the module refcount goes negative - if owner is not set, the module can be unloaded while code is running This patch changes anon_inode_getfd to be symmetric regarding fops->owner handling. I have checked all existing users of anon_inode_getfd. Noone sets fops->owner, thats why nobody has seen the module refcount negative. The refcounting was tested with a patched and unpatched KVM module.(see patch 2/2) I also did an epoll_open/close test. Signed-off-by: Christian Borntraeger Reviewed-by: Davide Libenzi Signed-off-by: Avi Kivity commit e93353c93a3ba4215633ce930784f40a4e94e3f9 Author: Eduardo Habkost Date: Fri Dec 5 18:36:45 2008 -0200 x86: KVM guest: kvm_get_tsc_khz: return khz, not lpj kvm_get_tsc_khz() currently returns the previously-calculated preset_lpj value, but it is in loops-per-jiffy, not kHz. The current code works correctly only when HZ=1000. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit ad218f85e388e8ca816ff09d91c246cd014c53a8 Author: Marcelo Tosatti Date: Mon Dec 1 22:32:05 2008 -0200 KVM: MMU: prepopulate the shadow on invlpg If the guest executes invlpg, peek into the pagetable and attempt to prepopulate the shadow entry. Also stop dirty fault updates from interfering with the fork detector. 2% improvement on RHEL3/AIM7. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit 6cffe8ca4a2adf1ac5003d9cad08fe4434d6eee0 Author: Marcelo Tosatti Date: Mon Dec 1 22:32:04 2008 -0200 KVM: MMU: skip global pgtables on sync due to cr3 switch Skip syncing global pages on cr3 switch (but not on cr4/cr0). This is important for Linux 32-bit guests with PAE, where the kmap page is marked as global. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit b1a368218ad5b6e62380c8f206f16e6f18bf154c Author: Marcelo Tosatti Date: Mon Dec 1 22:32:03 2008 -0200 KVM: MMU: collapse remote TLB flushes on root sync Collapse remote TLB flushes on root sync. kernbench is 2.7% faster on 4-way guest. Improvements have been seen with other loads such as AIM7. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit 60c8aec6e2c9923492dabbd6b67e34692bd26c20 Author: Marcelo Tosatti Date: Mon Dec 1 22:32:02 2008 -0200 KVM: MMU: use page array in unsync walk Instead of invoking the handler directly collect pages into an array so the caller can work with it. Simplifies TLB flush collapsing. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit fbce554e940a983d005e29849636d0ef54b3eb18 Author: Amit Shah Date: Thu Dec 4 11:11:40 2008 +0000 KVM: x86 emulator: Fix handling of VMMCALL instruction The VMMCALL instruction doesn't get recognised and isn't processed by the emulator. This is seen on an Intel host that tries to execute the VMMCALL instruction after a guest live migrates from an AMD host. Signed-off-by: Amit Shah Signed-off-by: Avi Kivity commit 9bf8ea42fe22d7d1c48044148fa658cb9083d49c Author: Guillaume Thouvenin Date: Thu Dec 4 14:30:13 2008 +0100 KVM: x86 emulator: add the emulation of shld and shrd instructions Add emulation of shld and shrd instructions Signed-off-by: Guillaume Thouvenin Signed-off-by: Avi Kivity commit d175226a5f54817ba427368c6b739aefa7780fb2 Author: Guillaume Thouvenin Date: Thu Dec 4 14:29:00 2008 +0100 KVM: x86 emulator: add the assembler code for three operands Add the assembler code for instruction with three operands and one operand is stored in ECX register Signed-off-by: Guillaume Thouvenin Signed-off-by: Avi Kivity commit bfcadf83ec5aafe600e73dd427d997db7bcc1d12 Author: Guillaume Thouvenin Date: Thu Dec 4 14:27:38 2008 +0100 KVM: x86 emulator: add a new "implied 1" Src decode type Add SrcOne operand type when we need to decode an implied '1' like with regular shift instruction Signed-off-by: Guillaume Thouvenin Signed-off-by: Avi Kivity commit 0dc8d10f7d848b63c8d32cf6fd31ba7def792ac9 Author: Guillaume Thouvenin Date: Thu Dec 4 14:26:42 2008 +0100 KVM: x86 emulator: add Src2 decode set Instruction like shld has three operands, so we need to add a Src2 decode set. We start with Src2None, Src2CL, and Src2ImmByte, Src2One to support shld/shrd and we will expand it later. Signed-off-by: Guillaume Thouvenin Signed-off-by: Avi Kivity commit 45ed60b371aeae6ed80f7e9d594a5e6412edc176 Author: Guillaume Thouvenin Date: Thu Dec 4 14:25:38 2008 +0100 KVM: x86 emulator: Extend the opcode descriptor Extend the opcode descriptor to 32 bits. This is needed by the introduction of a new Src2 operand type. Signed-off-by: Guillaume Thouvenin Signed-off-by: Avi Kivity commit 6f89724829cfd4ad6771a92fd4b8d59c90c7220c Author: Glauber Costa Date: Wed Dec 3 13:40:51 2008 -0200 KVM: Really remove a slot when a user ask us so Right now, KVM does not remove a slot when we do a register ioctl for size 0 (would be the expected behaviour). Instead, we only mark it as empty, but keep all bitmaps and allocated data structures present. It completely nullifies our chances of reusing that same slot again for mapping a different piece of memory. In this patch, we destroy rmaps, and vfree() the pointers that used to hold the dirty bitmap, rmap and lpage_info structures. Signed-off-by: Glauber Costa Signed-off-by: Avi Kivity commit 7b7015914b30ad8d9136d41412c5129b9bc9af70 Author: Hollis Blanchard Date: Tue Dec 2 15:51:58 2008 -0600 KVM: ppc: mostly cosmetic updates to the exit timing accounting code The only significant changes were to kvmppc_exit_timing_write() and kvmppc_exit_timing_show(), both of which were dramatically simplified. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 73e75b416ffcfa3a84952d8e389a0eca080f00e1 Author: Hollis Blanchard Date: Tue Dec 2 15:51:57 2008 -0600 KVM: ppc: Implement in-kernel exit timing statistics Existing KVM statistics are either just counters (kvm_stat) reported for KVM generally or trace based aproaches like kvm_trace. For KVM on powerpc we had the need to track the timings of the different exit types. While this could be achieved parsing data created with a kvm_trace extension this adds too much overhead (at least on embedded PowerPC) slowing down the workloads we wanted to measure. Therefore this patch adds a in-kernel exit timing statistic to the powerpc kvm code. These statistic is available per vm&vcpu under the kvm debugfs directory. As this statistic is low, but still some overhead it can be enabled via a .config entry and should be off by default. Since this patch touched all powerpc kvm_stat code anyway this code is now merged and simplified together with the exit timing statistic code (still working with exit timing disabled in .config). Signed-off-by: Christian Ehrhardt Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit c5fbdffbda79254047ec83b09c1a61a3655d052a Author: Hollis Blanchard Date: Tue Dec 2 15:51:56 2008 -0600 KVM: ppc: save and restore guest mappings on context switch Store shadow TLB entries in memory, but only use it on host context switch (instead of every guest entry). This improves performance for most workloads on 440 by reducing the guest TLB miss rate. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 7924bd41097ae8991c6d38cef8b1e4058e30d198 Author: Hollis Blanchard Date: Tue Dec 2 15:51:55 2008 -0600 KVM: ppc: directly insert shadow mappings into the hardware TLB Formerly, we used to maintain a per-vcpu shadow TLB and on every entry to the guest would load this array into the hardware TLB. This consumed 1280 bytes of memory (64 entries of 16 bytes plus a struct page pointer each), and also required some assembly to loop over the array on every entry. Instead of saving a copy in memory, we can just store shadow mappings directly into the hardware TLB, accepting that the host kernel will clobber these as part of the normal 440 TLB round robin. When we do that we need less than half the memory, and we have decreased the exit handling time for all guest exits, at the cost of increased number of TLB misses because the host overwrites some guest entries. These savings will be increased on processors with larger TLBs or which implement intelligent flush instructions like tlbivax (which will avoid the need to walk arrays in software). In addition to that and to the code simplification, we have a greater chance of leaving other host userspace mappings in the TLB, instead of forcing all subsequent tasks to re-fault all their mappings. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit c0ca609c5f874f7d6ae8e180afe79317e1943d22 Author: Hollis Blanchard Date: Tue Dec 2 15:51:54 2008 -0600 powerpc/44x: declare tlb_44x_index for use in C code KVM currently ignores the host's round robin TLB eviction selection, instead maintaining its own TLB state and its own round robin index. However, by participating in the normal 44x TLB selection, we can drop the alternate TLB processing in KVM. This results in a significant performance improvement, since that processing currently must be done on *every* guest exit. Accordingly, KVM needs to be able to access and increment tlb_44x_index. (KVM on 440 cannot be a module, so there is no need to export this symbol.) Signed-off-by: Hollis Blanchard Acked-by: Josh Boyer Signed-off-by: Avi Kivity commit 891686188f69d330f7eeeec8e6642ccfb7453106 Author: Hollis Blanchard Date: Tue Dec 2 15:51:53 2008 -0600 KVM: ppc: support large host pages KVM on 440 has always been able to handle large guest mappings with 4K host pages -- we must, since the guest kernel uses 256MB mappings. This patch makes KVM work when the host has large pages too (tested with 64K). Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 4a643be8c9b8d3c1ae8f5ccd377daaa85bd57e0c Author: Mark McLoughlin Date: Mon Dec 1 13:57:49 2008 +0000 KVM: split out kvm_free_assigned_irq() Split out the logic corresponding to undoing assign_irq() and clean it up a bit. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit 61552367b2ce5e9bea6b6af670ec80aea386f34e Author: Mark McLoughlin Date: Mon Dec 1 13:57:48 2008 +0000 KVM: add KVM_USERSPACE_IRQ_SOURCE_ID assertions Make sure kvm_request_irq_source_id() never returns KVM_USERSPACE_IRQ_SOURCE_ID. Likewise, check that kvm_free_irq_source_id() never accepts KVM_USERSPACE_IRQ_SOURCE_ID. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit f29b2673d3fc7ae38ec22922e9cdc75ee37386b5 Author: Mark McLoughlin Date: Mon Dec 1 13:57:47 2008 +0000 KVM: don't free an unallocated irq source id Set assigned_dev->irq_source_id to -1 so that we can avoid freeing a source ID which we never allocated. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit fdd897e6b5253a45b633f7d334cf3e150bbaf386 Author: Mark McLoughlin Date: Mon Dec 1 13:57:46 2008 +0000 KVM: make kvm_unregister_irq_ack_notifier() safe We never pass a NULL notifier pointer here, but we may well pass a notifier struct which hasn't previously been registered. Guard against this by using hlist_del_init() which will not do anything if the node hasn't been added to the list and, when removing the node, will ensure that a subsequent call to hlist_del_init() will be fine too. Fixes an oops seen when an assigned device is freed before and IRQ is assigned to it. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit 844c7a9ff404d8fc88bb77b06461644621d2c985 Author: Mark McLoughlin Date: Mon Dec 1 13:57:45 2008 +0000 KVM: remove the IRQ ACK notifier assertions We will obviously never pass a NULL struct kvm_irq_ack_notifier* to this functions. They are always embedded in the assigned device structure, so the assertion add nothing. The irqchip_in_kernel() assertion is very out of place - clearly this little abstraction needs to know nothing about the upper layer details. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity commit efff9e538f6bfa8ee2ca03f7e9a55d98df115186 Author: Hannes Eder Date: Fri Nov 28 17:02:06 2008 +0100 KVM: VMX: fix sparse warning Impact: make global function static arch/x86/kvm/vmx.c:134:3: warning: symbol 'vmx_capability' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: Avi Kivity commit e8ba5d311d0c4420e84f40ff50f83981f5864a9a Author: Hannes Eder Date: Fri Nov 28 17:02:42 2008 +0100 KVM: fix sparse warning Impact: make global function static virt/kvm/kvm_main.c:85:6: warning: symbol 'kvm_rebooting' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: Avi Kivity commit f3fd92fbdb7663bd889c136842afc3851351ea8f Author: Avi Kivity Date: Sat Nov 29 20:38:12 2008 +0200 KVM: Remove extraneous semicolon after do/while Notices by Guillaume Thouvenin. Signed-off-by: Avi Kivity commit 2b48cc75b21431037d6f902b9d583b1aff198490 Author: Avi Kivity Date: Sat Nov 29 20:36:13 2008 +0200 KVM: x86 emulator: fix popf emulation Set operand type and size to get correct writeback behavior. Signed-off-by: Avi Kivity commit cf5de4f886116871c2ae2eee53524edd741a68ae Author: Avi Kivity Date: Fri Nov 28 00:14:07 2008 +0200 KVM: x86 emulator: fix ret emulation 'ret' did not set the operand type or size for the destination, so writeback ignored it. Signed-off-by: Avi Kivity commit 8a09b6877f3100207b3572e7e12ea796493fe914 Author: Avi Kivity Date: Thu Nov 27 18:06:33 2008 +0200 KVM: x86 emulator: switch 'pop reg' instruction to emulate_pop() Signed-off-by: Avi Kivity commit 781d0edc5fc5cfe7491a0c5081734e62f6dc66ee Author: Avi Kivity Date: Thu Nov 27 18:00:28 2008 +0200 KVM: x86 emulator: allow pop from mmio Signed-off-by: Avi Kivity commit faa5a3ae39483aefc46a78299c811194f953af27 Author: Avi Kivity Date: Thu Nov 27 17:36:41 2008 +0200 KVM: x86 emulator: Extract 'pop' sequence into a function Switch 'pop r/m' instruction to use the new function. Signed-off-by: Avi Kivity commit b82091824ee4970adf92d5cd6d57b12273171625 Author: Wu Fengguang Date: Wed Nov 26 19:59:06 2008 +0800 KVM: Prevent trace call into unloaded module text Add marker_synchronize_unregister() before module unloading. This prevents possible trace calls into unloaded module text. Signed-off-by: Wu Fengguang Signed-off-by: Avi Kivity commit 6692cef30b7caf7525ae99670cddbaf28f1f9d40 Author: Christian Borntraeger Date: Wed Nov 26 14:51:08 2008 +0100 KVM: s390: Fix memory leak of vcpu->run The s390 backend of kvm never calls kvm_vcpu_uninit. This causes a memory leak of vcpu->run pages. Lets call kvm_vcpu_uninit in kvm_arch_vcpu_destroy to free the vcpu->run. Signed-off-by: Christian Borntraeger Acked-by: Carsten Otte Signed-off-by: Avi Kivity commit d329c035e754156ffabcb64ff75d05bb8e2ddbf5 Author: Christian Borntraeger Date: Wed Nov 26 14:50:27 2008 +0100 KVM: s390: Fix refcounting and allow module unload Currently it is impossible to unload the kvm module on s390. This patch fixes kvm_arch_destroy_vm to release all cpus. This make it possible to unload the module. In addition we stop messing with the module refcount in arch code. Signed-off-by: Christian Borntraeger Acked-by: Carsten Otte Signed-off-by: Avi Kivity commit 6b7ad61ffb9ca110add6f7fb36cc8a4dd89696a4 Author: Avi Kivity Date: Wed Nov 26 15:30:45 2008 +0200 KVM: x86 emulator: consolidate emulation of two operand instructions No need to repeat the same assembly block over and over. Signed-off-by: Avi Kivity commit dda96d8f1b3de692cce09969ce28fe22e58e5acf Author: Avi Kivity Date: Wed Nov 26 15:14:10 2008 +0200 KVM: x86 emulator: reduce duplication in one operand emulation thunks Signed-off-by: Avi Kivity commit ecc5589f19a52e7e6501fe449047b19087ae11bb Author: Marcelo Tosatti Date: Tue Nov 25 15:58:07 2008 +0100 KVM: MMU: optimize set_spte for page sync The write protect verification in set_spte is unnecessary for page sync. Its guaranteed that, if the unsync spte was writable, the target page does not have a write protected shadow (if it had, the spte would have been write protected under mmu_lock by rmap_write_protect before). Same reasoning applies to mark_page_dirty: the gfn has been marked as dirty via the pagefault path. The cost of hash table and memslot lookups are quite significant if the workload is pagetable write intensive resulting in increased mmu_lock contention. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity commit 5319c662522db8995ff9276ba9d80549c64b294a Author: Sheng Yang Date: Mon Nov 24 14:32:57 2008 +0800 KVM: MSI to INTx translate Now we use MSI as default one, and translate MSI to INTx when guest need INTx rather than MSI. For legacy device, we provide support for non-sharing host IRQ. Provide a parameter msi2intx for this method. The value is true by default in x86 architecture. We can't guarantee this mode can work on every device, but for most of us tested, it works. If your device encounter some trouble with this mode, you can try set msi2intx modules parameter to 0. If the device is OK with msi2intx=0, then please report it to KVM mailing list or me. We may prepare a blacklist for the device that can't work in this mode. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 6b9cc7fd469869bed38831c5adac3f59dc25eaf5 Author: Sheng Yang Date: Mon Nov 24 14:32:56 2008 +0800 KVM: Enable MSI for device assignment We enable guest MSI and host MSI support in this patch. The userspace want to enable MSI should set KVM_DEV_IRQ_ASSIGN_ENABLE_MSI in the assigned_irq's flag. Function would return -ENOTTY if can't enable MSI, userspace shouldn't set MSI Enable bit when KVM_ASSIGN_IRQ return -ENOTTY with KVM_DEV_IRQ_ASSIGN_ENABLE_MSI. Userspace can tell the support of MSI device from #ifdef KVM_CAP_DEVICE_MSI. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit f64769eb05565c74d7fce6fa75d65924f9cdaf79 Author: Sheng Yang Date: Mon Nov 24 14:32:55 2008 +0800 KVM: Add assigned_device_msi_dispatch() The function is used to dispatch MSI to lapic according to MSI message address and message data. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 68b76f51675809c8ce200a86276c3c7266f17a64 Author: Sheng Yang Date: Mon Nov 24 14:32:54 2008 +0800 KVM: Export ioapic_get_delivery_bitmask It would be used for MSI in device assignment, for MSI dispatch. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 0937c48d075ddd59ae2c12a6fa8308b9c7a63753 Author: Sheng Yang Date: Mon Nov 24 14:32:53 2008 +0800 KVM: Add fields for MSI device assignment Prepared for kvm_arch_assigned_device_msi_dispatch(). Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit fbac7818d8fba7e1df9f4b209777f3b67b953dd3 Author: Sheng Yang Date: Mon Nov 24 14:32:52 2008 +0800 KVM: Clean up assigned_device_update_irq Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 4f906c19ae29397409bedabf7bbe5cb42ad90332 Author: Sheng Yang Date: Mon Nov 24 14:32:51 2008 +0800 KVM: Replace irq_requested with more generic irq_requested_type Separate guest irq type and host irq type, for we can support guest using INTx with host using MSI (but not opposite combination). Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 00e3ed39e2e25ffb3417ce1bec8f4b78ed4b85e7 Author: Sheng Yang Date: Mon Nov 24 14:32:50 2008 +0800 KVM: Separate update irq to a single function Separate INTx enabling part to a independence function, so that we can add MSI enabling part easily. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 342ffb93006e537fb8cb215b923ce69943a1e820 Author: Sheng Yang Date: Mon Nov 24 14:32:49 2008 +0800 KVM: Move ack notifier register and IRQ sourcd ID request Distinguish common part for device assignment and INTx part, perparing for refactor later. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 423cd25a5ade17b8a5cc85e6f0a0f37028d2c4a2 Author: Glauber Costa Date: Mon Nov 24 15:45:23 2008 -0200 x86: KVM guest: sign kvmclock as paravirt Currently, we only set the KVM paravirt signature in case of CONFIG_KVM_GUEST. However, it is possible to have it turned off, while CONFIG_KVM_CLOCK is turned on. This is also a paravirt case, and should be shown accordingly. Signed-off-by: Glauber Costa Signed-off-by: Avi Kivity commit df203ec9a77a7236cb90456664d714423b98a977 Author: Avi Kivity Date: Sun Nov 23 18:08:57 2008 +0200 KVM: VMX: Conditionally request interrupt window after injecting irq If we're injecting an interrupt, and another one is pending, request an interrupt window notification so we don't have excess latency on the second interrupt. This shouldn't happen in practice since an EOI will be issued, giving a second chance to request an interrupt window, but... Signed-off-by: Avi Kivity commit 8fe0736763a07fbea56213ea105a0c2ee098e6fc Author: Xiantao Zhang Date: Fri Nov 21 21:04:37 2008 +0800 KVM: ia64: Clean up vmm_ivt.S using tab to indent every line Using tab for indentation for vmm_ivt.S. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit 9f7d5bb5e2abf5316bb17eb3e7751dbafa09e5cf Author: Xiantao Zhang Date: Fri Nov 21 17:16:07 2008 +0800 KVM: ia64: Add handler for crashed vmm Since vmm runs in an isolated address space and it is just a copy of host's kvm-intel module, so once vmm crashes, we just crash all guests running on it instead of crashing whole kernel. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit 5e2be19832ccf93bf731a1758ec9fabf48414584 Author: Xiantao Zhang Date: Fri Nov 21 10:46:12 2008 +0800 KVM: ia64: Add some debug points to provide crash infomation Use printk infrastructure to print out some debug info once VM crashes. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit 7d637978151511148912fe2ea2bac9f9c64f5c35 Author: Xiantao Zhang Date: Fri Nov 21 20:58:11 2008 +0800 KVM: ia64: Define printk function for kvm-intel module kvm-intel module is relocated to an isolated address space with kernel, so it can't call host kernel's printk for debug purpose. In the module, we implement the printk to output debug info of vmm. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit d176720d34c72f7a8474a12204add93e54fe3ef1 Author: Eduardo Habkost Date: Mon Nov 17 19:03:24 2008 -0200 x86: disable VMX on all CPUs on reboot On emergency_restart, we may need to use an NMI to disable virtualization on all CPUs. We do that using nmi_shootdown_cpus() if VMX is enabled. Note: With this patch, we will run the NMI stuff only when the CPU where emergency_restart() was called has VMX enabled. This should work on most cases because KVM enables VMX on all CPUs, but we may miss the small window where KVM is doing that. Also, I don't know if all code using VMX out there always enable VMX on all CPUs like KVM does. We have two other alternatives for that: a) Have an API that all code that enables VMX on any CPU should use to tell the kernel core that it is going to enable VMX on the CPUs. b) Always call nmi_shootdown_cpus() if the CPU supports VMX. This is a bit intrusive and more risky, as it would run nmi_shootdown_cpus() on emergency_reboot() even on systems where virtualization is never enabled. Finding a proper point to hook the nmi_shootdown_cpus() call isn't trivial, as the non-emergency machine_restart() (that doesn't need the NMI tricks) uses machine_emergency_restart() directly. The solution to make this work without adding a new function or argument to machine_ops was setting a 'reboot_emergency' flag that tells if native_machine_emergency_restart() needs to do the virt cleanup or not. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 2340b62f77c782c305e6ae7748675a638436d1ef Author: Eduardo Habkost Date: Mon Nov 17 19:03:23 2008 -0200 kdump: forcibly disable VMX and SVM on machine_crash_shutdown() We need to disable virtualization extensions on all CPUs before booting the kdump kernel, otherwise the kdump kernel booting will fail, and rebooting after the kdump kernel did its task may also fail. We do it using cpu_emergency_vmxoff() and cpu_emergency_svm_disable(), that should always work, because those functions check if the CPUs support SVM or VMX before doing their tasks. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 0f3e9eeba0ea212bbea88790729d054b700ab91e Author: Eduardo Habkost Date: Mon Nov 17 19:03:22 2008 -0200 x86: cpu_emergency_svm_disable() function This function can be used by the reboot or kdump code to forcibly disable SVM on the CPU. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 2c8dceebb238680d5577500f8283397d41ca5590 Author: Eduardo Habkost Date: Mon Nov 17 19:03:21 2008 -0200 KVM: SVM: move svm_hardware_disable() code to asm/virtext.h Create cpu_svm_disable() function. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 63d1142f8f69e39468bc6079ab2239e902828134 Author: Eduardo Habkost Date: Mon Nov 17 19:03:20 2008 -0200 KVM: SVM: move has_svm() code to asm/virtext.h Use a trick to keep the printk()s on has_svm() working as before. gcc will take care of not generating code for the 'msg' stuff when the function is called with a NULL msg argument. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 6aa07a0d77f6aafbe69e4e8609ffaf2b7ee1b591 Author: Eduardo Habkost Date: Mon Nov 17 19:03:19 2008 -0200 x86: cpu_emergency_vmxoff() function Add cpu_emergency_vmxoff() and its friends: cpu_vmx_enabled() and __cpu_emergency_vmxoff(). Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 710ff4a855d0f3bf74b5b4a20328e2858a8a2968 Author: Eduardo Habkost Date: Mon Nov 17 19:03:18 2008 -0200 KVM: VMX: extract kvm_cpu_vmxoff() from hardware_disable() Along with some comments on why it is different from the core cpu_vmxoff() function. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 1e9931146c748420343aeefadb3bb17bd1c14a37 Author: Eduardo Habkost Date: Mon Nov 17 19:03:17 2008 -0200 x86: asm/virtext.h: add cpu_vmxoff() inline function Unfortunately we can't use exactly the same code from vmx hardware_disable(), because the KVM function uses the __kvm_handle_fault_on_reboot() tricks. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 6210e37b122583643da335c0389f74098713e5ca Author: Eduardo Habkost Date: Mon Nov 17 19:03:16 2008 -0200 KVM: VMX: move cpu_has_kvm_support() to an inline on asm/virtext.h It will be used by core code on kdump and reboot, to disable vmx if needed. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit eca70fc5671b226966dfb7ee9953d59199288566 Author: Eduardo Habkost Date: Mon Nov 17 19:03:15 2008 -0200 KVM: VMX: move ASM_VMX_* definitions from asm/kvm_host.h to asm/vmx.h Those definitions will be used by code outside KVM, so move it outside of a KVM-specific source file. Those definitions are used only on kvm/vmx.c, that already includes asm/vmx.h, so they can be moved safely. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit c2cedf7be2017e3264c93a4c0d75b1d96d0d7104 Author: Eduardo Habkost Date: Mon Nov 17 19:03:14 2008 -0200 KVM: SVM: move svm.h to include/asm svm.h will be used by core code that is independent of KVM, so I am moving it outside the arch/x86/kvm directory. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit 13673a90f1cf88296f726265cc7cf3ec76ecba30 Author: Eduardo Habkost Date: Mon Nov 17 19:03:13 2008 -0200 KVM: VMX: move vmx.h to include/asm vmx.h will be used by core code that is independent of KVM, so I am moving it outside the arch/x86/kvm directory. Signed-off-by: Eduardo Habkost Signed-off-by: Avi Kivity commit fe4e771d5c37f0949047faf95d16a512b21406bf Author: Hollis Blanchard Date: Mon Nov 10 14:57:36 2008 -0600 KVM: ppc: fix userspace mapping invalidation on context switch We used to defer invalidating userspace TLB entries until jumping out of the kernel. This was causing MMU weirdness most easily triggered by using a pipe in the guest, e.g. "dmesg | tail". I believe the problem was that after the guest kernel changed the PID (part of context switch), the old process's mappings were still present, and so copy_to_user() on the "return to new process" path ended up using stale mappings. Testing with large pages (64K) exposed the problem, probably because with 4K pages, pressure on the TLB faulted all process A's mappings out before the guest kernel could insert any for process B. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit df9b856c454e331bc394c80903fcdea19cae2a33 Author: Hollis Blanchard Date: Mon Nov 10 14:57:35 2008 -0600 KVM: ppc: use prefetchable mappings for guest memory Bare metal Linux on 440 can "overmap" RAM in the kernel linear map, so that it can use large (256MB) mappings even if memory isn't a multiple of 256MB. To prevent the hardware prefetcher from loading from an invalid physical address through that mapping, it's marked Guarded. However, KVM must ensure that all guest mappings are backed by real physical RAM (since a deliberate access through a guarded mapping could still cause a machine check). Accordingly, we don't need to make our mappings guarded, so let's allow prefetching as the designers intended. Curiously this patch didn't affect performance at all on the quick test I tried, but it's clearly the right thing to do anyways and may improve other workloads. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit bf5d4025c9fe8a64c5905c00bf4292319d634903 Author: Hollis Blanchard Date: Mon Nov 10 14:57:34 2008 -0600 KVM: ppc: use MMUCR accessor to obtain TID We have an accessor; might as well use it. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit e7cacd40d20849f69c908f1290c714145073685a Author: Sheng Yang Date: Tue Nov 11 15:30:40 2008 +0800 KVM: Fix kernel allocated memory slot Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot userspace addresses are page-aligned" broke kernel space allocated memory slot, for the userspace_addr is invalid. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity commit 30ed5bb685ab03c9bdf812502900b65087d61490 Author: Xiantao Zhang Date: Fri Oct 24 11:47:57 2008 +0800 KVM: ia64: Remove some macro definitions in asm-offsets.c. Use kernel's corresponding macro instead. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity commit 74ef740da64fd82a14dbab6d7f43d798ecc1b6cc Author: Hollis Blanchard Date: Fri Nov 7 13:15:13 2008 -0600 KVM: ppc: fix Kconfig constraints Make sure that CONFIG_KVM cannot be selected without processor support (currently, 440 is the only processor implementation available). Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 78749809222be5083e21bfe697b44ab797e5c0a8 Author: Hollis Blanchard Date: Fri Nov 7 13:32:12 2008 -0600 KVM: ensure that memslot userspace addresses are page-aligned Bad page translation and silent guest failure ensue if the userspace address is not page-aligned. I hit this problem using large (host) pages with qemu, because qemu currently has a hardcoded 4096-byte alignment for guest memory allocations. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 0fdf8e59faa5c60e9d77c8e14abe3a0f8bfcf586 Author: Nitin A Kamble Date: Wed Nov 5 15:56:21 2008 -0800 KVM: Fix cpuid iteration on multiple leaves per eac The code to traverse the cpuid data array list for counting type of leaves is currently broken. This patches fixes the 2 things in it. 1. Set the 1st counting entry's flag KVM_CPUID_FLAG_STATE_READ_NEXT. Without it the code will never find a valid entry. 2. Also the stop condition in the for loop while looking for the next unflaged entry is broken. It needs to stop when it find one matching entry; and in the case of count of 1, it will be the same entry found in this iteration. Signed-Off-By: Nitin A Kamble Signed-off-by: Avi Kivity commit 0853d2c1d849ef69884d2447d90d04007590b72b Author: Nitin A Kamble Date: Wed Nov 5 15:37:36 2008 -0800 KVM: Fix cpuid leaf 0xb loop termination For cpuid leaf 0xb the bits 8-15 in ECX register define the end of counting leaf. The previous code was using bits 0-7 for this purpose, which is a bug. Signed-off-by: Nitin A Kamble Signed-off-by: Avi Kivity commit fcfdbd266a41d3e41d17666de410a24995fde03a Author: Hollis Blanchard Date: Wed Nov 5 09:36:24 2008 -0600 KVM: ppc: improve trap emulation set ESR[PTR] when emulating a guest trap. This allows Linux guests to properly handle WARN_ON() (i.e. detect that it's a non-fatal trap). Also remove debugging printk in trap emulation. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit d4cf3892e50b8e35341086a4fe2bb8a3989b55d4 Author: Hollis Blanchard Date: Wed Nov 5 09:36:23 2008 -0600 KVM: ppc: optimize irq delivery path In kvmppc_deliver_interrupt is just one case left in the switch and it is a rare one (less than 8%) when looking at the exit numbers. Therefore we can at least drop the switch/case and if an if. I inserted an unlikely too, but that's open for discussion. In kvmppc_can_deliver_interrupt all frequent cases are in the default case. I know compilers are smart but we can make it easier for them. By writing down all options and removing the default case combined with the fact that ithe values are constants 0..15 should allow the compiler to write an easy jump table. Modifying kvmppc_can_deliver_interrupt pointed me to the fact that gcc seems to be unable to reduce priority_exception[x] to a build time constant. Therefore I changed the usage of the translation arrays in the interrupt delivery path completely. It is now using priority without translation to irq on the full irq delivery path. To be able to do that ivpr regs are stored by their priority now. Additionally the decision made in kvmppc_can_deliver_interrupt is already sufficient to get the value of interrupt_msr_mask[x]. Therefore we can replace the 16x4byte array used here with a single 4byte variable (might still be one miss, but the chance to find this in cache should be better than the right entry of the whole array). Signed-off-by: Christian Ehrhardt Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 9ab80843c01ac25139e635d018467e528729a317 Author: Hollis Blanchard Date: Wed Nov 5 09:36:22 2008 -0600 KVM: ppc: optimize find first bit Since we use a unsigned long here anyway we can use the optimized __ffs. Signed-off-by: Christian Ehrhardt Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 1b6766c7f3533c5d03668e11dd5617ae4a52e5a8 Author: Hollis Blanchard Date: Wed Nov 5 09:36:21 2008 -0600 KVM: ppc: optimize kvm stat handling Currently we use an unnecessary if&switch to detect some cases. To be honest we don't need the ligh_exits counter anyway, because we can calculate it out of others. Sum_exits can also be calculated, so we can remove that too. MMIO, DCR and INTR can be counted on other places without these additional control structures (The INTR case was never hit anyway). The handling of BOOKE_INTERRUPT_EXTERNAL/BOOKE_INTERRUPT_DECREMENTER is similar, but we can avoid the additional if when copying 3 lines of code. I thought about a goto there to prevent duplicate lines, but rewriting three lines should be better style than a goto cross switch/case statements (its also not enough code to justify a new inline function). Signed-off-by: Christian Ehrhardt Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit b8fd68ac8db1f926fdb2c7f196598a279461de53 Author: Hollis Blanchard Date: Wed Nov 5 09:36:20 2008 -0600 KVM: ppc: fix set regs to take care of msr change When changing some msr bits e.g. problem state we need to take special care of that. We call the function in our mtmsr emulation (not needed for wrtee[i]), but we don't call kvmppc_set_msr if we change msr via set_regs ioctl. It's a corner case we never hit so far, but I assume it should be kvmppc_set_msr in our arch set regs function (I found it because it is also a corner case when using pv support which would miss the update otherwise). Signed-off-by: Christian Ehrhardt Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 5cf8ca22146fa106f3bb865631ec04f5b499508f Author: Hollis Blanchard Date: Wed Nov 5 09:36:19 2008 -0600 KVM: ppc: adjust vcpu types to support 64-bit cores However, some of these fields could be split into separate per-core structures in the future. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit db93f5745d836f81cef0b4101a7c2685eeb55efb Author: Hollis Blanchard Date: Wed Nov 5 09:36:18 2008 -0600 KVM: ppc: create struct kvm_vcpu_44x and introduce container_of() accessor This patch doesn't yet move all 44x-specific data into the new structure, but is the first step down that path. In the future we may also want to create a struct kvm_vcpu_booke. Based on patch from Liu Yu . Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 5cbb5106f50b4515815cd32cf944958c0d4da83f Author: Hollis Blanchard Date: Wed Nov 5 09:36:17 2008 -0600 KVM: ppc: Move the last bits of 44x code out of booke.c Needed to port to other Book E processors. Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity commit 75f74f0dbe086c239b4b0cc5ed75b903ea3e663f Author: Hollis Blanchard Date: Wed Nov 5 09:36:16 2008 -0600 KVM: ppc: refactor instruction emulation into generic and core-specific pieces Cores provide 3 emulation hooks, implemented for example in the new 4xx_emulate.c: kvmppc_core_emulate_op kvmppc_core_emulate_mtspr kvmppc_core_emulate_mfspr Strictly speaking the last two aren't necessary, but provide for more informative error reporting ("unknown SPR"). Long term I'd like to have instruction decoding autogenerated from tables of opcodes, and that way we could aggregate universal, Book E, and core-specific instructions more easily and without redundant switch statements. Sign