Jens Axboe [Sun, 4 Oct 2009 18:36:19 +0000 (20:36 +0200)]
cfq-iosched: don't delay async queue if it hasn't dispatched at all
We cannot delay for the first dispatch of the async queue if it
hasn't dispatched at all, since that could present a local user
DoS attack vector using an app that just did slow timed sync reads
while filling memory.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Martin K. Petersen [Sat, 3 Oct 2009 18:52:01 +0000 (20:52 +0200)]
block: Topology ioctls
Not all users of the topology information want to use libblkid. Provide
the topology information through bdev ioctls.
Also clarify sector size comments for existing BLK ioctls.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe [Sat, 3 Oct 2009 17:46:03 +0000 (19:46 +0200)]
cfq-iosched: use assigned slice sync value, not default
We should use the sysfs modified slice sync value, in case it differs
from the default.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe [Sat, 3 Oct 2009 17:42:18 +0000 (19:42 +0200)]
cfq-iosched: rename 'desktop' sysfs entry to 'low_latency'
Don't think that's necessarily a perfect description of what this
option fiddles with, but it's probably better than 'desktop'.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe [Sat, 3 Oct 2009 14:26:03 +0000 (16:26 +0200)]
cfq-iosched: implement slower async initiate and queue ramp up
This slowly ramps up the async queue depth based on the time
passed since the sync IO, and doesn't allow async at all until
a sync slice period has passed.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Vivek Goyal [Sat, 3 Oct 2009 13:21:27 +0000 (15:21 +0200)]
cfq-iosched: delay async IO dispatch, if sync IO was just done
o Do not allow more than max_dispatch requests from an async queue, if some
sync request has finished recently. This is in the hope that sync activity
is still going on in the system and we might receive a sync request soon.
Most likely from a sync queue which finished a request and we did not enable
idling on it.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe [Fri, 2 Oct 2009 17:27:04 +0000 (19:27 +0200)]
cfq-iosched: add a knob for desktop interactiveness
This is basically identical to what Vivek Goyal posted, but combined
into one and labelled 'desktop' instead of 'fairness'. The goal
is to continue to improve on the latency side of things as it relates
to interactiveness, keeping the questionable bits under this sysfs
tunable so it would be easy for throughput-only people to turn off.
Apart from adding the interactive sysfs knob, it also adds the
behavioural change of allowing slice idling even if the hardware
does tagged command queuing.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jun'ichi Nomura [Thu, 1 Oct 2009 19:16:13 +0000 (21:16 +0200)]
Add a tracepoint for block request remapping
Since 2.6.31 now has request-based device-mapper, it's useful to have
a tracepoint for request-remapping as well as bio-remapping.
This patch adds a tracepoint for request-remapping, trace_block_rq_remap().
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Christoph Hellwig [Wed, 30 Sep 2009 11:54:20 +0000 (13:54 +0200)]
block: allow large discard requests
Currently we set the bio size to the byte equivalent of the blocks to
be trimmed when submitting the initial DISCARD ioctl. That means it
is subject to the max_hw_sectors limitation of the HBA which is
much lower than the size of a DISCARD request we can support.
Add a separate max_discard_sectors tunable to limit the size for discard
requests.
We limit the max discard request size in bytes to 32bit as that is the
limit for bio->bi_size. This could be much larger if we had a way to pass
that information through the block layer.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Christoph Hellwig [Wed, 30 Sep 2009 11:52:12 +0000 (13:52 +0200)]
block: use normal I/O path for discard requests
prepare_discard_fn() was being called in a place where memory allocation
was effectively impossible. This makes it inappropriate for all but
the most trivial translations of Linux's DISCARD operation to the block
command set. Additionally adding a payload there makes the ownership
of the bio backing unclear as it's now allocated by the device driver
and not the submitter as usual.
It is replaced with QUEUE_FLAG_DISCARD which is used to indicate whether
the queue supports discard operations or not. blkdev_issue_discard now
allocates a one-page, sector-length payload which is the right thing
for the common ATA and SCSI implementations.
The mtd implementation of prepare_discard_fn() is replaced with simply
checking for the request being a discard.
Largely based on a previous patch from Matthew Wilcox <matthew@wil.cx>
which did the prepare_discard_fn but not the different payload allocation
yet.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Suresh Jayaraman [Wed, 30 Sep 2009 08:53:48 +0000 (10:53 +0200)]
swapfile: avoid NULL pointer dereference in swapon when s_bdev is NULL
While testing Swap over NFS patchset, I noticed an oops that was triggered
during swapon. Investigating further, the NULL pointer deference is due to the
SSD device check/optimization in the swapon code that assumes s_bdev could never
be NULL.
inode->i_sb->s_bdev could be NULL in a few cases. For e.g. one such case is
loopback NFS mount, there could be others as well. Fix this by ensuring s_bdev
is not NULL before we try to deference s_bdev.
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
H Hartley Sweeten [Sat, 26 Sep 2009 14:19:21 +0000 (16:19 +0200)]
fs/bio.c: move EXPORT* macros to line after function
As mentioned in Documentation/CodingStyle, move EXPORT* macro's
to the line immediately after the closing function brace line.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Zdenek Kabelac [Fri, 25 Sep 2009 04:19:26 +0000 (06:19 +0200)]
Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
introduced in commit
1d54ad6da9192fed5dd3b60224d9f2dfea0dcd82.
Release kobject also in case the request_fn is NULL.
Problem was noticed via kmemleak backtrace when some sysfs entries were
note properly destroyed during device removal:
unreferenced object 0xffff88001aa76640 (size 80):
comm "lvcreate", pid 2120, jiffies
4294885144
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 f0 65 a7 1a 00 88 ff ff .........e......
90 66 a7 1a 00 88 ff ff 86 1d 53 81 ff ff ff ff .f........S.....
backtrace:
[<
ffffffff813f9cc6>] kmemleak_alloc+0x26/0x60
[<
ffffffff8111d693>] kmem_cache_alloc+0x133/0x1c0
[<
ffffffff81195891>] sysfs_new_dirent+0x41/0x120
[<
ffffffff81194b0c>] sysfs_add_file_mode+0x3c/0xb0
[<
ffffffff81197c81>] internal_create_group+0xc1/0x1a0
[<
ffffffff81197d93>] sysfs_create_group+0x13/0x20
[<
ffffffff810d8004>] blk_trace_init_sysfs+0x14/0x20
[<
ffffffff8123f45c>] blk_register_queue+0x3c/0xf0
[<
ffffffff812447e4>] add_disk+0x94/0x160
[<
ffffffffa00d8b08>] dm_create+0x598/0x6e0 [dm_mod]
[<
ffffffffa00de951>] dev_create+0x51/0x350 [dm_mod]
[<
ffffffffa00de823>] ctl_ioctl+0x1a3/0x240 [dm_mod]
[<
ffffffffa00de8f2>] dm_compat_ctl_ioctl+0x12/0x20 [dm_mod]
[<
ffffffff81177bfd>] compat_sys_ioctl+0xcd/0x4f0
[<
ffffffff81036ed8>] sysenter_dispatch+0x7/0x2c
[<
ffffffffffffffff>] 0xffffffffffffffff
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Alexander Beregalov [Thu, 24 Sep 2009 14:15:38 +0000 (16:15 +0200)]
cciss: fix build when !PROC_FS
Fix these build errors when CONFIG_PROC_FS is not set:
drivers/block/cciss.c: In function 'cciss_show_raid_level':
drivers/block/cciss.c:623: error: 'RAID_UNKNOWN' undeclared (first use in this function)
drivers/block/cciss.c:626: error: 'raid_label' undeclared (first use in this function)
drivers/block/cciss.c: In function 'cciss_geometry_inquiry':
drivers/block/cciss.c:2696: error: 'RAID_UNKNOWN' undeclared (first use in this function)
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Martin K. Petersen [Mon, 21 Sep 2009 19:46:05 +0000 (21:46 +0200)]
block: Do not clamp max_hw_sectors for stacking devices
Stacking devices do not have an inherent max_hw_sector limit. Set the
default to INT_MAX so we are bounded only by capabilities of the
underlying storage.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Martin K. Petersen [Fri, 18 Sep 2009 20:54:37 +0000 (22:54 +0200)]
block: Set max_sectors correctly for stacking devices
The topology changes unintentionally caused SAFE_MAX_SECTORS to be set
for stacking devices. Set the default limit to BLK_DEF_MAX_SECTORS and
provide SAFE_MAX_SECTORS in blk_queue_make_request() for legacy hw
drivers that depend on the old behavior.
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe [Fri, 18 Sep 2009 20:24:21 +0000 (22:24 +0200)]
cciss: cciss_host_attr_groups should be const
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:31 +0000 (13:48 -0500)]
cciss: Dynamically allocate the drive_info_struct for each logical drive.
cciss: Dynamically allocate the drive_info_struct for each logical drive.
This reduces the size of the per-hba ctlr_info structure from 106936
bytes to 8132 bytes. That's on 32-bit systems. On 64-bit systems, the
improvement is even bigger. Without this, the ctlr_info struct is so big
that the driver won't even load on a 64 bit system if CISS_MAX_LUN was
at it's current setting of 1024 logical drives.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:26 +0000 (13:48 -0500)]
cciss: Add usage_count attribute to each logical drive in /sys
Add usage_count attribute to each logical drive at
/sys/devices/<dev>/ccissX/cXdY/usage_count for controller X,
logical drive Y. The usage count is the number of times
the device has currently been opened.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:21 +0000 (13:48 -0500)]
cciss: Add a "raid_level" attribute to each logical drive in /sys
and change get rid of some magic numbers in raid lavel decoding.
Add raid_level attribute to each logical drive at
/sys/devices/<dev>/ccissX/cXdY/raid_level for controller X,
logical drive Y
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:15 +0000 (13:48 -0500)]
cciss: fix some magic numbers in the raid-level decoding
cciss: fix some magic numbers in the raid-level decoding
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:10 +0000 (13:48 -0500)]
cciss: Add lunid attribute to each logical drive in /sys
Add lunid attribute to each logical drive at
/sys/devices/<dev>/ccissX/cXdY/lunid for controller X,
logical drive Y
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:05 +0000 (13:48 -0500)]
cciss: Don't check h->busy_initializing in cciss_open().
Don't check h->busy_initializing in cciss_open(). Open won't be
called before things are ready, but h->busy_initializing won't be
unset until after the initial rebuild_lun_table is finished. But,
to read the partitions, cciss_open will be called for each logical
drive during rebuild_lun_table. If cciss_open checks h->busy_initializing,
then the reading of the partition information during the initial
rebuild_lun_table will fail, which is especially bad news if it
happens to be your boot device.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:48:00 +0000 (13:48 -0500)]
cciss: Preserve all 8 bytes of LUN ID for logical drives.
Preserve all 8 bytes of the LunID field returned
by CCISS_REPORT_LOGICAL instead of only saving 4 bytes.
This fixes a bug with logical volume addressing encountered on
an MSA2012.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:55 +0000 (13:47 -0500)]
cciss: Silence noisy per-disk messages output by cciss_read_capacity
Silence noisy per-disk messages output by cciss_read_capacity
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:50 +0000 (13:47 -0500)]
cciss: Fix excessive gendisk freeing bug on driver unload.
Fix bug that free_hba was calling put_disk for all gendisk[]
pointers -- all 1024 of them -- regardless of whether the were
used or not (NULL). This bug could cause rmmod to oops if logical
drives had been deleted during the driver's lifetime.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:44 +0000 (13:47 -0500)]
cciss: Fix usage_count check in rebuild_lun_table when triggered via sysfs.
When rebuild_lun_table is reached via sysfs, the usage count that
is checked prior to messing with c0d0 has different constraints
(must be zero) than if rebuild_lun_table is reached via ioctl
(must be one.) Fix rebuild_lun_table to take that into account.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:39 +0000 (13:47 -0500)]
cciss: Clear all sysfs-exposed data for deleted logical drives.
When removing a logical drive, clear all the information that is
now exposed by sysfs (e.g. vendor, model, serial number.)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:34 +0000 (13:47 -0500)]
cciss: Handle special case for sysfs attributes of the first logical drive.
For c0dx where x is not 0, we handle deletion and addition simply,
but for c0d0, there is the special case that even when there's no
disk, the device node exists so that the controller may be accessed.
So, for c0d0, we only create the sysfs entries once, when a controller
is added, and only remove them once, when a controller is being
taken down.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:29 +0000 (13:47 -0500)]
cciss: Handle cases when cciss_add_disk fails.
Handle cases when cciss_add_disk fails.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:24 +0000 (13:47 -0500)]
cciss: Handle failure of blk_init_queue gracefully in cciss_add_disk.
Handle failure of blk_init_queue gracefully in cciss_add_disk.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:19 +0000 (13:47 -0500)]
cciss: Rearrange logical drive sysfs code to make the "changing a disk" path work.
Rearrange logical drive sysfs code to make the "changing a disk" path work.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:14 +0000 (13:47 -0500)]
cciss: Dynamically allocate struct device for each logical drive as needed.
Dynamically allocate struct device for each logical drive as needed
instead of allocating the maximum we would ever need at driver init time.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Stephen M. Cameron [Thu, 17 Sep 2009 18:47:08 +0000 (13:47 -0500)]
cciss: Remove some unused code in rebuild_lun_table()
Remove some unused code in rebuild_lun_table()
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Andrew Patterson [Thu, 17 Sep 2009 18:47:03 +0000 (13:47 -0500)]
cciss: Allow triggering of rescan of logical drive topology via sysfs entry
Added /sys/bus/pci/devices/<dev>/ccissX/rescan sysfs entry used
to kick off a rescan that discovers logical drive topology changes.
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Andrew Patterson [Thu, 17 Sep 2009 18:46:58 +0000 (13:46 -0500)]
cciss: Use one scan thread per controller and fix hang during rmmod
Replace the use of one scan kthread per controller with one per driver.
Use a queue to hold a list of controllers that need to be rescanned with
routines to add and remove controllers from the queue.
Fix locking and completion handling to prevent a hang during rmmod.
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Andrew Patterson [Thu, 17 Sep 2009 18:46:53 +0000 (13:46 -0500)]
cciss: Remove sysfs entries for logical drives on driver cleanup.
Sysfs entries for logical drives need to be removed when a drive is
deleted during driver cleanup.
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Randy Dunlap [Fri, 18 Sep 2009 19:58:48 +0000 (12:58 -0700)]
cciss: fix schedule_timeout() parameters
Change schedule_timeout() parameter to not be specific to HZ=1000.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Mike Miller <mike.miller@hp.com>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: "Cameron, Steve" <Steve.Cameron@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Alexey Dobriyan [Fri, 18 Sep 2009 19:58:48 +0000 (12:58 -0700)]
dac960: switch to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Alexey Dobriyan [Fri, 18 Sep 2009 19:58:47 +0000 (12:58 -0700)]
cpqarray: switch to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Chirag Kantharia <chirag.kantharia@hp.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Linus Torvalds [Sun, 27 Sep 2009 21:57:48 +0000 (14:57 -0700)]
Linux 2.6.32-rc1
Linus Torvalds [Sun, 27 Sep 2009 21:46:05 +0000 (14:46 -0700)]
alpha: Fix duplicate <asm/thread_info.h> include
.. duplicated by merging the same fix twice, for details see commit
0d9df2515dbceb67d343c0f10fd3ff218380d524 ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dave Young [Sun, 27 Sep 2009 16:00:42 +0000 (16:00 +0000)]
tty: Fix regressions caused by commit
b50989dc
The following commit made console open fails while booting:
commit
b50989dc444599c8b21edc23536fc305f4e9b7d5
Author: Alan Cox <alan@linux.intel.com>
Date: Sat Sep 19 13:13:22 2009 -0700
tty: make the kref destructor occur asynchronously
Due to tty release routines run in a workqueue now, error like the
following will be reported while booting:
INIT open /dev/console Input/output error
It also causes hibernation regression to appear as reported at
http://bugzilla.kernel.org/show_bug.cgi?id=14229
The reason is that now there's latency issue with closing, but when
we open a "closing not finished" tty, -EIO will be returned.
Fix it as per the following Alan's suggestion:
Fun but it's actually not a bug and the fix is wrong in itself as
the port may be closing but not yet being destructed, in which case
it seems to do the wrong thing. Opening a tty that is closing (and
could be closing for long periods) is supposed to return -EIO.
I suspect a better way to deal with this and keep the old console
timing is to split tty->shutdown into two functions.
tty->shutdown() - called synchronously just before we dump the tty
onto the waitqueue for destruction
tty->cleanup() - called when the destructor runs.
We would then do the shutdown part which can occur in IRQ context
fine, before queueing the rest of the release (from tty->magic = 0
... the end) to occur asynchronously
The USB update in -next would then need a call like
if (tty->cleanup)
tty->cleanup(tty);
at the top of the async function and the USB shutdown to be split
between shutdown and cleanup as the USB resource cleanup and final
tidy cannot occur synchronously as it needs to sleep.
In other words the logic becomes
final kref put
make object unfindable
async
clean it up
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
[ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
[ Changed serial naming to match new rules, dropped tty_shutdown as per
comments from Alan Stern - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 27 Sep 2009 18:58:36 +0000 (11:58 -0700)]
ACPI: kill "unused variable ‘i’" warning
Commit
3d5b6fb47a8e68fa311ca2c3447e7f8a7c3a9cf3 ("ACPI: Kill overly
verbose "power state" log messages") removed the actual use of this
variable, but didn't remove the variable itself, resulting in build
warnings like
drivers/acpi/processor_idle.c: In function ‘acpi_processor_power_init’:
drivers/acpi/processor_idle.c:1169: warning: unused variable ‘i’
Just get rid of the now unused variable.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alexey Dobriyan [Sun, 27 Sep 2009 18:29:37 +0000 (22:29 +0400)]
const: mark struct vm_struct_operations
* mark struct vm_area_struct::vm_ops as const
* mark vm_ops in AGP code
But leave TTM code alone, something is fishy there with global vm_ops
being used.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 27 Sep 2009 17:39:04 +0000 (10:39 -0700)]
Merge branch 'timers-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
hrtimer: Eliminate needless reprogramming of clock events device
Linus Torvalds [Sun, 27 Sep 2009 17:38:48 +0000 (10:38 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: IA64=y ACPI=n build fix
ACPI: Kill overly verbose "power state" log messages
ACPI: fix Compaq Evo N800c (Pentium 4m) boot hang regression
ACPI: Clarify resource conflict message
thinkpad-acpi: fix CONFIG_THINKPAD_ACPI_HOTKEY_POLL build problem
Linus Torvalds [Sun, 27 Sep 2009 17:38:34 +0000 (10:38 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Fix hwpoison code related build failure on 32-bit NUMAQ
Len Brown [Sun, 27 Sep 2009 08:17:21 +0000 (04:17 -0400)]
ACPI: IA64=y ACPI=n build fix
ia64's sim_defconfig uses CONFIG_ACPI=n
which now #define's acpi_disabled in <linux/acpi.h>
So we shouldn't re-define it here in <asm/acpi.h>
Signed-off-by: Len Brown <len.brown@intel.com>
Roland Dreier [Thu, 24 Sep 2009 21:52:36 +0000 (14:52 -0700)]
ACPI: Kill overly verbose "power state" log messages
I was recently lucky enough to get a 64-CPU system, so my kernel log
ends up with 64 lines like:
ACPI: CPU0 (power states: C1[C1] C2[C3])
This is pretty useless clutter because this info is already available
after boot from both /sys/devices/system/cpu/cpu*/cpuidle/state?/ as
well as /proc/acpi/processor/CPU*/power.
So just delete the code that prints the C-states in processor_idle.c.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Linus Torvalds [Sat, 26 Sep 2009 16:35:07 +0000 (09:35 -0700)]
x86: Fix hwpoison code related build failure on 32-bit NUMAQ
This build failure triggers:
In file included from include/linux/suspend.h:8,
from arch/x86/kernel/asm-offsets_32.c:11,
from arch/x86/kernel/asm-offsets.c:2:
include/linux/mm.h:503:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
Because due to the hwpoison page flag we ran out of page
flags on 32-bit.
Dont turn on hwpoison on 32-bit NUMA (it's rare in any
case).
Also clean up the Kconfig dependencies in the generic MM
code by introducing ARCH_SUPPORTS_MEMORY_FAILURE.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Zhao Yakui [Sun, 27 Sep 2009 07:30:51 +0000 (03:30 -0400)]
ACPI: fix Compaq Evo N800c (Pentium 4m) boot hang regression
Don't disable ARB_DISABLE when the familary ID is 0x0F.
http://bugzilla.kernel.org/show_bug.cgi?id=14211
This was a 2.6.31 regression, and so this patch
needs to be applied to 2.6.31.stable
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Jean Delvare [Tue, 8 Sep 2009 13:31:46 +0000 (15:31 +0200)]
ACPI: Clarify resource conflict message
The message "ACPI: Device needs an ACPI driver" is misleading. The
device _may_ need an ACPI driver, if the BIOS implemented a custom
API for the device in question (which, AFAIK, can't be checked.) If
not, then either a generic ACPI driver may be used (for example
"thermal"), or nothing can be done (other than a white list).
I propose to reword the message to:
ACPI: If an ACPI driver is available for this device, you should use
it instead of the native driver
which I think is more correct. Comments and suggestions welcome.
I also added a message warning about possible problems and system
instability when users pass acpi_enforce_resources=lax, as suggested
by Len.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Alan Jenkins <sourcejedi.lkml@googlemail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Henrique de Moraes Holschuh [Sun, 27 Sep 2009 00:42:49 +0000 (21:42 -0300)]
thinkpad-acpi: fix CONFIG_THINKPAD_ACPI_HOTKEY_POLL build problem
Fix this problem when CONFIG_THINKPAD_ACPI_HOTKEY_POLL is undefined:
CHECK drivers/platform/x86/thinkpad_acpi.c
drivers/platform/x86/thinkpad_acpi.c:1968:21: error: not an lvalue
CC [M] drivers/platform/x86/thinkpad_acpi.o
drivers/platform/x86/thinkpad_acpi.c: In function 'tpacpi_hotkey_driver_mask_set':
drivers/platform/x86/thinkpad_acpi.c:1968: error: lvalue required as left operand of assignment
Reported-by: Noah Dain <noahdain@gmail.com>
Reported-by: Audrius Kazukauskas <audrius@neutrino.lt>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Linus Torvalds [Sat, 26 Sep 2009 20:39:21 +0000 (13:39 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] implement ticket locks for Itanium
Linus Torvalds [Sat, 26 Sep 2009 17:51:54 +0000 (10:51 -0700)]
Merge git://git./linux/kernel/git/sam/kbuild-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
alpha: fix build after vmlinux.lds.S cleanup
mips: fix build of vmlinux.lds
Linus Torvalds [Sat, 26 Sep 2009 17:50:47 +0000 (10:50 -0700)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
leds: move leds-clevo-mail's probe function to .devinit.text
leds: Fix indentation in LEDS_LP3944 Kconfig entry
leds: Fix LED names
leds: Fix leds-pca9532 whitespace issues
leds: fix coding style in worker thread code for ledtrig-gpio.
leds: gpio-leds: fix typographics fault
leds: Add WM831x status LED driver
Linus Torvalds [Sat, 26 Sep 2009 17:49:42 +0000 (10:49 -0700)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
backlight: new driver for ADP5520/ADP5501 MFD PMICs
backlight: extend event support to also support poll()
backlight/eeepc-laptop: Update the backlight state when we change brightness
backlight/acpi: Update the backlight state when we change brightness
backlight: Allow drivers to update the core, and generate events on changes
backlight: switch to da903x driver to dev_pm_ops
backlight: Add support for the Avionic Design Xanthos backlight device.
backlight: spi driver for LMS283GF05 LCD
backlight: move hp680-bl's probe function to .devinit.text
backlight: Add support for new Apple machines.
backlight: mbp_nvidia_bl: add support for MacBookAir 1,1
backlight: Add WM831x backlight driver
Trivial conflicts due to '#ifdef CONFIG_PM' differences in
drivers/video/backlight/da903x_bl.c
Alexey Dobriyan [Sat, 26 Sep 2009 15:37:22 +0000 (19:37 +0400)]
headers: kref.h redux
* remove asm/atomic.h inclusion from kref.h -- not needed, linux/types.h
is enough for atomic_t
* remove linux/kref.h inclusion from files which do not need it.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 26 Sep 2009 17:15:53 +0000 (10:15 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
futex: Add memory barrier commentary to futex_wait_queue_me()
futex: Fix wakeup race by setting TASK_INTERRUPTIBLE before queue_me()
futex: Correct futex_q woken state commentary
futex: Make function kernel-doc commentary consistent
futex: Correct queue_me and unqueue_me commentary
futex: Correct futex_wait_requeue_pi() commentary
Linus Torvalds [Sat, 26 Sep 2009 17:15:33 +0000 (10:15 -0700)]
Merge branch 'perf-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf tools: Dont use openat()
perf tools: Fix buffer allocation
perf tools: .gitignore += perf*.html
perf tools: Handle relative paths while loading module symbols
perf tools: Fix module symbol loading bug
perf_event, x86: Fix 'perf sched record' crashing the machine
perf_event: Update PERF_EVENT_FORK header definition
perf stat: Fix zero total printouts
Linus Torvalds [Sat, 26 Sep 2009 17:14:41 +0000 (10:14 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clocksource: Resume clocksource without taking the clocksource mutex
Linus Torvalds [Sat, 26 Sep 2009 17:13:54 +0000 (10:13 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
modules, tracing: Remove stale struct marker signature from module_layout()
tracing/workqueue: Use %pf in workqueue trace events
tracing: Fix a comment and a trivial format issue in tracepoint.h
tracing: Fix failure path in ftrace_regex_open()
tracing: Fix failure path in ftrace_graph_write()
tracing: Check the return value of trace_get_user()
tracing: Fix off-by-one in trace_get_user()
Linus Torvalds [Sat, 26 Sep 2009 17:13:35 +0000 (10:13 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Remove redundant non-NUMA topology functions
x86: early_printk: Protect against using the same device twice
x86: Reduce verbosity of "PAT enabled" kernel message
x86: Reduce verbosity of "TSC is reliable" message
x86: mce: Use safer ways to access MCE registers
x86: mce, inject: Use real inject-msg in raise_local
x86: mce: Fix thermal throttling message storm
x86: mce: Clean up thermal throttling state tracking code
x86: split NX setup into separate file to limit unstack-protected code
xen: check EFER for NX before setting up GDT mapping
x86: Cleanup linker script using new linker script macros.
x86: Use section .data.page_aligned for the idt_table.
x86: convert to use __HEAD and HEAD_TEXT macros.
x86: convert compressed loader to use __HEAD and HEAD_TEXT macros.
x86: fix fragile computation of vsyscall address
Linus Torvalds [Sat, 26 Sep 2009 17:12:03 +0000 (10:12 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (32 commits)
ACPI: i2c-scmi: don't use acpi_device_uid()
ACPI: simplify building device HID/CID list
ACPI: remove acpi_device_uid() and related stuff
ACPI: remove acpi_device.flags.hardware_id
ACPI: remove acpi_device.flags.compatible_ids
ACPI: maintain a single list of _HID and _CID IDs
ACPI: make sure every acpi_device has an ID
ACPI: use acpi_device_hid() when possible
ACPI: fix synthetic HID for \_SB_
ACPI: handle re-enumeration, when acpi_devices might already exist
ACPI: factor out device type and status checking
ACPI: add acpi_bus_get_status_handle()
ACPI: use acpi_walk_namespace() to enumerate devices
ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE
ACPI: enumerate namespace before adding functional fixed hardware devices
ACPI: convert acpi_bus_scan() to operate on an acpi_handle
ACPI: add acpi_bus_get_parent() and remove "parent" arguments
ACPI: remove unnecessary argument checking
ACPI: remove redundant "type" arguments
ACPI: remove acpi_device_set_context() "type" argument
...
Linus Torvalds [Sat, 26 Sep 2009 17:11:13 +0000 (10:11 -0700)]
Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block
* 'writeback' of git://git.kernel.dk/linux-2.6-block:
writeback: pass in super_block to bdi_start_writeback()
Linus Torvalds [Sat, 26 Sep 2009 17:10:35 +0000 (10:10 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: fix locking and list handling code in cifs_open and its helper
[CIFS] Remove build warning
cifs: fix problems with last two commits
[CIFS] Fix build break when keys support turned off
cifs: eliminate cifs_init_private
cifs: convert oplock breaks to use slow_work facility (try #4)
cifs: have cifsFileInfo hold an extra inode reference
cifs: take read lock on GlobalSMBSes_lock in is_valid_oplock_break
cifs: remove cifsInodeInfo.oplockPending flag
cifs: fix oplock request handling in posix codepath
[CIFS] Re-enable Lanman security
Linus Torvalds [Sat, 26 Sep 2009 17:09:39 +0000 (10:09 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
at91_can: Forgotten git 'add' of at91_can.c
TI Davinci EMAC: Fix in vector definition for EMAC_VERSION_2
ax25: Fix ax25_cb refcounting in ax25_ctl_ioctl
virtio_net: Check for room in the vq before adding buffer
virtio_net: avoid (most) NETDEV_TX_BUSY by stopping queue early.
virtio_net: formalize skb_vnet_hdr
virtio_net: don't free buffers in xmit ring
virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb.
virtio_net: skb_orphan() and nf_reset() in xmit path.
Linus Torvalds [Sat, 26 Sep 2009 17:08:23 +0000 (10:08 -0700)]
Merge git://git./linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: vio: Kill BUILD_BUG_ON() in vio_dring_avail().
Trivial conflict in arch/sparc/include/asm/vio.h due to David removing
the whole messy BUG_ON that was confused.
Nicolas Pitre [Fri, 25 Sep 2009 20:28:02 +0000 (16:28 -0400)]
make Linux bootable on ARM again
Commit
200b812d00 "Clear the exclusive monitor when returning from an
exception" broke the vast majority of ARM systems in the wild which are
still pre ARMv6. The kernel is crashing on the first occurrence of an
exception due to the removal of the actual return instruction for them.
Let's add it back.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Hennerich [Thu, 17 Sep 2009 18:29:52 +0000 (14:29 -0400)]
backlight: new driver for ADP5520/ADP5501 MFD PMICs
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Henrique de Moraes Holschuh [Sun, 20 Sep 2009 17:44:47 +0000 (14:44 -0300)]
backlight: extend event support to also support poll()
Extend the backlight event support to also allow the use of
poll()/select() on actual_brightness.
We already have the entire event hookup anyway, adding a single
function call in one line to get functionality like that is a really
good deal.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Bjorn Helgaas [Sat, 26 Sep 2009 03:11:43 +0000 (21:11 -0600)]
ACPI: i2c-scmi: don't use acpi_device_uid()
We recently removed the acpi_device_uid() interface because nobody
used it. I don't think it's essential here either.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Len Brown [Sat, 26 Sep 2009 05:08:55 +0000 (01:08 -0400)]
Merge branch 'thinkpad-2.6.32-part2' into release
Len Brown [Sat, 26 Sep 2009 05:08:43 +0000 (01:08 -0400)]
Merge branch 'bjorn-HID' into release
Jens Axboe [Fri, 25 Sep 2009 22:07:46 +0000 (00:07 +0200)]
writeback: pass in super_block to bdi_start_writeback()
Sometimes we only want to write pages from a specific super_block,
so allow that to be passed in.
This fixes a problem with commit
56a131dcf7ed36c3c6e36bea448b674ea85ed5bb
causing writeback on all super_blocks on a bdi, where we only really
want to sync a specific sb from writeback_inodes_sb().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
David S. Miller [Fri, 25 Sep 2009 19:14:43 +0000 (12:14 -0700)]
at91_can: Forgotten git 'add' of at91_can.c
Signed-off-by: David S. Miller <davem@davemloft.net>
Sriram [Thu, 24 Sep 2009 19:15:18 +0000 (19:15 +0000)]
TI Davinci EMAC: Fix in vector definition for EMAC_VERSION_2
In the emac_poll function when looking for interrupt status masks
correct definition must be chosen based on EMAC_VERSION(the bit
mask has changed from version 1 to version 2).
Signed-off-by: Sriram <srk@ti.com>
Acked-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jarek Poplawski [Fri, 25 Sep 2009 03:10:38 +0000 (03:10 +0000)]
ax25: Fix ax25_cb refcounting in ax25_ctl_ioctl
Use ax25_cb_put after ax25_find_cb in ax25_ctl_ioctl.
Reported-by: Bernard Pidoux F6BVP <f6bvp@free.fr>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Reviewed-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:40 +0000 (13:35 -0600)]
ACPI: simplify building device HID/CID list
Minor code cleanup, no functional change. Instead of remembering
what HIDs & CIDs to add later, just add them immediately.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:35 +0000 (13:35 -0600)]
ACPI: remove acpi_device_uid() and related stuff
Nobody uses acpi_device_uid(), so this patch removes it.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:29 +0000 (13:35 -0600)]
ACPI: remove acpi_device.flags.hardware_id
Every acpi_device has at least one ID (if there's no _HID or _CID, we
give it a synthetic or default ID). So there's no longer a need to
check whether an ID exists; we can just use it.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:24 +0000 (13:35 -0600)]
ACPI: remove acpi_device.flags.compatible_ids
We now keep a single list of IDs that includes both the _HID and any
_CIDs. We no longer need to keep track of whether the device has a _CID.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:19 +0000 (13:35 -0600)]
ACPI: maintain a single list of _HID and _CID IDs
There's no need to treat _HID and _CID differently. Keeping them in
a single list makes code that uses the IDs a little simpler because it
can just traverse the list rather than checking "do we have a HID?",
"do we have any CIDs?"
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:14 +0000 (13:35 -0600)]
ACPI: make sure every acpi_device has an ID
This makes sure every acpi_device has at least one ID. If we build an
acpi_device for a namespace node with no _HID or _CID, we sometimes
synthesize an ID like "LNXCPU" or "LNXVIDEO". If we don't even have
that, give it a default "device" ID.
Note that this means things like:
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/HWP0001:00/HWP0002:04/device:00
(a PCI slot SxFy device) will have "hid" and "modprobe" entries, where
they didn't before. These aren't very useful (a HID of "device" doesn't
tell you what *kind* of device it is, so it doesn't help find a driver),
but I don't think they're harmful.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:09 +0000 (13:35 -0600)]
ACPI: use acpi_device_hid() when possible
Use acpi_device_hid() rather than accessing acpi_device.pnp.hardware_id
directly.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:35:04 +0000 (13:35 -0600)]
ACPI: fix synthetic HID for \_SB_
This makes \_SB_ show up as /sys/devices/LNXSYSTM:00/LNXSYBUS:00
rather than "device:00". This has been broken for a loooong time
(at least since 2.6.13) because device->parent is an acpi_device
pointer, not a handle.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:30:11 +0000 (19:30 +0000)]
ACPI: handle re-enumeration, when acpi_devices might already exist
acpi_bus_scan() traverses the namespace to enumerate devices and uses
acpi_add_single_object() to create acpi_devices. When the platform
notifies us of a hot-plug event, we need to traverse part of the namespace
again to figure out what appeared or disappeared. (We don't yet call
acpi_bus_scan() during hot-plug, but I plan to do that in the future.)
This patch makes acpi_add_single_object() notice when we already have
an acpi_device, so we don't need to make a new one.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:30:06 +0000 (19:30 +0000)]
ACPI: factor out device type and status checking
This patch adds acpi_bus_type_and_status(), which determines the type
of the object and whether we want to build an acpi_device for it. If
it is acpi_device-worthy, it returns the type and the device's current
status.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:30:01 +0000 (19:30 +0000)]
ACPI: add acpi_bus_get_status_handle()
Add acpi_bus_get_status_handle() so we can get the status of a namespace
object before building a struct acpi_device.
This removes a use of "device->flags.dynamic_status", a cached indicator of
whether _STA exists. It seems simpler and more reliable to just evaluate
_STA and catch AE_NOT_FOUND errors.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:56 +0000 (19:29 +0000)]
ACPI: use acpi_walk_namespace() to enumerate devices
acpi_bus_scan() currently walks the namespace manually. This patch changes
it to use acpi_walk_namespace() instead.
Besides removing some complicated code, this means we take advantage of the
namespace locking done by acpi_walk_namespace(). The locking isn't so
important at boot-time, but I hope to eventually use this same path to
handle hot-addition of devices, when it will be important.
Note that acpi_walk_namespace() does not actually visit the starting node
first, so we need to do that by hand first.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:50 +0000 (19:29 +0000)]
ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE
We can identify the root of the ACPI device tree by the fact that it
has no parent. This is simpler than passing around ACPI_BUS_TYPE_SYSTEM
and will help remove special treatment of the device tree root.
Currently, we add the root by hand with ACPI_BUS_TYPE_SYSTEM. If we
traverse the tree treating the root as just another device and use
acpi_get_type(), the root shows up as ACPI_TYPE_DEVICE.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:45 +0000 (19:29 +0000)]
ACPI: enumerate namespace before adding functional fixed hardware devices
This patch changes the order so we enumerate in the "root, namespace,
functional fixed" order instead of the "root, functional fixed, namespace"
order. When I change acpi_bus_scan() to use acpi_walk_namespace(), it
will use the former order, so this patch isolates the order change for
bisectability.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:40 +0000 (19:29 +0000)]
ACPI: convert acpi_bus_scan() to operate on an acpi_handle
This patch changes acpi_bus_scan() to take an acpi_handle rather than an
acpi_device pointer. I plan to use acpi_bus_scan() in the hotplug path,
and I'd rather not assume that notifications only go to nodes that already
have acpi_devices.
This will also help remove the special case for adding the root node. We
currently add the root by hand before acpi_bus_scan(), but using a handle
here means we can start the acpi_bus_scan() directly with the root even
though it doesn't have an acpi_device yet.
Note that acpi_bus_scan() currently adds and/or starts the *children* of
its device argument. It doesn't do anything with the device itself.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:35 +0000 (19:29 +0000)]
ACPI: add acpi_bus_get_parent() and remove "parent" arguments
This patch adds acpi_bus_get_parent(), which ascends the namespace until
it finds a parent with an acpi_device.
Then we use acpi_bus_get_parent() in acpi_add_single_object(), so callers
don't have to figure out or keep track of the parent acpi_device.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:30 +0000 (19:29 +0000)]
ACPI: remove unnecessary argument checking
acpi_add_single_object() is static, and all callers supply a valid "child"
argument, so we don't need to check it. This patch also remove some
unnecessary initializations.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:25 +0000 (19:29 +0000)]
ACPI: remove redundant "type" arguments
We now save the ACPI bus "device_type" in the acpi_device structure, so
we don't need to pass it around explicitly anymore.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:20 +0000 (19:29 +0000)]
ACPI: remove acpi_device_set_context() "type" argument
We only pass the "type" to acpi_device_set_context() so we know whether
the device has a handle to which we can attach the acpi_device pointer.
But it's safer to just check for the handle directly, since it's in the
acpi_device already.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:15 +0000 (19:29 +0000)]
ACPI: use device_type rather than comparing HID
Check the acpi_device device_type rather than the HID.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Bjorn Helgaas [Mon, 21 Sep 2009 19:29:10 +0000 (19:29 +0000)]
ACPI: save device_type in acpi_device
Most uses of the ACPI bus device_type (ACPI_BUS_TYPE_DEVICE,
ACPI_BUS_TYPE_POWER, etc) are during device initialization, but
we do need it later for notify handler installation, since that
is different for fixed hardware devices vs. namespace devices.
This patch saves the device_type in the acpi_device structure,
so we can check that rather than comparing against the _HID string.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>