linux-2.6
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:17:04 +0000 (11:17 -0700)] 
Merge git://git./linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (61 commits)
  Dynamic debug: fix pr_fmt() build error
  Dynamic debug: allow simple quoting of words
  dynamic debug: update docs
  dynamic debug: combine dprintk and dynamic printk
  sysfs: fix some bin_vm_ops errors
  kobject: don't block for each kobject_uevent
  sysfs: only allow one scheduled removal callback per kobj
  Driver core: Fix device_move() vs. dpm list ordering, v2
  Driver core: some cleanup on drivers/base/sys.c
  Driver core: implement uevent suppress in kobject
  vcs: hook sysfs devices into object lifetime instead of "binding"
  driver core: fix passing platform_data
  driver core: move platform_data into platform_device
  sysfs: don't block indefinitely for unmapped files.
  driver core: move knode_bus into private structure
  driver core: move knode_driver into private structure
  driver core: move klist_children into private structure
  driver core: create a private portion of struct device
  driver core: remove polling for driver_probe_done(v5)
  sysfs: reference sysfs_dirent from sysfs inodes
  ...

Fixed conflicts in drivers/sh/maple/maple.c manually

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:13:06 +0000 (11:13 -0700)] 
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (53 commits)
  ide: use try_to_identify() in ide_driveid_update()
  ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
  ide: sanitize SELECT_MASK() usage in ide_driveid_update()
  ide: classify device type in do_probe()
  ide: remove broken EXABYTENEST support
  ide: shorten timeout value in ide_driveid_update()
  ide: propagate AltStatus workarounds to ide_driveid_update()
  ide: fix kmalloc() failure handling in ide_driveid_update()
  mn10300: remove <asm/ide.h>
  frv: remove <asm/ide.h>
  ide: remove pciirq argument from ide_pci_setup_ports()
  ide: fix ->init_chipset method to return 'int' value
  ide: remove try_to_identify() wrapper
  ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)
  ide: remove no longer needed IRQ fallback code from hwif_init()
  amd74xx: remove no longer needed ->init_hwif method
  ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS
  ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()
  ide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()
  ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:11:23 +0000 (11:11 -0700)] 
Merge git://git./linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (96 commits)
  sh: add support for SMSC Polaris platform
  sh: fix the HD64461 level-triggered interrupts handling
  sh: sh-rtc wakeup support
  sh: sh-rtc invalid time rework
  sh: sh-rtc carry interrupt rework
  sh: disallow kexec virtual entry
  sh: kexec jump: fix for ftrace.
  sh: kexec: Drop SR.BL bit toggling.
  sh: add kexec jump support
  sh: rework kexec segment code
  sh: simplify kexec vbr code
  sh: Flush only the needed range when unmapping a VMA.
  sh: Update debugfs ASID dumping for 16-bit ASID support.
  sh: tlb-pteaex: Kill off legacy PTEA updates.
  sh: Support for extended ASIDs on PTEAEX-capable SH-X3 cores.
  sh: sh7763rdp: Change IRQ number for sh_eth of sh7763rdp
  sh: espt-giga board support
  sh: dma: Make G2 DMA configurable.
  sh: dma: Make PVR2 DMA configurable.
  sh: Move IRQ multi definition of DMAC to defconfig
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
Linus Torvalds [Thu, 26 Mar 2009 18:08:47 +0000 (11:08 -0700)] 
Merge git://git./linux/kernel/git/steve/gfs2-2.6-nmw

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
  GFS2: Fix freeze issue
  Fix a minor bug in the previous patch
  GFS2: Clean up of glops.c
  GFS2: Fix locking bug in failed shared to exclusive conversion
  GFS2: Pagecache usage optimization on GFS2
  GFS2: fix sparse warning: Should it be static?
  GFS2: fix sparse warnings: constant is so big it is ...
  GFS2: Support quota/noquota mount arguments
  GFS2: Fix alignment issue and tidy gfs2_bitfit
  GFS2: Add a "demote a glock" interface to sysfs
  GFS2: Expose UUID via sysfs/uevent
  GFS2: Support generation of discard requests
  GFS2: Fix deadlock on journal flush
  GFS2: Fix error path ref counting for root inode
  GFS2: Remove unused field from glock
  GFS2: Merge lock_dlm module into GFS2
  GFS2: Remove "double" locking in quota
  GFS2: change gfs2_quota_scan into a shrinker
  GFS2: Bring back lvb-related stuff to lock_nolock to support quotas
  GFS2: Fix remount argument parsing

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:05:58 +0000 (11:05 -0700)] 
Merge git://git./linux/kernel/git/hskinnemoen/avr32-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: remove duplicated #include
  avr32: fix out-of-range rjmp instruction on large kernels
  avr32: Fix out-of-range rcalls in large kernels

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:05:17 +0000 (11:05 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (430 commits)
  ALSA: hda - Add quirk for Acer Ferrari 5000
  ALSA: hda - Use cached calls to get widget caps and pin caps
  ALSA: hda - Don't create empty/single-item input source
  ALSA: hda - Fix the wrong pin-cap check in patch_realtek.c
  ALSA: hda - Cache pin-cap values
  ALSA: hda - Avoid output amp manipulation to digital mic pins
  ALSA: hda - Add function id to proc output
  ALSA: pcm - Safer boundary checks
  ALSA: hda - Detect digital-mic inputs on ALC663 / ALC272
  ALSA: sound/ali5451: typo: s/resouces/resources/
  ALSA: hda - Don't show the current connection for power widgets
  ALSA: Fix wrong pointer to dev_err() in arm/pxa2xx-ac97-lib.c
  ASoC: Declare Headset as Mic and Headphone widgets for SDP3430
  ASoC: OMAP: N810: Add more jack functions
  ASoC: OMAP: N810: Mark not connected input pins
  ASoC: Add FLL support for WM8400
  ALSA: hda - Don't reset stream at each prepare callback
  ALSA: hda - Don't reset BDL unnecessarily
  ALSA: pcm - Fix delta calculation at boundary overlap
  ALSA: pcm - Reset invalid position even without debug option
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 26 Mar 2009 18:04:34 +0000 (11:04 -0700)] 
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (29 commits)
  crypto: sha512-s390 - Add missing block size
  hwrng: timeriomem - Breaks an allyesconfig build on s390:
  nlattr: Fix build error with NET off
  crypto: testmgr - add zlib test
  crypto: zlib - New zlib crypto module, using pcomp
  crypto: testmgr - Add support for the pcomp interface
  crypto: compress - Add pcomp interface
  netlink: Move netlink attribute parsing support to lib
  crypto: Fix dead links
  hwrng: timeriomem - New driver
  crypto: chainiv - Use kcrypto_wq instead of keventd_wq
  crypto: cryptd - Per-CPU thread implementation based on kcrypto_wq
  crypto: api - Use dedicated workqueue for crypto subsystem
  crypto: testmgr - Test skciphers with no IVs
  crypto: aead - Avoid infinite loop when nivaead fails selftest
  crypto: skcipher - Avoid infinite loop when cipher fails selftest
  crypto: api - Fix crypto_alloc_tfm/create_create_tfm return convention
  crypto: api - crypto_alg_mod_lookup either tested or untested
  crypto: amcc - Add crypt4xx driver
  crypto: ansi_cprng - Add maintainer
  ...

15 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Thu, 26 Mar 2009 18:04:08 +0000 (11:04 -0700)] 
Merge branch 'next' of git://git./linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: (35 commits)
  [CPUFREQ] Prevent p4-clockmod from auto-binding to the ondemand governor.
  [CPUFREQ] Make cpufreq-nforce2 less obnoxious
  [CPUFREQ] p4-clockmod reports wrong frequency.
  [CPUFREQ] powernow-k8: Use a common exit path.
  [CPUFREQ] Change link order of x86 cpufreq modules
  [CPUFREQ] conservative: remove 10x from def_sampling_rate
  [CPUFREQ] conservative: fixup governor to function more like ondemand logic
  [CPUFREQ] conservative: fix dbs_cpufreq_notifier so freq is not locked
  [CPUFREQ] conservative: amend author's email address
  [CPUFREQ] Use swap() in longhaul.c
  [CPUFREQ] checkpatch cleanups for acpi-cpufreq
  [CPUFREQ] powernow-k8: Only print error message once, not per core.
  [CPUFREQ] ondemand/conservative: sanitize sampling_rate restrictions
  [CPUFREQ] ondemand/conservative: deprecate sampling_rate{min,max}
  [CPUFREQ] powernow-k8: Always compile powernow-k8 driver with ACPI support
  [CPUFREQ] Introduce /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_transition_latency
  [CPUFREQ] checkpatch cleanups for powernow-k8
  [CPUFREQ] checkpatch cleanups for ondemand governor.
  [CPUFREQ] checkpatch cleanups for powernow-k7
  [CPUFREQ] checkpatch cleanups for speedstep related drivers.
  ...

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Thu, 26 Mar 2009 18:03:39 +0000 (11:03 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (71 commits)
  SELinux: inode_doinit_with_dentry drop no dentry printk
  SELinux: new permission between tty audit and audit socket
  SELinux: open perm for sock files
  smack: fixes for unlabeled host support
  keys: make procfiles per-user-namespace
  keys: skip keys from another user namespace
  keys: consider user namespace in key_permission
  keys: distinguish per-uid keys in different namespaces
  integrity: ima iint radix_tree_lookup locking fix
  TOMOYO: Do not call tomoyo_realpath_init unless registered.
  integrity: ima scatterlist bug fix
  smack: fix lots of kernel-doc notation
  TOMOYO: Don't create securityfs entries unless registered.
  TOMOYO: Fix exception policy read failure.
  SELinux: convert the avc cache hash list to an hlist
  SELinux: code readability with avc_cache
  SELinux: remove unused av.decided field
  SELinux: more careful use of avd in avc_has_perm_noaudit
  SELinux: remove the unused ae.used
  SELinux: check seqno when updating an avc_node
  ...

15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Thu, 26 Mar 2009 18:02:50 +0000 (11:02 -0700)] 
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: R2: Fix problem with code that incorrectly modifies ebase.
  MIPS: Change {set,clear,change}_c0_<foo> to return old value.
  MIPS: compat: Remove duplicated #include
  MIPS: VR5500: Enable prefetch
  MIPS: Fix oops in dma_unmap_page on not coherent mips platforms

15 years agowriteback: double the dirty thresholds
Wu Fengguang [Mon, 23 Mar 2009 00:57:38 +0000 (08:57 +0800)] 
writeback: double the dirty thresholds

Enlarge default dirty ratios from 5/10 to 10/20.  This fixes [Bug
#12809] iozone regression with 2.6.29-rc6.

The iozone benchmarks are performed on a 1200M file, with 8GB ram.

  iozone -i 0 -i 1 -i 2 -i 3 -i 4 -r 4k -s 64k -s 512m -s 1200m -b tmp.xls
  iozone -B -r 4k -s 64k -s 512m -s 1200m -b tmp.xls

The performance regression is triggered by commit 1cf6e7d83bf3(mm: task
dirty accounting fix), which makes more correct/thorough dirty
accounting.

The default 5/10 dirty ratios were picked (a) with the old dirty logic
and (b) largely at random and (c) designed to be aggressive.  In
particular, that (a) means that having fixed some of the dirty
accounting, maybe the real bug is now that it was always too aggressive,
just hidden by an accounting issue.

The enlarged 10/20 dirty ratios are just about enough to fix the regression.

[ We will have to look at how this affects the old fsync() latency issue,
  but that probably will need independent work.  - Linus ]

Cc: Nick Piggin <npiggin@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: "Lin, Ming M" <ming.m.lin@intel.com>
Tested-by: "Lin, Ming M" <ming.m.lin@intel.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMake relatime default
Matthew Garrett [Thu, 26 Mar 2009 17:53:14 +0000 (17:53 +0000)] 
Make relatime default

Change the default behaviour of the kernel to use relatime for all
filesystems. This can be overridden with the "strictatime" mount
option.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd a strictatime mount option
Matthew Garrett [Thu, 26 Mar 2009 17:49:56 +0000 (17:49 +0000)] 
Add a strictatime mount option

Add support for explicitly requesting full atime updates. This makes it
possible for kernels to default to relatime but still allow userspace to
override it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAllow relatime to update atime once a day
Matthew Garrett [Thu, 26 Mar 2009 17:32:14 +0000 (17:32 +0000)] 
Allow relatime to update atime once a day

Allow atime to be updated once per day even with relatime. This lets
utilities like tmpreaper (which delete files based on last access time)
continue working, making relatime a plausible default for distributions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Valerie Aurora Henson <vaurora@redhat.com>
Acked-by: Alan Cox <alan@redhat.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoDynamic debug: fix pr_fmt() build error
Greg Banks [Wed, 11 Mar 2009 10:07:28 +0000 (21:07 +1100)] 
Dynamic debug: fix pr_fmt() build error

When CONFIG_DYNAMIC_DEBUG is enabled, allow callers of pr_debug()
to provide their own definition of pr_fmt() even if that definition
uses tricks like

#define pr_fmt(fmt) "%s:" fmt, __func__

Signed-off-by: Greg Banks <gnb@sgi.com>
Cc: Jason Baron <jbaron@redhat.com>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDynamic debug: allow simple quoting of words
Greg Banks [Fri, 6 Feb 2009 01:54:26 +0000 (12:54 +1100)] 
Dynamic debug: allow simple quoting of words

Allow simple quoting of words in the dynamic debug control language.

This allows more natural specification when using the control language
to match against printk formats, e.g

#echo -n 'format "Setting node for non-present cpu" +p' >
/mnt/debugfs/dynamic_debug/control

instead of

#echo -n 'format Setting\040node\040for\040non-present\040cpu +p' >
/mnt/debugfs/dynamic_debug/control

Adjust the dynamic debug documention to describe that and provide a
new example.  Adjust the existing examples in the documentation to
reflect the current whitespace escaping behaviour when reading the
control file.  Fix some minor documentation trailing whitespace.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodynamic debug: update docs
Jason Baron [Thu, 5 Feb 2009 16:53:15 +0000 (11:53 -0500)] 
dynamic debug: update docs

updates the documentation for 'dynamic debug' feature.

Signed-off-by: Greg Banks <gnb@sgi.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodynamic debug: combine dprintk and dynamic printk
Jason Baron [Thu, 5 Feb 2009 16:51:38 +0000 (11:51 -0500)] 
dynamic debug: combine dprintk and dynamic printk

This patch combines Greg Bank's dprintk() work with the existing dynamic
printk patchset, we are now calling it 'dynamic debug'.

The new feature of this patchset is a richer /debugfs control file interface,
(an example output from my system is at the bottom), which allows fined grained
control over the the debug output. The output can be controlled by function,
file, module, format string, and line number.

for example, enabled all debug messages in module 'nf_conntrack':

echo -n 'module nf_conntrack +p' > /mnt/debugfs/dynamic_debug/control

to disable them:

echo -n 'module nf_conntrack -p' > /mnt/debugfs/dynamic_debug/control

A further explanation can be found in the documentation patch.

Signed-off-by: Greg Banks <gnb@sgi.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: fix some bin_vm_ops errors
Hugh Dickins [Mon, 23 Mar 2009 01:41:27 +0000 (01:41 +0000)] 
sysfs: fix some bin_vm_ops errors

Commit 86c9508eb1c0ce5aa07b5cf1d36b60c54efc3d7a
"sysfs: don't block indefinitely for unmapped files" in linux-next
crashes the PowerMac G5 when X starts up.  It's caught out by the way
powerpc's pci_mmap of legacy_mem uses shmem_zero_setup(), substituting
a new vma->vm_file whose private_data no longer points to the bin_buffer
(substitution done because some versions of X crash if that mmap fails).

The fix to this is straightforward: the original vm_file is fput() in
that case, so this mmap won't block sysfs at all, so just don't switch
over to bin_vm_ops if vm_file has changed.

But more fixes made before realizing that was the problem:-

It should not be an error if bin_page_mkwrite() finds no underlying
page_mkwrite().

Check that a file already mmap'ed has the same underlying vm_ops
_before_ pointing vma->vm_ops at bin_vm_ops.

If the file being mmap'ed is a shmem/tmpfs file, don't fail the mmap
on CONFIG_NUMA=y, just because that has a set_policy and get_policy:
provide bin_set_policy, bin_get_policy and bin_migrate.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Eric Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agokobject: don't block for each kobject_uevent
Arjan van de Ven [Thu, 19 Mar 2009 16:09:05 +0000 (09:09 -0700)] 
kobject: don't block for each kobject_uevent

Right now, the kobject_uevent code blocks for each uevent that's being
generated, due to using (for hystoric reasons) UHM_WAIT_EXEC as flag to
call_usermode_helper().  Specifically, the effect is that each uevent
that is being sent causes the code to wake up keventd, then block until
keventd has processed the work. Needless to say, this happens many times
during the system boot.

This patches changes that to UHN_NO_WAIT (brilliant name for a constant
btw) so that we only schedule the work to fire the uevent message, but
do not wait for keventd to process the work.

This removes one of the bottlenecks during boot; each one of them is
only a small effect, but the sum of them does add up.

[Note, distros that need this are broken, they should be setting
CONFIG_UEVENT_HELPER_PATH to "", that way this code path will never be
excuted at all -- gregkh]

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: only allow one scheduled removal callback per kobj
Alex Chiang [Fri, 13 Mar 2009 18:07:36 +0000 (12:07 -0600)] 
sysfs: only allow one scheduled removal callback per kobj

The only way for a sysfs attribute to remove itself (without
deadlock) is to use the sysfs_schedule_callback() interface.

Vegard Nossum discovered that a poorly written sysfs ->store
callback can repeatedly schedule remove callbacks on the same
device over and over, e.g.

$ while true ; do echo 1 > /sys/devices/.../remove ; done

If the 'remove' attribute uses the sysfs_schedule_callback API
and also does not protect itself from concurrent accesses, its
callback handler will be called multiple times, and will
eventually attempt to perform operations on a freed kobject,
leading to many problems.

Instead of requiring all callers of sysfs_schedule_callback to
implement their own synchronization, provide the protection in
the infrastructure.

Now, sysfs_schedule_callback will only allow one scheduled
callback per kobject. On subsequent calls with the same kobject,
return -EAGAIN.

This is a short term fix. The long term fix is to allow sysfs
attributes to remove themselves directly, without any of this
callback hokey pokey.

[cornelia.huck@de.ibm.com: s390 ccwgroup bits]

Reported-by: vegard.nossum@gmail.com
Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: Fix device_move() vs. dpm list ordering, v2
Cornelia Huck [Wed, 4 Mar 2009 11:44:00 +0000 (12:44 +0100)] 
Driver core: Fix device_move() vs. dpm list ordering, v2

dpm_list currently relies on the fact that child devices will
be registered after their parents to get a correct suspend
order. Using device_move() however destroys this assumption, as
an already registered device may be moved under a newly registered
one.

This patch adds a new argument to device_move(), allowing callers
to specify how dpm_list should be adapted.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: some cleanup on drivers/base/sys.c
Zhenwen Xu [Tue, 3 Mar 2009 10:36:02 +0000 (18:36 +0800)] 
Driver core: some cleanup on drivers/base/sys.c

do some cleanup on drivers/base/sys.c

Signed-off-by: Zhenwen Xu <helight.xu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: implement uevent suppress in kobject
Ming Lei [Sun, 1 Mar 2009 13:10:49 +0000 (21:10 +0800)] 
Driver core: implement uevent suppress in kobject

This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:

1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.

2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)

This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.

[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovcs: hook sysfs devices into object lifetime instead of "binding"
Kay Sievers [Mon, 9 Mar 2009 13:18:52 +0000 (14:18 +0100)] 
vcs: hook sysfs devices into object lifetime instead of "binding"

During bootup performance tracing I noticed many occurrences of
vca* device creation and removal, leading to the usual userspace
uevent processing, which are, in this case, rather pointless.

A simple test showing the kernel timing (not including all the
work userspace has to do), gives us these numbers:
  $ time for i in `seq 1000`; do echo a > /dev/tty2; done
  real    0m1.142s
  user    0m0.015s
  sys     0m0.540s

If we move the hook for the vcs* driver core devices from the
tty "binding" to the vc allocation/deallocation, which is what
the vcs* devices represent, we get the following numbers:
  $ time for i in `seq 1000`; do echo a > /dev/tty2; done
  real    0m0.152s
  user    0m0.030s
  sys     0m0.072s

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: fix passing platform_data
Ming Lei [Fri, 13 Mar 2009 15:06:59 +0000 (23:06 +0800)] 
driver core: fix passing platform_data

We will remove platform_data field from struct device until
all platform devices pass its specific data from platfom_device
and all platform drivers use platform specific data passed by
platform_device->platform_data. This kind of conversion will
need a long time, for thousands of files is affected.

To make the conversion easily, we allow platform specific data
passed by struct device or struct platform_device and platform
driver may use it from struct device or struct platform_device.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move platform_data into platform_device
Ming Lei [Sun, 8 Mar 2009 15:13:32 +0000 (23:13 +0800)] 
driver core: move platform_data into platform_device

This patch moves platform_data from struct device into
struct platform_device, based on the two ideas:

1. Now all platform_driver is registered by platform_driver_register,
   which makes probe()/release()/... of platform_driver passed parameter
   of platform_device *, so platform driver can get platform_data from
   platform_device;

2. Other kind of devices do not need to use platform_data, we can
   decrease size of device if moving it to platform_device.

Taking into consideration of thousands of files to be fixed and they
can't be finished in one night(maybe it will take a long time), so we
keep platform_data in device to allow two kind of cases coexist until
all platform devices pass its platfrom data from
platform_device->platform_data.

All patches to do this kind of conversion are welcome.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: don't block indefinitely for unmapped files.
Eric W. Biederman [Wed, 4 Mar 2009 19:57:20 +0000 (11:57 -0800)] 
sysfs: don't block indefinitely for unmapped files.

Modify sysfs bin files so that we can remove the bin file while they are
still mapped.  When the kobject is removed we unmap the bin file and
arrange for future accesses to the mapping to receive SIGBUS.

Implementing this prevents a nasty DOS when pci devices are hot plugged
and unplugged.  Where if any of their resources were mmaped the kernel
could not free up their pci resources or release their pci data
structures.

[akpm@linux-foundation.org: remove unused var]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move knode_bus into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:26:21 +0000 (12:26 -0800)] 
driver core: move knode_bus into private structure

Nothing outside of the driver core should ever touch knode_bus, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move knode_driver into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:25:49 +0000 (12:25 -0800)] 
driver core: move knode_driver into private structure

Nothing outside of the driver core should ever touch knode_driver, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move klist_children into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:24:56 +0000 (12:24 -0800)] 
driver core: move klist_children into private structure

Nothing outside of the driver core should ever touch klist_children, or
knode_parent, so move them out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: create a private portion of struct device
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:23:36 +0000 (12:23 -0800)] 
driver core: create a private portion of struct device

This is to be used to move things out of struct device that no code
outside of the driver core should ever touch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: remove polling for driver_probe_done(v5)
Ming Lei [Sat, 21 Feb 2009 08:45:07 +0000 (16:45 +0800)] 
driver core: remove polling for driver_probe_done(v5)

This patch removes 100ms polling for driver_probe_done in
wait_for_device_probe(), and uses wait_event() instead.
Removing polling in fs initialization may lead to
a faster boot.

This patch also changes the return type of wait_for_device_done()
from int to void.

This patch is against Arjan's patch in linux-next tree.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: reference sysfs_dirent from sysfs inodes
Eric W. Biederman [Wed, 11 Feb 2009 21:20:23 +0000 (13:20 -0800)] 
sysfs: reference sysfs_dirent from sysfs inodes

The sysfs_dirent serves as both an inode and a directory entry
for sysfs.  To prevent the sysfs inode numbers from being freed
prematurely hold a reference to sysfs_dirent from the sysfs inode.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: sysfs_add_one WARNs with full path to duplicate filename
Alex Chiang [Thu, 12 Feb 2009 17:56:59 +0000 (10:56 -0700)] 
sysfs: sysfs_add_one WARNs with full path to duplicate filename

sysfs: sysfs_add_one WARNs with full path to duplicate filename

As a debugging aid, it can be useful to know the full path to a
duplicate file being created in sysfs.

We now will display warnings such as:

sysfs: cannot create duplicate filename '/foo'

when attempting to create multiple files named 'foo' in the sysfs
root, or:

sysfs: cannot create duplicate filename '/bus/pci/slots/5/foo'

when attempting to create multiple files named 'foo' under a
given directory in sysfs.

The path displayed is always a relative path to sysfs_root. The
leading '/' in the path name refers to the sysfs_root mount
point, and should not be confused with the "real" '/'.

Thanks to Alex Williamson for essentially writing sysfs_pathname.

Cc: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver-core: do not register a driver with bus_type not registered
Dave Young [Sat, 14 Feb 2009 13:23:22 +0000 (21:23 +0800)] 
driver-core: do not register a driver with bus_type not registered

If the bus_type is not registerd, driver_register to that bus will cause oops.

I found this bug when test built-in usb serial drivers (ie. aircable driver)
with 'nousb' cmdline params.

In this patch:
1. set the bus->p=NULL when bus_register failed and unregisterd.
2. if bus->p is NULL, driver_register BUG_ON will be triggered.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoscsi/m68k: Kill NCR_700_detect() warnings
Geert Uytterhoeven [Wed, 11 Mar 2009 08:23:52 +0000 (09:23 +0100)] 
scsi/m68k: Kill NCR_700_detect() warnings

The patch from Ming Lei <tom.leiming@gmail.com> entitled:
    platform driver: fix incorrect use of 'platform_bus_type' with 'struct devic
introduced the following warnings on m68k, as `dev' is now a `struct
platform_device *' instead of a `struct device *':

| drivers/scsi/a4000t.c:64: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/mvme16x_scsi.c:67: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/bvme6000_scsi.c:61: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type

I think the below is missing (untested on real hardware).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'
Ming Lei [Fri, 6 Feb 2009 15:40:12 +0000 (23:40 +0800)] 
platform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'

This patch fixes the bug reported in
http://bugzilla.kernel.org/show_bug.cgi?id=11681.

"Lots of device drivers register a 'struct device_driver' with
the '.bus' member set to '&platform_bus_type'. This is wrong,
since the platform_bus functions expect the 'struct device_driver'
to be wrapped up in a 'struct platform_driver' which provides
some additional callbacks (like suspend_late, resume_early).
The effect may be that platform_suspend_late() uses bogus data
outside the device_driver struct as a pointer pointer to the
device driver's suspend_late() function or other hard to
reproduce failures."(Lothar Wassmann)

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Take offset into account when determining number of pages that can be mapped
Ian Abbott [Tue, 24 Feb 2009 17:22:59 +0000 (17:22 +0000)] 
UIO: Take offset into account when determining number of pages that can be mapped

If a UIO memory region does not start on a page boundary but straddles one,
the number of actual pages that overlap the memory region may be calculated
incorrectly because the offset isn't taken into account.  If userspace sets
the mmap length to offset+size, it may fail with -EINVAL if UIO thinks it's
trying to allocate too many pages.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agouio: add the uio_aec driver
Brandon Philips [Tue, 27 Jan 2009 21:00:04 +0000 (13:00 -0800)] 
uio: add the uio_aec driver

UIO driver for the Adrienne Electronics Corporation PCI time code
device.

This device differs from other UIO devices since it uses I/O ports instead of
memory mapped I/O. In order to make it possible for UIO to work with this
device a utility, uioport, can be used to read and write the ports.

uioport is designed to be a setuid program and checks the permissions of
the /dev/uio* node and if the user has write permissions it will use
iopl and out*/in* to access the device.

[1] git clone git://ifup.org/philips/uioport.git

Signed-off-by: Brandon Philips <brandon@ifup.org>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Add name attributes for mappings and port regions
Hans J. Koch [Tue, 6 Jan 2009 23:15:39 +0000 (00:15 +0100)] 
UIO: Add name attributes for mappings and port regions

If a UIO device has several memory mappings, it can be difficult for userspace
to find the right one. The situation becomes even worse if the UIO driver can
handle different versions of a card that have different numbers of mappings.
Benedikt Spranger has such cards and pointed this out to me. Thanks, Bene!

To address this problem, this patch adds "name" sysfs attributes for each
mapping. Userspace can use these to clearly identify each mapping. The name
string is optional. If a driver doesn't set it, an empty string will be
returned, so this patch won't break existing drivers.

The same problem exists for port region information, so a "name" attribute is
added there, too.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: introduce module id table for platform devices
Eric Miao [Wed, 4 Feb 2009 03:52:40 +0000 (11:52 +0800)] 
platform: introduce module id table for platform devices

Now platform_device is being widely used on SoC processors where the
peripherals are attached to the system bus, which is simple enough.

However, silicon IPs for these SoCs are usually shared heavily across
a family of processors, even products from different companies.  This
makes the original simple driver name based matching insufficient, or
simply not straight-forward.

Introduce a module id table for platform devices, and makes it clear
that a platform driver is able to support some shared IP and handle
slight differences across different platforms (by 'driver_data').
Module alias is handled automatically when a MODULE_DEVICE_TABLE()
is defined.

To not disturb the current platform drivers too much, the matched id
entry is recorded and can be retrieved by platform_get_device_id().

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: make better use of to_platform_{device,driver}() macros
Eric Miao [Sat, 31 Jan 2009 14:47:44 +0000 (22:47 +0800)] 
platform: make better use of to_platform_{device,driver}() macros

This helps the code look more consistent and cleaner.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: check bus->match without holding device lock
Ming Lei [Wed, 21 Jan 2009 15:27:47 +0000 (23:27 +0800)] 
driver core: check bus->match without holding device lock

This patch moves bus->match out from driver_probe_device and
does not hold device lock to check the match between a device
and a driver.

The idea has been verified by the commit 6cd495860901,
which leads to a faster boot. But the commit 6cd495860901 has
the following drawbacks: 1),only does the quick check in
the path of __driver_attach->driver_probe_device, not in other
paths; 2),for a matched device and driver, check the same match
twice. It is a waste of cpu ,especially for some drivers with long
device id table (eg. usb-storage driver).

This patch adds a helper of driver_match_device to check the match
in all paths, and testes the match only once.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: Take sysfs_mutex when fetching the root inode.
Eric W. Biederman [Wed, 21 Jan 2009 19:55:11 +0000 (11:55 -0800)] 
sysfs: Take sysfs_mutex when fetching the root inode.

sysfs_get_inode ultimately calls sysfs_count_nlink when the a
directory inode is fectched.  sysfs_count_nlink needs to be
called under the sysfs_mutex to guard against the unlikely
but possible scenario that the root directory is changing
as we are counting the number entries in it, and just in
general to be consistent.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoSYSFS: use standard magic.h for sysfs
Qinghuang Feng [Wed, 14 Jan 2009 07:45:13 +0000 (15:45 +0800)] 
SYSFS: use standard magic.h for sysfs

SYSFS_MAGIC has been added into magic.h, so only use that definition
in magic.h to avoid potential consistency problem.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: get rid of struct device's bus_id string array
Kay Sievers [Sun, 25 Jan 2009 14:17:37 +0000 (15:17 +0100)] 
driver core: get rid of struct device's bus_id string array

Now that all users of bus_id is gone, we can remove it from struct
device.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: FHCI: use dev_name() in place of bus_id.
Sachin Sant [Mon, 16 Feb 2009 13:40:11 +0000 (19:10 +0530)] 
USB: FHCI: use dev_name() in place of bus_id.

Replace references to bus_id with dev_name() to fix fhci driver build break.

drivers/usb/host/fhci-hcd.c:586: error: struct device has no member named bus_id
drivers/usb/host/fhci-hcd.c:653: error: struct device has no member named bus_id
drivers/usb/host/fhci-dbg.c:111: error: struct device has no member named bus_id

Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoPS3: replace bus_id usage
Greg Kroah-Hartman [Mon, 26 Jan 2009 17:12:12 +0000 (09:12 -0800)] 
PS3: replace bus_id usage

These simple debug statments should be using dev_dbg() instead of
accessing bus_id directly (or they should use device_name).

As bus_id is going away, this patch is necessary.

Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
usb: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agowimax: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
wimax: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: inaky.perez-gonzalez@intel.com
Cc: linux-wimax@intel.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomfd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
mfd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: sameo@openedhand.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomca: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
mca: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: James.Bottomley@HansenPartnership.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agogpio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
gpio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoeisa: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
eisa: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodma: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
dma: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dan Williams <dan.j.williams@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
dio: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoamba: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
amba: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agov4l: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
v4l: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mchehab@infradead.org
Cc: linux-media@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodrm: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
drm: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: airlied@linux.ie
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agonet: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
net: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Cc: netdev@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agortc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
rtc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: a.zummo@towertech.it
Cc: rtc-linux@googlegroups.com
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agopcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-pcmcia@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agotc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
tc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: macro@linux-mips.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agosh: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
sh: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoserial: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
serial: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agos390: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
s390: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: schwidefsky@de.ibm.com
Cc: linux-s390@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agorapidio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
rapidio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mporter@kernel.crashing.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agopci: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
pci: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: jbarnes@virtuousgeek.org
Cc: linux-pci@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomtd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
mtd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dwmw2@infradead.org
Cc: linux-mtd@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agommc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
mmc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: drzeus-mmc@drzeus.cx
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agozorro: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
zorro: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agovideo: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
video: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agospi: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
spi: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dbrownell@users.sourceforge.net
Cc: spi-devel-general@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoedac: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
edac: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dougthompson@xmission.com
Cc: bluesmoke-devel@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoide: use try_to_identify() in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:59 +0000 (23:22 +0100)] 
ide: use try_to_identify() in ide_driveid_update()

* Pass pointer to buffer for IDENTIFY data to do_identify()
  and try_to_identify().

* Un-static try_to_identify() and use it in ide_driveid_update().

* Rename try_to_identify() to ide_dev_read_id().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)] 
ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()

Clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
to match try_to_identify().

Also remove superfluous local_irq_enable() call while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: sanitize SELECT_MASK() usage in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)] 
ide: sanitize SELECT_MASK() usage in ide_driveid_update()

Call SELECT_MASK() after ide_fix_driveid().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: classify device type in do_probe()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)] 
ide: classify device type in do_probe()

Defer classifying device type from do_identify() to do_probe().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove broken EXABYTENEST support
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)] 
ide: remove broken EXABYTENEST support

do_identify() marks EXABYTENEST device as non-present and frees
drive->id so enable_nest() has absolutely no chance of working.

The code was like this since at least 2.6.12-rc2 and nobody
has noticed so just remove broken EXABYTENEST support.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: shorten timeout value in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:57 +0000 (23:22 +0100)] 
ide: shorten timeout value in ide_driveid_update()

Shorten timeout value in ide_driveid_update() (30s -> 15s)
to match try_to_identify().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: propagate AltStatus workarounds to ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:55 +0000 (23:22 +0100)] 
ide: propagate AltStatus workarounds to ide_driveid_update()

Propagate AltStatus workarounds from try_to_identify()
to ide_driveid_update().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix kmalloc() failure handling in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)] 
ide: fix kmalloc() failure handling in ide_driveid_update()

* Doing kmalloc() in the middle of command execution is not only ugly
  but leaves drive waiting to send data on kmalloc() failure.  Fix it.

While at it:

* Unify error code paths.

* Fixup error message to be more useful and add missing KERN_ERR level.

* Rename 'stat' variable to 's'.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agomn10300: remove <asm/ide.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)] 
mn10300: remove <asm/ide.h>

* Remove superfluous <asm/intctl-regs.h> include.

* Remove no longer used SUPPORT_SLOW_DATA_PORTS define.

* Move defining SUPPORT_VLB_SYNC to <linux/ide.h>.

* Use __ide_mm_*() macros from <asm-generic/ide_iops.h>
  (MN10300 uses only memory-mapped I/O).

* Remove <asm/ide.h>.

While at it:

* Remove superfluous SPARC64 #ifdef from <linux/ide.h>.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agofrv: remove <asm/ide.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)] 
frv: remove <asm/ide.h>

* Remove superfluous <asm/{setup,io,irq}.h> includes.

* Remove <asm/ide.h>.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove pciirq argument from ide_pci_setup_ports()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)] 
ide: remove pciirq argument from ide_pci_setup_ports()

* Set ->irq explicitly in cs5520.c.

* Remove irq argument from ide_hw_configure().

* Remove pciirq argument from ide_pci_setup_ports().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix ->init_chipset method to return 'int' value
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)] 
ide: fix ->init_chipset method to return 'int' value

* Return 0 instead of dev->irq in ->init_chipset implementations.

* Fix ->init_chipset method to return 'int' value instead of
  'unsigned int' one.

This fixes ->init_chipset handling for host drivers (cs5530, hpt366
and pdc202xx_new) for which it is possible for this method to fail.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove try_to_identify() wrapper
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)] 
ide: remove try_to_identify() wrapper

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)] 
ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)

v2:
Update actual_try_to_identify() documentation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IRQ fallback code from hwif_init()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)] 
ide: remove no longer needed IRQ fallback code from hwif_init()

Then remove no longer used __ide_default_irq().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoamd74xx: remove no longer needed ->init_hwif method
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)] 
amd74xx: remove no longer needed ->init_hwif method

This is now handled by core IDE PCI code.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)] 
ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:51 +0000 (23:22 +0100)] 
ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)] 
ide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)] 
ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()

Move handling of IDE_HFLAG[_FORCE]_LEGACY_IRQS from ide_init_port()
to ide_pci_init_{one,two}().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotrm290: small ->init_hwif cleanup
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)] 
trm290: small ->init_hwif cleanup

Core IDE PCI code takes care of assigning hwif->irq for both ports.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agons87415: small ->init_hwif cleanup
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)] 
ns87415: small ->init_hwif cleanup

Core IDE PCI code takes care of assigning hwif->irq for both ports.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agons87415: use pci_get_legacy_ide_irq()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)] 
ns87415: use pci_get_legacy_ide_irq()

Fix ->init_hwif to use pci_get_legacy_ide_irq() instead of
__ide_default_irq().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoamd74xx: use ide_pci_is_in_compatibility_mode()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)] 
amd74xx: use ide_pci_is_in_compatibility_mode()

Fix ->init_hwif to check if IDE PCI controller is in compatibility
mode instead of checking for hwif->irq == 0.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agomn10300: add pci_get_legacy_ide_irq() to <asm/pci.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)] 
mn10300: add pci_get_legacy_ide_irq() to <asm/pci.h>

Add missing pci_get_legacy_ide_irq() implementation
before it becomes required by core IDE PCI code.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>