Andrew Morton [Fri, 14 May 2004 12:46:55 +0000 (05:46 -0700)]
[PATCH] dentry qstr consolidation
When dentries are given an external name we currently allocate an entire qstr
for the external name.
This isn't needed. We can use the internal qstr and kmalloc only the string
itself. This saves 12 bytes from externally-allocated names and 4 bytes from
the dentry itself.
The saving of 4 bytes from the dentry doesn't actually decrease the dentry's
storage requirements, but it makes four more bytes available for internal
names, taking the internal/external ratio from 89% up to 93% on my 1.5M files.
Fix:
The qstr consolidation wasn't quite right, because it can cause qstr->len to
be unstable during lookup lockless traverasl.
Fix that up by taking d_lock earlier in lookup. This serialises against
d_move.
Take the lock after comparing the parent and hash to preserve the
mostly-lockless behaviour.
Andrew Morton [Fri, 14 May 2004 12:46:12 +0000 (05:46 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o-makefile-cleanup.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* The Kconfig and Makefile in drivers/message/i2o still got a CONFIG_I2O_PCI
entry, which is not used anymore. This one is replaced by a
CONFIG_I2O_CONFIG entry, which now builds the i2o_config module.
Andrew Morton [Fri, 14 May 2004 12:46:01 +0000 (05:46 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o-64-bit-fix.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* provides i2o_context_list_*() functions, which maps 64-bit pointers to
32-bit context id's in a dynamic list. On 32-bit systems the functions are
replaced with a static inline.
* i2o_scsi now uses the i2o_context_list_*() functions for transaction
context, and therefore now work on 64-bit systems too.
Andrew Morton [Fri, 14 May 2004 12:45:50 +0000 (05:45 -0700)]
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o_block-cleanup.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com>
* more than 3 "visible" disks (hda, hdb, hdc, hdd) lead to kernel panics.
* removes some unused code with partitions.
* I2O_LOCK was often called with the addresses of the controller, and not
with the address of the device. Fixed.
* the cleanup function for gendisk (del_gendisk) doesn't work if the queue
is shared between different devices. To workaround the queue is removed
before.
* redundant code removed in module initialization and remove, use
i2ob_new_device and i2ob_del_device instead.
* removed atomic_t queue_depth
* removed unnecessary and bogus code for queue handling
Andrew Morton [Fri, 14 May 2004 12:44:57 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: core
From: Ashok Raj <ashok.raj@intel.com>
Supports basic ability to enable hotplug functions for IA64.
Code is just evolving, and there are several loose ends to tie up.
What this code drop does
- Support logical online and offline
- Handles interrupt migration without loss of interrupts.
- Handles stress fine > 24+ hrs with make -j/ftp/rcp workloads
- Handles irq migration from a dying cpu without loss of interrupts.
What needs to be done
- Boot CPU removal support, with platform level authentication
- Putting cpu being removed in BOOT_RENDEZ mode.
With a hotplug capable kernel, there is a requirement to distinguish a
possible CPU from one actually present. The set of possible CPU numbers
doesn't change during a single system boot, but the set of present CPUs
changes as CPUs are physically inserted into or removed from a system. The
cpu_possible_map does not change once initialized at boot, but the
cpu_present_map changes dynamically as CPUs are inserted or removed.
Paul Jackson <pj@sgi.com> provided an expanded explanation:
Ashok's cpu hot plug patch adds a cpu_present_map, resulting in the following
cpu maps being available. All the following maps are fixed size bitmaps of
size NR_CPUS.
#ifdef CONFIG_HOTPLUG_CPU
cpu_possible_map - map with all NR_CPUS bits set
cpu_present_map - map with bit 'cpu' set iff cpu is populated
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler
#else
cpu_possible_map - map with bit 'cpu' set iff cpu is populated
cpu_present_map - copy of cpu_possible_map
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler
#endif
In either case, NR_CPUS is fixed at compile time, as the static size of these
bitmaps. The cpu_possible_map is fixed at boot time, as the set of CPU id's
that it is possible might ever be plugged in at anytime during the life of
that system boot. The cpu_present_map is dynamic(*), representing which CPUs
are currently plugged in. And cpu_online_map is the dynamic subset of
cpu_present_map, indicating those CPUs available for scheduling.
If HOTPLUG is enabled, then cpu_possible_map is forced to have all NR_CPUS
bits set, otherwise it is just the set of CPUs that ACPI reports present at
boot.
If HOTPLUG is enabled, then cpu_present_map varies dynamically, depending on
what ACPI reports as currently plugged in, otherwise cpu_present_map is just a
copy of cpu_possible_map.
(*) Well, cpu_present_map is dynamic in the hotplug case. If not hotplug,
it's the same as cpu_possible_map, hence fixed at boot.
Andrew Morton [Fri, 14 May 2004 12:44:34 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: /proc rework
From: Ashok Raj <ashok.raj@intel.com>
Changes proc entries for cpu hotplug to be created via the cpu hotplug
notifier callbacks. Also fixed a bug in the removal code that did not remove
proc entries as expected.
Andrew Morton [Fri, 14 May 2004 12:44:23 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: IRQ affinity work
From: Ashok Raj <ashok.raj@intel.com>
irq affinity setting via /proc was forcing iosapic rte programming by force.
The correct way to do this is to perform this when a interrupt is pending.
Andrew Morton [Fri, 14 May 2004 12:44:13 +0000 (05:44 -0700)]
[PATCH] ia64 cpu hotplug: sysfs additions
From: Ashok Raj <ashok.raj@intel.com>
Creation of sysfs via topology_init() creates sysfs entries. The creation of
the online control file is created separately when the cpu_up is invoked in
arch independent code.
Andrew Morton [Fri, 14 May 2004 12:43:39 +0000 (05:43 -0700)]
[PATCH] swap speedups and fix
From: Andrea Arcangeli <andrea@suse.de>
I don't think we need an install_swap_bdev/remove_swap_bdev anymore, we should
use the swap_info->bdev, not the swap_bdevs. the swap_info already has a
->bdev field, the only point of remove_swap_bdev/install_swap_bdev was to
unplug all devices as efficiently as possible, we don't need that anymore with
the page parameter.
Plus the semaphore should be a rwsem to allow parallel unplug from multiple
pages.
After that I don't need to take the semaphore anymore during swapon, no
swapcache with swp_type() pointing to such bdev, will be allowed until swapon
is complete (SWP_ACTIVE is set a lot later after setting p->bdev).
In swapoff I only need a dummy serialization with the readers, after
try_to_unuse is complete:
Andrew Morton [Fri, 14 May 2004 12:43:07 +0000 (05:43 -0700)]
[PATCH] Add blk_run_page()
From: Andrea Arcangeli <andrea@suse.de>
From: Jens Axboe
Add blk_run_page() API. This is so that we can pass the target page all the
way down to (for example) the swap unplug function. So swap can work out
which blockdevs back this particular page.
Andrew Morton [Fri, 14 May 2004 12:42:56 +0000 (05:42 -0700)]
[PATCH] rmap-5-swap_unplug-page-revert
Revert the pre-2.6.6 per-address-space unplugging changes. This removes a
swapper_space exceptionality, syncs things with Andrea and provides for
simplification of the swap unplug function.
Andrew Morton [Fri, 14 May 2004 12:42:34 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: apply to buffer_head functions
From: William Lee Irwin III <wli@holomorphy.com>
This patch implements wake-one semantics for buffer_head wakeups in a single
step. The buffer_head being waited on is passed to the waiter's wakeup
function by the waker, and the wakeup function compares that to the a pointer
stored in its on-stack structure and checking the readiness of the bit there
also. Wake-one semantics are achieved by using WQ_FLAG_EXCLUSIVE in the
codepaths waiting to acquire the bit for mutual exclusion.
Andrew Morton [Fri, 14 May 2004 12:42:25 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: apply to pagecache functions
From: William Lee Irwin III <wli@holomorphy.com>
This patch implements wake-one semantics for page wakeups in a single step.
Discrimination between distinct pages is achieved by passing the page to the
wakeup function, which compares it to a pointer in its own on-stack structure
containing the waitqueue element and the page. Bit discrimination is achieved
by storing the bit number in that same structure and testing the bit in the
wakeup function. Wake-one semantics are achieved by using WQ_FLAG_EXCLUSIVE
in the codepaths waiting to acquire the bit for mutual exclusion.
Andrew Morton [Fri, 14 May 2004 12:42:14 +0000 (05:42 -0700)]
[PATCH] filtered wakeups: wakeup enhancements
From: William Lee Irwin III <wli@holomorphy.com>
This patch provides an additional argument to __wake_up_common() so that the
information wakefunc.patch made waiters ready to receive may be passed to them
by wakers. This is provided as a separate patch so that the overhead of the
additional argument to __wake_up_common() can be measured in isolation. No
change in performance was observable here.
Andrew Morton [Fri, 14 May 2004 12:42:03 +0000 (05:42 -0700)]
[PATCH] filtered wakeups
From: William Lee Irwin III <wli@holomorphy.com>
This patch series is solving the "thundering herd" problem that occurs in the
mainline implementation of hashed waitqueues. There are two sources of
spurious wakeups in such arrangements:
(a) Hash collisions that place waiters on different objects on the same
waitqueue, which wakes threads falsely when any of the objects hashed to
the same queue receives a wakeup. i.e. loss of information about which
object a wakeup event is related to.
(b) Loss of information about which object a given waiter is waiting on.
This precludes wake-one semantics for mutual exclusion scenarios. For
instance, a lock bit may be slept on. If there are any waiters on the
object, a lock bit release event must wake at least one of them so as to
prevent deadlock. But without information as to which waiter is waiting
on which object, we must resort to waking all waiters who could possibly
be waiting on it. Now, as the lock bit provides mutual exclusion, only
one of the waiters woken can proceed, and the remainder will go back to
sleep and wait for another event, creating unnecessary system load. Once
wake-one semantics are established, only one of the waiters waiting to
acquire a lock bit need to be woken, which measurably reduces system load
and improves efficiency (i.e. it's the subject of the benchmarking I've
been sending to you).
Even beyond the measurable efficiency gains, there are reasons of robustness
and responsiveness to motivate addressing the issue of thundering herds. In a
real-life scenario I've been personally involved in resolving, the thundering
herd issue caused powerful modern SMP machines with fast IO systems to be
unresponsive to user input for a minute at a time or more. Analogues of these
patches for the distro kernels involved fully resolved the issue to the
customer's satisfaction and obviated workarounds to limit the pagecache's
size.
The latest spin of these patches basically shoves more pieces of the logic
into the wakeup functions, with some efficiency gains from sharing the hot
codepath with the rest of the kernel, and a slightly larger diff than the
patches with the newly-introduced entrypoint. Writing these was motivated by
the push to insulate sched.c from more of the details of wakeup semantics by
putting more of the logic into the wakeup functions. In order to accomplish
this while still solving (b), the wakeup functions grew a new argument for
communication about what object a wakeup event is related to to be passed by
the waker.
=========
This patch provides an additional argument to wakeup functions so that
information may be passed from the waker to the waiter. This is provided as a
separate patch so that the overhead of the additional argument can be measured
in isolation. No change in performance was observable here.
Andrew Morton [Fri, 14 May 2004 12:41:41 +0000 (05:41 -0700)]
[PATCH] VM accounting fix
From: Hugh Dickins <hugh@veritas.com>
Stas Sergeev <stsp@aknet.ru> wrote:
mprotect() fails to merge VMAs because one VMA can end up with
VM_ACCOUNT flag set, and another without that flag. That makes several
apps of mine to malfuncate.
Great find! Someone has got their test the wrong way round. Since that
VM_MAYACCT macro is being used in one place only, and just hiding what it's
actually about, fold it into its callsite.
Andrew Morton [Fri, 14 May 2004 12:41:31 +0000 (05:41 -0700)]
[PATCH] revert the process-migration-speedup patch
David Mosberger asked that this be backed out:
"I do not believe that flushing the TLB before migration is be the right thing
to do on ia64 machines which support global TLB purges (i.e., all but SGI's
machines)."
It was of huge benefit for the SGI machines, so work is ongoing.
Andrew Morton [Fri, 14 May 2004 12:41:20 +0000 (05:41 -0700)]
[PATCH] MSEC_TO_JIFFIES to msec_to_jiffies
Switch all users of MSEC[S]_TO_JIFFIES and JIFFIES_TO_MSEC[S] over to use
jiffies_to_msecs() and msecs_to_jiffies(). Withdraw MSECS_TO_JIFFIES() and
JIFFIES_TO_MSECS() from the kernel API.
Andrew Morton [Fri, 14 May 2004 12:40:57 +0000 (05:40 -0700)]
[PATCH] MSEC_TO_JIFFIES consolidation
From: Ingo Molnar <mingo@elte.hu>
We have various different implementations of MSEC[S]_TO_JIFFIES and
JIFFIES_TO_MSEC[S]. We recently had a compile-time clash in USB.
Fix all that up.
- The SCTP version was very inefficient. Hopefully this version is accurate
enough.
- Optimise for the HZ=100 and HZ=1000 cases
- This version does round-up, so sleep(9 milliseconds) works OK on 100HZ.
- We still have lots of jiffies_to_msec and msec_to_jiffies implementations.
From: William Lee Irwin III <wli@holomorphy.com>
Optimize the cases where HZ is a divisor of 1000 or vice-versa in
JIFFIES_TO_MSECS() and MSECS_TO_JIFFIES() by allowing the nonvanishing(!)
integral ratios to appear as a parenthesized expressions eligible for
constant folding optimizations.
From: me
Use typesafe inlines for the jiffies-to-millisecond conversion functions.
This means that milliseconds officially takes the type `unsigned int'.
All current callers seem to be OK with that.
Drivers need to be fixed up to use this instead of their private versions.
The race occurs if the vmscan.c path sees page_count()==1 and then the
page_cache_release() path happens in that few-instruction "window 1" before
vmscan's page_cache_get().
The page_cache_release() path does put_page_testzero(), which returns true.
Then this CPU takes an interrupt...
The vmscan.c path then does page_cache_get(), taking the refcount to one.
Then it uses the page and does page_cache_release(), taking the refcount to
zero and the page is really freed.
Now, the CPU running page_cache_release() returns from the interrupt, takes
the LRU lock, sees the page still has a refcount of zero and frees it again.
Boom.
The patch fixes this by closing "window 1". We provide a
"get_page_testone()" which grabs a ref on the page and returns true if the
refcount was previously zero. If that happens the vmscan.c code simply drops
the page's refcount again and leaves the page on the LRU.
All this happens under the zone->lru_lock, which is also taken by
__page_cache_release() and release_pages(), so the vmscan code knows that the
page has not been returned to the page allocator yet.
In terms of implementation, the page counts are now offset by one: a free page
has page->_count of -1. This is so that we can use atomic_add_negative() and
atomic_inc_and_test() to provide put_page_testzero() and get_page_testone().
The macros hide all of this so the public interpretation of page_count() and
set_page_count() remains unaltered.
The compiler can usually constant-fold the offsetting of page->count. This
patch increases an x86 SMP kernel's text by 32 bytes.
The patch renames page->count to page->_count to break callers who aren't
using the macros.
This patch requires that the architecture implement atomic_add_negative(). It
is currently present on
Bjørn Mork [Fri, 14 May 2004 07:59:26 +0000 (00:59 -0700)]
[PATCH] I2C: "probe" module param broken for it87 in Linux 2.6.6
Jean Delvare <khali@linux-fr.org> writes:
> So I'd suggest that you simply use the standard exit sequence in the
> it87 driver (the second one in your current patch). A patch for the 2.4
> driver would be appreciated as well.
OK. I've attached a new version of the patch against linux-2.6.6.
I'll send a patch against current lm_sensors CVS removing the extra
exit command in a separate mail.
Greg KH <greg@kroah.com> writes:
> On Wed, May 12, 2004 at 04:38:03PM +0200, Bj?rn Mork wrote:
>> + if (!it87_find(&addr)) {
>> + printk("it87.o: new ISA address: 0x%04x\n", addr);
>
> That printk is wrong (no KERN_ level, or dev_printk() style use).
> Please fix it in your next revision of this patch.
Errh, I just added it to document my sloppyness. It was never meant
to be in the patch I sent you. Sorry. Removed in the attached patch.
The style of these drivers seem to be "just working, making no noise"
so I assume informational printk's are unwanted.
Jason D. Gaston [Fri, 14 May 2004 07:58:42 +0000 (00:58 -0700)]
[PATCH] I2C: ICH6/6300ESB i2c support
This patch adds DID support for ICH6 and 6300ESB to i2c-i801.c(SMBus).
In order to add this support I needed to patch pci_ids.h with the SMBus
DID's. To keep things orginized I renumbered the ICH6 and ESB entries
in pci_ids.h. I then patched the piix IDE and i810 audio drivers to
reflect the updated #define's. I also removed an error from irq.c;
there was a reference to a 6300ESB DID that does not exist.
David Brownell [Fri, 14 May 2004 05:19:20 +0000 (22:19 -0700)]
[PATCH] USB: hcd-pci suspend tweak
I needed this to get an APM + UHCI config to behave on resume.
Applies against your BK of last night ... OHCI and EHCI do
some of this manually, they could be simplified later.
Maneesh Soni [Fri, 14 May 2004 05:13:00 +0000 (22:13 -0700)]
[PATCH] sysfs_rename_dir-cleanup
o The following patch cleans up sysfs_rename_dir(). It now checks the
return code of kobject_set_name() and propagates the error code to its
callers. Because of this there are changes in the following two APIs. Both
return int instead of void.
int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
int kobject_rename(struct kobject * kobj, char *new_name)
David Brownell [Fri, 14 May 2004 04:57:21 +0000 (21:57 -0700)]
[PATCH] USB: ohci resume fix
Prakash K. Cheemplavam wrote:
> David Brownell wrote:
>
>>> There appear lines like
>>>
>>> usb usb2: string descriptor 0 read error: -108
>>>
>>> bug or feature? They weren't there with 2.6.6-mm1. I have no usb2.0
>>> stuff to actually test. My usb1 stuff seems to work though.
>>
>> Bug; minor, since the only real symptom seems to be messages like
>> that. Ignore them for now, I'll make a patch soonish.
>
> Ok, good. Thanks for the explanation of what is going on, though I don't
> can make too much out of it. ;-)
Andrew Morton [Thu, 13 May 2004 07:15:01 +0000 (00:15 -0700)]
[PATCH] USB: fix ohci-hcd build error
"Matt H." <lkml@lpbproductions.com> wrote:
>
> Just attempted to compile 2.6.6-mm2 and got this error
>
> CC [M] drivers/usb/core/driverfs.o
> CC [M] drivers/usb/core/hcd-pci.o
> LD [M] drivers/usb/core/usbcore.o
> LD drivers/usb/host/built-in.o
> CC [M] drivers/usb/host/ehci-hcd.o
> CC [M] drivers/usb/host/ohci-hcd.o
> In file included from drivers/usb/host/ohci-hcd.c:129:
> drivers/usb/host/ohci-hub.c: In function `ohci_rh_resume':
> drivers/usb/host/ohci-hub.c:313: error: `hcd' undeclared (first use in this
> function)
Alan Stern [Thu, 13 May 2004 07:14:34 +0000 (00:14 -0700)]
[PATCH] USB: Don't delete interfaces until all are unbound
On Thu, 13 May 2004, Duncan Sands wrote:
> No, but the pointer for another (previous) interface may just have been
> set to NULL, causing an Oops when usb_ifnum_to_if loops over all
> interfaces.
Of course! I trust you won't mind me changing your suggested fix
slightly. This should do an equally good job of repairing things, and it
will prevent other possible invalid references as well.
Duncan Sands [Thu, 13 May 2004 07:14:05 +0000 (00:14 -0700)]
[PATCH] USB: Patch to remove interface indices from devio.c
> I went ahead and created a patch to change all the places where devio.c
> uses an interface index. Now it always uses just the interface number.
> Does this look all right to you? I don't have a convenient way to test
> it.
Hi Alan, thanks for doing this. It looks and works OK. I added some name
changes: all struct usb_interface pointers are now called intf; and, when
reasonable, variables holding interface numbers are now all called ifnum.
This drowns your original changes in a sea of churning names, I hope you
don't mind.
David Brownell [Thu, 13 May 2004 07:13:38 +0000 (00:13 -0700)]
[PATCH] USB: missing probe() diagnostics for CDC Ethernet
This patch should help correct the "missing diagnostics with
CONFIG_USB_DEBUG during CDC Ethernet probe()" issue. Some
folk are having problems with firmware that doesn't respond
properly to descriptor fetches -- which is unnecessarily
confusing because the diagnostics aren't being printed.
Maneesh Soni [Tue, 11 May 2004 09:43:50 +0000 (02:43 -0700)]
[PATCH] kobject/sysfs race fix
The following patch fixes the race involved between unregistering a kobject
and simultaneously opeing a corresponding attribute file in sysfs.
Ideally sysfs should take a ref. to the kobject as long as it has dentries
referring to the kobjects, but because of current limitations in
module/kobject ref counting, sysfs's pinning of kobject leads to
hang/delays in rmmod of certain modules. The patch checks for unhashed
dentries in check_perm() while opening a sysfs file. If the dentry is
still hashed then it goes ahead and takes the ref to kobject. This done
under the per dentry lock. It does this in the inline routine
sysfs_get_kobject(dentry).
o The following patch cleansup the kobject_set_name() users. Basically checking
return code from kobject_set_name(). There can be error returns like -ENOMEM
or -EFAULT from kobject_set_name() if the name length exceeds KOBJ_NAME_LEN.
David Brownell [Tue, 11 May 2004 09:03:07 +0000 (02:03 -0700)]
[PATCH] USB: OHCI root hub suspend/resume/wakeup
This patch goes on top of the previous two, and the hcd-0506 patch:
- Moves root hub suspend/resume code out of PCI-specific bus glue
into generic hub code. That way it's easy to re-use it even
for non-PCI implementations like SA1111, OMAP, and LH7A404.
(Plus, given CONFIG_USB_SUSPEND, it can be invoked with sysfs.)
- Root hub suspend is a lot more careful, as is root hub resume.
Pending transactions are now shut down more consistently; and
more registers are re-initialized on resume.
- The PCI bus glue is now left with truly generic PCI stuff, plus
some PMAC-specific stuff (which doesn't include irq disabling
any more, hcd-0506 moves that up a level in the stack).
- Remote wakeup support is basically working for the root hub.
(given CONFIG_USB_SUSPEND to suspend devices and enable it).
- Idle HCs will now automatically suspend themselves, and resume
as necessary. This saves a certain amount of power on most
systems, and matches what UHCI has been doing for a while.
The large size of this patch is mostly because of moving that
root hub suspend/resume code out of the PCI-specific glue.
David Brownell [Tue, 11 May 2004 08:57:51 +0000 (01:57 -0700)]
[PATCH] USB: khubd turns port power back on after reset
This goes with the OHCI anti-deadlock patch, and is what
ensures that when a root hub loses power during suspend,
khubd can turn port power back on so devices can enumerate.
David Brownell [Tue, 11 May 2004 08:56:50 +0000 (01:56 -0700)]
[PATCH] USB: OHCI resume/reset stops deadlocking in PM code
System-wide PM resume now happily deadlocks if one of the
resuming devices tries to remove devices which vanished
during the suspend(*). IMO that's unreasonable both
because devices can/do vanish, and because 2.4 didn't
deadlock in those cases; but no patch to fix that has been
merged. The result is that ever since merging the "new" PM
code, some OHCI-based systems deadlock on resume.
So this patch handles the "lost power during resume" case
differently: it doesn't disconnect the root hub (or its
children) directly. Instead, it does part of that work
immediately, and defers the rest to khubd:
- add a "pending" list for live urbs, and use it after reset
to abort pending URBs (and reclaim "live" EDs/TDs)
- immediately mark all devices NOTATTACHED, so any operations
on the devices before khubd handles the disconnects, including
resume() callbacks, will fail
- kick root hub so it can do the cleanup
It also handles "fminterval" init/reinit a bit better, mostly
to work better in some remote wakeup scenarios addressed in
later patches:
- save any initial value the boot firmware provided
- use it during initialization (and eventually, remote wakeup)
Other changes:
- use better jiffies calculation for scheduled delays
- the allocator does more of the one-time initialization
- initialize hcd.can_wakeup according to boot firmware
- move some inlines to the header
- minor cleanups
(*) http://marc.theaimsgroup.com/?l=linux-kernel&m=106606272103414&w=2
reported against 2.6.0-test7.
Oliver Neukum [Tue, 11 May 2004 08:45:25 +0000 (01:45 -0700)]
[PATCH] USB: fixes of assumptions about waitqueues
quoting Linus:
--
> so there is no need to recheck the bit in do/while loop, because
> there is no false wakeups now.
You should never assume this. You should assume that there are _always_
false wakeups.
Why? Because Linux has always allowed people to leave wait-queues active,
without being "atomic". For example, the tty read/write layer used to
(still does?) add itself on the wait-queue _once_, and then leave itself
on the wait-queue while in a loop it does copies from/to user space.
--
Unfortunately, this means us. Here's the first fix. Comments?
- make sure timeouts are observed even if somebody left us on a queue
David Brownell [Tue, 11 May 2004 08:41:37 +0000 (01:41 -0700)]
[PATCH] USB: more functional HCD PCI PM glue
This patch makes the usbcore PCI suspend/resume logic behave
much better. In particular:
- Even HCs without PCI PM support will normally be able
to support global suspend, saving power ... and will
need to resume later. Let them try to suspend; lots
of not-that-old USB controllers don't have PM caps.
- Saner order for the boilerplate PCI stuff. It also
explicitly disables the IRQ and DMA, which aren't
available in D1/D2/D3 states anyway.
- Uses pci_enable_wake() when the root hub supports
remote wakeup. Didn't fully work in one test setup;
that controller's PME# was evidently ignored. (Not
enabled unless CONFIG_USB_SUSPEND.)
It worked for me with brief tests with the current 2.6.6-rc
uhci-hcd with one old UHCI; more extensive ones with various
OHCIs (using patches which I'll post soonish); and not at all
with EHCI (where PM hasn't ever worked).
Those of you who've been having PM problems might find
this helpful as-is, though I think that unless you're
using UHCI you'll also need an HCD patch.
Alan Stern [Tue, 11 May 2004 08:34:08 +0000 (01:34 -0700)]
[PATCH] USB: Accept devices with funky interface/altsetting numbers
Now that all the USB drivers have been audited, we can safely accept
devices that have noncompliant numbering for their interfaces or
altsettings. This patch skips bad or duplicate descriptors, allows gaps
in the numbering, accepts more or fewer interfaces than bNumInterfaces,
and logs warnings describing all these things. Also, the debugging log
messages have been improved by David Brownell.
David Brownell [Tue, 11 May 2004 08:33:38 +0000 (01:33 -0700)]
[PATCH] USB: EHCI power management updates
This patch updates EHCI suspend/resume so that its essential
components work on a few different implementations:
- make root hub suspend/resume work
- make remote wakeup work (given CONFIG_USB_SUSPEND patch)
- separate root hub suspend/resume from PCI suspend/resume
- say if controller supports remote wakeup (on this system)
- sysfs register dump unavailable if controller is suspended
Plus a handful of minor cleanups. Please merge, along with the
"hcd-0506.patch" I sent last week.
Tested by modifying sysfs power/state files, since ACPI doesn't
work on this system (so I can't test system suspend/resume):
- For root hub(*) ... suspend/resume works, also remote wakeup
- PCI controller ... suspend/resume works, remote wakeup
signals PME# (according to "lspci -vv"), but that's ignored
on my test sytem
Regardless of whether USB was active, "echo 1 > /proc/acpi/sleep"
produced a system that wouldn't resume, and the same result
came from "echo standby > /sys/power/state". So that's about
as far as I can take this testing for now.
- Dave
(*) Doing this relies on the CONFIG_USB_SUSPEND patch. Otherwise
no USB devices respond to sysfs power/state updates. The
PCI suspend/resume is a superset of this.
Alan Stern [Tue, 11 May 2004 08:33:09 +0000 (01:33 -0700)]
[PATCH] USB Gadget: Fix file-storage gadget Request Sense length
On Fri, 7 May 2004, kernel@metro.cx wrote:
> Hi All,
>
> I don't know where else to report this, but I found a very very very
> minor bug in the usb gadgets drivers, specifically the file_storage.c
> mass storage driver.
>
> In the function do_request_sense(..) it says:
>
> buf[7] = 18 - 7; // Additional sense length
>
> Whereas (according to page 38 of the USB mass storage class, UFI command spec,
> http://www.usb.org/developers/devclass_docs#approved) this clearly neads
> to be equal to 10, not 11.
>
> I checked with the 2.6.5 source, it is still there. Hope someone will find this usefull, although most USB hosts seem to ignore length bits alltogether anyway....
>
> Koen Martens
You are quite right; thank you for pointing this out. Greg, please apply
the patch below.
Hanna V. Linder [Tue, 11 May 2004 07:31:21 +0000 (00:31 -0700)]
[PATCH] Add class support to drivers/net/wan/cosa.c
This patch adds sysfs class support to the Cosa driver. I have verified it
compiles but do not have the hardware to test it. If someone could that
would be helpful.
Jean Delvare [Tue, 11 May 2004 06:46:12 +0000 (23:46 -0700)]
[PATCH] I2C: Rename hardware monitoring I2C class
Quoting myself:
> Mmm, I once proposed that I2C_ADAP_CLASS_SMBUS would be better renamed
> I2C_ADAP_CLASS_SENSORS (so I2C_CLASS_SENSORS now). What about that? I
> think it would be great to embed that change into your patch, so that
> the name changes only once.
>
> BTW, if HWMON is prefered to SENSORS, this is fine with me too, I
> have no strong preference.
Below is a patch that does that. I finally went for HWMON. Yes, it's
big, but it's actually nothing more than
s/I2C_CLASS_SMBUS/I2C_CLASS_HWMON/ (thanks perl -wip :)).
Ronald S. Bultje [Tue, 11 May 2004 06:45:12 +0000 (23:45 -0700)]
[PATCH] I2C: new i2c video decoder calls: saa7111 driver
Attached patch implements the i2c calls in the saa7111 driver.
The driver is still compatible with old behaviour, so the zr36067 driver
(the original user of the saa7111 module) doesn't need any changes. I'll
probably gradually make everything use DECODER_INIT instead of 0 (that was
a nice hack back then) somewhere later.
Can I just remove '0' later on? Or are there official ABI rules for
stable kernel versions?
Ronald S. Bultje [Tue, 11 May 2004 06:44:19 +0000 (23:44 -0700)]
[PATCH] I2C: new i2c video decoder calls
Attached patch adds three new calls to the i2c video decoder API. The changes
were requested by Michael (CC'ed) and approved by Gerd Knorr (v4l maintainer,
CC'ed).
Short explanation:
* INIT is a general initialization call with optional initialization data.
Reason for this is that several i2c decoders (or general: clients) are being
used by several adapters (main drivers), and in some cases, one adapter
simply needs different settings than the other, either because the adapter
is completely different or because the card was reverse engineered in a way
that doesn't allow multiple adapters to run using the same original
initialization data. Michael faces such a problem right now. Both he and
me lack time to properly sit together and work out the exact details or a
proper way to merge.
* VBI_BYPASS and GPIO set specific pins on the decoder. This will be used
in the saa7111 driver. My driver (zr36067, original user of the saa7111
driver) doesn't use any of this, but Michael's does.
Jean Delvare [Tue, 11 May 2004 06:43:55 +0000 (23:43 -0700)]
[PATCH] I2C: kill duplicate includes in i2c bus drivers
Following a suggestion of Arthur Othieno, here is a trivial patch that
kills duplicate inclusions of config.h in four i2c bus drivers.
At first I was thinking of also removing inclusions of config.h wherever
it doesn't seem to be necessary but Eugene doesn't seem to think it's a
good idea. So I may give it a try later (in 2.7), but for now this
simple patch will be enough.
M68k: Remove superfluous whitespace that hurts my eyes with `let
c_space_errors=1' in vim. This includes correcting trailing whitespace and
spaces in front of tabs. `diff -urNbB' shows no difference before/after.