aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-12dm: factor out max_io_len_target_boundaryMike Snitzer2-8/+24
Split max_io_len_target_boundary out of max_io_len so that the discard support can make use of it without duplicating max_io_len code. Avoiding max_io_len's split_io logic enables DM's discard support to submit the entire discard request to a target. But discards must still be split on target boundaries. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: use common __issue_target_request for flush and discard supportMike Snitzer1-8/+22
Rename __flush_target to __issue_target_request now that it is used to issue both flush and discard requests. Introduce __issue_target_requests as a convenient wrapper to __issue_target_request 'num_flush_requests' or 'num_discard_requests' times per target. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: linear support discardMike Snitzer5-12/+105
Allow discards to be passed through to linear mappings if at least one underlying device supports it. Discards will be forwarded only to devices that support them. A target that supports discards should set num_discard_requests to indicate how many times each discard request must be submitted to it. Verify table's underlying devices support discards prior to setting the associated DM device as capable of discards (via QUEUE_FLAG_DISCARD). Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]> Reviewed-by: Joe Thornber <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm crypt: simplify crypt_ctrMilan Broz1-81/+104
Allocate cipher strings indpendently of struct crypt_config and move cipher parsing and allocation into a separate function to prepare for supporting the cryptoapi format e.g. "xts(aes)". No functional change in this patch. Signed-off-by: Milan Broz <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm crypt: simplify crypt_config destruction logicMilan Broz1-87/+93
Use just one label and reuse common destructor for crypt target. Parse remaining argv arguments in logic order. Also do not ignore error values from IV init and set key functions. No functional change in this patch except changed return codes based on above. Signed-off-by: Milan Broz <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: allow autoloading of dm modPeter Rajnoha4-2/+8
Add devname:mapper/control and MAPPER_CTRL_MINOR module alias to support dm-mod module autoloading. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Peter Rajnoha <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: rename map_info flush_request to target_request_nrMike Snitzer4-14/+16
'target_request_nr' is a more generic name that reflects the fact that it will be used for both flush and discard support. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: refactor dm_table_completeWill Drewry3-38/+52
This change unifies the various checks and finalization that occurs on a table prior to use. By doing so, it allows table construction without traversing the dm-ioctl interface. Signed-off-by: Will Drewry <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm snapshot: implement mergeMikulas Patocka1-0/+16
Implement merge method for the snapshot origin to improve read performance. Without merge method, dm asks the upper layers to submit smallest possible bios --- one page. Submitting such small bios impacts performance negatively when reading or writing the origin device. Without this patch, CPU consumption when reading the origin on lvm on md-raid0 was 6 to 12%, with this patch, it drops to 1 to 4%. Note: in my testing, it actually degraded performance in some settings, I traced it to Maxtor disks having problems with > 512-sector requests. Reducing the number of sectors to /sys/block/sd*/queue/max_sectors_kb to 256 fixed the read performance. I think we don't have to care about weird disks that actually degrade performance because of large requests being sent to them. Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: do not initialise full request queue when bio basedMike Snitzer3-26/+79
Change bio-based mapped devices no longer to have a fully initialized request_queue (request_fn, elevator, etc). This means bio-based DM devices no longer register elevator sysfs attributes ('iosched/' tree or 'scheduler' other than "none"). In contrast, a request-based DM device will continue to have a full request_queue and will register elevator sysfs attributes. Therefore a user can determine a DM device's type by checking if elevator sysfs attributes exist. First allocate a minimalist request_queue structure for a DM device (needed for both bio and request-based DM). Initialization of a full request_queue is deferred until it is known that the DM device is request-based, at the end of the table load sequence. Factor DM device's request_queue initialization: - common to both request-based and bio-based into dm_init_md_queue(). - specific to request-based into dm_init_request_based_queue(). The md->type_lock mutex is used to protect md->queue, in addition to md->type, during table_load(). A DM device's first table_load will establish the immutable md->type. But md->queue initialization, based on md->type, may fail at that time (because blk_init_allocated_queue cannot allocate memory). Therefore any subsequent table_load must (re)try dm_setup_md_queue independently of establishing md->type. Signed-off-by: Mike Snitzer <[email protected]> Acked-by: Kiyoshi Ueda <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: make bio or request based device type immutableMike Snitzer4-9/+52
Determine whether a mapped device is bio-based or request-based when loading its first (inactive) table and don't allow that to be changed later. This patch performs different device initialisation in each of the two cases. (We don't think it's necessary to add code to support changing between the two types.) Allowed md->type transitions: DM_TYPE_NONE to DM_TYPE_BIO_BASED DM_TYPE_NONE to DM_TYPE_REQUEST_BASED We now prevent table_load from replacing the inactive table with a conflicting type of table even after an explicit table_clear. Introduce 'type_lock' into the struct mapped_device to protect md->type and to prepare for the next patch that will change the queue initialization and allocate memory while md->type_lock is held. Signed-off-by: Mike Snitzer <[email protected]> Acked-by: Kiyoshi Ueda <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]> drivers/md/dm-ioctl.c | 15 +++++++++++++++ drivers/md/dm.c | 37 ++++++++++++++++++++++++++++++------- drivers/md/dm.h | 5 +++++ include/linux/dm-ioctl.h | 4 ++-- 4 files changed, 52 insertions(+), 9 deletions(-)
2010-08-12dm: skip second flush on bio unsupported errorMikulas Patocka1-2/+13
When processing barriers, skip the second flush if processing the bio failed with -EOPNOTSUPP. This can happen with discard+barrier requests. If the device doesn't support discard, there would be two useless SYNCHRONIZE CACHE commands. The first dm_flush cannot be so easily optimized out, so we leave it there. Previously, -EOPNOTSUPP could be received in dec_pending only with empty barriers and we ignored that error, assuming the device not supporting cache flushes has cache always consistent. With the addition of discard barriers, this -EOPNOTSUPP can also be generated by discards and we must record it in md->barrier_error for process_barrier. Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm snapshot: persistent use define for disk header chunk sizeTomohiro Kusumi1-3/+3
This patch fixes hard-coded value for the size of a chunk that includes disk header for persistent snapshot. It should be changed to existing macro NUM_SNAPSHOT_HDR_CHUNKS instead of using hard-coded value 1. Signed-off-by: Tomohiro Kusumi <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm crypt: use kstrdupJulia Lawall1-2/+1
Use kstrdup when the goal of an allocation is copy a string into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to; expression flag,E1,E2; statement S; @@ - to = kmalloc(strlen(from) + 1,flag); + to = kstrdup(from, flag); ... when != \(from = E1 \| to = E1 \) if (to==NULL || ...) S ... when != \(from = E2 \| to = E2 \) - strcpy(to, from); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: use nonseekable_openArnd Bergmann1-0/+1
The dm control device does not implement read/write, so it has no use for seeking. Using no_llseek prevents falling back to default_llseek, which requires the BKL. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: separate device deletion from dm_putKiyoshi Ueda3-20/+62
This patch separates the device deletion code from dm_put() to make sure the deletion happens in the process context. By this patch, device deletion always occurs in an ioctl (process) context and dm_put() can be called in interrupt context. As a result, the request-based dm's bad dm_put() usage pointed out by Mikulas below disappears. http://marc.info/?l=dm-devel&m=126699981019735&w=2 Without this patch, I confirmed there is a case to crash the system: dm_put() => dm_table_destroy() => vfree() => BUG_ON(in_interrupt()) Some more backgrounds and details: In request-based dm, a device opener can remove a mapped_device while the last request is still completing, because bios in the last request complete first and then the device opener can close and remove the mapped_device before the last request completes: CPU0 CPU1 ================================================================= <<INTERRUPT>> blk_end_request_all(clone_rq) blk_update_request(clone_rq) bio_endio(clone_bio) == end_clone_bio blk_update_request(orig_rq) bio_endio(orig_bio) <<I/O completed>> dm_blk_close() dev_remove() dm_put(md) <<Free md>> blk_finish_request(clone_rq) .... dm_end_request(clone_rq) free_rq_clone(clone_rq) blk_end_request_all(orig_rq) rq_completed(md) So request-based dm used dm_get()/dm_put() to hold md for each I/O until its request completion handling is fully done. However, the final dm_put() can call the device deletion code which must not be run in interrupt context and may cause kernel panic. To solve the problem, this patch moves the device deletion code, dm_destroy(), to predetermined places that is actually deleting the mapped_device in ioctl (process) context, and changes dm_put() just to decrement the reference count of the mapped_device. By this change, dm_put() can be used in any context and the symmetric model below is introduced: dm_create(): create a mapped_device dm_destroy(): destroy a mapped_device dm_get(): increment the reference count of a mapped_device dm_put(): decrement the reference count of a mapped_device dm_destroy() waits for all references of the mapped_device to disappear, then deletes the mapped_device. dm_destroy() uses active waiting with msleep(1), since deleting the mapped_device isn't performance-critical task. And since at this point, nobody opens the mapped_device and no new reference will be taken, the pending counts are just for racing completing activity and will eventually decrease to zero. For the unlikely case of the forced module unload, dm_destroy_immediate(), which doesn't wait and forcibly deletes the mapped_device, is also introduced and used in dm_hash_remove_all(). Otherwise, "rmmod -f" may be stuck and never return. And now, because the mapped_device is deleted at this point, subsequent accesses to the mapped_device may cause NULL pointer references. Cc: [email protected] Signed-off-by: Kiyoshi Ueda <[email protected]> Signed-off-by: Jun'ichi Nomura <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: release _hash_lock between devices in remove_allKiyoshi Ueda1-19/+25
This patch changes dm_hash_remove_all() to release _hash_lock when removing a device. After removing the device, dm_hash_remove_all() takes _hash_lock and searches the hash from scratch again. This patch is a preparation for the next patch, which changes device deletion code to wait for md reference to be 0. Without this patch, the wait in the next patch may cause AB-BA deadlock: CPU0 CPU1 ----------------------------------------------------------------------- dm_hash_remove_all() down_write(_hash_lock) table_status() md = find_device() dm_get(md) <increment md->holders> dm_get_live_or_inactive_table() dm_get_inactive_table() down_write(_hash_lock) <in the md deletion code> <wait for md->holders to be 0> Signed-off-by: Kiyoshi Ueda <[email protected]> Signed-off-by: Jun'ichi Nomura <[email protected]> Cc: [email protected] Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm: prevent access to md being deletedKiyoshi Ueda1-0/+1
This patch prevents access to mapped_device which is being deleted. Currently, even after a mapped_device has been removed from the hash, it could be accessed through idr_find() using minor number. That could cause a race and NULL pointer reference below: CPU0 CPU1 ------------------------------------------------------------------ dev_remove(param) down_write(_hash_lock) dm_lock_for_deletion(md) spin_lock(_minor_lock) set_bit(DMF_DELETING) spin_unlock(_minor_lock) __hash_remove(hc) up_write(_hash_lock) dev_status(param) md = find_device(param) down_read(_hash_lock) __find_device_hash_cell(param) dm_get_md(param->dev) md = dm_find_md(dev) spin_lock(_minor_lock) md = idr_find(MINOR(dev)) spin_unlock(_minor_lock) dm_put(md) free_dev(md) dm_get(md) up_read(_hash_lock) __dev_status(md, param) dm_put(md) This patch fixes such problems. Signed-off-by: Kiyoshi Ueda <[email protected]> Signed-off-by: Jun'ichi Nomura <[email protected]> Cc: [email protected] Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: return uevent flag after renamePeter Rajnoha1-17/+24
All the dm ioctls that generate uevents set the DM_UEVENT_GENERATED flag so that userspace knows whether or not to wait for a uevent to be processed before continuing, The dm rename ioctl sets this flag but was not structured to return it to userspace. This patch restructures the rename ioctl processing to behave like the other ioctls that return data and so fix this. Signed-off-by: Peter Rajnoha <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: make __dev_status voidAlasdair G Kergon1-36/+31
__dev_status() cannot fail so make it void and simplify callers. Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm ioctl: remove __dev_status from geometry and target messagePeter Rajnoha1-6/+0
Remove useless __dev_status call while processing an ioctl that sets up device geometry and target message. The data is not returned to userspace so there is no point collecting it and in the case of target_message it is collected before processing the message so if it did return it might be stale. Signed-off-by: Peter Rajnoha <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm snapshot: test chunk size against both origin and snapshotMikulas Patocka3-17/+26
Validate chunk size against both origin and snapshot sector size Don't allow chunk size smaller than either origin or snapshot logical sector size. Reading or writing data not aligned to sector size is not allowed and causes immediate errors. This requires us to open the origin before initialising the exception store and to export dm_snap_origin. Cc: [email protected] Signed-off-by: Mikulas Patocka <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm snapshot: iterate origin and cow devicesMikulas Patocka1-1/+7
Iterate both origin and snapshot devices iterate_devices method should call the callback for all the devices where the bio may be remapped. Thus, snapshot_iterate_devices should call the callback for both snapshot and origin underlying devices because it remaps some bios to the snapshot and some to the origin. snapshot_iterate_devices called the callback only for the origin device. This led to badly calculated device limits if snapshot and origin were placed on different types of disks. Cc: [email protected] Signed-off-by: Mikulas Patocka <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12dm mpath: fix NULL pointer dereference when path parameters missingAlasdair G Kergon1-0/+1
multipath_ctr() forgets to return an error after detecting missing path parameters. Fix this. Signed-off-by: Patrick LoPresti <[email protected]> Cc: [email protected] Signed-off-by: Alasdair G Kergon <[email protected]>
2010-08-12io-mapping: move asm include inside the config optionDave Airlie1-1/+2
nouveau starting using these APIs, the first on non-x86 hw, and this include isn't required on anything with real amounts of vmalloc space. this fixes a build problem on powerpc. Signed-off-by: Dave Airlie <[email protected]>
2010-08-12vgaarb: drop vga.h includeDave Airlie1-1/+0
We don't actually need this include on any platform. built on powerpc + x86, reported on m68k. Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm/radeon: Add probing of clocks from device-treeBenjamin Herrenschmidt1-0/+81
When we find no ROM we understand and a device-tree is present, see if we can retreive clock info from there. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm/radeon: drop old and broken mesa warningDave Airlie1-5/+0
This never really got fixed in mesa, and the kernel deals with the problem just fine, so don't got reporting things that confuse people. Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm/radeon: Fix pci_map_page() error checkingBenjamin Herrenschmidt3-3/+4
0 is a valid DMA address from pci_map_page(), use pci_dma_mapping_error() instead to check for errors [airlied: fix warning + two other places with errors.] Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm: Remove count_lock for calling lastclose() after 58474713 (v2)Chris Wilson1-13/+3
When removing of the BKL the locking around lastclose() was rearranged and resulted in the holding of the open_count spinlock over the call into drm_lastclose(). The drivers were not ready for this path to be atomic - it may indeed involve long waits to release old objects and cleanup the GPU - and so we ended up scheduling whilst atomic. [ 54.625598] BUG: scheduling while atomic: X/3546/0x00000002 [ 54.625600] Modules linked in: sco bridge stp llc input_polldev rfcomm bnep l2cap crc16 sch_sfq ipv6 md_mod acpi_cpufreq mperf cryptd aes_x86_64 aes_generic xts gf128mul dm_crypt dm_mod btusb bluetooth usbhid hid zaurus cdc_ether usbnet mii cdc_wdm cdc_acm uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_codec_conexant arc4 pcmcia ecb snd_hda_intel joydev sdhci_pci sdhci snd_hda_codec tpm_tis firewire_ohci mmc_core e1000e uhci_hcd thinkpad_acpi nvram yenta_socket pcmcia_rsrc pcmcia_core tpm wmi sr_mod firewire_core iwlagn ehci_hcd snd_hwdep snd_pcm usbcore tpm_bios thermal led_class snd_timer iwlcore snd soundcore ac snd_page_alloc pcspkr psmouse serio_raw battery sg mac80211 evdev cfg80211 i2c_i801 iTCO_wdt iTCO_vendor_support cdrom processor crc_itu_t rfkill xfs exportfs sd_mod crc_t10dif ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan] [ 54.625663] Pid: 3546, comm: X Not tainted 2.6.35-04771-g1787985 #301 [ 54.625665] Call Trace: [ 54.625671] [<ffffffff8102d599>] __schedule_bug+0x57/0x5c [ 54.625675] [<ffffffff81384141>] schedule+0xe5/0x832 [ 54.625679] [<ffffffff81163e77>] ? put_dec+0x20/0x3c [ 54.625682] [<ffffffff81384dd4>] schedule_timeout+0x275/0x29f [ 54.625686] [<ffffffff810455e1>] ? process_timeout+0x0/0xb [ 54.625688] [<ffffffff81384e17>] schedule_timeout_uninterruptible+0x19/0x1b [ 54.625691] [<ffffffff81045893>] msleep+0x16/0x1d [ 54.625695] [<ffffffff812a2e53>] i9xx_crtc_dpms+0x273/0x2ae [ 54.625698] [<ffffffff812a18be>] intel_crtc_dpms+0x28/0xe7 [ 54.625702] [<ffffffff811ec0fa>] drm_helper_disable_unused_functions+0xf0/0x118 [ 54.625705] [<ffffffff811ecde3>] drm_crtc_helper_set_config+0x644/0x7c8 [ 54.625708] [<ffffffff811f12dd>] ? drm_copy_field+0x40/0x50 [ 54.625711] [<ffffffff811ebca2>] drm_fb_helper_force_kernel_mode+0x3e/0x85 [ 54.625713] [<ffffffff811ebcf2>] drm_fb_helper_restore+0x9/0x24 [ 54.625717] [<ffffffff81290a41>] i915_driver_lastclose+0x2b/0x5c [ 54.625720] [<ffffffff811f14a7>] drm_lastclose+0x44/0x2ad [ 54.625722] [<ffffffff811f1ed2>] drm_release+0x5c6/0x609 [ 54.625726] [<ffffffff810d1275>] fput+0x109/0x1c7 [ 54.625728] [<ffffffff810ce5e4>] filp_close+0x61/0x6b [ 54.625731] [<ffffffff810ce680>] sys_close+0x92/0xd4 [ 54.625734] [<ffffffff81002a2b>] system_call_fastpath+0x16/0x1b v2: The spinlock is actually superfluous as access to open_count is entirely serialised by drm_global_mutex and so can be dropped. The count_lock spinlock instead appears to be used to protect access to dev->buf_alloc and dev->buf_use. Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm/radeon/kms: allow FG_ALPHA_VALUE on r5xxMarek Olšák1-0/+1
This is a CS checker fix. I need this for FP16 alpha-test. Signed-off-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12drm/radeon/kms: another r6xx/r7xx CS checker fixAlex Deucher1-0/+1
add default case for buffer formats Signed-off-by: Alex Deucher <[email protected]> Cc: Andre Maasikas <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12DRM: Replace kmalloc/memset combos with kzallocDavidlohr Bueso1-22/+11
Currently most, if not all, memory allocation in drm_bufs.c is followed by initializing the memory with 0. Replace the use of kmalloc+memset with kzalloc. Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2010-08-12Further tidyup of raid6 naming in lib/raid6NeilBrown6-11/+11
Rename raid6/raid6x86.h to raid6/x86.h and modify some comments. Signed-off-by: NeilBrown <[email protected]>
2010-08-12Make lib/raid6/test build correctly.NeilBrown2-1/+3
Some bit-rot needs to be cleaned out. Signed-off-by: NeilBrown <[email protected]>
2010-08-11Merge branch 'for-linus' of ↵Linus Torvalds15-130/+223
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: isofs: Fix lseek() to position beyond 4 GB vfs: remove unused MNT_STRICTATIME vfs: show unreachable paths in getcwd and proc vfs: only add " (deleted)" where necessary vfs: add prepend_path() helper vfs: __d_path: dont prepend the name of the root dentry ia64: perfmon: add d_dname method vfs: add helpers to get root and pwd cachefiles: use path_get instead of lone dget fs/sysv/super.c: add support for non-PDP11 v7 filesystems V7: Adjust sanity checks for some volumes Add v7 alias v9fs: fixup for inode_setattr being removed Manual merge to take Al's version of the fs/sysv/super.c file: it merged cleanly, but Al had removed an unnecessary header include, so his side was better.
2010-08-11i2c: I2C bus multiplexer driver pca954xMichael Lawnick6-1/+377
I2C driver for PCA954x I2C multiplexer series. Signed-off-by: Michael Lawnick <[email protected]> Acked-by: Rodolfo Giometti <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-08-11i2c: Multiplexed I2C bus core supportMichael Lawnick7-8/+327
Add multiplexed bus core support. I2C multiplexer and switches like pca954x get instantiated as new adapters per port. Signed-off-by: Michael Lawnick <[email protected]> Acked-by: Rodolfo Giometti <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-08-11i2c: Use a separate mutex for userspace client listsJean Delvare2-6/+8
Moving userspace-instantiated clients to separate lists wasn't nearly enough to avoid deadlocks in multiplexed bus cases. We also want to have a dedicated mutex to protect each list. Signed-off-by: Jean Delvare <[email protected]> Cc: Michael Lawnick <[email protected]>
2010-08-11i2c: Make i2c_default_probe self-sufficientJean Delvare1-22/+10
Make i2c_default_probe self-sufficient, so that callers don't have to do functionality checks themselves. This ensures everything is and will stay consistent. Signed-off-by: Jean Delvare <[email protected]>
2010-08-11i2c: Drop dummy variableJean Delvare1-3/+2
Now that bus_for_each_drv() is no longer __must_check, we can drop the dummy variable that was used to store the returned value. Signed-off-by: Jean Delvare <[email protected]> Cc: Justin P. Mattock <[email protected]>
2010-08-11i2c: Move adapter locking helpers to i2c-coreJean Delvare2-22/+37
Uninline i2c adapter locking helper functions, move them to i2c-core, and use them in i2c-core itself. The functions are still exported for external users. This makes future updates to the locking model (which will be needed for multiplexing support) possible and transparent. Signed-off-by: Jean Delvare <[email protected]> Cc: Michael Lawnick <[email protected]>
2010-08-11V4L/DVB: Use custom I2C probing function mechanismJean Delvare4-26/+18
Now that i2c-core offers the possibility to provide custom probing function for I2C devices, let's make use of it. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]>
2010-08-11i2c: Add support for custom probe functionJean Delvare11-21/+31
The probe method used by i2c_new_probed_device() may not be suitable for all cases. Let the caller provide its own, optional probe function. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]>
2010-08-11i2c-dev: Use memdup_userJulia Lawall1-16/+6
Use memdup_user when user data is immediately copied into the allocated region. Note that in the second case, the ++i is no longer necessary, as the last value is already freed if needed by the call to memdup_user. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; position p; identifier l1,l2; @@ - to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( - to==NULL + IS_ERR(to) || ...) { <+... when != goto l1; - -ENOMEM + PTR_ERR(to) ...+> } - if (copy_from_user(to, from, size) != 0) { - <+... when != goto l2; - -EFAULT - ...+> - } // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-08-11i2c-dev: Remove unnecessary kmalloc castsJoe Perches1-3/+1
Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-08-11Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linusLinus Torvalds9-21/+181
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus: Squashfs: fix checkpatch.pl warnings Squashfs: fix filename typo Squashfs: update Kconfig and documentation for LZO Squashfs: fix block size use in LZO decompressor Squashfs: Add LZO compression support squashfs: fix filename in header comment Squashfs: Make XATTR config name consistent with other file systems squashfs: fix compiler inline warning
2010-08-11Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osdLinus Torvalds4-52/+31
* 'for-linus' of git://git.open-osd.org/linux-open-osd: exofs: Fix groups code when num_devices is not divisible by group_width exofs: Remove useless optimization exofs: exofs_file_fsync and exofs_file_flush correctness exofs: Remove superfluous dependency on buffer_head and writeback
2010-08-11Merge branch 'for-linus' of ↵Linus Torvalds39-410/+1162
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (39 commits) ceph: generalize mon requests, add pool op support ceph: only queue async writeback on cap revocation if there is dirty data ceph: do not ignore osd_idle_ttl mount option ceph: constify dentry_operations ceph: whitespace cleanup ceph: add flock/fcntl lock support ceph: define on-wire types, constants for file locking support ceph: add CEPH_FEATURE_FLOCK to the supported feature bits ceph: support v2 reconnect encoding ceph: support v2 client_caps encoding ceph: move AES iv definition to shared header ceph: fix decoding of pool snap info ceph: make ->sync_fs not wait if wait==0 ceph: warn on missing snap realm ceph: print useful error message when crush rule not found ceph: use %pU to print uuid (fsid) ceph: sync header defs with server code ceph: clean up header guards ceph: strip misleading/obsolete version, feature info ceph: specify supported features in super.h ...
2010-08-11Merge branch 'msm-video' of git://codeaurora.org/quic/kernel/dwalker/linux-msmLinus Torvalds2-4/+1
* 'msm-video' of git://codeaurora.org/quic/kernel/dwalker/linux-msm: video: msm: Fix section mismatch in mddi.c. drivers: video: msm: drop some unused variables