aboutsummaryrefslogtreecommitdiffstats
path: root/drivers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-01-09md: Allow md devices to be created by name.NeilBrown1-18/+101
Using sequential numbers to identify md devices is somewhat artificial. Using names can be a lot more user-friendly. Also, creating md devices by opening the device special file is a bit awkward. So this patch provides a new option for creating and naming devices. Writing a name such as "md_home" to /sys/modules/md_mod/parameters/new_array will cause an array with that name to be created. It will appear in /sys/block/ /proc/partitions and /proc/mdstat as 'md_home'. It will have an arbitrary minor number allocated. md devices that a created by an open are destroyed on the last close when the device is inactive. For named md devices, they will not be destroyed until the array is explicitly stopped, either with the STOP_ARRAY ioctl or by writing 'clear' to /sys/block/md_XXXX/md/array_state. The name of the array must start 'md_' to avoid conflict with other devices. Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: make devices disappear when they are no longer needed.NeilBrown1-12/+49
Currently md devices, once created, never disappear until the module is unloaded. This is essentially because the gendisk holds a reference to the mddev, and the mddev holds a reference to the gendisk, this a circular reference. If we drop the reference from mddev to gendisk, then we need to ensure that the mddev is destroyed when the gendisk is destroyed. However it is not possible to hook into the gendisk destruction process to enable this. So we drop the reference from the gendisk to the mddev and destroy the gendisk when the mddev gets destroyed. However this has a complication. Between the call __blkdev_get->get_gendisk->kobj_lookup->md_probe and the call __blkdev_get->md_open there is no obvious way to hold a reference on the mddev any more, so unless something is done, it will disappear and gendisk will be destroyed prematurely. Also, once we decide to destroy the mddev, there will be an unlockable moment before the gendisk is unlinked (blk_unregister_region) during which a new reference to the gendisk can be created. We need to ensure that this reference can not be used. i.e. the ->open must fail. So: 1/ in md_probe we set a flag in the mddev (hold_active) which indicates that the array should be treated as active, even though there are no references, and no appearance of activity. This is cleared by md_release when the device is closed if it is no longer needed. This ensures that the gendisk will survive between md_probe and md_open. 2/ In md_open we check if the mddev we expect to open matches the gendisk that we did open. If there is a mismatch we return -ERESTARTSYS and modify __blkdev_get to retry from the top in that case. In the -ERESTARTSYS sys case we make sure to wait until the old gendisk (that we succeeded in opening) is really gone so we loop at most once. Some udev configurations will always open an md device when it first appears. If we allow an md device that was just created by an open to disappear on an immediate close, then this can race with such udev configurations and result in an infinite loop the device being opened and closed, then re-open due to the 'ADD' even from the first open, and then close and so on. So we make sure an md device, once created by an open, remains active at least until some md 'ioctl' has been made on it. This means that all normal usage of md devices will allow them to disappear promptly when not needed, but the worst that an incorrect usage will do it cause an inactive md device to be left in existence (it can easily be removed). As an array can be stopped by writing to a sysfs attribute echo clear > /sys/block/mdXXX/md/array_state we need to use scheduled work for deleting the gendisk and other kobjects. This allows us to wait for any pending gendisk deletion to complete by simply calling flush_scheduled_work(). Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: centralise all freeing of an 'mddev' in 'md_free'NeilBrown1-9/+11
md_free is the .release handler for the md kobj_type. So it makes sense to release all the objects referenced by the mddev in there, rather than just prior to calling kobject_put for what we think is the last time. Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: move allocation of ->queue from mddev_find to md_probeNeilBrown1-11/+17
It is more balanced to just do simple initialisation in mddev_find, which allocates and links a new md device, and leave all the more sophisticated allocation to md_probe (which calls mddev_find). md_probe already allocated the gendisk. It should allocate the queue too. Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: need another print_sb for mdp_superblock_1Cheng Renquan1-6/+60
md_print_devices is called in two code path: MD_BUG(...), and md_ioctl with PRINT_RAID_DEBUG. it will dump out all in use md devices information; However, it wrongly processed two types of superblock in one: The header file <linux/raid/md_p.h> has defined two types of superblock, struct mdp_superblock_s (typedefed with mdp_super_t) according to md with metadata 0.90, and struct mdp_superblock_1 according to md with metadata 1.0 and later, These two types of superblock are very different, The md_print_devices code processed them both in mdp_super_t, that would lead to wrong informaton dump like: [ 6742.345877] [ 6742.345887] md: ********************************** [ 6742.345890] md: * <COMPLETE RAID STATE PRINTOUT> * [ 6742.345892] md: ********************************** [ 6742.345896] md1: <ram7><ram6><ram5><ram4> [ 6742.345907] md: rdev ram7, SZ:00065472 F:0 S:1 DN:3 [ 6742.345909] md: rdev superblock: [ 6742.345914] md: SB: (V:0.90.0) ID:<42ef13c7.598c059a.5f9f1645.801e9ee6> CT:4919856d [ 6742.345918] md: L5 S00065472 ND:4 RD:4 md1 LO:2 CS:65536 [ 6742.345922] md: UT:4919856d ST:1 AD:4 WD:4 FD:0 SD:0 CSUM:b7992907 E:00000001 [ 6742.345924] D 0: DISK<N:0,(1,8),R:0,S:6> [ 6742.345930] D 1: DISK<N:1,(1,10),R:1,S:6> [ 6742.345933] D 2: DISK<N:2,(1,12),R:2,S:6> [ 6742.345937] D 3: DISK<N:3,(1,14),R:3,S:6> [ 6742.345942] md: THIS: DISK<N:3,(1,14),R:3,S:6> ... [ 6742.346058] md0: <ram3><ram2><ram1><ram0> [ 6742.346067] md: rdev ram3, SZ:00065472 F:0 S:1 DN:3 [ 6742.346070] md: rdev superblock: [ 6742.346073] md: SB: (V:1.0.0) ID:<369aad81.00000000.00000000.00000000> CT:9a322a9c [ 6742.346077] md: L-1507699579 S976570180 ND:48 RD:0 md0 LO:65536 CS:196610 [ 6742.346081] md: UT:00000018 ST:0 AD:131048 WD:0 FD:8 SD:0 CSUM:00000000 E:00000000 [ 6742.346084] D 0: DISK<N:-1,(-1,-1),R:-1,S:-1> [ 6742.346089] D 1: DISK<N:-1,(-1,-1),R:-1,S:-1> [ 6742.346092] D 2: DISK<N:-1,(-1,-1),R:-1,S:-1> [ 6742.346096] D 3: DISK<N:-1,(-1,-1),R:-1,S:-1> [ 6742.346102] md: THIS: DISK<N:0,(0,0),R:0,S:0> ... [ 6742.346219] md: ********************************** [ 6742.346221] Here md1 is metadata 0.90.0, and md0 is metadata 1.2 After some more code to distinguish these two types of superblock, in this patch, it will generate dump information like: [ 7906.755790] [ 7906.755799] md: ********************************** [ 7906.755802] md: * <COMPLETE RAID STATE PRINTOUT> * [ 7906.755804] md: ********************************** [ 7906.755808] md1: <ram7><ram6><ram5><ram4> [ 7906.755819] md: rdev ram7, SZ:00065472 F:0 S:1 DN:3 [ 7906.755821] md: rdev superblock (MJ:0): [ 7906.755826] md: SB: (V:0.90.0) ID:<3fca7a0d.a612bfed.5f9f1645.801e9ee6> CT:491989f3 [ 7906.755830] md: L5 S00065472 ND:4 RD:4 md1 LO:2 CS:65536 [ 7906.755834] md: UT:491989f3 ST:1 AD:4 WD:4 FD:0 SD:0 CSUM:00fb52ad E:00000001 [ 7906.755836] D 0: DISK<N:0,(1,8),R:0,S:6> [ 7906.755842] D 1: DISK<N:1,(1,10),R:1,S:6> [ 7906.755845] D 2: DISK<N:2,(1,12),R:2,S:6> [ 7906.755849] D 3: DISK<N:3,(1,14),R:3,S:6> [ 7906.755855] md: THIS: DISK<N:3,(1,14),R:3,S:6> ... [ 7906.755972] md0: <ram3><ram2><ram1><ram0> [ 7906.755981] md: rdev ram3, SZ:00065472 F:0 S:1 DN:3 [ 7906.755984] md: rdev superblock (MJ:1): [ 7906.755989] md: SB: (V:1) (F:0) Array-ID:<5fbcf158:55aa:5fbe:9a79:1e939880dcbd> [ 7906.755990] md: Name: "DG5:0" CT:1226410480 [ 7906.755998] md: L5 SZ130944 RD:4 LO:2 CS:128 DO:24 DS:131048 SO:8 RO:0 [ 7906.755999] md: Dev:00000003 UUID: 9194d744:87f7:a448:85f2:7497b84ce30a [ 7906.756001] md: (F:0) UT:1226410480 Events:0 ResyncOffset:-1 CSUM:0dbcd829 [ 7906.756003] md: (MaxDev:384) ... [ 7906.756113] md: ********************************** [ 7906.756116] this md0 (metadata 1.2) information dumping is exactly according to struct mdp_superblock_1. Signed-off-by: Cheng Renquan <crquan@gmail.com> Cc: Neil Brown <neilb@suse.de> Cc: Dan Williams <dan.j.williams@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: use list_for_each_entry macro directlyCheng Renquan9-87/+56
The rdev_for_each macro defined in <linux/raid/md_k.h> is identical to list_for_each_entry_safe, from <linux/list.h>, it should be defined to use list_for_each_entry_safe, instead of reinventing the wheel. But some calls to each_entry_safe don't really need a safe version, just a direct list_for_each_entry is enough, this could save a temp variable (tmp) in every function that used rdev_for_each. In this patch, most rdev_for_each loops are replaced by list_for_each_entry, totally save many tmp vars; and only in the other situations that will call list_del to delete an entry, the safe version is used. Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0: make hash_spacing and preshift sector-based.Andre Noll1-29/+29
This patch renames the hash_spacing and preshift members of struct raid0_private_data to spacing and sector_shift respectively and changes the semantics as follows: We always have spacing = 2 * hash_spacing. In case sizeof(sector_t) > sizeof(u32) we also have sector_shift = preshift + 1 while sector_shift = preshift = 0 otherwise. Note that the values of nb_zone and zone are unaffected by these changes because in the sector_div() preceeding the assignement of these two variables both arguments double. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0: Represent the size of strip zones in sectors.Andre Noll1-13/+13
This completes the block -> sector conversion of struct strip_zone. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's.Andre Noll1-21/+25
This patch consists only of these trivial changes. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0 create_strip_zones(): Make two local variables sector-based.Andre Noll1-14/+13
current_offset and curr_zone_offset stored the corresponding offsets as 1K quantities. Rename them to current_start and curr_zone_start to match the naming of struct strip_zone and store the offsets as sector counts. Also, add KERN_INFO to the printk() affected by this change to make checkpatch happy. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0: Represent zone->zone_offset in sectors.Andre Noll1-6/+6
For the same reason as in the previous patch, rename it from zone_offset to zone_start. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0: Represent device offset in sectors.Andre Noll1-5/+4
Rename zone->dev_offset to zone->dev_start to make sure all users have been converted. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0_make_request(): Replace local variable block by sector.Andre Noll1-7/+6
This change already simplifies the code a bit. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0_make_request(): Remove local variable chunk_size.Andre Noll1-4/+3
We might as well use chunk_sects instead. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: raid0_make_request(): Replace chunksize_bits by chunksect_bits.Andre Noll1-5/+5
As ffz(~(2 * x)) = ffz(~x) + 1, we have chunksect_bits = chunksize_bits + 1. Fixup all users accordingly. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: use sysfs_notify_dirent to notify changes to md/sync_action.NeilBrown1-7/+13
There is no compelling need for this, but sysfs_notify_dirent is a nicer interface and the change is good for consistency. Signed-off-by: NeilBrown <neilb@suse.de>
2009-01-09md: fix bitmap-on-external-file bug.NeilBrown1-3/+5
commit a2ed9615e3222645007fc19991aedf30eed3ecfd fixed a bug with 'internal' bitmaps, but in the process broke 'in a file' bitmaps. So they are broken in 2.6.28 This fixes it, and needs to go in 2.6.28-stable. Signed-off-by: NeilBrown <neilb@suse.de> Cc: stable@kernel.org
2009-01-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds4-10/+10
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc64: Work around branch tracer warning. sparc64: Fix unsigned long long warnings in drivers. sparc64: Use unsigned long long for u64. sparc: refactor code in fault_32.c sparc64: refactor code in init_64.c sparc64: refactor code in viohs.c sparc: make proces_ver_nack a bit more readable
2009-01-07Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6Linus Torvalds27-184/+106
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: V4L/DVB (10191a): Update MAINTAINERS entries on media drivers V4L/DVB (10190): cx88: Fix some Kbuild troubles V4L/DVB (10189): dm1105: Fix build with INPUT=m and DVB_DM1105=y V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etc V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initialization V4L/DVB (10181): v4l2-device: Fix some sparse warnings V4L/DVB (10180): drivers/media: Fix a number of sparse warnings V4L/DVB (10179): tda8290: Fix two sparse warnings V4L/DVB (10178): dvb_frontend: Fix some sparse warnings due to static symbols V4L/DVB (10177): Fix sparse warnings on em28xx V4L/DVB (10176b): pxa-camera: fix redefinition warnings and missing DMA definitions V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpage
2009-01-07V4L/DVB (10190): cx88: Fix some Kbuild troublesMauro Carvalho Chehab6-47/+65
As Randy Dunlap <randy.dunlap@oracle.com> reported, cx88 has some compilation issues: drivers/built-in.o: In function `cx88_call_i2c_clients': (.text+0x20af17): undefined reference to `videobuf_dvb_get_frontend' drivers/built-in.o: In function `cx8802_probe': cx88-mpeg.c:(.devinit.text+0x268c4): undefined reference to `videobuf_dvb_alloc_frontend' cx88-mpeg.c:(.devinit.text+0x268ea): undefined reference to `videobuf_dvb_dealloc_frontends' With those configs: CONFIG_VIDEO_CX88=y CONFIG_VIDEO_CX88_BLACKBIRD=y CONFIG_VIDEO_CX88_DVB=m CONFIG_DVB_CORE=m After carefully examining the code, with the current code, several cx88 drivers (cx8800, cx8802, cx88_dvb and cx88_blackbird) should be compiled as a module, if one of them is marked as such. Just fixing Kconfig could create a very complex set of rules. Also, this hides a problem with the current approach where the dvb functionality weren't confined inside dvb module. What happens is that: - cx88-i2c (part of cx8800) has some special rules if DVB; - cx88-mpeg (cx8802 module) has also part of DVB init code; - cx88-dvb has the rest of the dvb code; - cx88-blackbird can be used with cx88-mpeg, having cx88-dvb or not. So, instead of doing some tricks at Kconfig and wait for a next breakage, this patch moves the dvb code inside cx88-i2c and cx88-mpeg into cx88-dvb. Another problem is that cx8802 were being compiled, even without cx88-dvb and cx88-blackbird modules. While on this code, let's fix also a reported problem: http://www.linuxtv.org/pipermail/linux-dvb/2009-January/031225.html A solution for the issue were proposed here: http://www.mail-archive.com/linux-media@vger.kernel.org/msg00021.html Thanks to Randy, Andy, Gregoire and Thomas for helping us to detect and solve the issues. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10189): dm1105: Fix build with INPUT=m and DVB_DM1105=yMauro Carvalho Chehab1-0/+1
As reported by Randy Dunlap <randy.dunlap@oracle.com>: With CONFIG_INPUT=m and CONFIG_DVB_DM1105=y: drivers/built-in.o: In function `input_sync': dm1105.c:(.text+0x120c33): undefined reference to `input_event' drivers/built-in.o: In function `dm1105_emit_key': dm1105.c:(.text+0x120c6c): undefined reference to `input_event' dm1105.c:(.text+0x120c82): undefined reference to `input_event' dm1105.c:(.text+0x120cb2): undefined reference to `input_event' dm1105.c:(.text+0x120cd1): undefined reference to `input_event' drivers/built-in.o: In function `dm1105_ir_init': (.devinit.text+0xd8ae): undefined reference to `input_allocate_device' drivers/built-in.o: In function `dm1105_ir_init': (.devinit.text+0xd9f6): undefined reference to `input_register_device' drivers/built-in.o: In function `dm1105_ir_init': (.devinit.text+0xda09): undefined reference to `input_free_device' drivers/built-in.o: In function `dm1105_ir_exit': (.devexit.text+0xcde): undefined reference to `input_unregister_device' This is due to the lack of a dependency between dm1105 and CONFIG_INPUT Cc: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etcJulia Lawall5-7/+5
This patch extends 134179823b3ca9c8b98e0631906459dbb022ff9b 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. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ 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) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initializationMichael Krufky1-1/+2
Don't call tda8290_init_tuner unless we have either a TDA8275 or TDA8275A present. Calling this function will cause a TDA18271 to get sick, so we should only call it when needed. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10181): v4l2-device: Fix some sparse warningsMauro Carvalho Chehab1-2/+2
/home/v4l/master/v4l/v4l2-device.c:32:2: warning: Using plain integer as NULL pointer /home/v4l/master/v4l/v4l2-device.c:64:2: warning: Using plain integer as NULL pointer Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10180): drivers/media: Fix a number of sparse warningsMauro Carvalho Chehab6-9/+9
anysee.c:44:5: warning: symbol 'dvb_usb_anysee_delsys' was not declared. Should it be static? cx24116.c:378:3: warning: symbol 'CX24116_MODFEC_MODES' was not declared. Should it be static? stb0899_algo.c:57:5: warning: symbol 'stb0899_get_srate' was not declared. Should it be static? stb0899_algo.c:766:6: warning: symbol 'Log2Int' was not declared. Should it be static? stb0899_drv.c:137:20: warning: symbol 'stb0899_quant_tab' was not declared. Should it be static? stb0899_drv.c:180:20: warning: symbol 'stb0899_est_tab' was not declared. Should it be static? stb0899_drv.c:220:5: warning: symbol '_stb0899_read_reg' was not declared. Should it be static? budget-ci.c:1348:23: warning: symbol 'tt3200_stb6100_config' was not declared. Should it be static? /home/v4l/master/v4l/cx25840-core.c:190:6: warning: symbol 'cx25840_work_handler' was not declared. Should it be static? /home/v4l/master/v4l/m5602_s5k83a.c:116:6: warning: symbol 's5k83a_dump_registers' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10179): tda8290: Fix two sparse warningsMauro Carvalho Chehab1-2/+1
/home/v4l/master/v4l/tda8290.c:233:7: warning: symbol 'i' shadows an earlier one /home/v4l/master/v4l/tda8290.c:178:3: warning: symbol 'fm_mode' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10178): dvb_frontend: Fix some sparse warnings due to static symbolsMauro Carvalho Chehab1-11/+15
/home/v4l/master/v4l/dvb_frontend.c:838:19: warning: symbol 'dtv_cmds' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1035:6: warning: symbol 'dtv_property_dump' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1066:5: warning: symbol 'is_legacy_delivery_system' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1080:6: warning: symbol 'dtv_property_cache_sync' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1132:6: warning: symbol 'dtv_property_legacy_params_sync' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1187:6: warning: symbol 'dtv_property_adv_params_sync' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1222:6: warning: symbol 'dtv_property_cache_submit' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1253:5: warning: symbol 'dtv_property_process_get' was not declared. Should it be static? /home/v4l/master/v4l/dvb_frontend.c:1362:5: warning: symbol 'dtv_property_process_set' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10177): Fix sparse warnings on em28xxMauro Carvalho Chehab3-3/+3
/home/v4l/master/v4l/em28xx-core.c:396:25: warning: symbol 'outputs' was not declared. Should it be static? /home/v4l/master/v4l/em28xx-input.c:324:6: warning: symbol 'em28xx_ir_start' was not declared. Should it be static? /home/v4l/master/v4l/em28xx-cards.c:1925:5: warning: symbol 'em28xx_init_dev' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10176b): pxa-camera: fix redefinition warnings and missing DMA definitionsEric Miao2-98/+1
1. now pxa_camera.c uses ioremap() for register access, pxa_camera.h is totally useless. Remove it. 2. <asm/dma.h> does no longer include <mach/dma.h>, include the latter file explicitly delete mode 100644 drivers/media/video/pxa_camera.h Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpageGuennadi Liakhovetski2-4/+2
Not all architectures provide clear_user_page(), but clear_user_highpage() is available everywhere at least via the compatibility inline function. Is this the "trivial patch" that's required for these two drivers? Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07staging: __FUNCTION__ is gcc-specific, use __func__Harvey Harrison64-360/+360
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07trivial: replace last usages of __FUNCTION__ in kernelHarvey Harrison5-10/+10
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6Linus Torvalds41-1088/+1867
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (98 commits) PCI PM: Put PM callbacks in the order of execution PCI PM: Run default PM callbacks for all devices using new framework PCI PM: Register power state of devices during initialization PCI PM: Call pci_fixup_device from legacy routines PCI PM: Rearrange code in pci-driver.c PCI PM: Avoid touching devices behind bridges in unknown state PCI PM: Move pci_has_legacy_pm_support PCI PM: Power-manage devices without drivers during suspend-resume PCI PM: Add suspend counterpart of pci_reenable_device PCI PM: Fix poweroff and restore callbacks PCI: Use msleep instead of cpu_relax during ASPM link retraining PCI: PCIe portdrv: Add kerneldoc comments to remining core funtions PCI: PCIe portdrv: Rearrange code so that related things are together PCI: PCIe portdrv: Fix suspend and resume of PCI Express port services PCI: PCIe portdrv: Add kerneldoc comments to some core functions x86/PCI: Do not use interrupt links for devices using MSI-X net: sfc: Use pci_clear_master() to disable bus mastering PCI: Add pci_clear_master() as opposite of pci_set_master() PCI hotplug: remove redundant test in cpq hotplug PCI: pciehp: cleanup register and field definitions ...
2009-01-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds148-1332/+23869
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (123 commits) wimax/i2400m: add CREDITS and MAINTAINERS entries wimax: export linux/wimax.h and linux/wimax/i2400m.h with headers_install i2400m: Makefile and Kconfig i2400m/SDIO: TX and RX path backends i2400m/SDIO: firmware upload backend i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends i2400m/SDIO: header for the SDIO subdriver i2400m/USB: TX and RX path backends i2400m/USB: firmware upload backend i2400m/USB: probe/disconnect, dev init/shutdown and reset backends i2400m/USB: header for the USB bus driver i2400m: debugfs controls i2400m: various functions for device management i2400m: RX and TX data/control paths i2400m: firmware loading and bootrom initialization i2400m: linkage to the networking stack i2400m: Generic probe/disconnect, reset and message passing i2400m: host/device procotol and core driver definitions i2400m: documentation and instructions for usage wimax: Makefile, Kconfig and docbook linkage for the stack ...
2009-01-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-asyncLinus Torvalds3-87/+121
* git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async: async: don't do the initcall stuff post boot bootchart: improve output based on Dave Jones' feedback async: make the final inode deletion an asynchronous event fastboot: Make libata initialization even more async fastboot: make the libata port scan asynchronous fastboot: make scsi probes asynchronous async: Asynchronous function calls to speed up kernel boot
2009-01-07topology: Fix sparc64 build.David Miller1-0/+1
Due to changeset ba84be2338d3a2b6020d39279335bb06fcd332e1 ("remove linux/hardirq.h from asm-generic/local.h") the sparc64 build started failing on drivers/base/topology.c: drivers/base/topology.c: In function ‘show_physical_package_id’: drivers/base/topology.c:103: error: implicit declaration of function ‘cpu_data’ drivers/base/topology.c:103: error: request for member ‘proc_id’ in something not a structure or union drivers/base/topology.c: In function ‘show_core_id’: drivers/base/topology.c:106: error: request for member ‘core_id’ in something not a structure or union Adding the obvious fix of including asm/cpudata.h into asm/topology.h on sparc64 doesn't fix it, in fact it makes things worse because of the header file dependency chain: linux/gfp.h --> linux/mmzone.h --> linux/topology.h --> asm/topology.h --> asm/cpudata.h --> linux/percpu.h --> linux/slab.h which results in: include/linux/slub_def.h: In function ‘kmalloc_large’: include/linux/slub_def.h:209: error: implicit declaration of function ‘__get_free_pages’ include/linux/slub_def.h:209: error: ‘__GFP_COMP’ undeclared (first use in this function) include/linux/slub_def.h:209: error: (Each undeclared identifier is reported only once include/linux/slub_def.h:209: error: for each function it appears in.) include/linux/slub_def.h:209: warning: cast to pointer from integer of different size The simplest thing to do is to add yet another one-off hack like parts of the guilty changeset did, by putting an explicit linux/hardirq.h include into drivers/base/topology.c Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds27-181/+163
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: reorder struct fw_card for better cache efficiency firewire: fix resetting of bus manager retry counter firewire: improve refcounting of fw_card firewire: typo in comment firewire: fix small memory leak at module removal firewire: fw-sbp2: remove unnecessary locking ieee1934: dv1394: interrupt enabling/disabling broken on big-endian ieee1394: dv1394: annotate frame input/output structs as little endian ieee1394: eth1394: trivial sparse annotations ieee1394: mark bus_info_data as a __be32 array ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro ieee1394: pcilynx: trivial endian annotation ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets ieee1394: consolidate uses of IEEE1934_BUSID_MAGIC ieee1394: ohci1394: flush MMIO writes before delay in initialization ieee1394: ohci1394: pass error codes from request_irq through ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume ieee1394: mark all hpsb_address_ops instances as const ieee1394: replace a GFP_ATOMIC by GFP_KERNEL allocation
2009-01-07Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds26-352/+2517
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (29 commits) hwmon: Fix various typos hwmon: Check for ACPI resource conflicts hwmon: (lm70) Add TI TMP121 support hwmon: (lm70) Code streamlining and cleanup hwmon: Deprecate the fscher and fscpos drivers hwmon: (fschmd) Add watchdog support hwmon: (fschmd) Cleanups for watchdog support hwmon: (i5k_amb) Load automatically on all 5000/5400 chipsets hwmon: (it87) Add support for the ITE IT8720F hwmon: Don't overuse I2C_CLIENT_MODULE_PARM hwmon: Add LTC4245 driver hwmon: (f71882fg) Fix fan_to/from_reg prototypes hwmon: (f71882fg) Printout fan modes hwmon: (f71882fg) Add documentation hwmon: (f71882fg) Fix auto_channels_temp temp numbering with f8000 hwmon: (f71882fg) Add missing pwm3 attr for f71862fg hwmon: (f71882fg) Add F8000 support hwmon: (f71882fg) Remove the fan_mode module option hwmon: (f71882fg) Separate max and crit alarm and beep hwmon: (f71882fg) Check for hwmon powerdown state ...
2009-01-07Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds18-80/+98
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Use snprintf to set adapter names Input: apanel - convert to new i2c binding i2c: Drop I2C_CLASS_CAM_DIGITAL i2c: Drop I2C_CLASS_CAM_ANALOG and I2C_CLASS_SOUND i2c: Drop I2C_CLASS_ALL i2c: Get rid of remaining bus_id access i2c: Replace bus_id with dev_name(), dev_set_name()
2009-01-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6Linus Torvalds1-1/+1
* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6: avr32: Move syscalls.h under arch/avr32/include/asm/ avr32: Define DIE_OOPS avr32: Remove DMATEST from defconfigs arch/avr32: Eliminate NULL test and memset after alloc_bootmem avr32: data param to at32_add_device_mci() must be non-NULL atmel-mci: move atmel-mci.h file to include/linux avr32: Hammerhead board support avr32: Allow reserving multiple pins at once favr-32: Remove deprecated call MIMC200: Remove deprecated call avr: struct device - replace bus_id with dev_name(), dev_set_name() avr32: Introducing asm/syscalls.h
2009-01-07touchscreen: Fix build of da9034Alan Cox1-0/+1
Missing an include and thus breaks the x86-64 build. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds47-65/+65
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits) trivial: chack -> check typo fix in main Makefile trivial: Add a space (and a comma) to a printk in 8250 driver trivial: Fix misspelling of "firmware" in docs for ncr53c8xx/sym53c8xx trivial: Fix misspelling of "firmware" in powerpc Makefile trivial: Fix misspelling of "firmware" in usb.c trivial: Fix misspelling of "firmware" in qla1280.c trivial: Fix misspelling of "firmware" in a100u2w.c trivial: Fix misspelling of "firmware" in megaraid.c trivial: Fix misspelling of "firmware" in ql4_mbx.c trivial: Fix misspelling of "firmware" in acpi_memhotplug.c trivial: Fix misspelling of "firmware" in ipw2100.c trivial: Fix misspelling of "firmware" in atmel.c trivial: Fix misspelled firmware in Kconfig trivial: fix an -> a typos in documentation and comments trivial: fix then -> than typos in comments and documentation trivial: update Jesper Juhl CREDITS entry with new email trivial: fix singal -> signal typo trivial: Fix incorrect use of "loose" in event.c trivial: printk: fix indentation of new_text_line declaration trivial: rtc-stk17ta8: fix sparse warning ...
2009-01-07HID: fix hid->hiddev initialization in hiddev_connect()Jiri Kosina1-0/+2
Commit 079034073fa ("HID: hiddev cleanup -- handle all error conditions properly") by mistake removed proper initialization of hid->hiddev pointer in hiddev_connect() in case usb_register_dev() succeeds for the hiddev node. Put it properly back in place. Reported-and-tested-by: Gabriel C <nix.or.die@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07PCI PM: Put PM callbacks in the order of executionRafael J. Wysocki1-43/+43
Put PM callbacks in drivers/pci/pci-driver.c in the order in which they are executed which makes it much easier to follow the code. No functional changes should result from this. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Run default PM callbacks for all devices using new frameworkRafael J. Wysocki1-82/+53
It should be quite clear that it generally makes sense to execute the default PM callbacks (ie. the callbacks used for handling suspend, hibernation and resume of PCI devices without drivers) for all devices. Of course, the drivers that provide legacy PCI PM support (ie. the ->suspend, ->suspend_late, ->resume_early or ->resume hooks in the pci_driver structure), carry out these operations too, so we can't do it for devices with such drivers. Still, we can make the default PM callbacks run for devices with drivers using the new framework (ie. implement the pm object), since there are no such drivers at the moment. This also simplifies the code and makes it smaller. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Register power state of devices during initializationRafael J. Wysocki1-2/+6
Use the observation that the power state of a PCI device can be loaded into its pci_dev structure as soon as pci_pm_init() is run for it and make that happen. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Call pci_fixup_device from legacy routinesRafael J. Wysocki1-33/+19
The size of drivers/pci/pci-driver.c can be reduced quite a bit if pci_fixup_device() is called from the legacy PM callbacks, so make it happen. No functional changes should result from this. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Rearrange code in pci-driver.cRafael J. Wysocki1-41/+75
Rename two functions and rearrange code in drivers/pci/pci-driver.c so that it's easier to follow. In particular, separate invocations of the legacy callbacks from the rest of the new callbacks' code. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Avoid touching devices behind bridges in unknown stateRafael J. Wysocki3-38/+74
It generally is better to avoid accessing devices behind bridges that may not be in the D0 power state, because in that case the bridges' secondary buses may not be accessible. For this reason, during the early phase of resume (ie. with interrupts disabled), before restoring the standard config registers of a device, check the power state of the bridge the device is behind and postpone the restoration of the device's config space, as well as any other operations that would involve accessing the device, if that state is not D0. In such cases the restoration of the device's config space will be retried during the "normal" phase of resume (ie. with interrupts enabled), so that the bridge can be put into D0 before that happens. Also, save standard configuration registers of PCI devices during the "normal" phase of suspend (ie. with interrupts enabled), so that the bridges the devices are behind can be put into low power states (we don't put bridges into low power states at the moment, but we may want to do it in the future and it seems reasonable to design for that). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI PM: Move pci_has_legacy_pm_supportRafael J. Wysocki1-8/+8
Move pci_has_legacy_pm_support() closer to the functions that call it. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>