Fix /proc/acpi/alarm BCD alarm encodings
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c67c36e4b86872ac875716d502748b84b2541de5 Commit: c67c36e4b86872ac875716d502748b84b2541de5 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Linus Torvalds [EMAIL PROTECTED] AuthorDate: Wed Oct 17 23:18:32 2007 -0400 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Thu Oct 25 15:08:03 2007 -0700 Fix /proc/acpi/alarm BCD alarm encodings This fixes some totally illogical and wrong code that converts things to and from BCD mode essentially randomly, does math on values in BCD mode etc etc. Introduce a few helper functions to make it a bit more obvious what is going on, and make sure that we always do all the arithmetic (and anythign else, for that matter) in binary, not BCD. Tested by Mark Lord, who found the problem originally, and also pushed the patch back and reminded me about it. Signed-off-by: Mark Lord [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- drivers/acpi/sleep/proc.c | 66 +++- 1 files changed, 29 insertions(+), 37 deletions(-) diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 3839efd..1538355 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c @@ -194,6 +194,23 @@ static int get_date_field(char **p, u32 * value) return result; } +/* Read a possibly BCD register, always return binary */ +static u32 cmos_bcd_read(int offset, int rtc_control) +{ + u32 val = CMOS_READ(offset); + if (!(rtc_control RTC_DM_BINARY) || RTC_ALWAYS_BCD) + BCD_TO_BIN(val); + return val; +} + +/* Write binary value into possibly BCD register */ +static void cmos_bcd_write(u32 val, int offset, int rtc_control) +{ + if (!(rtc_control RTC_DM_BINARY) || RTC_ALWAYS_BCD) + BIN_TO_BCD(val); + CMOS_WRITE(val, offset); +} + static ssize_t acpi_system_write_alarm(struct file *file, const char __user * buffer, size_t count, loff_t * ppos) @@ -258,35 +275,18 @@ acpi_system_write_alarm(struct file *file, spin_lock_irq(rtc_lock); rtc_control = CMOS_READ(RTC_CONTROL); - if (!(rtc_control RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } if (adjust) { - yr += CMOS_READ(RTC_YEAR); - mo += CMOS_READ(RTC_MONTH); - day += CMOS_READ(RTC_DAY_OF_MONTH); - hr += CMOS_READ(RTC_HOURS); - min += CMOS_READ(RTC_MINUTES); - sec += CMOS_READ(RTC_SECONDS); + yr += cmos_bcd_read(RTC_YEAR, rtc_control); + mo += cmos_bcd_read(RTC_MONTH, rtc_control); + day += cmos_bcd_read(RTC_DAY_OF_MONTH, rtc_control); + hr += cmos_bcd_read(RTC_HOURS, rtc_control); + min += cmos_bcd_read(RTC_MINUTES, rtc_control); + sec += cmos_bcd_read(RTC_SECONDS, rtc_control); } spin_unlock_irq(rtc_lock); - if (!(rtc_control RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BCD_TO_BIN(yr); - BCD_TO_BIN(mo); - BCD_TO_BIN(day); - BCD_TO_BIN(hr); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - } - if (sec 59) { min++; sec -= 60; @@ -307,14 +307,6 @@ acpi_system_write_alarm(struct file *file, yr++; mo -= 12; } - if (!(rtc_control RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } spin_lock_irq(rtc_lock); /* @@ -326,9 +318,9 @@ acpi_system_write_alarm(struct file *file, CMOS_READ(RTC_INTR_FLAGS); /* write the fields the rtc knows about */ - CMOS_WRITE(hr, RTC_HOURS_ALARM); - CMOS_WRITE(min, RTC_MINUTES_ALARM); - CMOS_WRITE(sec, RTC_SECONDS_ALARM); + cmos_bcd_write(hr, RTC_HOURS_ALARM, rtc_control); + cmos_bcd_write(min, RTC_MINUTES_ALARM, rtc_control); + cmos_bcd_write(sec, RTC_SECONDS_ALARM, rtc_control); /* * If the system supports an enhanced alarm it will have non-zero @@ -336,11 +328,11 @@ acpi_system_write_alarm(struct file *file, * to the RTC area of memory. */ if (acpi_gbl_FADT.day_alarm) - CMOS_WRITE(day, acpi_gbl_FADT.day_alarm); + cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, rtc_control); if (acpi_gbl_FADT.month_alarm) - CMOS_WRITE(mo, acpi_gbl_FADT.month_alarm); +
Fix pointer mismatches in proc_sysctl.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a2da53b181bdafcdecb43c457735ee2892ae885 Commit: 2a2da53b181bdafcdecb43c457735ee2892ae885 Parent: de48844398f81cfdf087d56e12c920d620dae8d5 Author: David Howells [EMAIL PROTECTED] AuthorDate: Thu Oct 25 15:27:40 2007 +0100 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Thu Oct 25 15:16:49 2007 -0700 Fix pointer mismatches in proc_sysctl.c Fix pointer mismatches in proc_sysctl.c. The proc_handler() method returns a size_t through an arg pointer, but is given a pointer to a ssize_t to return into. Signed-off-by: David Howells [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- fs/proc/proc_sysctl.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 680c429..4e57fcf 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -171,7 +171,8 @@ static ssize_t proc_sys_read(struct file *filp, char __user *buf, struct dentry *dentry = filp-f_dentry; struct ctl_table_header *head; struct ctl_table *table; - ssize_t error, res; + ssize_t error; + size_t res; table = do_proc_sys_lookup(dentry-d_parent, dentry-d_name, head); /* Has the sysctl entry disappeared on us? */ @@ -209,7 +210,8 @@ static ssize_t proc_sys_write(struct file *filp, const char __user *buf, struct dentry *dentry = filp-f_dentry; struct ctl_table_header *head; struct ctl_table *table; - ssize_t error, res; + ssize_t error; + size_t res; table = do_proc_sys_lookup(dentry-d_parent, dentry-d_name, head); /* Has the sysctl entry disappeared on us? */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
fs: Fix to correct the mbcache entries counter
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9e83489cbb3670df810d4f9fe308cde88faa0a9 Commit: f9e83489cbb3670df810d4f9fe308cde88faa0a9 Parent: 2a2da53b181bdafcdecb43c457735ee2892ae885 Author: Ram Gupta [EMAIL PROTECTED] AuthorDate: Thu Oct 25 10:03:28 2007 -0500 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Thu Oct 25 15:18:29 2007 -0700 fs: Fix to correct the mbcache entries counter This patch fixes the c_entry_count counter of the mbcache. Currently it increments the counter first allocate the cache entry later. In case of failure to allocate the entry due to insufficient memory this counter is still left incremented. This patch fixes this anomaly. Signed-off-by: Ram Gupta [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- fs/mbcache.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/mbcache.c b/fs/mbcache.c index 1046cbe..eb31b73 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -403,9 +403,9 @@ mb_cache_entry_alloc(struct mb_cache *cache) { struct mb_cache_entry *ce; - atomic_inc(cache-c_entry_count); ce = kmem_cache_alloc(cache-c_entry_cache, GFP_KERNEL); if (ce) { + atomic_inc(cache-c_entry_count); INIT_LIST_HEAD(ce-e_lru_list); INIT_LIST_HEAD(ce-e_block_list); ce-e_cache = cache; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: fix sched_domain sysctl registration again
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7378547f2c83ca16a30d0a7c488a43a688ea0888 Commit: 7378547f2c83ca16a30d0a7c488a43a688ea0888 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Milton Miller [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:48 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:48 2007 +0200 sched: fix sched_domain sysctl registration again commit 029190c515f15f512ac85de8fc686d4dbd0ae731 (cpuset sched_load_balance flag) was not tested SCHED_DEBUG enabled as committed as it dereferences NULL when used and it reordered the sysctl registration to cause it to never show any domains or their tunables. Fixes: 1) restore arch_init_sched_domains ordering we can't walk the domains before we build them presently we register cpus with empty directories (no domain directories or files). 2) make unregister_sched_domain_sysctl do nothing when already unregistered detach_destroy_domains is now called one set of cpus at a time unregister_syctl dereferences NULL if called with a null. While the the function would always dereference null if called twice, in the previous code it was always called once and then was followed a register. So only the hidden bug of the sysctl_root_table not being allocated followed by an attempt to free it would have shown the error. 3) always call unregister and register in partition_sched_domains The code is smart about unregistering only needed domains. Since we aren't guaranteed any calls to unregister, always unregister. Without calling register on the way out we will not have a table or any sysctl tree. 4) warn if register is called without unregistering The previous table memory is lost, leaving pointers to the later freed memory in sysctl and leaking the memory of the tables. Before this patch on a 2-core 4-thread box compiled for SMT and NUMA, the domains appear empty (there are actually 3 levels per cpu). And as soon as two domains a null pointer is dereferenced (unreliable in this case is stack garbage): bu19a:~# ls -R /proc/sys/kernel/sched_domain/ /proc/sys/kernel/sched_domain/: cpu0 cpu1 cpu2 cpu3 /proc/sys/kernel/sched_domain/cpu0: /proc/sys/kernel/sched_domain/cpu1: /proc/sys/kernel/sched_domain/cpu2: /proc/sys/kernel/sched_domain/cpu3: bu19a:~# mkdir /dev/cpuset bu19a:~# mount -tcpuset cpuset /dev/cpuset/ bu19a:~# cd /dev/cpuset/ bu19a:/dev/cpuset# echo 0 sched_load_balance bu19a:/dev/cpuset# mkdir one bu19a:/dev/cpuset# echo 1 one/cpus bu19a:/dev/cpuset# echo 0 one/sched_load_balance Unable to handle kernel paging request for data at address 0x0018 Faulting instruction address: 0xc006b608 NIP: c006b608 LR: c006b604 CTR: REGS: c00018d973f0 TRAP: 0300 Not tainted (2.6.23-bml) MSR: 90009032 EE,ME,IR,DR CR: 28242442 XER: DAR: 0018, DSISR: 4000 TASK = c0001912e340[1987] 'bash' THREAD: c00018d94000 CPU: 2 .. NIP [c006b608] .unregister_sysctl_table+0x38/0x110 LR [c006b604] .unregister_sysctl_table+0x34/0x110 Call Trace: [c00018d97670] [c7017270] 0xc7017270 (unreliable) [c00018d97720] [c0058710] .detach_destroy_domains+0x30/0xb0 [c00018d977b0] [c005cf1c] .partition_sched_domains+0x1bc/0x230 [c00018d97870] [c009fdc4] .rebuild_sched_domains+0xb4/0x4c0 [c00018d97970] [c00a02e8] .update_flag+0x118/0x170 [c00018d97a80] [c00a1768] .cpuset_common_file_write+0x568/0x820 [c00018d97c00] [c009d95c] .cgroup_file_write+0x7c/0x180 [c00018d97cf0] [c00e76b8] .vfs_write+0xe8/0x1b0 [c00018d97d90] [c00e810c] .sys_write+0x4c/0x90 [c00018d97e30] [c000852c] syscall_exit+0x0/0x40 Signed-off-by: Milton Miller [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- kernel/sched.c | 25 - 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index 2810e56..e51f0ea 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -5461,11 +5461,12 @@ static void register_sched_domain_sysctl(void) struct ctl_table *entry = sd_alloc_ctl_entry(cpu_num + 1); char buf[32]; + WARN_ON(sd_ctl_dir[0].child); + sd_ctl_dir[0].child = entry; + if (entry == NULL) return; - sd_ctl_dir[0].child = entry; - for_each_online_cpu(i) { snprintf(buf, 32, cpu%d, i); entry-procname =
sched: fix fastcall mismatch in completion APIs
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b15136e9497ef5d6e08cf665e0d0acf7a229f6dc Commit: b15136e9497ef5d6e08cf665e0d0acf7a229f6dc Parent: 7378547f2c83ca16a30d0a7c488a43a688ea0888 Author: Ingo Molnar [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:48 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:48 2007 +0200 sched: fix fastcall mismatch in completion APIs Jeff Dike noticed that wait_for_completion_interruptible()'s prototype had a mismatched fastcall. Fix this by removing the fastcall attributes from all the completion APIs. Found-by: Jeff Dike [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- include/linux/completion.h | 18 +- kernel/sched.c | 10 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index 268c5a4..33d6aaf 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -42,15 +42,15 @@ static inline void init_completion(struct completion *x) init_waitqueue_head(x-wait); } -extern void FASTCALL(wait_for_completion(struct completion *)); -extern int FASTCALL(wait_for_completion_interruptible(struct completion *x)); -extern unsigned long FASTCALL(wait_for_completion_timeout(struct completion *x, - unsigned long timeout)); -extern unsigned long FASTCALL(wait_for_completion_interruptible_timeout( - struct completion *x, unsigned long timeout)); - -extern void FASTCALL(complete(struct completion *)); -extern void FASTCALL(complete_all(struct completion *)); +extern void wait_for_completion(struct completion *); +extern int wait_for_completion_interruptible(struct completion *x); +extern unsigned long wait_for_completion_timeout(struct completion *x, + unsigned long timeout); +extern unsigned long wait_for_completion_interruptible_timeout( + struct completion *x, unsigned long timeout); + +extern void complete(struct completion *); +extern void complete_all(struct completion *); #define INIT_COMPLETION(x) ((x).done = 0) diff --git a/kernel/sched.c b/kernel/sched.c index e51f0ea..80edf29 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -3820,7 +3820,7 @@ __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr_exclusive) } EXPORT_SYMBOL_GPL(__wake_up_sync); /* For internal use only */ -void fastcall complete(struct completion *x) +void complete(struct completion *x) { unsigned long flags; @@ -3832,7 +3832,7 @@ void fastcall complete(struct completion *x) } EXPORT_SYMBOL(complete); -void fastcall complete_all(struct completion *x) +void complete_all(struct completion *x) { unsigned long flags; @@ -3884,13 +3884,13 @@ wait_for_common(struct completion *x, long timeout, int state) return timeout; } -void fastcall __sched wait_for_completion(struct completion *x) +void __sched wait_for_completion(struct completion *x) { wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE); } EXPORT_SYMBOL(wait_for_completion); -unsigned long fastcall __sched +unsigned long __sched wait_for_completion_timeout(struct completion *x, unsigned long timeout) { return wait_for_common(x, timeout, TASK_UNINTERRUPTIBLE); @@ -3906,7 +3906,7 @@ int __sched wait_for_completion_interruptible(struct completion *x) } EXPORT_SYMBOL(wait_for_completion_interruptible); -unsigned long fastcall __sched +unsigned long __sched wait_for_completion_interruptible_timeout(struct completion *x, unsigned long timeout) { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: clean up sched_domain_debug()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4dcf6aff023d9934630fb3649284951831c51f8f Commit: 4dcf6aff023d9934630fb3649284951831c51f8f Parent: b15136e9497ef5d6e08cf665e0d0acf7a229f6dc Author: Ingo Molnar [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:48 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:48 2007 +0200 sched: clean up sched_domain_debug() clean up sched_domain_debug(). this also shrinks the code a bit: textdata bss dec hex filename 504744306 480 55260d7dc sched.o.before 504044306 480 55190d796 sched.o.after Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- kernel/sched.c | 146 1 files changed, 73 insertions(+), 73 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index 80edf29..af02a4d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -5617,101 +5617,101 @@ int nr_cpu_ids __read_mostly = NR_CPUS; EXPORT_SYMBOL(nr_cpu_ids); #ifdef CONFIG_SCHED_DEBUG -static void sched_domain_debug(struct sched_domain *sd, int cpu) + +static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level) { - int level = 0; + struct sched_group *group = sd-groups; + cpumask_t groupmask; + char str[NR_CPUS]; - if (!sd) { - printk(KERN_DEBUG CPU%d attaching NULL sched-domain.\n, cpu); - return; + cpumask_scnprintf(str, NR_CPUS, sd-span); + cpus_clear(groupmask); + + printk(KERN_DEBUG %*s domain %d: , level, , level); + + if (!(sd-flags SD_LOAD_BALANCE)) { + printk(does not load-balance\n); + if (sd-parent) + printk(KERN_ERR ERROR: !SD_LOAD_BALANCE domain +has parent); + return -1; } - printk(KERN_DEBUG CPU%d attaching sched-domain:\n, cpu); + printk(KERN_CONT span %s\n, str); + + if (!cpu_isset(cpu, sd-span)) { + printk(KERN_ERR ERROR: domain-span does not contain + CPU%d\n, cpu); + } + if (!cpu_isset(cpu, group-cpumask)) { + printk(KERN_ERR ERROR: domain-groups does not contain +CPU%d\n, cpu); + } + printk(KERN_DEBUG %*s groups:, level + 1, ); do { - int i; - char str[NR_CPUS]; - struct sched_group *group = sd-groups; - cpumask_t groupmask; - - cpumask_scnprintf(str, NR_CPUS, sd-span); - cpus_clear(groupmask); - - printk(KERN_DEBUG); - for (i = 0; i level + 1; i++) - printk( ); - printk(domain %d: , level); - - if (!(sd-flags SD_LOAD_BALANCE)) { - printk(does not load-balance\n); - if (sd-parent) - printk(KERN_ERR ERROR: !SD_LOAD_BALANCE domain -has parent); + if (!group) { + printk(\n); + printk(KERN_ERR ERROR: group is NULL\n); break; } - printk(span %s\n, str); + if (!group-__cpu_power) { + printk(KERN_CONT \n); + printk(KERN_ERR ERROR: domain-cpu_power not + set\n); + break; + } - if (!cpu_isset(cpu, sd-span)) - printk(KERN_ERR ERROR: domain-span does not contain - CPU%d\n, cpu); - if (!cpu_isset(cpu, group-cpumask)) - printk(KERN_ERR ERROR: domain-groups does not contain -CPU%d\n, cpu); + if (!cpus_weight(group-cpumask)) { + printk(KERN_CONT \n); + printk(KERN_ERR ERROR: empty group\n); + break; + } - printk(KERN_DEBUG); - for (i = 0; i level + 2; i++) - printk( ); - printk(groups:); - do { - if (!group) { - printk(\n); - printk(KERN_ERR ERROR: group is NULL\n); - break; - } + if (cpus_intersects(groupmask, group-cpumask)) { + printk(KERN_CONT \n); + printk(KERN_ERR ERROR: repeated CPUs\n); + break; + } - if (!group-__cpu_power) { - printk(KERN_CONT \n); -
sched: use show_regs() to improve __schedule_bug() output
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=838225b48edc971620cbeb292034dabd2b0d7d1d Commit: 838225b48edc971620cbeb292034dabd2b0d7d1d Parent: 4dcf6aff023d9934630fb3649284951831c51f8f Author: Satyam Sharma [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:50 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:50 2007 +0200 sched: use show_regs() to improve __schedule_bug() output A full register dump along with stack backtrace would make the scheduling while atomic message more helpful. Use show_regs() instead of dump_stack() for this. We already know we're atomic in here (that is why this function was called) so show_regs()'s atomicity expectations are guaranteed. Also, modify the output of the BUG: scheduling while atomic: header a bit to keep task-comm and task-pid together and preempt_count() after them. Signed-off-by: Satyam Sharma [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- kernel/sched.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index af02a4d..d1e6663 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -66,6 +66,7 @@ #include linux/pagemap.h #include asm/tlb.h +#include asm/irq_regs.h /* * Scheduler clock - returns current time in nanosec units. @@ -3507,12 +3508,19 @@ EXPORT_SYMBOL(sub_preempt_count); */ static noinline void __schedule_bug(struct task_struct *prev) { - printk(KERN_ERR BUG: scheduling while atomic: %s/0x%08x/%d\n, - prev-comm, preempt_count(), task_pid_nr(prev)); + struct pt_regs *regs = get_irq_regs(); + + printk(KERN_ERR BUG: scheduling while atomic: %s/%d/0x%08x\n, + prev-comm, prev-pid, preempt_count()); + debug_show_held_locks(prev); if (irqs_disabled()) print_irqtrace_events(prev); - dump_stack(); + + if (regs) + show_regs(regs); + else + dump_stack(); } /* - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: document profile=sleep requiring CONFIG_SCHEDSTATS
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3da2a73ff5a2953a4ad8ebbf0aa7e6965ff9de2 Commit: b3da2a73ff5a2953a4ad8ebbf0aa7e6965ff9de2 Parent: 838225b48edc971620cbeb292034dabd2b0d7d1d Author: Mel Gorman [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:50 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:50 2007 +0200 sched: document profile=sleep requiring CONFIG_SCHEDSTATS profile=sleep only works if CONFIG_SCHEDSTATS is set. This patch notes the limitation in Documentation/kernel-parameters.txt and prints a warning at boot-time if profile=sleep is used without CONFIG_SCHEDSTAT. Signed-off-by: Mel Gorman [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- Documentation/kernel-parameters.txt |3 ++- kernel/profile.c|5 + 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a13d69b..8ae5fac 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1444,7 +1444,8 @@ and is between 256 and 4096 characters. It is defined in the file Param: schedule - profile schedule points. Param: number - step/bucket size as a power of 2 for statistical time based profiling. - Param: sleep - profile D-state sleeping (millisecs) + Param: sleep - profile D-state sleeping (millisecs). + Requires CONFIG_SCHEDSTATS Param: kvm - profile VM exits. processor.max_cstate= [HW,ACPI] diff --git a/kernel/profile.c b/kernel/profile.c index 631b75c..5e95330 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -60,6 +60,7 @@ static int __init profile_setup(char * str) int par; if (!strncmp(str, sleepstr, strlen(sleepstr))) { +#ifdef CONFIG_SCHEDSTATS prof_on = SLEEP_PROFILING; if (str[strlen(sleepstr)] == ',') str += strlen(sleepstr) + 1; @@ -68,6 +69,10 @@ static int __init profile_setup(char * str) printk(KERN_INFO kernel sleep profiling enabled (shift: %ld)\n, prof_shift); +#else + printk(KERN_WARNING + kernel sleep profiling requires CONFIG_SCHEDSTATS\n); +#endif /* CONFIG_SCHEDSTATS */ } else if (!strncmp(str, schedstr, strlen(schedstr))) { prof_on = SCHED_PROFILING; if (str[strlen(schedstr)] == ',') - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: constify sched.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a8972ccf00b7184a743eb6cd9bc7f3443357910c Commit: a8972ccf00b7184a743eb6cd9bc7f3443357910c Parent: b3da2a73ff5a2953a4ad8ebbf0aa7e6965ff9de2 Author: Joe Perches [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:50 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:50 2007 +0200 sched: constify sched.h Add const to some struct task_struct * uses Signed-off-by: Joe Perches [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- include/linux/sched.h | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 13df99f..52288a6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1196,7 +1196,7 @@ static inline int rt_prio(int prio) return 0; } -static inline int rt_task(struct task_struct *p) +static inline int rt_task(const struct task_struct *p) { return rt_prio(p-prio); } @@ -1211,22 +1211,22 @@ static inline void set_task_pgrp(struct task_struct *tsk, pid_t pgrp) tsk-signal-__pgrp = pgrp; } -static inline struct pid *task_pid(struct task_struct *task) +static inline struct pid *task_pid(const struct task_struct *task) { return task-pids[PIDTYPE_PID].pid; } -static inline struct pid *task_tgid(struct task_struct *task) +static inline struct pid *task_tgid(const struct task_struct *task) { return task-group_leader-pids[PIDTYPE_PID].pid; } -static inline struct pid *task_pgrp(struct task_struct *task) +static inline struct pid *task_pgrp(const struct task_struct *task) { return task-group_leader-pids[PIDTYPE_PGID].pid; } -static inline struct pid *task_session(struct task_struct *task) +static inline struct pid *task_session(const struct task_struct *task) { return task-group_leader-pids[PIDTYPE_SID].pid; } @@ -1255,7 +1255,7 @@ struct pid_namespace; * see also pid_nr() etc in include/linux/pid.h */ -static inline pid_t task_pid_nr(struct task_struct *tsk) +static inline pid_t task_pid_nr(const struct task_struct *tsk) { return tsk-pid; } @@ -1268,7 +1268,7 @@ static inline pid_t task_pid_vnr(struct task_struct *tsk) } -static inline pid_t task_tgid_nr(struct task_struct *tsk) +static inline pid_t task_tgid_nr(const struct task_struct *tsk) { return tsk-tgid; } @@ -1281,7 +1281,7 @@ static inline pid_t task_tgid_vnr(struct task_struct *tsk) } -static inline pid_t task_pgrp_nr(struct task_struct *tsk) +static inline pid_t task_pgrp_nr(const struct task_struct *tsk) { return tsk-signal-__pgrp; } @@ -1294,7 +1294,7 @@ static inline pid_t task_pgrp_vnr(struct task_struct *tsk) } -static inline pid_t task_session_nr(struct task_struct *tsk) +static inline pid_t task_session_nr(const struct task_struct *tsk) { return tsk-signal-__session; } @@ -1321,7 +1321,7 @@ static inline pid_t task_ppid_nr_ns(struct task_struct *tsk, * If pid_alive fails, then pointers within the task structure * can be stale and must not be dereferenced. */ -static inline int pid_alive(struct task_struct *p) +static inline int pid_alive(const struct task_struct *p) { return p-pids[PIDTYPE_PID].pid != NULL; } @@ -1332,7 +1332,7 @@ static inline int pid_alive(struct task_struct *p) * * Check if a task structure is the first user space task the kernel created. */ -static inline int is_global_init(struct task_struct *tsk) +static inline int is_global_init(const struct task_struct *tsk) { return tsk-pid == 1; } @@ -1469,7 +1469,7 @@ extern int rt_mutex_getprio(struct task_struct *p); extern void rt_mutex_setprio(struct task_struct *p, int prio); extern void rt_mutex_adjust_pi(struct task_struct *p); #else -static inline int rt_mutex_getprio(struct task_struct *p) +static inline int rt_mutex_getprio(const struct task_struct *p) { return p-normal_prio; } @@ -1721,7 +1721,7 @@ extern void wait_task_inactive(struct task_struct * p); * all we care about is that we have a task with the appropriate * pid, we don't actually care if we have the right task. */ -static inline int has_group_leader_pid(struct task_struct *p) +static inline int has_group_leader_pid(const struct task_struct *p) { return p-pid == p-tgid; } @@ -1738,7 +1738,7 @@ static inline struct task_struct *next_thread(const struct task_struct *p) struct task_struct, thread_group); } -static inline int thread_group_empty(struct task_struct *p) +static inline int thread_group_empty(const struct task_struct *p) { return list_empty(p-thread_group); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: clean up some control group code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b01dfe37203e825edd8417ad3993d01cbbb527e Commit: 2b01dfe37203e825edd8417ad3993d01cbbb527e Parent: a8972ccf00b7184a743eb6cd9bc7f3443357910c Author: Paul Menage [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:50 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:50 2007 +0200 sched: clean up some control group code - replace cont with cgrp in a few places in the CFS cgroup code, - use write_uint rather than write for cpu.shares write function Signed-off-by: Paul Menage [EMAIL PROTECTED] Acked-by : Srivatsa Vaddagiri [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- kernel/sched.c | 53 ++--- 1 files changed, 18 insertions(+), 35 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index d1e6663..cc9cd5b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -7124,25 +7124,25 @@ unsigned long sched_group_shares(struct task_group *tg) #ifdef CONFIG_FAIR_CGROUP_SCHED /* return corresponding task_group object of a cgroup */ -static inline struct task_group *cgroup_tg(struct cgroup *cont) +static inline struct task_group *cgroup_tg(struct cgroup *cgrp) { - return container_of(cgroup_subsys_state(cont, cpu_cgroup_subsys_id), -struct task_group, css); + return container_of(cgroup_subsys_state(cgrp, cpu_cgroup_subsys_id), + struct task_group, css); } static struct cgroup_subsys_state * -cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) +cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp) { struct task_group *tg; - if (!cont-parent) { + if (!cgrp-parent) { /* This is early initialization for the top cgroup */ - init_task_group.css.cgroup = cont; + init_task_group.css.cgroup = cgrp; return init_task_group.css; } /* we support only 1-level deep hierarchical scheduler atm */ - if (cont-parent-parent) + if (cgrp-parent-parent) return ERR_PTR(-EINVAL); tg = sched_create_group(); @@ -7150,21 +7150,21 @@ cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) return ERR_PTR(-ENOMEM); /* Bind the cgroup to task_group object we just created */ - tg-css.cgroup = cont; + tg-css.cgroup = cgrp; return tg-css; } static void cpu_cgroup_destroy(struct cgroup_subsys *ss, - struct cgroup *cont) + struct cgroup *cgrp) { - struct task_group *tg = cgroup_tg(cont); + struct task_group *tg = cgroup_tg(cgrp); sched_destroy_group(tg); } static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, -struct cgroup *cont, struct task_struct *tsk) +struct cgroup *cgrp, struct task_struct *tsk) { /* We don't support RT-tasks being in separate groups */ if (tsk-sched_class != fair_sched_class) @@ -7174,38 +7174,21 @@ static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, } static void -cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cont, +cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, struct cgroup *old_cont, struct task_struct *tsk) { sched_move_task(tsk); } -static ssize_t cpu_shares_write(struct cgroup *cont, struct cftype *cftype, - struct file *file, const char __user *userbuf, - size_t nbytes, loff_t *ppos) +static int cpu_shares_write_uint(struct cgroup *cgrp, struct cftype *cftype, + u64 shareval) { - unsigned long shareval; - struct task_group *tg = cgroup_tg(cont); - char buffer[2*sizeof(unsigned long) + 1]; - int rc; - - if (nbytes 2*sizeof(unsigned long)) /* safety check */ - return -E2BIG; - - if (copy_from_user(buffer, userbuf, nbytes)) - return -EFAULT; - - buffer[nbytes] = 0; /* nul-terminate */ - shareval = simple_strtoul(buffer, NULL, 10); - - rc = sched_group_set_shares(tg, shareval); - - return (rc 0 ? rc : nbytes); + return sched_group_set_shares(cgroup_tg(cgrp), shareval); } -static u64 cpu_shares_read_uint(struct cgroup *cont, struct cftype *cft) +static u64 cpu_shares_read_uint(struct cgroup *cgrp, struct cftype *cft) { - struct task_group *tg = cgroup_tg(cont); + struct task_group *tg = cgroup_tg(cgrp); return (u64) tg-shares; } @@ -7213,7 +7196,7 @@ static u64 cpu_shares_read_uint(struct cgroup *cont, struct cftype *cft) static struct cftype cpu_shares = { .name = shares, .read_uint = cpu_shares_read_uint,
sched: make cpu_shares_{show,store}() static
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a0f846aa76c3e03d54c1700a87cab3a46ccd71e2 Commit: a0f846aa76c3e03d54c1700a87cab3a46ccd71e2 Parent: 2b01dfe37203e825edd8417ad3993d01cbbb527e Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:50 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:50 2007 +0200 sched: make cpu_shares_{show,store}() static cpu_shares_{show,store}() can become static. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- kernel/user.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/user.c b/kernel/user.c index e91331c..0f3aa02 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -129,7 +129,7 @@ static inline void uids_mutex_unlock(void) } /* return cpu shares held by the user */ -ssize_t cpu_shares_show(struct kset *kset, char *buffer) +static ssize_t cpu_shares_show(struct kset *kset, char *buffer) { struct user_struct *up = container_of(kset, struct user_struct, kset); @@ -137,7 +137,8 @@ ssize_t cpu_shares_show(struct kset *kset, char *buffer) } /* modify cpu shares held by the user */ -ssize_t cpu_shares_store(struct kset *kset, const char *buffer, size_t size) +static ssize_t cpu_shares_store(struct kset *kset, const char *buffer, + size_t size) { struct user_struct *up = container_of(kset, struct user_struct, kset); unsigned long shares; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sched: reduce balance-tasks overhead
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1d1484f72127a5580d37c379f6a5b2c2786434c Commit: e1d1484f72127a5580d37c379f6a5b2c2786434c Parent: a0f846aa76c3e03d54c1700a87cab3a46ccd71e2 Author: Peter Williams [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:51 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:51 2007 +0200 sched: reduce balance-tasks overhead At the moment, balance_tasks() provides low level functionality for both move_tasks() and move_one_task() (indirectly) via the load_balance() function (in the sched_class interface) which also provides dual functionality. This dual functionality complicates the interfaces and internal mechanisms and makes the run time overhead of operations that are called with two run queue locks held. This patch addresses this issue and reduces the overhead of these operations. Signed-off-by: Peter Williams [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- include/linux/sched.h |7 ++- kernel/sched.c | 99 +++--- kernel/sched_fair.c | 44 - kernel/sched_idletask.c | 14 +- kernel/sched_rt.c | 28 + 5 files changed, 135 insertions(+), 57 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 52288a6..639241f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -829,11 +829,14 @@ struct sched_class { void (*put_prev_task) (struct rq *rq, struct task_struct *p); unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, - struct rq *busiest, - unsigned long max_nr_move, unsigned long max_load_move, + struct rq *busiest, unsigned long max_load_move, struct sched_domain *sd, enum cpu_idle_type idle, int *all_pinned, int *this_best_prio); + int (*move_one_task) (struct rq *this_rq, int this_cpu, + struct rq *busiest, struct sched_domain *sd, + enum cpu_idle_type idle); + void (*set_curr_task) (struct rq *rq); void (*task_tick) (struct rq *rq, struct task_struct *p); void (*task_new) (struct rq *rq, struct task_struct *p); diff --git a/kernel/sched.c b/kernel/sched.c index cc9cd5b..8607795 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -838,11 +838,35 @@ struct rq_iterator { struct task_struct *(*next)(void *); }; -static int balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, - unsigned long max_nr_move, unsigned long max_load_move, - struct sched_domain *sd, enum cpu_idle_type idle, - int *all_pinned, unsigned long *load_moved, - int *this_best_prio, struct rq_iterator *iterator); +#ifdef CONFIG_SMP +static unsigned long +balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, + unsigned long max_load_move, struct sched_domain *sd, + enum cpu_idle_type idle, int *all_pinned, + int *this_best_prio, struct rq_iterator *iterator); + +static int +iter_move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest, + struct sched_domain *sd, enum cpu_idle_type idle, + struct rq_iterator *iterator); +#else +static inline unsigned long +balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, + unsigned long max_load_move, struct sched_domain *sd, + enum cpu_idle_type idle, int *all_pinned, + int *this_best_prio, struct rq_iterator *iterator) +{ + return 0; +} + +static inline int +iter_move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest, + struct sched_domain *sd, enum cpu_idle_type idle, + struct rq_iterator *iterator) +{ + return 0; +} +#endif #include sched_stats.h #include sched_idletask.c @@ -2224,17 +2248,17 @@ int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu, return 1; } -static int balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, - unsigned long max_nr_move, unsigned long max_load_move, - struct sched_domain *sd, enum cpu_idle_type idle, - int *all_pinned, unsigned long *load_moved, - int *this_best_prio, struct rq_iterator *iterator) +static unsigned long +balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, + unsigned long max_load_move, struct sched_domain *sd, + enum cpu_idle_type idle, int *all_pinned, + int *this_best_prio, struct rq_iterator *iterator) { int pulled = 0, pinned = 0, skip_for_load; struct task_struct *p;
sched: isolate SMP balancing code a bit more
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=681f3e68541d6f03e3e05d21fe15093578b8b539 Commit: 681f3e68541d6f03e3e05d21fe15093578b8b539 Parent: e1d1484f72127a5580d37c379f6a5b2c2786434c Author: Peter Williams [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:51 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:51 2007 +0200 sched: isolate SMP balancing code a bit more At the moment, a lot of load balancing code that is irrelevant to non SMP systems gets included during non SMP builds. This patch addresses this issue and reduces the binary size on non SMP systems: textdata bss dec hex filename 10983 281192 122032fab sched.o.before 10739 281192 119592eb7 sched.o.after Signed-off-by: Peter Williams [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- include/linux/sched.h |2 ++ kernel/sched.c | 17 - kernel/sched_fair.c |4 kernel/sched_idletask.c |4 kernel/sched_rt.c |4 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 639241f..24e08d1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -828,6 +828,7 @@ struct sched_class { struct task_struct * (*pick_next_task) (struct rq *rq); void (*put_prev_task) (struct rq *rq, struct task_struct *p); +#ifdef CONFIG_SMP unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, struct rq *busiest, unsigned long max_load_move, struct sched_domain *sd, enum cpu_idle_type idle, @@ -836,6 +837,7 @@ struct sched_class { int (*move_one_task) (struct rq *this_rq, int this_cpu, struct rq *busiest, struct sched_domain *sd, enum cpu_idle_type idle); +#endif void (*set_curr_task) (struct rq *rq); void (*task_tick) (struct rq *rq, struct task_struct *p); diff --git a/kernel/sched.c b/kernel/sched.c index 8607795..b4fbbc4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -849,23 +849,6 @@ static int iter_move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest, struct sched_domain *sd, enum cpu_idle_type idle, struct rq_iterator *iterator); -#else -static inline unsigned long -balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, - unsigned long max_load_move, struct sched_domain *sd, - enum cpu_idle_type idle, int *all_pinned, - int *this_best_prio, struct rq_iterator *iterator) -{ - return 0; -} - -static inline int -iter_move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest, - struct sched_domain *sd, enum cpu_idle_type idle, - struct rq_iterator *iterator) -{ - return 0; -} #endif #include sched_stats.h diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a90d045..9971831 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -876,6 +876,7 @@ static void put_prev_task_fair(struct rq *rq, struct task_struct *prev) } } +#ifdef CONFIG_SMP /** * Fair scheduling class load-balancing methods: */ @@ -1008,6 +1009,7 @@ move_one_task_fair(struct rq *this_rq, int this_cpu, struct rq *busiest, return 0; } +#endif /* * scheduler tick hitting a task of our scheduling class: @@ -1084,8 +1086,10 @@ static const struct sched_class fair_sched_class = { .pick_next_task = pick_next_task_fair, .put_prev_task = put_prev_task_fair, +#ifdef CONFIG_SMP .load_balance = load_balance_fair, .move_one_task = move_one_task_fair, +#endif .set_curr_task = set_curr_task_fair, .task_tick = task_tick_fair, diff --git a/kernel/sched_idletask.c b/kernel/sched_idletask.c index 586b06c..bf9c25c 100644 --- a/kernel/sched_idletask.c +++ b/kernel/sched_idletask.c @@ -37,6 +37,7 @@ static void put_prev_task_idle(struct rq *rq, struct task_struct *prev) { } +#ifdef CONFIG_SMP static unsigned long load_balance_idle(struct rq *this_rq, int this_cpu, struct rq *busiest, unsigned long max_load_move, @@ -52,6 +53,7 @@ move_one_task_idle(struct rq *this_rq, int this_cpu, struct rq *busiest, { return 0; } +#endif static void task_tick_idle(struct rq *rq, struct task_struct *curr) { @@ -76,8 +78,10 @@ const struct sched_class idle_sched_class = { .pick_next_task = pick_next_task_idle, .put_prev_task = put_prev_task_idle, +#ifdef CONFIG_SMP .load_balance = load_balance_idle, .move_one_task = move_one_task_idle, +#endif
sched: mark CONFIG_FAIR_GROUP_SCHED as !EXPERIMENTAL
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ef93cf11413e3f2dc28bfaf736e1f49981ed700 Commit: 8ef93cf11413e3f2dc28bfaf736e1f49981ed700 Parent: 681f3e68541d6f03e3e05d21fe15093578b8b539 Author: Ingo Molnar [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:51 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 18:23:51 2007 +0200 sched: mark CONFIG_FAIR_GROUP_SCHED as !EXPERIMENTAL mark CONFIG_FAIR_GROUP_SCHED as !EXPERIMENTAL. All bugs have been fixed and it's perfect ;-) Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- init/Kconfig |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index b7dffa8..8b88d0b 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -322,7 +322,6 @@ config CPUSETS config FAIR_GROUP_SCHED bool Fair group CPU scheduler default y - depends on EXPERIMENTAL help This feature lets CPU scheduler recognize task groups and control CPU bandwidth allocation to such task groups. - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
remove Documentation/networking/net-modules.txt
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4316b450e811a7298c80bb4f905af2de5cab54a8 Commit: 4316b450e811a7298c80bb4f905af2de5cab54a8 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:25:03 2007 +0200 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:13 2007 -0400 remove Documentation/networking/net-modules.txt According to git, the only one who touched this file during the last 5 years was me when removing drivers... modinfo offers less ancient information. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Acked-by: Geert Uytterhoeven [EMAIL PROTECTED] Acked-by: Paul Gortmaker [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- Documentation/networking/00-INDEX|2 - Documentation/networking/net-modules.txt | 315 -- 2 files changed, 0 insertions(+), 317 deletions(-) diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index 153d84d..f5a5e6d 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX @@ -80,8 +80,6 @@ multicast.txt - Behaviour of cards under Multicast ncsa-telnet - notes on how NCSA telnet (DOS) breaks with MTU discovery enabled. -net-modules.txt - - info and insmod parameters for all network driver modules. netdevices.txt - info on network device driver functions exported to the kernel. olympic.txt diff --git a/Documentation/networking/net-modules.txt b/Documentation/networking/net-modules.txt deleted file mode 100644 index 98c4392..000 --- a/Documentation/networking/net-modules.txt +++ /dev/null @@ -1,315 +0,0 @@ -Wed 2-Aug-95 [EMAIL PROTECTED] - - Linux network driver modules - - Do not mistake this for README.modules at the top-level - directory! That document tells about modules in general, while - this one tells only about network device driver modules. - - This is a potpourri of INSMOD-time(*) configuration options - (if such exists) and their default values of various modules - in the Linux network drivers collection. - - Some modules have also hidden (= non-documented) tunable values. - The choice of not documenting them is based on general belief, that - the less the user needs to know, the better. (There are things that - driver developers can use, others should not confuse themselves.) - - In many cases it is highly preferred that insmod:ing is done - ONLY with defining an explicit address for the card, AND BY - NOT USING AUTO-PROBING! - - Now most cards have some explicitly defined base address that they - are compiled with (to avoid auto-probing, among other things). - If that compiled value does not match your actual configuration, - do use the io=0xXXX -parameter for the insmod, and give there - a value matching your environment. - - If you are adventurous, you can ask the driver to autoprobe - by using the io=0 parameter, however it is a potentially dangerous - thing to do in a live system. (If you don't know where the - card is located, you can try autoprobing, and after possible - crash recovery, insmod with proper IO-address..) - - -- - (*) INSMOD-time means when you load module with - /sbin/insmod you can feed it optional parameters. - See man insmod. - -- - - - 8390 based Network Modules (Paul Gortmaker, Nov 12, 1995) - -- - -(Includes: smc-ultra, ne, wd, 3c503, hp, hp-plus, e2100 and ac3200) - -The 8390 series of network drivers now support multiple card systems without -reloading the same module multiple times (memory efficient!) This is done by -specifying multiple comma separated values, such as: - - insmod 3c503.o io=0x280,0x300,0x330,0x350 xcvr=0,1,0,1 - -The above would have the one module controlling four 3c503 cards, with card 2 -and 4 using external transceivers. The insmod manual describes the usage -of comma separated value lists. - -It is *STRONGLY RECOMMENDED* that you supply io= instead of autoprobing. -If an io= argument is not supplied, then the ISA drivers will complain -about autoprobing being not recommended, and begrudgingly autoprobe for -a *SINGLE CARD ONLY* -- if you want to use multiple cards you *have* to -supply an io=0xNNN,0xQQQ,... argument. - -The ne module is an exception to the above. A NE2000 is essentially an -8390 chip, some bus glue and some RAM. Because of this, the ne probe is -more invasive than the rest, and so at boot we make sure the ne probe is -done last of all the 8390 cards (so that it won't trip over other 8390 based -cards) With modules we can't ensure that all other non-ne
drivers/net/ipg.c: cleanups
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96fd74b2d9b59edeed7ea1287d322b7661d549ca Commit: 96fd74b2d9b59edeed7ea1287d322b7661d549ca Parent: 4316b450e811a7298c80bb4f905af2de5cab54a8 Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:19 2007 +0200 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:13 2007 -0400 drivers/net/ipg.c: cleanups This patch contains the following cleanups: - make ipg_nic_get_stats() static - move DefaultPhyParam[] from ipg.h to ipg.c and make it static Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/ipg.c | 22 +- drivers/net/ipg.h | 20 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 6888723..dbd23bb 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -55,6 +55,26 @@ MODULE_DESCRIPTION(IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver DrvVer); MODULE_LICENSE(GPL); +//variable record -- index by leading revision/length +//Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN +static unsigned short DefaultPhyParam[] = { + // 11/12/03 IP1000A v1-3 rev=0x40 + /*-- + (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, +27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, +31, 0x, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, + --*/ + // 12/17/03 IP1000A v1-4 rev=0x40 + (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, + 0x, + 30, 0x005e, 9, 0x0700, + // 01/09/04 IP1000A v1-5 rev=0x41 + (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, + 0x, + 30, 0x005e, 9, 0x0700, + 0x +}; + static const char *ipg_brand_name[] = { IC PLUS IP1000 1000/100/10 based NIC, Sundance Technology ST2021 based NIC, @@ -990,7 +1010,7 @@ static void ipg_nic_txcleanup(struct net_device *dev) } /* Provides statistical information about the IPG NIC. */ -struct net_device_stats *ipg_nic_get_stats(struct net_device *dev) +static struct net_device_stats *ipg_nic_get_stats(struct net_device *dev) { struct ipg_nic_private *sp = netdev_priv(dev); void __iomem *ioaddr = sp-ioaddr; diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h index e418b90..d5d092c 100644 --- a/drivers/net/ipg.h +++ b/drivers/net/ipg.h @@ -833,24 +833,4 @@ struct ipg_nic_private { struct delayed_work task; }; -//variable record -- index by leading revision/length -//Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN -unsigned short DefaultPhyParam[] = { - // 11/12/03 IP1000A v1-3 rev=0x40 - /*-- - (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, -27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, -31, 0x, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, - --*/ - // 12/17/03 IP1000A v1-4 rev=0x40 - (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x41 - (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - 0x -}; - #endif /* __LINUX_IPG_H */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
natsemi: fix oops, link back netdevice from private-struct
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbbab5ca835fb7676434815a47add8f2c696bec7 Commit: bbbab5ca835fb7676434815a47add8f2c696bec7 Parent: 0173b793ca477aa2ca516ebf0a35e137b678d466 Author: Ingo Molnar [EMAIL PROTECTED] AuthorDate: Wed Oct 24 13:58:57 2007 +0200 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:14 2007 -0400 natsemi: fix oops, link back netdevice from private-struct * Andrew Nelless [EMAIL PROTECTED] wrote: Hi, I booted up 2.6.24-rc1 this morning [Real early over a brew ;-)] and was having a problems with multiple ~5 second hangs on SATA/drive init (Something to do with EH something-or-other and resets but I'll email in separately about it later unless its fixed by the time I get the chance). Anyway, I went to fire up netconsole to get a decent log dump and hit across the following nasty. Netconsole works fine in 2.6.23.1 with a similar config and the same kernel parameters. A shot of the screen is the only method I could come up with to capture the log, I hope that is OK, it is pretty readable. The nasty: http://andotnet.nfshost.com/linux/2.6.24-rc1-netconsole-nullderef.jpg the NULL dereference is here: (gdb) list *0x804a9504 0x804a9504 is in natsemi_poll (drivers/net/natsemi.c:717). 712 return count; 713 } 714 715 static inline void __iomem *ns_ioaddr(struct net_device *dev) 716 { 717 return (void __iomem *) dev-base_addr; 718 } 719 which is this code from natsemi.c: 2227struct net_device *dev = np-dev; 2228void __iomem * ioaddr = ns_ioaddr(dev); 2229int work_done = 0; seems like the NAPI changes in -rc1 added an np-dev field but forgot to initialize it ... does the patch below fix the oops for you? Ingo Subject: natsemi: fix oops, link back netdevice from private-struct From: Ingo Molnar [EMAIL PROTECTED] this commit: commit bea3348eef27e6044b6161fd04c3152215f96411 Author: Stephen Hemminger [EMAIL PROTECTED] Date: Wed Oct 3 16:41:36 2007 -0700 [NET]: Make NAPI polling independent of struct net_device objects. added np-dev to drivers/net/natsemi.c's struct netdev_private, but forgot to initialize that new field upon driver init. The result was a predictable NULL dereference oops the first time the hardware generated an interrupt. Reported-by: Andrew Nelless [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/natsemi.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 9531171..87cde06 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c @@ -864,6 +864,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev, np = netdev_priv(dev); netif_napi_add(dev, np-napi, natsemi_poll, 64); + np-dev = dev; np-pci_dev = pdev; pci_set_drvdata(pdev, dev); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
cpmac: use print_mac() instead of MAC_FMT
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df523b5cd9950485350fb1b7d97d5b8882d94a4e Commit: df523b5cd9950485350fb1b7d97d5b8882d94a4e Parent: bbbab5ca835fb7676434815a47add8f2c696bec7 Author: Eugene Konev [EMAIL PROTECTED] AuthorDate: Wed Oct 24 10:42:01 2007 +0800 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:14 2007 -0400 cpmac: use print_mac() instead of MAC_FMT Switch to using DECLARE_MAC_BUF/print_mac() added by commit 0795af5729b18218767fab27c44b1384f72dc9ad [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF(). Signed-off-by: Eugene Konev [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/cpmac.c | 13 - 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 57541d2..0598d4d 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c @@ -53,12 +53,6 @@ MODULE_PARM_DESC(debug_level, Number of NETIF_MSG bits to enable); MODULE_PARM_DESC(dumb_switch, Assume switch is not connected to MDIO bus); #define CPMAC_VERSION 0.5.0 -/* stolen from net/ieee80211.h */ -#ifndef MAC_FMT -#define MAC_FMT %02x:%02x:%02x:%02x:%02x:%02x -#define MAC_ARG(x) ((u8*)(x))[0], ((u8*)(x))[1], ((u8*)(x))[2], \ - ((u8*)(x))[3], ((u8*)(x))[4], ((u8*)(x))[5] -#endif /* frame size + 802.1q tag */ #define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) #define CPMAC_QUEUES 8 @@ -1006,6 +1000,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) struct cpmac_priv *priv; struct net_device *dev; struct plat_cpmac_data *pdata; + DECLARE_MAC_BUF(mac); pdata = pdev-dev.platform_data; @@ -1077,9 +1072,9 @@ static int __devinit cpmac_probe(struct platform_device *pdev) if (netif_msg_probe(priv)) { printk(KERN_INFO - cpmac: device %s (regs: %p, irq: %d, phy: %s, mac: - MAC_FMT )\n, dev-name, (void *)mem-start, dev-irq, - priv-phy_name, MAC_ARG(dev-dev_addr)); + cpmac: device %s (regs: %p, irq: %d, phy: %s, + mac: %s)\n, dev-name, (void *)mem-start, dev-irq, + priv-phy_name, print_mac(mac, dev-dev_addr)); } return 0; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
cpmac: convert to napi_struct interface
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67d129d14da1555bb3eaca754f6f81c02cacbe0e Commit: 67d129d14da1555bb3eaca754f6f81c02cacbe0e Parent: df523b5cd9950485350fb1b7d97d5b8882d94a4e Author: Eugene Konev [EMAIL PROTECTED] AuthorDate: Wed Oct 24 10:42:02 2007 +0800 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:15 2007 -0400 cpmac: convert to napi_struct interface Convert cpmac to new napi_struct API introduced by bea3348eef27e6044b6161fd04c3152215f96411 [NET]: Make NAPI polling independent of struct net_device objects. Only disable rx interrupts if napi actually has been scheduled. Signed-off-by: Eugene Konev [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/cpmac.c | 68 +++--- 1 files changed, 37 insertions(+), 31 deletions(-) diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 0598d4d..486c82b 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c @@ -205,6 +205,7 @@ struct cpmac_priv { struct net_device *dev; struct work_struct reset_work; struct platform_device *pdev; + struct napi_struct napi; }; static irqreturn_t cpmac_irq(int, void *); @@ -356,47 +357,48 @@ static void cpmac_set_multicast_list(struct net_device *dev) } } -static struct sk_buff *cpmac_rx_one(struct net_device *dev, - struct cpmac_priv *priv, +static struct sk_buff *cpmac_rx_one(struct cpmac_priv *priv, struct cpmac_desc *desc) { struct sk_buff *skb, *result = NULL; if (unlikely(netif_msg_hw(priv))) - cpmac_dump_desc(dev, desc); + cpmac_dump_desc(priv-dev, desc); cpmac_write(priv-regs, CPMAC_RX_ACK(0), (u32)desc-mapping); if (unlikely(!desc-datalen)) { if (netif_msg_rx_err(priv) net_ratelimit()) printk(KERN_WARNING %s: rx: spurious interrupt\n, - dev-name); + priv-dev-name); return NULL; } - skb = netdev_alloc_skb(dev, CPMAC_SKB_SIZE); + skb = netdev_alloc_skb(priv-dev, CPMAC_SKB_SIZE); if (likely(skb)) { skb_reserve(skb, 2); skb_put(desc-skb, desc-datalen); - desc-skb-protocol = eth_type_trans(desc-skb, dev); + desc-skb-protocol = eth_type_trans(desc-skb, priv-dev); desc-skb-ip_summed = CHECKSUM_NONE; - dev-stats.rx_packets++; - dev-stats.rx_bytes += desc-datalen; + priv-dev-stats.rx_packets++; + priv-dev-stats.rx_bytes += desc-datalen; result = desc-skb; - dma_unmap_single(dev-dev, desc-data_mapping, CPMAC_SKB_SIZE, -DMA_FROM_DEVICE); + dma_unmap_single(priv-dev-dev, desc-data_mapping, +CPMAC_SKB_SIZE, DMA_FROM_DEVICE); desc-skb = skb; - desc-data_mapping = dma_map_single(dev-dev, skb-data, + desc-data_mapping = dma_map_single(priv-dev-dev, skb-data, CPMAC_SKB_SIZE, DMA_FROM_DEVICE); desc-hw_data = (u32)desc-data_mapping; if (unlikely(netif_msg_pktdata(priv))) { - printk(KERN_DEBUG %s: received packet:\n, dev-name); - cpmac_dump_skb(dev, result); + printk(KERN_DEBUG %s: received packet:\n, + priv-dev-name); + cpmac_dump_skb(priv-dev, result); } } else { if (netif_msg_rx_err(priv) net_ratelimit()) printk(KERN_WARNING - %s: low on skbs, dropping packet\n, dev-name); - dev-stats.rx_dropped++; + %s: low on skbs, dropping packet\n, + priv-dev-name); + priv-dev-stats.rx_dropped++; } desc-buflen = CPMAC_SKB_SIZE; @@ -405,25 +407,25 @@ static struct sk_buff *cpmac_rx_one(struct net_device *dev, return result; } -static int cpmac_poll(struct net_device *dev, int *budget) +static int cpmac_poll(struct napi_struct *napi, int budget) { struct sk_buff *skb; struct cpmac_desc *desc; - int received = 0, quota = min(dev-quota, *budget); - struct cpmac_priv *priv = netdev_priv(dev); + int received = 0; + struct cpmac_priv *priv = container_of(napi, struct cpmac_priv, napi); spin_lock(priv-rx_lock); if (unlikely(!priv-rx_head)) { if (netif_msg_rx_err(priv) net_ratelimit())
cpmac: update to new fixed phy driver interface
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b88219f8a2028a1ca2dd17aa7c9d9b643615646e Commit: b88219f8a2028a1ca2dd17aa7c9d9b643615646e Parent: 67d129d14da1555bb3eaca754f6f81c02cacbe0e Author: Eugene Konev [EMAIL PROTECTED] AuthorDate: Wed Oct 24 10:42:03 2007 +0800 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:31:15 2007 -0400 cpmac: update to new fixed phy driver interface Use fixed_mdio_get_phydev for obtaining fixed phy instances and adopt to changed fixed phy device naming. Signed-off-by: Eugene Konev [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/cpmac.c | 64 -- 1 files changed, 46 insertions(+), 18 deletions(-) diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 486c82b..6fd95a2 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c @@ -34,6 +34,7 @@ #include linux/skbuff.h #include linux/mii.h #include linux/phy.h +#include linux/phy_fixed.h #include linux/platform_device.h #include linux/dma-mapping.h #include asm/gpio.h @@ -847,6 +848,15 @@ static void cpmac_adjust_link(struct net_device *dev) spin_unlock(priv-lock); } +static int cpmac_link_update(struct net_device *dev, +struct fixed_phy_status *status) +{ + status-link = 1; + status-speed = 100; + status-duplex = 1; + return 0; +} + static int cpmac_open(struct net_device *dev) { int i, size, res; @@ -855,15 +865,6 @@ static int cpmac_open(struct net_device *dev) struct cpmac_desc *desc; struct sk_buff *skb; - priv-phy = phy_connect(dev, priv-phy_name, cpmac_adjust_link, - 0, PHY_INTERFACE_MODE_MII); - if (IS_ERR(priv-phy)) { - if (netif_msg_drv(priv)) - printk(KERN_ERR %s: Could not attach to PHY\n, - dev-name); - return PTR_ERR(priv-phy); - } - mem = platform_get_resource_byname(priv-pdev, IORESOURCE_MEM, regs); if (!request_mem_region(mem-start, mem-end - mem-start, dev-name)) { if (netif_msg_drv(priv)) @@ -950,8 +951,6 @@ fail_remap: release_mem_region(mem-start, mem-end - mem-start); fail_reserve: - phy_disconnect(priv-phy); - return res; } @@ -966,8 +965,6 @@ static int cpmac_stop(struct net_device *dev) cancel_work_sync(priv-reset_work); napi_disable(priv-napi); phy_stop(priv-phy); - phy_disconnect(priv-phy); - priv-phy = NULL; cpmac_hw_stop(dev); @@ -1001,11 +998,12 @@ static int external_switch; static int __devinit cpmac_probe(struct platform_device *pdev) { - int rc, phy_id; + int rc, phy_id, i; struct resource *mem; struct cpmac_priv *priv; struct net_device *dev; struct plat_cpmac_data *pdata; + struct fixed_info *fixed_phy; DECLARE_MAC_BUF(mac); pdata = pdev-dev.platform_data; @@ -1064,11 +1062,41 @@ static int __devinit cpmac_probe(struct platform_device *pdev) priv-ring_size = 64; priv-msg_enable = netif_msg_init(debug_level, 0xff); memcpy(dev-dev_addr, pdata-dev_addr, sizeof(dev-dev_addr)); + if (phy_id == 31) { - snprintf(priv-phy_name, BUS_ID_SIZE, PHY_ID_FMT, -cpmac_mii.id, phy_id); - } else - snprintf(priv-phy_name, BUS_ID_SIZE, [EMAIL PROTECTED]:%d, 100, 1); + snprintf(priv-phy_name, BUS_ID_SIZE, PHY_ID_FMT, cpmac_mii.id, +phy_id); + } else { + /* Let's try to get a free fixed phy... */ + for (i = 0; i MAX_PHY_AMNT; i++) { + fixed_phy = fixed_mdio_get_phydev(i); + if (!fixed_phy) + continue; + if (!fixed_phy-phydev-attached_dev) { + strncpy(priv-phy_name, + fixed_phy-phydev-dev.bus_id, + BUS_ID_SIZE); + fixed_mdio_set_link_update(fixed_phy-phydev, + cpmac_link_update); + goto phy_found; + } + } + if (netif_msg_drv(priv)) + printk(KERN_ERR %s: Could not find fixed PHY\n, + dev-name); + rc = -ENODEV; + goto fail; + } + +phy_found: + priv-phy = phy_connect(dev, priv-phy_name, cpmac_adjust_link, 0, + PHY_INTERFACE_MODE_MII); + if (IS_ERR(priv-phy)) { + if (netif_msg_drv(priv)) + printk(KERN_ERR %s: Could not attach to PHY\n, +
rndis_host: reduce MTU instead of refusing to talk to devices with low max packet size
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=500d2c2f7b8c1cf6194dc9e8f47c6e2295fc5be5 Commit: 500d2c2f7b8c1cf6194dc9e8f47c6e2295fc5be5 Parent: b88219f8a2028a1ca2dd17aa7c9d9b643615646e Author: Thomas Sailer [EMAIL PROTECTED] AuthorDate: Wed Oct 24 00:47:19 2007 +0200 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:34:59 2007 -0400 rndis_host: reduce MTU instead of refusing to talk to devices with low max packet size This patch makes the host RNDIS driver talk to RNDIS devices with an MTU less than 1.5k, instead of refusing to talk to such a device. Signed-Off-by: Thomas Sailer [EMAIL PROTECTED] Acked-by: David Brownell [EMAIL PROTECTED] -- Hi Jeff, are you the right person to send this to? Nobody else seems to be wanting to forward this to Linus... Thanks, Tom Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/usb/rndis_host.c | 18 +- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index cd991a0..1ebe325 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -512,11 +512,19 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) } tmp = le32_to_cpu(u.init_c-max_transfer_size); if (tmp dev-hard_mtu) { - dev_err(intf-dev, - dev can't take %u byte packets (max %u)\n, - dev-hard_mtu, tmp); - retval = -EINVAL; - goto fail_and_release; + if (tmp = net-hard_header_len) { + dev_err(intf-dev, + dev can't take %u byte packets (max %u)\n, + dev-hard_mtu, tmp); + retval = -EINVAL; + goto fail_and_release; + } + dev-hard_mtu = tmp; + net-mtu = dev-hard_mtu - net-hard_header_len; + dev_warn(intf-dev, +dev can't take %u byte packets (max %u), +adjusting MTU to %u\n, +dev-hard_mtu, tmp, net-mtu); } /* REVISIT: peripheral alignment request is ignored ... */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[netdrvr] forcedeth: add MCP77 device IDs
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96fd4cd3e40e240f0c385af87f58e74da8b7099a Commit: 96fd4cd3e40e240f0c385af87f58e74da8b7099a Parent: 500d2c2f7b8c1cf6194dc9e8f47c6e2295fc5be5 Author: Ayaz Abdulla [EMAIL PROTECTED] AuthorDate: Thu Oct 25 03:36:42 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 03:36:42 2007 -0400 [netdrvr] forcedeth: add MCP77 device IDs Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/net/forcedeth.c | 16 include/linux/pci_ids.h |4 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 70ddf1a..92ce2e3 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -5597,6 +5597,22 @@ static struct pci_device_id pci_tbl[] = { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_31), .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR, }, + { /* MCP77 Ethernet Controller */ + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32), + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT, + }, + { /* MCP77 Ethernet Controller */ + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33), + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT, + }, + { /* MCP77 Ethernet Controller */ + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34), + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT, + }, + { /* MCP77 Ethernet Controller */ + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35), + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT, + }, {0,}, }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4e10a07..e44aac8 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1236,6 +1236,10 @@ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 +#define PCI_DEVICE_ID_NVIDIA_NVENET_32 0x0760 +#define PCI_DEVICE_ID_NVIDIA_NVENET_33 0x0761 +#define PCI_DEVICE_ID_NVIDIA_NVENET_34 0x0762 +#define PCI_DEVICE_ID_NVIDIA_NVENET_35 0x0763 #define PCI_VENDOR_ID_IMS 0x10e0 #define PCI_DEVICE_ID_IMS_TT1280x9128 - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[libata] Create internal helper ata_dev_set_feature()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=218f3d30e60f32394738372c594d063f8e43ee6d Commit: 218f3d30e60f32394738372c594d063f8e43ee6d Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Thu Oct 25 00:33:27 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 00:33:27 2007 -0400 [libata] Create internal helper ata_dev_set_feature() Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/ata/libata-core.c | 26 +++--- 1 files changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2d147b5..294eee3 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -68,7 +68,8 @@ const unsigned long sata_deb_timing_long[]= { 100, 2000, 5000 }; static unsigned int ata_dev_init_params(struct ata_device *dev, u16 heads, u16 sectors); static unsigned int ata_dev_set_xfermode(struct ata_device *dev); -static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable); +static unsigned int ata_dev_set_feature(struct ata_device *dev, + u8 enable, u8 feature); static void ata_dev_xfermask(struct ata_device *dev); static unsigned long ata_dev_blacklisted(const struct ata_device *dev); @@ -1799,13 +1800,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, * SET_FEATURES spin-up subcommand before it will accept * anything other than the original IDENTIFY command. */ - ata_tf_init(dev, tf); - tf.command = ATA_CMD_SET_FEATURES; - tf.feature = SETFEATURES_SPINUP; - tf.protocol = ATA_PROT_NODATA; - tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; - err_mask = ata_exec_internal(dev, tf, NULL, -DMA_NONE, NULL, 0, 0); + err_mask = ata_dev_set_feature(dev, SETFEATURES_SPINUP, 0); if (err_mask id[2] != 0x738c) { rc = -EIO; reason = SPINUP failed; @@ -2075,7 +2070,8 @@ int ata_dev_configure(struct ata_device *dev) unsigned int err_mask; /* issue SET feature command to turn this on */ - err_mask = ata_dev_set_AN(dev, SETFEATURES_SATA_ENABLE); + err_mask = ata_dev_set_feature(dev, + SETFEATURES_SATA_ENABLE, SATA_AN); if (err_mask) ata_dev_printk(dev, KERN_ERR, failed to enable ATAPI AN @@ -4181,15 +4177,14 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev) DPRINTK(EXIT, err_mask=%x\n, err_mask); return err_mask; } - /** - * ata_dev_set_AN - Issue SET FEATURES - SATA FEATURES + * ata_dev_set_feature - Issue SET FEATURES - SATA FEATURES * @dev: Device to which command will be sent * @enable: Whether to enable or disable the feature + * @feature: The sector count represents the feature to set * * Issue SET FEATURES - SATA FEATURES command to device @dev - * on port @ap with sector count set to indicate Asynchronous - * Notification feature + * on port @ap with sector count * * LOCKING: * PCI/etc. bus probe sem. @@ -4197,7 +4192,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev) * RETURNS: * 0 on success, AC_ERR_* mask otherwise. */ -static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable) +static unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, + u8 feature) { struct ata_taskfile tf; unsigned int err_mask; @@ -4210,7 +4206,7 @@ static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable) tf.feature = enable; tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; tf.protocol = ATA_PROT_NODATA; - tf.nsect = SATA_AN; + tf.nsect = feature; err_mask = ata_exec_internal(dev, tf, NULL, DMA_NONE, NULL, 0, 0); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
libata-core.c: make 2 functions static
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=741b776335c3e91b0b8bf765a97f9484a3cd5034 Commit: 741b776335c3e91b0b8bf765a97f9484a3cd5034 Parent: 218f3d30e60f32394738372c594d063f8e43ee6d Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:23:06 2007 +0200 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 01:59:30 2007 -0400 libata-core.c: make 2 functions static strn_pattern_cmp() and ata_port_detach() can become static. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/ata/libata-core.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 294eee3..0ec717b 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4003,7 +4003,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { } }; -int strn_pattern_cmp(const char *patt, const char *name, int wildchar) +static int strn_pattern_cmp(const char *patt, const char *name, int wildchar) { const char *p; int len; @@ -6917,7 +6917,7 @@ int ata_host_activate(struct ata_host *host, int irq, * LOCKING: * Kernel thread context (may sleep). */ -void ata_port_detach(struct ata_port *ap) +static void ata_port_detach(struct ata_port *ap) { unsigned long flags; struct ata_link *link; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
libata: cosmetic clean up in ata_eh_reset()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e06d9ce7a49d2ef2858cf07b44a324fc3a4c192 Commit: 0e06d9ce7a49d2ef2858cf07b44a324fc3a4c192 Parent: 741b776335c3e91b0b8bf765a97f9484a3cd5034 Author: Tejun Heo [EMAIL PROTECTED] AuthorDate: Wed Oct 24 15:21:26 2007 +0900 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 02:02:02 2007 -0400 libata: cosmetic clean up in ata_eh_reset() Local variable @action usage in ata_eh_reset() is a bit confusing. It's used only to cache ehc-i.action to test reset masks after clearing it; however, due to the generic name action, it's easy to misinterpret the local variable as containing the selected reset method later. Also, the reason for caching the original value is easy to miss. This patch renames @action to @tmp_action and make it buffer newly selected value instead to improve readability. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/ata/libata-eh.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 93e2b54..8cb35bb 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2071,7 +2071,7 @@ int ata_eh_reset(struct ata_link *link, int classify, int try = 0; struct ata_device *dev; unsigned long deadline; - unsigned int action; + unsigned int tmp_action; ata_reset_fn_t reset; unsigned long flags; int rc; @@ -2086,14 +2086,14 @@ int ata_eh_reset(struct ata_link *link, int classify, /* Determine which reset to use and record in ehc-i.action. * prereset() may examine and modify it. */ - action = ehc-i.action; - ehc-i.action = ~ATA_EH_RESET_MASK; if (softreset (!hardreset || (!(link-flags ATA_LFLAG_NO_SRST) !sata_set_spd_needed(link) -!(action ATA_EH_HARDRESET - ehc-i.action |= ATA_EH_SOFTRESET; +!(ehc-i.action ATA_EH_HARDRESET + tmp_action = ATA_EH_SOFTRESET; else - ehc-i.action |= ATA_EH_HARDRESET; + tmp_action = ATA_EH_HARDRESET; + + ehc-i.action = (ehc-i.action ~ATA_EH_RESET_MASK) | tmp_action; if (prereset) { rc = prereset(link, jiffies + ATA_EH_PRERESET_TIMEOUT); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Fix pata_icside build for recent libata API changes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c15fcafe1c42daff212d78d4ce9619a52a74379f Commit: c15fcafe1c42daff212d78d4ce9619a52a74379f Parent: 0e06d9ce7a49d2ef2858cf07b44a324fc3a4c192 Author: Al Viro [EMAIL PROTECTED] AuthorDate: Sun Oct 14 01:12:39 2007 +0100 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 02:05:26 2007 -0400 Fix pata_icside build for recent libata API changes Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/ata/pata_icside.c | 42 ++ 1 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c index be30923..842fe08 100644 --- a/drivers/ata/pata_icside.c +++ b/drivers/ata/pata_icside.c @@ -332,12 +332,13 @@ static void ata_dummy_noret(struct ata_port *port) { } -static void pata_icside_postreset(struct ata_port *ap, unsigned int *classes) +static void pata_icside_postreset(struct ata_link *link, unsigned int *classes) { + struct ata_port *ap = link-ap; struct pata_icside_state *state = ap-host-private_data; if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE) - return ata_std_postreset(ap, classes); + return ata_std_postreset(link, classes); state-port[ap-port_no].disabled = 1; @@ -395,29 +396,30 @@ static struct ata_port_operations pata_icside_port_ops = { static void __devinit pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base, -const struct portinfo *info) +struct pata_icside_info *info, +const struct portinfo *port) { struct ata_ioports *ioaddr = ap-ioaddr; - void __iomem *cmd = base + info-dataoffset; + void __iomem *cmd = base + port-dataoffset; ioaddr-cmd_addr= cmd; - ioaddr-data_addr = cmd + (ATA_REG_DATA info-stepping); - ioaddr-error_addr = cmd + (ATA_REG_ERR info-stepping); - ioaddr-feature_addr= cmd + (ATA_REG_FEATURE info-stepping); - ioaddr-nsect_addr = cmd + (ATA_REG_NSECTinfo-stepping); - ioaddr-lbal_addr = cmd + (ATA_REG_LBAL info-stepping); - ioaddr-lbam_addr = cmd + (ATA_REG_LBAM info-stepping); - ioaddr-lbah_addr = cmd + (ATA_REG_LBAH info-stepping); - ioaddr-device_addr = cmd + (ATA_REG_DEVICE info-stepping); - ioaddr-status_addr = cmd + (ATA_REG_STATUS info-stepping); - ioaddr-command_addr= cmd + (ATA_REG_CMD info-stepping); - - ioaddr-ctl_addr= base + info-ctrloffset; + ioaddr-data_addr = cmd + (ATA_REG_DATA port-stepping); + ioaddr-error_addr = cmd + (ATA_REG_ERR port-stepping); + ioaddr-feature_addr= cmd + (ATA_REG_FEATURE port-stepping); + ioaddr-nsect_addr = cmd + (ATA_REG_NSECTport-stepping); + ioaddr-lbal_addr = cmd + (ATA_REG_LBAL port-stepping); + ioaddr-lbam_addr = cmd + (ATA_REG_LBAM port-stepping); + ioaddr-lbah_addr = cmd + (ATA_REG_LBAH port-stepping); + ioaddr-device_addr = cmd + (ATA_REG_DEVICE port-stepping); + ioaddr-status_addr = cmd + (ATA_REG_STATUS port-stepping); + ioaddr-command_addr= cmd + (ATA_REG_CMD port-stepping); + + ioaddr-ctl_addr= base + port-ctrloffset; ioaddr-altstatus_addr = ioaddr-ctl_addr; ata_port_desc(ap, cmd 0x%lx ctl 0x%lx, - info-raw_base + info-dataoffset, - info-raw_base + info-ctrloffset); + info-raw_base + port-dataoffset, + info-raw_base + port-ctrloffset); if (info-raw_ioc_base) ata_port_desc(ap, iocbase 0x%lx, info-raw_ioc_base); @@ -441,7 +443,7 @@ static int __devinit pata_icside_register_v5(struct pata_icside_info *info) info-nr_ports = 1; info-port[0] = pata_icside_portinfo_v5; - info-raw_base = ecard_resource_start(ec, ECARD_RES_MEMC); + info-raw_base = ecard_resource_start(info-ec, ECARD_RES_MEMC); return 0; } @@ -522,7 +524,7 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info) ap-flags |= ATA_FLAG_SLAVE_POSS; ap-ops = pata_icside_port_ops; - pata_icside_setup_ioaddr(ap, info-base, info-port[i]); + pata_icside_setup_ioaddr(ap, info-base, info, info-port[i]); } return ata_host_activate(host, ec-irq, ata_interrupt, 0, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ahci: ahci: implement workaround for ASUS P5W-DH Deluxe ahci_broken_hardreset(), take #2
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=edc93052844c2032b2ec5910ace516da9078714d Commit: edc93052844c2032b2ec5910ace516da9078714d Parent: c15fcafe1c42daff212d78d4ce9619a52a74379f Author: Tejun Heo [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:59:16 2007 +0900 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Thu Oct 25 02:06:59 2007 -0400 ahci: ahci: implement workaround for ASUS P5W-DH Deluxe ahci_broken_hardreset(), take #2 P5W-DH Deluxe has ICH9 which doesn't have PMP support but SIMG 4726 hardwired to the second port of AHCI controller at PCI device 1f.2. The 4726 doesn't work as PMP but as a storage processor which can do hardware RAID on downstream ports. When no device is attached to the downstream port of the 4726, pseudo ATA device for configuration appears. Unfortunately, ATA emulation on the device is very lousy and causes long hang during boot. This patch implements workaround for the board. If the mainboard is P5W-DH Deluxe (matched using DMI), only hardreset is used on the second port of AHCI controller @ 1f.2 and the hardreset doesn't depend on receiving the first FIS and just proceed to IDENTIFY. This workaround fixes bugzilla #8923. http://bugzilla.kernel.org/show_bug.cgi?id=8923 Signed-off-by: Tejun Heo [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/ata/ahci.c | 144 1 files changed, 144 insertions(+), 0 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 95229e7..49cf4cf 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -41,6 +41,7 @@ #include linux/interrupt.h #include linux/dma-mapping.h #include linux/device.h +#include linux/dmi.h #include scsi/scsi_host.h #include scsi/scsi_cmnd.h #include linux/libata.h @@ -241,6 +242,7 @@ static void ahci_pmp_attach(struct ata_port *ap); static void ahci_pmp_detach(struct ata_port *ap); static void ahci_error_handler(struct ata_port *ap); static void ahci_vt8251_error_handler(struct ata_port *ap); +static void ahci_p5wdh_error_handler(struct ata_port *ap); static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); static int ahci_port_resume(struct ata_port *ap); static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl); @@ -339,6 +341,40 @@ static const struct ata_port_operations ahci_vt8251_ops = { .port_stop = ahci_port_stop, }; +static const struct ata_port_operations ahci_p5wdh_ops = { + .check_status = ahci_check_status, + .check_altstatus= ahci_check_status, + .dev_select = ata_noop_dev_select, + + .tf_read= ahci_tf_read, + + .qc_defer = sata_pmp_qc_defer_cmd_switch, + .qc_prep= ahci_qc_prep, + .qc_issue = ahci_qc_issue, + + .irq_clear = ahci_irq_clear, + + .scr_read = ahci_scr_read, + .scr_write = ahci_scr_write, + + .freeze = ahci_freeze, + .thaw = ahci_thaw, + + .error_handler = ahci_p5wdh_error_handler, + .post_internal_cmd = ahci_post_internal_cmd, + + .pmp_attach = ahci_pmp_attach, + .pmp_detach = ahci_pmp_detach, + +#ifdef CONFIG_PM + .port_suspend = ahci_port_suspend, + .port_resume= ahci_port_resume, +#endif + + .port_start = ahci_port_start, + .port_stop = ahci_port_stop, +}; + #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) static const struct ata_port_info ahci_port_info[] = { @@ -1213,6 +1249,53 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, return rc ?: -EAGAIN; } +static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, + unsigned long deadline) +{ + struct ata_port *ap = link-ap; + struct ahci_port_priv *pp = ap-private_data; + u8 *d2h_fis = pp-rx_fis + RX_FIS_D2H_REG; + struct ata_taskfile tf; + int rc; + + ahci_stop_engine(ap); + + /* clear D2H reception area to properly wait for D2H FIS */ + ata_tf_init(link-device, tf); + tf.command = 0x80; + ata_tf_to_fis(tf, 0, 0, d2h_fis); + + rc = sata_link_hardreset(link, sata_ehc_deb_timing(link-eh_context), +deadline); + + ahci_start_engine(ap); + + if (rc || ata_link_offline(link)) + return rc; + + /* spec mandates = 2ms before checking status */ + msleep(150); + + /* The pseudo configuration device on SIMG4726 attached to +* ASUS P5W-DH Deluxe doesn't send signature FIS after +* hardreset if no device is attached to
lguest: use defines from x86 headers instead of magic numbers
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25c47bb35355c1e1b2ae325b49441b2c8b201ece Commit: 25c47bb35355c1e1b2ae325b49441b2c8b201ece Parent: db24e8c2ef7eceb46818a8c22fc38dea733fe159 Author: Rusty Russell [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:09:53 2007 +1000 Committer: Rusty Russell [EMAIL PROTECTED] CommitDate: Thu Oct 25 14:09:53 2007 +1000 lguest: use defines from x86 headers instead of magic numbers Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- arch/x86/lguest/boot.c|5 ++--- drivers/lguest/x86/core.c |2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index d2235db..136d9df 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -371,8 +371,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx, static unsigned long current_cr0, current_cr3; static void lguest_write_cr0(unsigned long val) { - /* 8 == TS bit. */ - lazy_hcall(LHCALL_TS, val 8, 0, 0); + lazy_hcall(LHCALL_TS, val X86_CR0_TS, 0, 0); current_cr0 = val; } @@ -387,7 +386,7 @@ static unsigned long lguest_read_cr0(void) static void lguest_clts(void) { lazy_hcall(LHCALL_TS, 0, 0, 0); - current_cr0 = ~8U; + current_cr0 = ~X86_CR0_TS; } /* CR2 is the virtual address of the last page fault, which the Guest only ever diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index 9eed12d..09d9207 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -562,7 +562,7 @@ void lguest_arch_setup_regs(struct lguest *lg, unsigned long start) * is supposed to always be 1. Bit 9 (0x200) controls whether * interrupts are enabled. We always leave interrupts enabled while * running the Guest. */ - regs-eflags = 0x202; + regs-eflags = X86_EFLAGS_IF | 0x2; /* The Extended Instruction Pointer register says where the Guest is * running. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
lguest: remove unused wake element from struct lguest
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=197bff630ae586252d24b3595c54f8f9b712610a Commit: 197bff630ae586252d24b3595c54f8f9b712610a Parent: 25c47bb35355c1e1b2ae325b49441b2c8b201ece Author: Rusty Russell [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:10:30 2007 +1000 Committer: Rusty Russell [EMAIL PROTECTED] CommitDate: Thu Oct 25 14:10:30 2007 +1000 lguest: remove unused wake element from struct lguest Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/lguest/lg.h |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index d9144be..0c74ac4 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -74,9 +74,6 @@ struct lguest u32 pgdidx; struct pgdir pgdirs[4]; - /* Cached wakeup: we hold a reference to this task. */ - struct task_struct *wake; - unsigned long noirq_start, noirq_end; unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
lguest: clean up lguest_launcher.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7334492b53706964eb055ed8e25e2e3315d7222a Commit: 7334492b53706964eb055ed8e25e2e3315d7222a Parent: 197bff630ae586252d24b3595c54f8f9b712610a Author: Rusty Russell [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:12:20 2007 +1000 Committer: Rusty Russell [EMAIL PROTECTED] CommitDate: Thu Oct 25 14:12:20 2007 +1000 lguest: clean up lguest_launcher.h Remove now-unused defines. Fix old idempotent #ifndef _ASM_LGUEST_USER name. Fix comment on use of lguest_req. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- include/linux/lguest_launcher.h | 18 -- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index 61e1e3e..c41fd48 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h @@ -1,17 +1,7 @@ -#ifndef _ASM_LGUEST_USER -#define _ASM_LGUEST_USER +#ifndef _LINUX_LGUEST_LAUNCHER +#define _LINUX_LGUEST_LAUNCHER /* Everything the lguest userspace program needs to know. */ #include linux/types.h -/* They can register up to 32 arrays of lguest_dma. */ -#define LGUEST_MAX_DMA 32 -/* At most we can dma 16 lguest_dma in one op. */ -#define LGUEST_MAX_DMA_SECTIONS16 - -/* How many devices? Assume each one wants up to two dma arrays per device. */ -#define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2) - -/* Where the Host expects the Guest to SEND_DMA console output to. */ -#define LGUEST_CONSOLE_DMA_KEY 0 /*D:010 * Drivers @@ -51,9 +41,9 @@ struct lguest_vqconfig { /* Write command first word is a request. */ enum lguest_req { - LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */ + LHREQ_INITIALIZE, /* + base, pfnlimit, pgdir, start */ LHREQ_GETDMA, /* No longer used */ LHREQ_IRQ, /* + irq */ LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ }; -#endif /* _ASM_LGUEST_USER */ +#endif /* _LINUX_LGUEST_LAUNCHER */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
lguest: build fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cfe6c3c1c301d3d7a36c9d579597b75ebb8ea13 Commit: 4cfe6c3c1c301d3d7a36c9d579597b75ebb8ea13 Parent: 7334492b53706964eb055ed8e25e2e3315d7222a Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:15:09 2007 +1000 Committer: Rusty Russell [EMAIL PROTECTED] CommitDate: Thu Oct 25 14:15:09 2007 +1000 lguest: build fix Fix this error (i386 !SMP build) arch/x86/lguest/boot.c: In function ‘lguest_init’: arch/x86/lguest/boot.c:1059: error: ‘pm_power_off’ undeclared (first use in this function) by including linux/pm.h. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- arch/x86/lguest/boot.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 136d9df..a0179fc 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -56,6 +56,7 @@ #include linux/lguest.h #include linux/lguest_launcher.h #include linux/virtio_console.h +#include linux/pm.h #include asm/paravirt.h #include asm/param.h #include asm/page.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
lguest: Add to maintainers file.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=568a17ffce2eeceae0cd9fc37e97cbad12f70278 Commit: 568a17ffce2eeceae0cd9fc37e97cbad12f70278 Parent: 4cfe6c3c1c301d3d7a36c9d579597b75ebb8ea13 Author: Rusty Russell [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:12:24 2007 +1000 Committer: Rusty Russell [EMAIL PROTECTED] CommitDate: Thu Oct 25 14:12:24 2007 +1000 lguest: Add to maintainers file. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- MAINTAINERS |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 76b8571..5862b78 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2259,6 +2259,13 @@ L: [EMAIL PROTECTED] W: http://legousb.sourceforge.net/ S: Maintained +LGUEST +P: Rusty Russell +M: [EMAIL PROTECTED] +L: [EMAIL PROTECTED] +W: http://lguest.ozlabs.org/ +S: Maintained + LINUX FOR IBM pSERIES (RS/6000) P: Paul Mackerras M: [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
SG build fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e2a06489e4d4d85ca4ca20af23f213e95c2fbeb Commit: 5e2a06489e4d4d85ca4ca20af23f213e95c2fbeb Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: David Miller [EMAIL PROTECTED] AuthorDate: Wed Oct 24 08:44:21 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 08:44:21 2007 +0200 SG build fix Signed-off-by: David S. Miller [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- arch/sparc64/kernel/iommu_common.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c index b70324e..efd5dff 100644 --- a/arch/sparc64/kernel/iommu_common.c +++ b/arch/sparc64/kernel/iommu_common.c @@ -234,7 +234,7 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents) dma_sg-dma_length = dent_len; if (dma_sg != sg) { - dma_sg = next_sg(dma_sg); + dma_sg = sg_next(dma_sg); dma_sg-dma_length = 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sg: add missing sg_init_table calls to zfcp
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de58d942924d431c1c2144ece35b0b9aceadaf2c Commit: de58d942924d431c1c2144ece35b0b9aceadaf2c Parent: 5e2a06489e4d4d85ca4ca20af23f213e95c2fbeb Author: Heiko Carstens [EMAIL PROTECTED] AuthorDate: Wed Oct 24 08:45:35 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 08:45:35 2007 +0200 sg: add missing sg_init_table calls to zfcp kernel BUG at include/linux/scatterlist.h:50! illegal operation: 0001 [#1] [...] Call Trace: ([0026f184] zfcp_ns_gid_pn_request+0x4c/0x2a0) [00276dd4] zfcp_erp_strategy_do_action+0x1410/0x1938 [00278412] zfcp_erp_thread+0x4fa/0x1430 [0001990a] kernel_thread_starter+0x6/0xc [00019904] kernel_thread_starter+0x0/0xc Cc: Swen Schillig [EMAIL PROTECTED] Cc: Christof Schmitt [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- drivers/s390/scsi/zfcp_aux.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index fd5d0c1..d9e7be9 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1518,6 +1518,8 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool) return -ENOMEM; memset(data, 0, sizeof(*data)); + sg_init_table(data-req , 1); + sg_init_table(data-resp , 1); data-ct.req = data-req; data-ct.resp = data-resp; data-ct.req_count = data-ct.resp_count = 1; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
SG: Change sg_set_page() to take length and offset argument
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=642f149031d70415d9318b919d50b71e4724adbd Commit: 642f149031d70415d9318b919d50b71e4724adbd Parent: bd6dee6f30a0f6943df190b387b5f8fe98a848f3 Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Wed Oct 24 11:20:47 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 11:20:47 2007 +0200 SG: Change sg_set_page() to take length and offset argument Most drivers need to set length and offset as well, so may as well fold those three lines into one. Add sg_assign_page() for those two locations that only needed to set the page, where the offset/length is set outside of the function context. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- block/ll_rw_blk.c |4 +-- crypto/hmac.c |3 +- drivers/ata/libata-core.c |4 +- drivers/block/cryptoloop.c |9 +- drivers/block/ub.c |9 ++ drivers/ieee1394/dma.c |4 +- drivers/infiniband/core/umem.c |4 +-- drivers/infiniband/hw/mthca/mthca_memfree.c |9 ++ drivers/md/dm-crypt.c |8 + drivers/media/common/saa7146_core.c |3 +- drivers/media/video/ivtv/ivtv-udma.c|6 +--- drivers/media/video/videobuf-dma-sg.c | 10 ++- drivers/net/mlx4/icm.c |4 +-- drivers/s390/scsi/zfcp_aux.c| 10 ++- drivers/s390/scsi/zfcp_def.h|3 +- drivers/s390/scsi/zfcp_erp.c|7 +--- drivers/scsi/ipr.c |2 +- drivers/scsi/iscsi_tcp.c|4 +-- drivers/scsi/osst.c |6 +--- drivers/scsi/sg.c | 13 +++-- drivers/scsi/st.c | 14 +++-- fs/ecryptfs/crypto.c| 23 +--- include/asm-frv/scatterlist.h |3 +- include/linux/scatterlist.h | 40 +++--- net/core/skbuff.c |9 ++ net/ieee80211/ieee80211_crypt_tkip.c|9 +- net/sctp/auth.c |4 +-- net/sctp/sm_make_chunk.c|8 + net/sunrpc/auth_gss/gss_krb5_crypto.c | 14 - net/sunrpc/xdr.c|4 +-- net/xfrm/xfrm_algo.c|9 ++ 31 files changed, 98 insertions(+), 161 deletions(-) diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index de5ba47..b01dee3 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -1366,9 +1366,7 @@ new_segment: sg = sg_next(sg); } - sg_set_page(sg, bvec-bv_page); - sg-length = nbytes; - sg-offset = bvec-bv_offset; + sg_set_page(sg, bvec-bv_page, nbytes, bvec-bv_offset); nsegs++; } bvprv = bvec; diff --git a/crypto/hmac.c b/crypto/hmac.c index e4eb6ac..6691981 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -160,8 +160,7 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg, sg_set_buf(sg1, ipad, bs); - sg_set_page(sg[1], (void *) sg); - sg1[1].length = 0; + sg_set_page(sg[1], (void *) sg, 0, 0); sg_set_buf(sg2, opad, bs + ds); err = crypto_hash_digest(desc, sg1, nbytes + bs, digest); diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2d147b5..b5f7c59 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4689,8 +4689,8 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) * data in this function or read data in ata_sg_clean. */ offset = lsg-offset + lsg-length - qc-pad_len; - sg_set_page(psg, nth_page(sg_page(lsg), offset PAGE_SHIFT)); - psg-offset = offset_in_page(offset); + sg_set_page(psg, nth_page(sg_page(lsg), offset PAGE_SHIFT), + qc-pad_len, offset_in_page(offset)); if (qc-tf.flags ATA_TFLAG_WRITE) { void *addr = kmap_atomic(sg_page(psg), KM_IRQ0); diff --git a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c index 1b58b01..2411678 100644 --- a/drivers/block/cryptoloop.c +++ b/drivers/block/cryptoloop.c @@ -150,13 +150,8 @@ cryptoloop_transfer(struct loop_device *lo, int cmd, u32 iv[4] = { 0, }; iv[0] = cpu_to_le32(IV 0x); - sg_set_page(sg_in, in_page); - sg_in.offset = in_offs; - sg_in.length = sz; - - sg_set_page(sg_out, out_page); -
arch/um/drivers/ubd_kern.c: fix a building error
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23464ffa47689e46985fb10ae9e34bbc9e83f387 Commit: 23464ffa47689e46985fb10ae9e34bbc9e83f387 Parent: 642f149031d70415d9318b919d50b71e4724adbd Author: WANG Cong [EMAIL PROTECTED] AuthorDate: Wed Oct 24 13:07:11 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 13:07:11 2007 +0200 arch/um/drivers/ubd_kern.c: fix a building error Fix this uml building error: arch/um/drivers/ubd_kern.c: In function 'do_ubd_request': arch/um/drivers/ubd_kern.c:1118: error: implicit declaration of function 'sg_page' arch/um/drivers/ubd_kern.c:1118: warning: passing argument 6 of 'prepare_request' makes pointer from integer without a cast make[1]: *** [arch/um/drivers/ubd_kern.o] Error 1 make: *** [arch/um/drivers] Error 2 Signed-off-by: WANG Cong [EMAIL PROTECTED] Add sg_init_table() call as well. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- arch/um/drivers/ubd_kern.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 3a8cd3d..e184b44 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -35,6 +35,7 @@ #include linux/genhd.h #include linux/spinlock.h #include linux/platform_device.h +#include linux/scatterlist.h #include asm/segment.h #include asm/uaccess.h #include asm/irq.h @@ -704,6 +705,7 @@ static int ubd_add(int n, char **error_out) ubd_dev-size = ROUND_BLOCK(ubd_dev-size); INIT_LIST_HEAD(ubd_dev-restart); + sg_init_table(ubd_dev-sg, MAX_SG); err = -ENOMEM; ubd_dev-queue = blk_init_queue(do_ubd_request, ubd_dev-lock); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
SG: audit of drivers that use blk_rq_map_sg()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3d1266c7042e696704e22085a0f55c714bc06194 Commit: 3d1266c7042e696704e22085a0f55c714bc06194 Parent: 23464ffa47689e46985fb10ae9e34bbc9e83f387 Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Wed Oct 24 13:21:21 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 13:21:21 2007 +0200 SG: audit of drivers that use blk_rq_map_sg() They need to properly init the sg table, or blk_rq_map_sg() will complain if CONFIG_DEBUG_SG is set. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- drivers/block/virtio_blk.c | 10 ++ drivers/cdrom/viocd.c |3 ++- drivers/message/i2o/i2o_block.c |1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index a901eee..3cf7129 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -4,7 +4,9 @@ #include linux/hdreg.h #include linux/virtio.h #include linux/virtio_blk.h -#include linux/virtio_blk.h +#include linux/scatterlist.h + +#define VIRTIO_MAX_SG (3+MAX_PHYS_SEGMENTS) static unsigned char virtblk_index = 'a'; struct virtio_blk @@ -23,7 +25,7 @@ struct virtio_blk mempool_t *pool; /* Scatterlist: can be too big for stack. */ - struct scatterlist sg[3+MAX_PHYS_SEGMENTS]; + struct scatterlist sg[VIRTIO_MAX_SG]; }; struct virtblk_req @@ -94,8 +96,8 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk, if (blk_barrier_rq(vbr-req)) vbr-out_hdr.type |= VIRTIO_BLK_T_BARRIER; - /* We have to zero this, otherwise blk_rq_map_sg gets upset. */ - memset(vblk-sg, 0, sizeof(vblk-sg)); + /* This init could be done at vblk creation time */ + sg_init_table(vblk-sg, VIRTIO_MAX_SG); sg_set_buf(vblk-sg[0], vbr-out_hdr, sizeof(vbr-out_hdr)); num = blk_rq_map_sg(q, vbr-req, vblk-sg+1); sg_set_buf(vblk-sg[num+1], vbr-in_hdr, sizeof(vbr-in_hdr)); diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 880b5dc..d8bb44b 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -41,9 +41,9 @@ #include linux/completion.h #include linux/proc_fs.h #include linux/seq_file.h +#include linux/scatterlist.h #include asm/vio.h -#include asm/scatterlist.h #include asm/iseries/hv_types.h #include asm/iseries/hv_lp_event.h #include asm/iseries/vio.h @@ -258,6 +258,7 @@ static int send_request(struct request *req) cmd = viomajorsubtype_cdio | viocdwrite; } + sg_init_table(sg, 1); if (blk_rq_map_sg(req-q, req, sg) == 0) { printk(VIOCD_KERN_WARNING error setting up scatter/gather list\n); diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index d602ba6..6824061 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -284,6 +284,7 @@ static inline struct i2o_block_request *i2o_block_request_alloc(void) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(ireq-queue); + sg_init_table(ireq-sg_table, I2O_MAX_PHYS_SEGMENTS); return ireq; }; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
AVR32: Fix sg_page breakage
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18ccc4194389c6edc78ede76ada3bf753525b11c Commit: 18ccc4194389c6edc78ede76ada3bf753525b11c Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Haavard Skinnemoen [EMAIL PROTECTED] AuthorDate: Wed Oct 24 10:16:02 2007 +0200 Committer: Haavard Skinnemoen [EMAIL PROTECTED] CommitDate: Wed Oct 24 10:16:02 2007 +0200 AVR32: Fix sg_page breakage The latest sg changes introduce the following build errors on AVR32: include/asm/dma-mapping.h: In function ‘dma_map_sg’: include/asm/dma-mapping.h:220: error: implicit declaration of function ‘sg_page’ include/asm/dma-mapping.h:220: error: invalid operands to binary - include/asm/dma-mapping.h:221: error: implicit declaration of function ‘sg_virt’ include/asm/dma-mapping.h:221: warning: assignment makes pointer from integer without a cast include/asm/dma-mapping.h: In function ‘dma_sync_sg_for_device’: include/asm/dma-mapping.h:330: warning: passing argument 2 of ‘dma_cache_sync’ makes pointer from integer without a cast Fix it by including the correct header file, i.e. linux/scatterlist.h instead of asm/scatterlist.h. Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED] --- include/asm-avr32/dma-mapping.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index a713163..57dc672 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h @@ -3,7 +3,7 @@ #include linux/mm.h #include linux/device.h -#include asm/scatterlist.h +#include linux/scatterlist.h #include asm/processor.h #include asm/cacheflush.h #include asm/io.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c7837c4f5cf177729297ba3fef1ec62f50f499b Commit: 8c7837c4f5cf177729297ba3fef1ec62f50f499b Parent: 5d9dc2cfd881b3b93c3f819ee94ad3ab7184b29a Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Wed Oct 24 13:28:40 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 13:28:40 2007 +0200 xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it It's currently using asm/scatterlist.h, but that is not enough. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- include/asm-xtensa/dma-mapping.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h index 8bd9d2c..3c7d537 100644 --- a/include/asm-xtensa/dma-mapping.h +++ b/include/asm-xtensa/dma-mapping.h @@ -11,10 +11,10 @@ #ifndef _XTENSA_DMA_MAPPING_H #define _XTENSA_DMA_MAPPING_H -#include asm/scatterlist.h #include asm/cache.h #include asm/io.h #include linux/mm.h +#include linux/scatterlist.h /* * DMA-consistent mapping functions. - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
blackfin: fix sg fallout
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82861924a5f26208c8421a799a4e8724d48eb560 Commit: 82861924a5f26208c8421a799a4e8724d48eb560 Parent: 8c7837c4f5cf177729297ba3fef1ec62f50f499b Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Wed Oct 24 14:09:25 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Wed Oct 24 14:09:25 2007 +0200 blackfin: fix sg fallout Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- arch/blackfin/kernel/dma-mapping.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index a16cb03..d6b61d5 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -35,6 +35,7 @@ #include linux/device.h #include linux/dma-mapping.h #include linux/io.h +#include linux/scatterlist.h #include asm/cacheflush.h #include asm/bfin-global.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: pci-gart fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e88a39dee10d3a506ed8c4ba78cde0dd76a6fc83 Commit: e88a39dee10d3a506ed8c4ba78cde0dd76a6fc83 Parent: 82861924a5f26208c8421a799a4e8724d48eb560 Author: FUJITA Tomonori [EMAIL PROTECTED] AuthorDate: Thu Oct 25 09:13:32 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Thu Oct 25 09:13:32 2007 +0200 x86: pci-gart fix map_sg could copy the last sg element to another position (if merging some elements). It breaks sg chaining. This copies only dma_address/length instead of the whole sg element. Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- arch/x86/kernel/pci-gart_64.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c56e9ee..ae7e016 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -338,7 +338,6 @@ static int __dma_map_cont(struct scatterlist *start, int nelems, BUG_ON(s != start s-offset); if (s == start) { - *sout = *s; sout-dma_address = iommu_bus_base; sout-dma_address += iommu_page*PAGE_SIZE + s-offset; sout-dma_length = s-length; @@ -365,7 +364,7 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, { if (!need) { BUG_ON(nelems != 1); - *sout = *start; + sout-dma_address = start-dma_address; sout-dma_length = start-length; return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ub: add sg_init_table for sense and read capacity commands
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f33a9d9a416313f0ecf6e6953d205385a431cd5 Commit: 4f33a9d9a416313f0ecf6e6953d205385a431cd5 Parent: e88a39dee10d3a506ed8c4ba78cde0dd76a6fc83 Author: FUJITA Tomonori [EMAIL PROTECTED] AuthorDate: Thu Oct 25 09:17:03 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Thu Oct 25 09:17:03 2007 +0200 ub: add sg_init_table for sense and read capacity commands Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- drivers/block/ub.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 5e740e1..08e909d 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd) scmd-state = UB_CMDST_INIT; scmd-nsg = 1; sg = scmd-sgv[0]; + sg_init_table(sg, UB_MAX_REQ_SG); sg_set_page(sg, virt_to_page(sc-top_sense), UB_SENSE_SIZE, (unsigned long)sc-top_sense (PAGE_SIZE-1)); scmd-len = UB_SENSE_SIZE; @@ -1863,6 +1864,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, cmd-state = UB_CMDST_INIT; cmd-nsg = 1; sg = cmd-sgv[0]; + sg_init_table(sg, UB_MAX_REQ_SG); sg_set_page(sg, virt_to_page(p), 8, (unsigned long)p (PAGE_SIZE-1)); cmd-len = 8; cmd-lun = lun; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
fix sg_phys to use dma_addr_t
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85cdffcde0b6b831a06422413300d0f5c0e608c3 Commit: 85cdffcde0b6b831a06422413300d0f5c0e608c3 Parent: 4f33a9d9a416313f0ecf6e6953d205385a431cd5 Author: Hugh Dickins [EMAIL PROTECTED] AuthorDate: Thu Oct 25 09:55:05 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Thu Oct 25 09:55:05 2007 +0200 fix sg_phys to use dma_addr_t x86_32 CONFIG_HIGHMEM64G with 5GB RAM hung when booting, after issuing some request_module: runaway loop modprobe binfmt- messages in trying to exec /sbin/init. The binprm buf doesn't see the right .ELF header because sg_phys() is providing the wrong physical addresses for high pages: a 32-bit unsigned long is too small in this case, we need to use dma_addr_t. Signed-off-by: Hugh Dickins [EMAIL PROTECTED] Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- include/linux/scatterlist.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 809b2ac..4571231 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -1,6 +1,7 @@ #ifndef _LINUX_SCATTERLIST_H #define _LINUX_SCATTERLIST_H +#include asm/types.h #include asm/scatterlist.h #include linux/mm.h #include linux/string.h @@ -255,7 +256,7 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) * on the sg page. * **/ -static inline unsigned long sg_phys(struct scatterlist *sg) +static inline dma_addr_t sg_phys(struct scatterlist *sg) { return page_to_phys(sg_page(sg)) + sg-offset; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: fix CONFIG_KEXEC build breakage
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1fb473d8f45658532555b956ee24e25a0ba493cd Commit: 1fb473d8f45658532555b956ee24e25a0ba493cd Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Mike Galbraith [EMAIL PROTECTED] AuthorDate: Wed Oct 24 12:58:01 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 12:58:01 2007 +0200 x86: fix CONFIG_KEXEC build breakage X86_32 build fix to commit 62a31a03b3d2a9d20e7a073e2cd9b27bfb7d6a3f Signed-off-by: Mike Galbraith [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/kernel/crash.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index af0253f..8bb482f 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -25,7 +25,7 @@ #include linux/kdebug.h #include asm/smp.h -#ifdef X86_32 +#ifdef CONFIG_X86_32 #include mach_ipi.h #else #include asm/mach_apic.h @@ -41,7 +41,7 @@ static int crash_nmi_callback(struct notifier_block *self, unsigned long val, void *data) { struct pt_regs *regs; -#ifdef X86_32 +#ifdef CONFIG_X86_32 struct pt_regs fixed_regs; #endif int cpu; @@ -60,7 +60,7 @@ static int crash_nmi_callback(struct notifier_block *self, return NOTIFY_STOP; local_irq_disable(); -#ifdef X86_32 +#ifdef CONFIG_X86_32 if (!user_mode_vm(regs)) { crash_fixup_ss_esp(fixed_regs, regs); regs = fixed_regs; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: lguest build fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=230e55adf6f74309683a068dec23e664a64fb08a Commit: 230e55adf6f74309683a068dec23e664a64fb08a Parent: 1fb473d8f45658532555b956ee24e25a0ba493cd Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Wed Oct 24 12:58:02 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 12:58:02 2007 +0200 x86: lguest build fix Fix this error (i386 !SMP build): arch/x86/lguest/boot.c: In function lguest_init: arch/x86/lguest/boot.c:1059: error: pm_power_off undeclared (first use in this function) by including linux/pm.h. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/lguest/boot.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index d2235db..8f13562 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -56,6 +56,7 @@ #include linux/lguest.h #include linux/lguest_launcher.h #include linux/virtio_console.h +#include linux/pm.h #include asm/paravirt.h #include asm/param.h #include asm/page.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: fix bogus KERN_ALERT on oops
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eec407c9ac5ee819bfcadb4e39ce892576d570d1 Commit: eec407c9ac5ee819bfcadb4e39ce892576d570d1 Parent: 230e55adf6f74309683a068dec23e664a64fb08a Author: Alexey Dobriyan [EMAIL PROTECTED] AuthorDate: Wed Oct 24 12:58:02 2007 +0200 Committer: Ingo Molnar [EMAIL PROTECTED] CommitDate: Wed Oct 24 12:58:02 2007 +0200 x86: fix bogus KERN_ALERT on oops fix this: printing eip: f881b9f3 *pdpt = 3001 1*pde = 0480a067 *pte = ^^^ [ mingo: added KERN_CONT as suggested by Pekka Enberg ] Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/mm/fault_32.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index 503dfc0..33563ee 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -550,7 +550,7 @@ no_context: page = PAGE_MASK; page = ((__typeof__(page) *) __va(page))[(address PMD_SHIFT) (PTRS_PER_PMD - 1)]; - printk(KERN_ALERT *pde = %016Lx , page); + printk(KERN_CONT *pde = %016Lx , page); page = ~_PAGE_NX; } #else - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NET]: Validate device addr prior to interface-up
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bada339ba24dee9e143bfb42e1dc61f146619846 Commit: bada339ba24dee9e143bfb42e1dc61f146619846 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:19:37 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:50 2007 -0700 [NET]: Validate device addr prior to interface-up Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/netdevice.h |2 ++ net/core/dev.c| 14 +- net/ethernet/eth.c|9 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c4de536..811024e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -669,6 +669,8 @@ struct net_device #define HAVE_SET_MAC_ADDR int (*set_mac_address)(struct net_device *dev, void *addr); +#define HAVE_VALIDATE_ADDR + int (*validate_addr)(struct net_device *dev); #define HAVE_PRIVATE_IOCTL int (*do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd); diff --git a/net/core/dev.c b/net/core/dev.c index 8726589..f861555 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1007,17 +1007,20 @@ int dev_open(struct net_device *dev) * Call device private open method */ set_bit(__LINK_STATE_START, dev-state); - if (dev-open) { + + if (dev-validate_addr) + ret = dev-validate_addr(dev); + + if (!ret dev-open) ret = dev-open(dev); - if (ret) - clear_bit(__LINK_STATE_START, dev-state); - } /* * If it went open OK then: */ - if (!ret) { + if (ret) + clear_bit(__LINK_STATE_START, dev-state); + else { /* * Set the flags. */ @@ -1038,6 +1041,7 @@ int dev_open(struct net_device *dev) */ call_netdevice_notifiers(NETDEV_UP, dev); } + return ret; } diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index ed8a3d4..6b2e454 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -298,6 +298,14 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu) return 0; } +static int eth_validate_addr(struct net_device *dev) +{ + if (!is_valid_ether_addr(dev-dev_addr)) + return -EINVAL; + + return 0; +} + const struct header_ops eth_header_ops cacheline_aligned = { .create = eth_header, .parse = eth_header_parse, @@ -317,6 +325,7 @@ void ether_setup(struct net_device *dev) dev-change_mtu = eth_change_mtu; dev-set_mac_address= eth_mac_addr; + dev-validate_addr = eth_validate_addr; dev-type = ARPHRD_ETHER; dev-hard_header_len= ETH_HLEN; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[DCCP]: Implement SIOCINQ/FIONREAD
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6273172e1772bf5ce8697bcae145f0f2954fd159 Commit: 6273172e1772bf5ce8697bcae145f0f2954fd159 Parent: bada339ba24dee9e143bfb42e1dc61f146619846 Author: Arnaldo Carvalho de Melo [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:23:30 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:50 2007 -0700 [DCCP]: Implement SIOCINQ/FIONREAD Just like UDP. Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED] Signed-off-by: Leandro Melo de Sales [EMAIL PROTECTED] Signed-off-by: Ian McDonald [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/dccp/proto.c | 33 +++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index cc9bf1c..d849739 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -26,6 +26,7 @@ #include net/sock.h #include net/xfrm.h +#include asm/ioctls.h #include asm/semaphore.h #include linux/spinlock.h #include linux/timer.h @@ -378,8 +379,36 @@ EXPORT_SYMBOL_GPL(dccp_poll); int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) { - dccp_pr_debug(entry\n); - return -ENOIOCTLCMD; + int rc = -ENOTCONN; + + lock_sock(sk); + + if (sk-sk_state == DCCP_LISTEN) + goto out; + + switch (cmd) { + case SIOCINQ: { + struct sk_buff *skb; + unsigned long amount = 0; + + skb = skb_peek(sk-sk_receive_queue); + if (skb != NULL) { + /* +* We will only return the amount of this packet since +* that is all that will be read. +*/ + amount = skb-len; + } + rc = put_user(amount, (int __user *)arg); + } + break; + default: + rc = -ENOIOCTLCMD; + break; + } +out: + release_sock(sk); + return rc; } EXPORT_SYMBOL_GPL(dccp_ioctl); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NETLINK]: Fix ACK processing after netlink_dump_start
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c58298c2536252ab95aa2b1497ab47eb878ca5d Commit: 5c58298c2536252ab95aa2b1497ab47eb878ca5d Parent: be7f827360b5dfecd8f43adbd48f2c39556004c9 Author: Denis V. Lunev [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:29:25 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:51 2007 -0700 [NETLINK]: Fix ACK processing after netlink_dump_start Revert to original netlink behavior. Do not reply with ACK if the netlink dump has bees successfully started. libnl has been broken by the cd40b7d3983c708aabe3d3008ec64ffce56d33b0 The following command reproduce the problem: /nl-route-get 192.168.1.1 Signed-off-by: Denis V. Lunev [EMAIL PROTECTED] Acked-by: Thomas Graf [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/netlink/af_netlink.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 98e313e..3252729 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, netlink_dump(sk); sock_put(sk); - return 0; + + /* We successfully started a dump, by returning -EINTR we +* signal not to send ACK even if it was requested. +*/ + return -EINTR; } void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) @@ -1619,17 +1623,21 @@ int netlink_rcv_skb(struct sk_buff *skb, int (*cb)(struct sk_buff *, /* Only requests are handled by the kernel */ if (!(nlh-nlmsg_flags NLM_F_REQUEST)) - goto skip; + goto ack; /* Skip control messages */ if (nlh-nlmsg_type NLMSG_MIN_TYPE) - goto skip; + goto ack; err = cb(skb, nlh); -skip: + if (err == -EINTR) + goto skip; + +ack: if (nlh-nlmsg_flags NLM_F_ACK || err) netlink_ack(skb, nlh, err); +skip: msglen = NLMSG_ALIGN(nlh-nlmsg_len); if (msglen skb-len) msglen = skb-len; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SCTP]: Consolidate sctp_ulpq_renege_xxx functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=16d14ef9f29dfa9b1d99f3eff860e9f15bc99f39 Commit: 16d14ef9f29dfa9b1d99f3eff860e9f15bc99f39 Parent: 5c58298c2536252ab95aa2b1497ab47eb878ca5d Author: Pavel Emelyanov [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:30:25 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:52 2007 -0700 [SCTP]: Consolidate sctp_ulpq_renege_xxx functions Both are equal, except for the list to be traversed. Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] Acked-by: Vlad Yasevich [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/sctp/ulpqueue.c | 34 ++ 1 files changed, 10 insertions(+), 24 deletions(-) diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index b937095..4be92d0 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c @@ -908,8 +908,8 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn) return; } -/* Renege 'needed' bytes from the ordering queue. */ -static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) +static __u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq, + struct sk_buff_head *list, __u16 needed) { __u16 freed = 0; __u32 tsn; @@ -919,7 +919,7 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) tsnmap = ulpq-asoc-peer.tsn_map; - while ((skb = __skb_dequeue_tail(ulpq-lobby)) != NULL) { + while ((skb = __skb_dequeue_tail(list)) != NULL) { freed += skb_headlen(skb); event = sctp_skb2event(skb); tsn = event-tsn; @@ -933,30 +933,16 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) return freed; } +/* Renege 'needed' bytes from the ordering queue. */ +static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) +{ + return sctp_ulpq_renege_list(ulpq, ulpq-lobby, needed); +} + /* Renege 'needed' bytes from the reassembly queue. */ static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed) { - __u16 freed = 0; - __u32 tsn; - struct sk_buff *skb; - struct sctp_ulpevent *event; - struct sctp_tsnmap *tsnmap; - - tsnmap = ulpq-asoc-peer.tsn_map; - - /* Walk backwards through the list, reneges the newest tsns. */ - while ((skb = __skb_dequeue_tail(ulpq-reasm)) != NULL) { - freed += skb_headlen(skb); - event = sctp_skb2event(skb); - tsn = event-tsn; - - sctp_ulpevent_free(event); - sctp_tsnmap_renege(tsnmap, tsn); - if (freed = needed) - return freed; - } - - return freed; + return sctp_ulpq_renege_list(ulpq, ulpq-reasm, needed); } /* Partial deliver the first message as there is pressure on rwnd. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[IPV4] ip_gre: sendto/recvfrom NBMA address
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a5f44d7a048c97b8bae8ce464c97b8fad61ff99 Commit: 6a5f44d7a048c97b8bae8ce464c97b8fad61ff99 Parent: 16d14ef9f29dfa9b1d99f3eff860e9f15bc99f39 Author: Timo Teras [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:31:53 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:53 2007 -0700 [IPV4] ip_gre: sendto/recvfrom NBMA address When GRE tunnel is in NBMA mode, this patch allows an application to use a PF_PACKET socket to: - send a packet to specific NBMA address with sendto() - use recvfrom() to receive packet and check which NBMA address it came from This is required to implement properly NHRP over GRE tunnel. Signed-off-by: Timo Teras [EMAIL PROTECTED] Acked-by: Alexey Kuznetsov [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/ip_gre.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index f151900..c5b77bb 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1033,7 +1033,6 @@ static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu) return 0; } -#ifdef CONFIG_NET_IPGRE_BROADCAST /* Nice toy. Unfortunately, useless in real life :-) It allows to construct virtual multiprotocol broadcast LAN over the Internet, provided multicast routing is tuned. @@ -1092,10 +1091,19 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev, return -t-hlen; } +static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr) +{ + struct iphdr *iph = (struct iphdr*) skb_mac_header(skb); + memcpy(haddr, iph-saddr, 4); + return 4; +} + static const struct header_ops ipgre_header_ops = { .create = ipgre_header, + .parse = ipgre_header_parse, }; +#ifdef CONFIG_NET_IPGRE_BROADCAST static int ipgre_open(struct net_device *dev) { struct ip_tunnel *t = netdev_priv(dev); @@ -1197,6 +1205,8 @@ static int ipgre_tunnel_init(struct net_device *dev) dev-stop = ipgre_close; } #endif + } else { + dev-header_ops = ipgre_header_ops; } if (!tdev tunnel-parms.link) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PKT_SCHED]: Fix sch_prio.c build with CONFIG_NETDEVICES_MULTIQUEUE
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0034622693ad21d6b341a1b51e766f72d1ef512e Commit: 0034622693ad21d6b341a1b51e766f72d1ef512e Parent: 6a5f44d7a048c97b8bae8ce464c97b8fad61ff99 Author: Pavel Emelyanov [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:50:58 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:53 2007 -0700 [PKT_SCHED]: Fix sch_prio.c build with CONFIG_NETDEVICES_MULTIQUEUE Fix one more user of netiff_subqueue_stopped. To check for the queue id one must use the __netiff_subqueue_stoped call. This run out of my sight when I made the: 668f895a85b0c3a62a690425145f13dabebebd7a [NET]: Hide the queue_mapping field inside netif_subqueue_stopped commit :( Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/sched/sch_prio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index abd82fc..de89409 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -136,7 +136,7 @@ prio_dequeue(struct Qdisc* sch) * pulling an skb. This way we avoid excessive requeues * for slower queues. */ - if (!netif_subqueue_stopped(sch-dev, (q-mq ? prio : 0))) { + if (!__netif_subqueue_stopped(sch-dev, (q-mq ? prio : 0))) { qdisc = q-queues[prio]; skb = qdisc-dequeue(qdisc); if (skb) { @@ -165,7 +165,7 @@ static struct sk_buff *rr_dequeue(struct Qdisc* sch) * for slower queues. If the queue is stopped, try the * next queue. */ - if (!netif_subqueue_stopped(sch-dev, + if (!__netif_subqueue_stopped(sch-dev, (q-mq ? q-curband : 0))) { qdisc = q-queues[q-curband]; skb = qdisc-dequeue(qdisc); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[9P]: Fix missing unlock before return in p9_mux_poll_start
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ffdd581497286e8af529b0b39770c01eab15b30 Commit: 0ffdd581497286e8af529b0b39770c01eab15b30 Parent: 0034622693ad21d6b341a1b51e766f72d1ef512e Author: Roel Kluin [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:52:48 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:54 2007 -0700 [9P]: Fix missing unlock before return in p9_mux_poll_start Signed-off-by: Roel Kluin [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/9p/mux.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/net/9p/mux.c b/net/9p/mux.c index f140147..c9f0805 100644 --- a/net/9p/mux.c +++ b/net/9p/mux.c @@ -222,8 +222,10 @@ static int p9_mux_poll_start(struct p9_conn *m) } if (i = ARRAY_SIZE(p9_mux_poll_tasks)) { - if (vptlast == NULL) + if (vptlast == NULL) { + mutex_unlock(p9_mux_task_lock); return -ENOMEM; + } P9_DPRINTK(P9_DEBUG_MUX, put in proc %d\n, i); list_add(m-mux_list, vptlast-mux_list); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NET]: Treat the sign of the result of skb_headroom() consistently
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2636b4d9e8ab8d16b9e2bf0f0744bb8418d4026 Commit: c2636b4d9e8ab8d16b9e2bf0f0744bb8418d4026 Parent: 0ffdd581497286e8af529b0b39770c01eab15b30 Author: Chuck Lever [EMAIL PROTECTED] AuthorDate: Tue Oct 23 21:07:32 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:55 2007 -0700 [NET]: Treat the sign of the result of skb_headroom() consistently In some places, the result of skb_headroom() is compared to an unsigned integer, and in others, the result is compared to a signed integer. Make the comparisons consistent and correct. Signed-off-by: Chuck Lever [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/skbuff.h |4 ++-- net/ipv4/ip_gre.c |2 +- net/ipv4/ip_output.c |2 +- net/ipv4/ipip.c|2 +- net/ipv4/ipvs/ip_vs_xmit.c |2 +- net/ipv4/tcp_input.c |2 +- net/ipv6/ip6_output.c |2 +- net/ipv6/ip6_tunnel.c |2 +- net/ipv6/sit.c |2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fd4e12f..94e4991 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -994,7 +994,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) * * Return the number of bytes of free space at the head of an sk_buff. */ -static inline int skb_headroom(const struct sk_buff *skb) +static inline unsigned int skb_headroom(const struct sk_buff *skb) { return skb-data - skb-head; } @@ -1347,7 +1347,7 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, * Returns true if modifying the header part of the cloned buffer * does not requires the data to be copied. */ -static inline int skb_clone_writable(struct sk_buff *skb, int len) +static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) { return !skb_header_cloned(skb) skb_headroom(skb) + len = skb-hdr_len; diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c5b77bb..02b02a8 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -674,7 +674,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) struct rtable *rt; /* Route to the other host */ struct net_device *tdev;/* Device to other host */ struct iphdr *iph; /* Our new IP header */ - intmax_headroom;/* The extra header space needed */ + unsigned int max_headroom; /* The extra header space needed */ intgre_hlen; __be32 dst; intmtu; diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index f508835..e5f7dc2 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -161,7 +161,7 @@ static inline int ip_finish_output2(struct sk_buff *skb) struct dst_entry *dst = skb-dst; struct rtable *rt = (struct rtable *)dst; struct net_device *dev = dst-dev; - int hh_len = LL_RESERVED_SPACE(dev); + unsigned int hh_len = LL_RESERVED_SPACE(dev); if (rt-rt_type == RTN_MULTICAST) IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 5cd5bbe..8c2b2b0 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -515,7 +515,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) struct net_device *tdev;/* Device to other host */ struct iphdr *old_iph = ip_hdr(skb); struct iphdr *iph; /* Our new IP header */ - intmax_headroom;/* The extra header space needed */ + unsigned int max_headroom; /* The extra header space needed */ __be32 dst = tiph-daddr; intmtu; diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index d0a92de..7c074e3 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c @@ -325,7 +325,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, __be16 df = old_iph-frag_off; sk_buff_data_t old_transport_header = skb-transport_header; struct iphdr *iph; /* Our new IP header */ - intmax_headroom;/* The extra header space needed */ + unsigned int max_headroom; /* The extra header space needed */ intmtu; EnterFunction(10); diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9288220..3dbbb44 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3909,7 +3909,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, while (before(start, end)) { struct sk_buff *nskb; - int
[NET]: Remove in-code externs for some functions from net/core/dev.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=342709efc7a4ba91eac6d2d2d931ec316a587dfa Commit: 342709efc7a4ba91eac6d2d2d931ec316a587dfa Parent: a37ae4086e7e804db534bc8f2d31c2fbf89c5761 Author: Pavel Emelyanov [EMAIL PROTECTED] AuthorDate: Tue Oct 23 21:14:45 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:56 2007 -0700 [NET]: Remove in-code externs for some functions from net/core/dev.c Inconsistent prototype and real type for functions may have worse consequences, than those for variables, so move them into a header. Since they are used privately in net/core, make this file reside in the same place. Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/core/dev.c |6 ++ net/core/net-sysfs.c |2 ++ net/core/net-sysfs.h |8 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index f861555..f1647d7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -120,6 +120,8 @@ #include linux/ctype.h #include linux/if_arp.h +#include net-sysfs.h + /* * The list of packet types we will receive (as opposed to discard) * and the routines to invoke. @@ -249,10 +251,6 @@ static RAW_NOTIFIER_HEAD(netdev_chain); DEFINE_PER_CPU(struct softnet_data, softnet_data); -extern int netdev_kobject_init(void); -extern int netdev_register_kobject(struct net_device *); -extern void netdev_unregister_kobject(struct net_device *); - #ifdef CONFIG_DEBUG_LOCK_ALLOC /* * register_netdevice() inits dev-_xmit_lock and sets lockdep class diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 6628e45..61ead1d 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -18,6 +18,8 @@ #include linux/wireless.h #include net/iw_handler.h +#include net-sysfs.h + #ifdef CONFIG_SYSFS static const char fmt_hex[] = %#x\n; static const char fmt_long_hex[] = %#lx\n; diff --git a/net/core/net-sysfs.h b/net/core/net-sysfs.h new file mode 100644 index 000..f5f108d --- /dev/null +++ b/net/core/net-sysfs.h @@ -0,0 +1,8 @@ +#ifndef __NET_SYSFS_H__ +#define __NET_SYSFS_H__ + +int netdev_kobject_init(void); +int netdev_register_kobject(struct net_device *); +void netdev_unregister_kobject(struct net_device *); + +#endif - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NET]: Don't declare extern variables in net/core/sysctl_net_core.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a37ae4086e7e804db534bc8f2d31c2fbf89c5761 Commit: a37ae4086e7e804db534bc8f2d31c2fbf89c5761 Parent: c1bd24b76879f61b2d10609b0dabde400792a6ec Author: Pavel Emelyanov [EMAIL PROTECTED] AuthorDate: Tue Oct 23 21:13:53 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:56 2007 -0700 [NET]: Don't declare extern variables in net/core/sysctl_net_core.c Some are already declared in include/linux/netdevice.h, while some others (xfrm ones) need to be declared. The driver/net/rrunner.c just uses same extern as well, so cleanup it also. Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/rrunner.c |8 +++- include/net/xfrm.h |2 ++ net/core/sysctl_net_core.c | 17 ++--- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index 19152f5..b822859 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c @@ -79,12 +79,10 @@ static char version[] __devinitdata = rrunner.c: v0.50 11/11/2002 Jes Sorensen */ /* - * These are checked at init time to see if they are at least 256KB - * and increased to 256KB if they are not. This is done to avoid ending - * up with socket buffers smaller than the MTU size, + * sysctl_[wr]mem_max are checked at init time to see if they are at + * least 256KB and increased to 256KB if they are not. This is done to + * avoid ending up with socket buffers smaller than the MTU size, */ -extern __u32 sysctl_wmem_max; -extern __u32 sysctl_rmem_max; static int __devinit rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 688f6f5..58dfa82 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -37,6 +37,8 @@ extern struct sock *xfrm_nl; extern u32 sysctl_xfrm_aevent_etime; extern u32 sysctl_xfrm_aevent_rseqth; +extern int sysctl_xfrm_larval_drop; +extern u32 sysctl_xfrm_acq_expires; extern struct mutex xfrm_cfg_mutex; diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 6d5ea97..113cc72 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -9,25 +9,12 @@ #include linux/sysctl.h #include linux/module.h #include linux/socket.h +#include linux/netdevice.h #include net/sock.h +#include net/xfrm.h #ifdef CONFIG_SYSCTL -extern int netdev_max_backlog; -extern int weight_p; - -extern __u32 sysctl_wmem_max; -extern __u32 sysctl_rmem_max; - -extern int sysctl_core_destroy_delay; - -#ifdef CONFIG_XFRM -extern u32 sysctl_xfrm_aevent_etime; -extern u32 sysctl_xfrm_aevent_rseqth; -extern int sysctl_xfrm_larval_drop; -extern u32 sysctl_xfrm_acq_expires; -#endif - ctl_table core_table[] = { #ifdef CONFIG_NET { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TCP]: Remove unneeded implicit type cast when calling tcp_minshall_update()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c1bd24b76879f61b2d10609b0dabde400792a6ec Commit: c1bd24b76879f61b2d10609b0dabde400792a6ec Parent: c2636b4d9e8ab8d16b9e2bf0f0744bb8418d4026 Author: Chuck Lever [EMAIL PROTECTED] AuthorDate: Tue Oct 23 21:08:54 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:55 2007 -0700 [TCP]: Remove unneeded implicit type cast when calling tcp_minshall_update() The tcp_minshall_update() function is called in exactly one place, and is passed an unsigned integer for the mss_len argument. Make the sign of the argument match the sign of the passed variable in order to eliminate an unneeded implicit type cast and a mixed sign comparison in tcp_minshall_update(). Signed-off-by: Chuck Lever [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/tcp.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 92049e6..d695cea 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -803,7 +803,7 @@ static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight) return left = tcp_max_burst(tp); } -static inline void tcp_minshall_update(struct tcp_sock *tp, int mss, +static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, const struct sk_buff *skb) { if (skb-len mss) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[IPV4]: Explicitly call fib_get_table() in fib_frontend.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03cf786c4e83dba404ad23ca58f49147ae52dffd Commit: 03cf786c4e83dba404ad23ca58f49147ae52dffd Parent: f0fe91ded36bab95541e960ae8a115abc1f5ba03 Author: Pavel Emelyanov [EMAIL PROTECTED] AuthorDate: Tue Oct 23 21:17:27 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 21:27:58 2007 -0700 [IPV4]: Explicitly call fib_get_table() in fib_frontend.c In case the multiple tables config option is y, the ip_fib_local_table is not a variable, but a macro, that calls fib_get_table(RT_TABLE_LOCAL). Some code uses this variable *3* times in one place, thus implicitly making 3 calls. Fix it. Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/fib_frontend.c | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 78b514b..6012390 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -128,13 +128,14 @@ struct net_device * ip_dev_find(__be32 addr) struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; struct fib_result res; struct net_device *dev = NULL; + struct fib_table *local_table; #ifdef CONFIG_IP_MULTIPLE_TABLES res.r = NULL; #endif - if (!ip_fib_local_table || - ip_fib_local_table-tb_lookup(ip_fib_local_table, fl, res)) + local_table = fib_get_table(RT_TABLE_LOCAL); + if (!local_table || local_table-tb_lookup(local_table, fl, res)) return NULL; if (res.type != RTN_LOCAL) goto out; @@ -152,6 +153,7 @@ unsigned inet_addr_type(__be32 addr) struct flowifl = { .nl_u = { .ip4_u = { .daddr = addr } } }; struct fib_result res; unsigned ret = RTN_BROADCAST; + struct fib_table *local_table; if (ZERONET(addr) || BADCLASS(addr)) return RTN_BROADCAST; @@ -162,10 +164,10 @@ unsigned inet_addr_type(__be32 addr) res.r = NULL; #endif - if (ip_fib_local_table) { + local_table = fib_get_table(RT_TABLE_LOCAL); + if (local_table) { ret = RTN_UNICAST; - if (!ip_fib_local_table-tb_lookup(ip_fib_local_table, - fl, res)) { + if (!local_table-tb_lookup(local_table, fl, res)) { ret = res.type; fib_res_put(res); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SPARC64]: pass correct addr in get_fb_unmapped_area(MAP_FIXED)
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d58aa8c7b1cc0add7b03e26bdb8988d98d2f4cd1 Commit: d58aa8c7b1cc0add7b03e26bdb8988d98d2f4cd1 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Chris Wright [EMAIL PROTECTED] AuthorDate: Tue Oct 23 20:36:14 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Tue Oct 23 22:42:07 2007 -0700 [SPARC64]: pass correct addr in get_fb_unmapped_area(MAP_FIXED) Looks like the MAP_FIXED case is using the wrong address hint. I'd expect the comment don't mess with it means pass the request straight on through, not change the address requested to -ENOMEM. Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- arch/sparc64/kernel/sys_sparc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 560cb1e..c56573a 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -318,7 +318,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u if (flags MAP_FIXED) { /* Ok, don't mess with it. */ - return get_unmapped_area(NULL, addr, len, pgoff, flags); + return get_unmapped_area(NULL, orig_addr, len, pgoff, flags); } flags = ~MAP_SHARED; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ISDN/sc: fix longstanding warning
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9317d4313e0cd51b2256ea9a9316f2d8561e37a8 Commit: 9317d4313e0cd51b2256ea9a9316f2d8561e37a8 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Tue Oct 23 18:36:39 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Wed Oct 24 05:16:25 2007 -0400 ISDN/sc: fix longstanding warning drivers/isdn/sc/shmem.c: In function 'memcpy_toshmem': drivers/isdn/sc/shmem.c:54: warning: passing argument 1 of 'memcpy_toio' makes pointer from integer without a cast Also, remove some unneeded braces, and add some useful whitespace. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/sc/shmem.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c index 034d41a..e0331e0 100644 --- a/drivers/isdn/sc/shmem.c +++ b/drivers/isdn/sc/shmem.c @@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) { unsigned long flags; unsigned char ch; + unsigned long dest_rem = ((unsigned long) dest) % 0x4000; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug(Invalid param: %d is not a valid card id\n, card); return; } - if(n SRAM_PAGESIZE) { + if (n SRAM_PAGESIZE) return; - } /* * determine the page to load from the address @@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) outb(((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE) 14) | 0x80, sc_adapter[card]-ioport[sc_adapter[card]-shmem_pgport]); - memcpy_toio(sc_adapter[card]-rambase + - ((unsigned long) dest % 0x4000), src, n); + memcpy_toio(sc_adapter[card]-rambase + dest_rem, src, n); spin_unlock_irqrestore(sc_adapter[card]-lock, flags); pr_debug(%s: set page to %#x\n,sc_adapter[card]-devicename, ((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE)14)|0x80); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: add new Novatel device ids to option driver
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3657f6c018907870d4264d466def384b58608484 Commit: 3657f6c018907870d4264d466def384b58608484 Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 Author: Greg Kroah-Hartman [EMAIL PROTECTED] AuthorDate: Tue Apr 9 12:14:34 2002 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:40 2007 -0700 USB: add new Novatel device ids to option driver This adds support for the U727 and MC950 devices. Cc: Rony Sarkis [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/option.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index a18659e..b1c9181 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -172,6 +172,8 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4100) }, /* Novatel U727 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x4400) }, /* Novatel MC950 */ { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
serial: stop passing NULL to functions that expect data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=149b36eae2ab6aa6056664f4bc461f3d3affc9c1 Commit: 149b36eae2ab6aa6056664f4bc461f3d3affc9c1 Parent: 3657f6c018907870d4264d466def384b58608484 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:16 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:40 2007 -0700 serial: stop passing NULL to functions that expect data Earlier patches have removed the checking for old v new differences from the USB drivers so we can now pass in a valid blank old termios so that we don't to fill the drivers with magic hacks for console support Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/serial/serial_core.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 1031890..3bb5d24 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1875,6 +1875,7 @@ uart_set_options(struct uart_port *port, struct console *co, int baud, int parity, int bits, int flow) { struct ktermios termios; + static struct ktermios dummy; int i; /* @@ -1920,7 +1921,7 @@ uart_set_options(struct uart_port *port, struct console *co, */ port-mctrl |= TIOCM_DTR; - port-ops-set_termios(port, termios, NULL); + port-ops-set_termios(port, termios, dummy); co-cflag = termios.c_cflag; return 0; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: ark3116: update termios handling
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adb5dca17dde297b685d57ec68fa0e5490feee8b Commit: adb5dca17dde297b685d57ec68fa0e5490feee8b Parent: 149b36eae2ab6aa6056664f4bc461f3d3affc9c1 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:17 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:40 2007 -0700 USB: ark3116: update termios handling - Set the i/ospeed in the initial termios properly - Use the tty_encode_baud_rate functions to report resulting rates properly Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ark3116.c | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 2a8e537..ddfee91 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -161,7 +161,8 @@ static void ark3116_set_termios(struct usb_serial_port *port, { struct usb_serial *serial = port-serial; struct ark3116_private *priv = usb_get_serial_port_data(port); - unsigned int cflag = port-tty-termios-c_cflag; + struct ktermios *termios = port-tty-termios; + unsigned int cflag = termios-c_cflag; unsigned long flags; int baud; int ark3116_baud; @@ -177,11 +178,14 @@ static void ark3116_set_termios(struct usb_serial_port *port, *(port-tty-termios) = tty_std_termios; port-tty-termios-c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + termios-c_ispeed = 9600; + termios-c_ospeed = 9600; priv-termios_initialized = 1; } spin_unlock_irqrestore(priv-lock, flags); - cflag = port-tty-termios-c_cflag; + cflag = termios-c_cflag; + termios-c_cflag = ~(CMSPAR|CRTSCTS); buf = kmalloc(1, GFP_KERNEL); if (!buf) { @@ -254,9 +258,13 @@ static void ark3116_set_termios(struct usb_serial_port *port, case 115200: case 230400: case 460800: + /* Report the resulting rate back to the caller */ + tty_encode_baud_rate(port-tty, baud, baud); break; /* set 9600 as default (if given baudrate is invalid for example) */ default: + tty_encode_baud_rate(port-tty, 9600, 9600); + case 0: baud = 9600; } @@ -302,6 +310,7 @@ static void ark3116_set_termios(struct usb_serial_port *port, /* TEST ARK3116_SND(154, 0xFE, 0x40, 0x, 0x0006); */ kfree(buf); + return; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
usb serial: kill another case we pass NULL and shouldn't
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7cc7ee28263e89793ae4d21e6e0102404c9a037b Commit: 7cc7ee28263e89793ae4d21e6e0102404c9a037b Parent: adb5dca17dde297b685d57ec68fa0e5490feee8b Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:18 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:40 2007 -0700 usb serial: kill another case we pass NULL and shouldn't Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/console.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 9386e21..0362654 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -164,6 +164,7 @@ static int usb_console_setup(struct console *co, char *options) } if (serial-type-set_termios) { + struct ktermios dummy; /* build up a fake tty structure so that the open call has something * to look at to get the cflag value */ tty = kzalloc(sizeof(*tty), GFP_KERNEL); @@ -177,12 +178,13 @@ static int usb_console_setup(struct console *co, char *options) kfree (tty); return -ENOMEM; } + memset(dummy, 0, sizeof(struct ktermios)); termios-c_cflag = cflag; tty-termios = termios; port-tty = tty; /* set up the initial termios settings */ - serial-type-set_termios(port, NULL); + serial-type-set_termios(port, dummy); port-tty = NULL; kfree (termios); kfree (tty); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: ch341: fix termios handling
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73f593081911b1be0d8d3962ecedd635c1e27179 Commit: 73f593081911b1be0d8d3962ecedd635c1e27179 Parent: 7cc7ee28263e89793ae4d21e6e0102404c9a037b Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:18 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:40 2007 -0700 USB: ch341: fix termios handling The ch341 currently doesn't support most of the hardware setting. So to keep the termios data right we propogate the old termios hardware values back then encode the speed. Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ch341.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 6b252ce..42582d4 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -272,9 +272,6 @@ static void ch341_set_termios(struct usb_serial_port *port, dbg(ch341_set_termios()); - if (!tty || !tty-termios) - return; - baud_rate = tty_get_baud_rate(tty); switch (baud_rate) { @@ -299,6 +296,11 @@ static void ch341_set_termios(struct usb_serial_port *port, * (cflag PARENB) : parity {NONE, EVEN, ODD} * (cflag CSTOPB) : stop bits [1, 2] */ + +/* Copy back the old hardware settings */ +tty_termios_copy_hw(tty-termios, old_termios); +/* And re-encode with the new baud */ +tty_encode_baud_rate(tty, baud_rate, baud_rate); } static struct usb_driver ch341_driver = { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: digi_acceleport: fix termios and also readability a bit
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7fa36a994cb4298f29994a248ced831be8dc7051 Commit: 7fa36a994cb4298f29994a248ced831be8dc7051 Parent: 73f593081911b1be0d8d3962ecedd635c1e27179 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:19 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:41 2007 -0700 USB: digi_acceleport: fix termios and also readability a bit - Expand some xy to x y so I could read it when checking - Clear CMSPAR bit in the termios (as the driver does not support it) - Encode the speed using the new tty_encode_baud_rate facility Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/digi_acceleport.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index dab2e66..ae410c4 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -973,6 +973,8 @@ static void digi_set_termios(struct usb_serial_port *port, } } /* set parity */ + tty-termios-c_cflag = ~CMSPAR; + if ((cflag(PARENB|PARODD)) != (old_cflag(PARENB|PARODD))) { if (cflagPARENB) { if (cflagPARODD) @@ -1054,15 +1056,15 @@ static void digi_set_termios(struct usb_serial_port *port, } /* set output flow control */ - if ((iflagIXON) != (old_iflagIXON) - || (cflagCRTSCTS) != (old_cflagCRTSCTS)) { + if ((iflag IXON) != (old_iflag IXON) + || (cflag CRTSCTS) != (old_cflag CRTSCTS)) { arg = 0; - if (iflagIXON) + if (iflag IXON) arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; else arg = ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; - if (cflagCRTSCTS) { + if (cflag CRTSCTS) { arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS; } else { arg = ~DIGI_OUTPUT_FLOW_CONTROL_CTS; @@ -1076,8 +1078,8 @@ static void digi_set_termios(struct usb_serial_port *port, } /* set receive enable/disable */ - if ((cflagCREAD) != (old_cflagCREAD)) { - if (cflagCREAD) + if ((cflag CREAD) != (old_cflag CREAD)) { + if (cflag CREAD) arg = DIGI_ENABLE; else arg = DIGI_DISABLE; @@ -1089,7 +1091,7 @@ static void digi_set_termios(struct usb_serial_port *port, } if ((ret = digi_write_oob_command(port, buf, i, 1)) != 0) dbg(digi_set_termios: write oob failed, ret=%d, ret); - + tty_encode_baud_rate(tty, baud, baud); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: empeg: clean up and handle speeds
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=998e8638711680aecceb9c2ea3b8a09a120d605b Commit: 998e8638711680aecceb9c2ea3b8a09a120d605b Parent: 7fa36a994cb4298f29994a248ced831be8dc7051 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:19 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:41 2007 -0700 USB: empeg: clean up and handle speeds The empeg is pretty fixed. Tidy up the long foo-bar-baz stuff and encode the fixed speed properly. Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/empeg.c | 23 --- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 050fcc9..a5c8e1e 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -449,14 +449,9 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) { - + struct ktermios *termios = port-tty-termios; dbg(%s - port %d, __FUNCTION__, port-number); - if ((!port-tty) || (!port-tty-termios)) { - dbg(%s - no tty structures, __FUNCTION__); - return; - } - /* * The empeg-car player wants these particular tty settings. * You could, for example, change the baud rate, however the @@ -466,7 +461,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol * * The default requirements for this device are: */ - port-tty-termios-c_iflag + termios-c_iflag = ~(IGNBRK /* disable ignore break */ | BRKINT/* disable break causes interrupt */ | PARMRK/* disable mark parity errors */ @@ -476,24 +471,23 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol | ICRNL /* disable translate CR to NL */ | IXON);/* disable enable XON/XOFF flow control */ - port-tty-termios-c_oflag + termios-c_oflag = ~OPOST; /* disable postprocess output characters */ - port-tty-termios-c_lflag + termios-c_lflag = ~(ECHO /* disable echo input characters */ | ECHONL/* disable echo new line */ | ICANON/* disable erase, kill, werase, and rprnt special characters */ | ISIG /* disable interrupt, quit, and suspend special characters */ | IEXTEN); /* disable non-POSIX special characters */ - port-tty-termios-c_cflag + termios-c_cflag = ~(CSIZE /* no size */ | PARENB/* disable parity bit */ | CBAUD); /* clear current baud rate */ - port-tty-termios-c_cflag - |= (CS8 /* character size 8 bits */ - | B115200); /* baud rate 115200 */ + termios-c_cflag + |= CS8; /* character size 8 bits */ /* * Force low_latency on; otherwise the pushes are scheduled; @@ -501,8 +495,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol * on the floor. We don't want to drop bytes on the floor. :) */ port-tty-low_latency = 1; - - return; + tty_encode_baud_rate(port-tty, 115200, 115200); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: ir_usb: termios handling
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=560aac22e1dce7c7e9756a0a4450ca3bae58fcd5 Commit: 560aac22e1dce7c7e9756a0a4450ca3bae58fcd5 Parent: 998e8638711680aecceb9c2ea3b8a09a120d605b Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:20 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:41 2007 -0700 USB: ir_usb: termios handling - Clean up paranoia checks - Propogate back a correct fixed termios Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ir-usb.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 5ab6a0c..6b803ab 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -504,11 +504,6 @@ static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_t dbg(%s - port %d, __FUNCTION__, port-number); - if ((!port-tty) || (!port-tty-termios)) { - dbg(%s - no tty structures, __FUNCTION__); - return; - } - baud = tty_get_baud_rate(port-tty); /* @@ -531,8 +526,6 @@ static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_t default: ir_baud = SPEED_9600; baud = 9600; - /* And once the new tty stuff is all done we need to - call back to correct the baud bits */ } if (xbof == -1) @@ -562,6 +555,10 @@ static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_t result = usb_submit_urb (port-write_urb, GFP_KERNEL); if (result) dev_err(port-dev, %s - failed submitting write urb, error %d\n, __FUNCTION__, result); + + /* Only speed changes are supported */ + tty_termios_copy_hw(port-tty-termios, old_termios); + tty_encode_baud_rate(port-tty, baud, baud); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: keyspan termios tidy
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74240b07a908e09e18fa09f2cba44f212be9c4c3 Commit: 74240b07a908e09e18fa09f2cba44f212be9c4c3 Parent: 560aac22e1dce7c7e9756a0a4450ca3bae58fcd5 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:20 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:41 2007 -0700 USB: keyspan termios tidy - Clear unsupported CMSPAR bit - Clean up long chains of a-b- a bit - Encode baud rate back into tty structure properly Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/keyspan.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index f2a6fce..6bfdba6 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -278,29 +278,35 @@ static void keyspan_set_termios (struct usb_serial_port *port, struct keyspan_port_private *p_priv; const struct keyspan_device_details *d_details; unsigned intcflag; + struct tty_struct *tty = port-tty; dbg(%s, __FUNCTION__); p_priv = usb_get_serial_port_data(port); d_details = p_priv-device_details; - cflag = port-tty-termios-c_cflag; + cflag = tty-termios-c_cflag; device_port = port-number - port-serial-minor; /* Baud rate calculation takes baud rate as an integer so other rates can be generated if desired. */ - baud_rate = tty_get_baud_rate(port-tty); + baud_rate = tty_get_baud_rate(tty); /* If no match or invalid, don't change */ - if (baud_rate = 0 -d_details-calculate_baud_rate(baud_rate, d_details-baudclk, + if (d_details-calculate_baud_rate(baud_rate, d_details-baudclk, NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) { /* FIXME - more to do here to ensure rate changes cleanly */ + /* FIXME - calcuate exact rate from divisor ? */ p_priv-baud = baud_rate; - } + } else + baud_rate = tty_termios_baud_rate(old_termios); + tty_encode_baud_rate(tty, baud_rate, baud_rate); /* set CTS/RTS handshake etc. */ p_priv-cflag = cflag; p_priv-flow_control = (cflag CRTSCTS)? flow_cts: flow_none; + /* Mark/Space not supported */ + tty-termios-c_cflag = ~CMSPAR; + keyspan_send_setup(port, 0); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: kobil_sct: termios encoding fixups
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a6ebf80dbc186d4782d6b08cf3676e4f22a8a84b Commit: a6ebf80dbc186d4782d6b08cf3676e4f22a8a84b Parent: 74240b07a908e09e18fa09f2cba44f212be9c4c3 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:21 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:41 2007 -0700 USB: kobil_sct: termios encoding fixups - Clear unsupported CMSPAR - Encode resulting speeds Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/kobil_sct.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 6f22419..aee4502 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -616,8 +616,9 @@ static void kobil_set_termios(struct usb_serial_port *port, struct ktermios *old case 1200: urb_val = SUSBCR_SBR_1200; break; - case 9600: default: + speed = 9600; + case 9600: urb_val = SUSBCR_SBR_9600; break; } @@ -641,6 +642,8 @@ static void kobil_set_termios(struct usb_serial_port *port, struct ktermios *old urb_val |= SUSBCR_SPASB_NoParity; strcat(settings, No Parity); } + port-tty-termios-c_cflag = ~CMSPAR; + tty_encode_baud_rate(port-tty, speed, speed); result = usb_control_msg( port-serial-dev, usb_rcvctrlpipe(port-serial-dev, 0 ), - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: sierra: termios
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed1f12ec50224222be9cc494cb72b4322bbacd7f Commit: ed1f12ec50224222be9cc494cb72b4322bbacd7f Parent: e650d8ae0494bb937eea6c7fd1a60e57ba74cd53 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:22 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 USB: sierra: termios No hardware termios setting in this case so keep the old settings Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/sierra.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 959b3e4..833f6e1 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -224,7 +224,7 @@ static void sierra_set_termios(struct usb_serial_port *port, struct ktermios *old_termios) { dbg(%s, __FUNCTION__); - + tty_termios_copy_hw(port-tty-termios, old_termios); sierra_send_setup(port); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
usb-serial: handle NULL termios methods as no hardware changing support
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=337850917a690ca83605b30b29c464bb3397abdf Commit: 337850917a690ca83605b30b29c464bb3397abdf Parent: ed1f12ec50224222be9cc494cb72b4322bbacd7f Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:22 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 usb-serial: handle NULL termios methods as no hardware changing support Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/usb-serial.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 4b1bd7d..426afaa 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -429,6 +429,8 @@ static void serial_set_termios (struct tty_struct *tty, struct ktermios * old) /* pass on to the driver specific version of this function if it is available */ if (port-serial-type-set_termios) port-serial-type-set_termios(port, old); + else + tty_termios_copy_hw(tty-termios, old); } static void serial_break (struct tty_struct *tty, int break_state) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: whiteheat: clean up can't happen checks and encode baud rate
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=01d1df29517625b8e8b5f48a0d3c2020d950eb4b Commit: 01d1df29517625b8e8b5f48a0d3c2020d950eb4b Parent: 337850917a690ca83605b30b29c464bb3397abdf Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:23 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 USB: whiteheat: clean up can't happen checks and encode baud rate Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/whiteheat.c | 11 ++- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index cc8b44c..ee5dd8b 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -885,16 +885,7 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un static void whiteheat_set_termios(struct usb_serial_port *port, struct ktermios *old_termios) { dbg(%s -port %d, __FUNCTION__, port-number); - - if ((!port-tty) || (!port-tty-termios)) { - dbg(%s - no tty structures, __FUNCTION__); - goto exit; - } - firm_setup_port(port); - -exit: - return; } @@ -1244,6 +1235,8 @@ static int firm_setup_port(struct usb_serial_port *port) { port_settings.baud = tty_get_baud_rate(port-tty); dbg(%s - baud rate = %d, __FUNCTION__, port_settings.baud); + /* fixme: should set validated settings */ + tty_encode_baud_rate(port-tty, port_settings.baud, port_settings.baud); /* handle any settings that aren't specified in the tty structure */ port_settings.lloop = 0; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: cp2101: convert to new termios
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ab0f202e6a700d1362a1eb990ac3054f2cd15ea Commit: 9ab0f202e6a700d1362a1eb990ac3054f2cd15ea Parent: 01d1df29517625b8e8b5f48a0d3c2020d950eb4b Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:24 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 USB: cp2101: convert to new termios - Convert to new baud rate functions - Add baud rate reporting Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/cp2101.c | 48 +- 1 files changed, 11 insertions(+), 37 deletions(-) diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index eb7df18..3a83cb4 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c @@ -361,7 +361,6 @@ static void cp2101_get_termios (struct usb_serial_port *port) dbg(%s - no tty structures, __FUNCTION__); return; } - cflag = port-tty-termios-c_cflag; cp2101_get_config(port, CP2101_BAUDRATE, baud, 2); /* Convert to baudrate */ @@ -369,40 +368,9 @@ static void cp2101_get_termios (struct usb_serial_port *port) baud = BAUD_RATE_GEN_FREQ / baud; dbg(%s - baud rate = %d, __FUNCTION__, baud); - cflag = ~CBAUD; - switch (baud) { - /* -* The baud rates which are commented out below -* appear to be supported by the device -* but are non-standard -*/ - case 600: cflag |= B600; break; - case 1200: cflag |= B1200; break; - case 1800: cflag |= B1800; break; - case 2400: cflag |= B2400; break; - case 4800: cflag |= B4800; break; - /*case 7200:cflag |= B7200; break;*/ - case 9600: cflag |= B9600; break; - /*case 14400: cflag |= B14400;break;*/ - case 19200: cflag |= B19200;break; - /*case 28800: cflag |= B28800;break;*/ - case 38400: cflag |= B38400;break; - /*case 55854: cflag |= B55054;break;*/ - case 57600: cflag |= B57600;break; - case 115200:cflag |= B115200; break; - /*case 127117: cflag |= B127117; break;*/ - case 230400:cflag |= B230400; break; - case 460800:cflag |= B460800; break; - case 921600:cflag |= B921600; break; - /*case 3686400: cflag |= B3686400; break;*/ - default: - dbg(%s - Baud rate is not supported, - using 9600 baud, __FUNCTION__); - cflag |= B9600; - cp2101_set_config_single(port, CP2101_BAUDRATE, - (BAUD_RATE_GEN_FREQ/9600)); - break; - } + + tty_encode_baud_rate(port-tty, baud, baud); + cflag = port-tty-termios-c_cflag; cp2101_get_config(port, CP2101_BITS, bits, 2); cflag = ~CSIZE; @@ -516,7 +484,7 @@ static void cp2101_get_termios (struct usb_serial_port *port) static void cp2101_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) { - unsigned int cflag, old_cflag=0; + unsigned int cflag, old_cflag; int baud=0, bits; unsigned int modem_ctl[4]; @@ -526,6 +494,8 @@ static void cp2101_set_termios (struct usb_serial_port *port, dbg(%s - no tty structures, __FUNCTION__); return; } + port-tty-termios-c_cflag = ~CMSPAR; + cflag = port-tty-termios-c_cflag; old_cflag = old_termios-c_cflag; baud = tty_get_baud_rate(port-tty); @@ -563,11 +533,15 @@ static void cp2101_set_termios (struct usb_serial_port *port, dbg(%s - Setting baud rate to %d baud, __FUNCTION__, baud); if (cp2101_set_config_single(port, CP2101_BAUDRATE, - (BAUD_RATE_GEN_FREQ / baud))) + (BAUD_RATE_GEN_FREQ / baud))) { dev_err(port-dev, Baud rate requested not supported by device\n); + baud = tty_termios_baud_rate(old_termios); + } } } + /* Report back the resulting baud rate */ +
USB: ftd_sio: cleanups and updates for new termios work
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=669a6db1037efeb064dd6620f69384f99fb45584 Commit: 669a6db1037efeb064dd6620f69384f99fb45584 Parent: 9ab0f202e6a700d1362a1eb990ac3054f2cd15ea Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:24 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 USB: ftd_sio: cleanups and updates for new termios work - Remove can't happen tests - Rework speed validation in terms of baud rates not CBAUD bits - Report speed set (or chosen) - Minor termios correctness Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ftdi_sio.c | 32 +++- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8a8a6b9..a63c0aa 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -294,7 +294,7 @@ struct ftdi_private { __u16 interface;/* FT2232C port interface (0 for FT232/245) */ - int force_baud; /* if non-zero, force the baud rate to this value */ + speed_t force_baud; /* if non-zero, force the baud rate to this value */ int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */ spinlock_t tx_lock; /* spinlock for transmit state */ @@ -878,6 +878,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) if (div_value == 0) { dbg(%s - Baudrate (%d) requested is not supported, __FUNCTION__, baud); div_value = ftdi_sio_b9600; + baud = 9600; div_okay = 0; } break; @@ -886,6 +887,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) div_value = ftdi_232am_baud_to_divisor(baud); } else { dbg(%s - Baud rate too high!, __FUNCTION__); + baud = 9600; div_value = ftdi_232am_baud_to_divisor(9600); div_okay = 0; } @@ -899,6 +901,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) dbg(%s - Baud rate too high!, __FUNCTION__); div_value = ftdi_232bm_baud_to_divisor(9600); div_okay = 0; + baud = 9600; } break; } /* priv-chip_type */ @@ -909,6 +912,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) ftdi_chip_name[priv-chip_type]); } + tty_encode_baud_rate(port-tty, baud, baud); return(div_value); } @@ -1263,7 +1267,7 @@ static void ftdi_USB_UIRT_setup (struct ftdi_private *priv) priv-flags |= ASYNC_SPD_CUST; priv-custom_divisor = 77; - priv-force_baud = B38400; + priv-force_baud = 38400; } /* ftdi_USB_UIRT_setup */ /* Setup for the HE-TIRA1 device, which requires hardwired @@ -1274,7 +1278,7 @@ static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv) priv-flags |= ASYNC_SPD_CUST; priv-custom_divisor = 240; - priv-force_baud = B38400; + priv-force_baud = 38400; priv-force_rtscts = 1; } /* ftdi_HE_TIRA1_setup */ @@ -1363,7 +1367,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp) /* ftdi_set_termios will send usb control messages */ if (port-tty) - ftdi_set_termios(port, NULL); + ftdi_set_termios(port, port-tty-termios); /* FIXME: Flow control might be enabled, so it should be checked - we have no control of defaults! */ @@ -1933,32 +1937,32 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state ) static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) { /* ftdi_termios */ struct usb_device *dev = port-serial-dev; - unsigned int cflag = port-tty-termios-c_cflag; struct ftdi_private *priv = usb_get_serial_port_data(port); + struct ktermios *termios = port-tty-termios; + unsigned int cflag = termios-c_cflag; __u16 urb_value; /* will hold the new flags */ char buf[1]; /* Perhaps I should dynamically alloc this? */ // Added for xon/xoff support - unsigned int iflag = port-tty-termios-c_iflag; + unsigned int iflag = termios-c_iflag; unsigned char vstop; unsigned char vstart; dbg(%s, __FUNCTION__); /* Force baud rate if this device requires it, unless it is set to B0. */ - if (priv-force_baud ((port-tty-termios-c_cflag CBAUD) != B0)) { + if (priv-force_baud
USB: ftd_sio cleanups and updates for new termios work checkpatch fixes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd5e47ccb656e74a775c002d0308c666bea65a2b Commit: bd5e47ccb656e74a775c002d0308c666bea65a2b Parent: 669a6db1037efeb064dd6620f69384f99fb45584 Author: Andrew Morton [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:25 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:42 2007 -0700 USB: ftd_sio cleanups and updates for new termios work checkpatch fixes WARNING: line over 80 characters #23: FILE: drivers/usb/serial/ftdi_sio.c:297: + speed_t force_baud; /* if non-zero, force the baud rate to this value */ ERROR: use tabs not spaces #31: FILE: drivers/usb/serial/ftdi_sio.c:881: +^I$ ERROR: use tabs not spaces #39: FILE: drivers/usb/serial/ftdi_sio.c:890: +^I$ WARNING: line over 80 characters #111: FILE: drivers/usb/serial/ftdi_sio.c:1956: + tty_encode_baud_rate(port-tty, priv-force_baud, priv-force_baud); Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ftdi_sio.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index a63c0aa..c40e77d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -878,7 +878,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) if (div_value == 0) { dbg(%s - Baudrate (%d) requested is not supported, __FUNCTION__, baud); div_value = ftdi_sio_b9600; - baud = 9600; + baud = 9600; div_okay = 0; } break; @@ -887,7 +887,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port) div_value = ftdi_232am_baud_to_divisor(baud); } else { dbg(%s - Baud rate too high!, __FUNCTION__); - baud = 9600; + baud = 9600; div_value = ftdi_232am_baud_to_divisor(9600); div_okay = 0; } @@ -1953,7 +1953,8 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old /* Force baud rate if this device requires it, unless it is set to B0. */ if (priv-force_baud ((termios-c_cflag CBAUD) != B0)) { dbg(%s: forcing baud rate for this device, __FUNCTION__); - tty_encode_baud_rate(port-tty, priv-force_baud, priv-force_baud); + tty_encode_baud_rate(port-tty, priv-force_baud, + priv-force_baud); } /* Force RTS-CTS if this device requires it. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: io_edgeport: cleanups, and tty speed reporting
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ce073bd8be0a741440944fed892a136a1d24bbe Commit: 6ce073bd8be0a741440944fed892a136a1d24bbe Parent: bd5e47ccb656e74a775c002d0308c666bea65a2b Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Thu Oct 18 01:24:25 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB: io_edgeport: cleanups, and tty speed reporting Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/io_edgeport.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 8dd3abc..a5d2e11 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -1503,22 +1503,16 @@ static void edge_unthrottle (struct usb_serial_port *port) */ static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) { + /* FIXME: This function appears unused ?? */ struct edgeport_port *edge_port = usb_get_serial_port_data(port); struct tty_struct *tty = port-tty; unsigned int cflag; - if (!port-tty || !port-tty-termios) { - dbg (%s - no tty or termios, __FUNCTION__); - return; - } - cflag = tty-termios-c_cflag; dbg(%s - clfag %08x iflag %08x, __FUNCTION__, tty-termios-c_cflag, tty-termios-c_iflag); - if (old_termios) { - dbg(%s - old clfag %08x old iflag %08x, __FUNCTION__, - old_termios-c_cflag, old_termios-c_iflag); - } + dbg(%s - old clfag %08x old iflag %08x, __FUNCTION__, + old_termios-c_cflag, old_termios-c_iflag); dbg(%s - port %d, __FUNCTION__, port-number); @@ -2653,7 +2647,11 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi dbg(%s - baud rate = %d, __FUNCTION__, baud); status = send_cmd_write_baud_rate (edge_port, baud); - + if (status == -1) { + /* Speed change was not possible - put back the old speed */ + baud = tty_termios_baud_rate(old_termios); + tty_encode_baud_rate(tty, baud, baud); + } return; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: fix scheduling of Iso URBs in uhci-hcd
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7898ffc543566a9c4a1b4ff39f43857d2d84a51c Commit: 7898ffc543566a9c4a1b4ff39f43857d2d84a51c Parent: 6ce073bd8be0a741440944fed892a136a1d24bbe Author: Alan Stern [EMAIL PROTECTED] AuthorDate: Tue Oct 16 11:55:30 2007 -0400 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB: fix scheduling of Iso URBs in uhci-hcd This patch (as1003) changes uhci-hcd to treat the URB_ISO_ASAP flag the same as other host controller drivers, namely, to schedule an Iso URB for the first available time slot that hasn't already expired. URBs in which the flag isn't set will be scheduled for the first slot following the last URB, even if it has expired. This fixes a problem reported by Martin Bachem. Signed-off-by: Alan Stern [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/host/uhci-q.c | 19 ++- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index e5d60d5..60379b1 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c @@ -1271,7 +1271,8 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb, } else if (qh-period != urb-interval) { return -EINVAL; /* Can't change the period */ - } else {/* Pick up where the last URB leaves off */ + } else { + /* Find the next unused frame */ if (list_empty(qh-queue)) { frame = qh-iso_frame; } else { @@ -1283,10 +1284,18 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb, lurb-number_of_packets * lurb-interval; } - if (urb-transfer_flags URB_ISO_ASAP) - urb-start_frame = frame; - else if (urb-start_frame != frame) - return -EINVAL; + if (urb-transfer_flags URB_ISO_ASAP) { + /* Skip some frames if necessary to insure +* the start frame is in the future. +*/ + uhci_get_current_frame_number(uhci); + if (uhci_frame_before_eq(frame, uhci-frame_number)) { + frame = uhci-frame_number + 1; + frame += ((qh-phase - frame) + (qh-period - 1)); + } + } /* Otherwise pick up where the last URB leaves off */ + urb-start_frame = frame; } /* Make sure we won't have to go too far into the future */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: FTDI Elan driver: Convert ftdi-u132_lock to mutex
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c93d46509e7aee7d58680c4c8a12cfbe98df98cb Commit: c93d46509e7aee7d58680c4c8a12cfbe98df98cb Parent: 7898ffc543566a9c4a1b4ff39f43857d2d84a51c Author: Matthias Kaehlcke [EMAIL PROTECTED] AuthorDate: Tue Oct 16 19:23:10 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB: FTDI Elan driver: Convert ftdi-u132_lock to mutex FTDI Elan driver: Convert the semaphore ftdi-u132_lock to the mutex API Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/ftdi-elan.c | 130 +- 1 files changed, 65 insertions(+), 65 deletions(-) diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index d3d8cd6..148b7fe 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -147,7 +147,7 @@ struct u132_target { /* Structure to hold all of our device specific stuff*/ struct usb_ftdi { struct list_head ftdi_list; -struct semaphore u132_lock; +struct mutex u132_lock; int command_next; int command_head; struct u132_command command[COMMAND_SIZE]; @@ -330,39 +330,39 @@ static int ftdi_elan_hcd_init(struct usb_ftdi *ftdi) static void ftdi_elan_abandon_completions(struct usb_ftdi *ftdi) { -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); while (ftdi-respond_next ftdi-respond_head) { struct u132_respond *respond = ftdi-respond[RESPOND_MASK ftdi-respond_head++]; *respond-result = -ESHUTDOWN; *respond-value = 0; complete(respond-wait_completion); -} up(ftdi-u132_lock); +} mutex_unlock(ftdi-u132_lock); } static void ftdi_elan_abandon_targets(struct usb_ftdi *ftdi) { int ed_number = 4; -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); while (ed_number-- 0) { struct u132_target *target = ftdi-target[ed_number]; if (target-active == 1) { target-condition_code = TD_DEVNOTRESP; -up(ftdi-u132_lock); +mutex_unlock(ftdi-u132_lock); ftdi_elan_do_callback(ftdi, target, NULL, 0); -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); } } ftdi-recieved = 0; ftdi-expected = 4; ftdi-ed_found = 0; -up(ftdi-u132_lock); +mutex_unlock(ftdi-u132_lock); } static void ftdi_elan_flush_targets(struct usb_ftdi *ftdi) { int ed_number = 4; -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); while (ed_number-- 0) { struct u132_target *target = ftdi-target[ed_number]; target-abandoning = 1; @@ -382,9 +382,9 @@ static void ftdi_elan_flush_targets(struct usb_ftdi *ftdi) ftdi-command_next += 1; ftdi_elan_kick_command_queue(ftdi); } else { -up(ftdi-u132_lock); +mutex_unlock(ftdi-u132_lock); msleep(100); -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); goto wait_1; } } @@ -404,9 +404,9 @@ static void ftdi_elan_flush_targets(struct usb_ftdi *ftdi) ftdi-command_next += 1; ftdi_elan_kick_command_queue(ftdi); } else { -up(ftdi-u132_lock); +mutex_unlock(ftdi-u132_lock); msleep(100); -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); goto wait_2; } } @@ -414,13 +414,13 @@ static void ftdi_elan_flush_targets(struct usb_ftdi *ftdi) ftdi-recieved = 0; ftdi-expected = 4; ftdi-ed_found = 0; -up(ftdi-u132_lock); +mutex_unlock(ftdi-u132_lock); } static void ftdi_elan_cancel_targets(struct usb_ftdi *ftdi) { int ed_number = 4; -down(ftdi-u132_lock); +mutex_lock(ftdi-u132_lock); while (ed_number-- 0) { struct u132_target *target = ftdi-target[ed_number]; target-abandoning = 1; @@ -440,9 +440,9 @@ static void ftdi_elan_cancel_targets(struct usb_ftdi *ftdi) ftdi-command_next += 1;
USB: isd200: sort out USB/IDE dependancy mess
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3794ade5b286cbd4551009dd341dbe9aeead2bc3 Commit: 3794ade5b286cbd4551009dd341dbe9aeead2bc3 Parent: c93d46509e7aee7d58680c4c8a12cfbe98df98cb Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Mon Oct 15 15:08:11 2007 +0100 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB: isd200: sort out USB/IDE dependancy mess The ISD200 driver imports a single trivial routine from the IDE layer and in doing so creates a mess of dependancies that drag in the entire old IDE layer. Even more sad - it does this for a routine which is usually (little endian) a null function! - Copy the function into ISD200 - Rename it so it doesn't clash with the ide header prototype - Remove all the depend constraints Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/storage/Kconfig |1 - drivers/usb/storage/isd200.c | 105 +- 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig index fe2c4cd..7e5 100644 --- a/drivers/usb/storage/Kconfig +++ b/drivers/usb/storage/Kconfig @@ -48,7 +48,6 @@ config USB_STORAGE_FREECOM config USB_STORAGE_ISD200 bool ISD-200 USB/ATA Bridge support depends on USB_STORAGE - depends on BLK_DEV_IDE=y || BLK_DEV_IDE=USB_STORAGE ---help--- Say Y here if you want to use USB Mass Store devices based on the In-Systems Design ISD-200 USB/ATA bridge. diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 93a7724..49ba6c0 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c @@ -977,6 +977,109 @@ static int isd200_manual_enum(struct us_data *us) return(retStatus); } +/* + * We are the last non IDE user of the legacy IDE ident structures + * and we thus want to keep a private copy of this function so the + * driver can be used without the obsolete drivers/ide layer + */ + +static void isd200_fix_driveid (struct hd_driveid *id) +{ +#ifndef __LITTLE_ENDIAN +# ifdef __BIG_ENDIAN + int i; + u16 *stringcast; + + id-config = __le16_to_cpu(id-config); + id-cyls = __le16_to_cpu(id-cyls); + id-reserved2 = __le16_to_cpu(id-reserved2); + id-heads = __le16_to_cpu(id-heads); + id-track_bytes= __le16_to_cpu(id-track_bytes); + id-sector_bytes = __le16_to_cpu(id-sector_bytes); + id-sectors= __le16_to_cpu(id-sectors); + id-vendor0= __le16_to_cpu(id-vendor0); + id-vendor1= __le16_to_cpu(id-vendor1); + id-vendor2= __le16_to_cpu(id-vendor2); + stringcast = (u16 *)id-serial_no[0]; + for (i = 0; i (20/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id-buf_type = __le16_to_cpu(id-buf_type); + id-buf_size = __le16_to_cpu(id-buf_size); + id-ecc_bytes = __le16_to_cpu(id-ecc_bytes); + stringcast = (u16 *)id-fw_rev[0]; + for (i = 0; i (8/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + stringcast = (u16 *)id-model[0]; + for (i = 0; i (40/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id-dword_io = __le16_to_cpu(id-dword_io); + id-reserved50 = __le16_to_cpu(id-reserved50); + id-field_valid= __le16_to_cpu(id-field_valid); + id-cur_cyls = __le16_to_cpu(id-cur_cyls); + id-cur_heads = __le16_to_cpu(id-cur_heads); + id-cur_sectors= __le16_to_cpu(id-cur_sectors); + id-cur_capacity0 = __le16_to_cpu(id-cur_capacity0); + id-cur_capacity1 = __le16_to_cpu(id-cur_capacity1); + id-lba_capacity = __le32_to_cpu(id-lba_capacity); + id-dma_1word = __le16_to_cpu(id-dma_1word); + id-dma_mword = __le16_to_cpu(id-dma_mword); + id-eide_pio_modes = __le16_to_cpu(id-eide_pio_modes); + id-eide_dma_min = __le16_to_cpu(id-eide_dma_min); + id-eide_dma_time = __le16_to_cpu(id-eide_dma_time); + id-eide_pio = __le16_to_cpu(id-eide_pio); + id-eide_pio_iordy = __le16_to_cpu(id-eide_pio_iordy); + for (i = 0; i 2; ++i) + id-words69_70[i] = __le16_to_cpu(id-words69_70[i]); + for (i = 0; i 4; ++i) + id-words71_74[i] = __le16_to_cpu(id-words71_74[i]); + id-queue_depth= __le16_to_cpu(id-queue_depth); + for (i = 0; i 4; ++i) + id-words76_79[i] = __le16_to_cpu(id-words76_79[i]); + id-major_rev_num = __le16_to_cpu(id-major_rev_num); + id-minor_rev_num = __le16_to_cpu(id-minor_rev_num); + id-command_set_1 = __le16_to_cpu(id-command_set_1); + id-command_set_2 =
USB: add URB_FREE_BUFFER to permissible flags
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0b28baaf74ca04be2e0cc4d4dd2bbc801697f744 Commit: 0b28baaf74ca04be2e0cc4d4dd2bbc801697f744 Parent: 3794ade5b286cbd4551009dd341dbe9aeead2bc3 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Wed Oct 17 14:37:54 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB: add URB_FREE_BUFFER to permissible flags URB_FREE_BUFFER needs to be allowed in the sanity checks to use drivers that use that flag. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Acked-by: Marcel Holtmann [EMAIL PROTECTED] Cc: stable [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/core/urb.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index c20c03a..d05ead2 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -372,7 +372,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) /* enforce simple/standard policy */ allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP | - URB_NO_INTERRUPT | URB_DIR_MASK); + URB_NO_INTERRUPT | URB_DIR_MASK | URB_FREE_BUFFER); switch (xfertype) { case USB_ENDPOINT_XFER_BULK: if (is_out) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB iowarrior.c: fix check-after-use
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e28c6a77061ab28bd2f0b57e400e3e58cd3474ca Commit: e28c6a77061ab28bd2f0b57e400e3e58cd3474ca Parent: 0b28baaf74ca04be2e0cc4d4dd2bbc801697f744 Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Thu Oct 18 12:52:50 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB iowarrior.c: fix check-after-use The Coverity checker spotted that we have already oops'ed if dev was NULL. Since dev being NULL doesn't seem to be possible here this patch removes the NULL check. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Acked-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/iowarrior.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index d372fbc..c86c132 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -351,7 +351,7 @@ static ssize_t iowarrior_write(struct file *file, mutex_lock(dev-mutex); /* verify that the device wasn't unplugged */ - if (dev == NULL || !dev-present) { + if (!dev-present) { retval = -ENODEV; goto exit; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB rio500.c: fix check-after-use
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3328d9752f3796a5f5f8695d27a175c34407a5ed Commit: 3328d9752f3796a5f5f8695d27a175c34407a5ed Parent: e28c6a77061ab28bd2f0b57e400e3e58cd3474ca Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Thu Oct 18 12:53:07 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:43 2007 -0700 USB rio500.c: fix check-after-use The Coverity checker spotted that we have already oops'ed if dev was NULL in these places. Since dev being NULL isn't possible at these places this patch removes the NULL checks. Additionally, I've fixed the formatting of the if's. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Acked-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/rio500.c | 15 +++ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 88f6abe..330c18e 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -118,10 +118,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd, mutex_lock((rio-lock)); /* Sanity check to make sure rio is connected, powered, etc */ -if ( rio == NULL || - rio-present == 0 || - rio-rio_dev == NULL ) - { +if (rio-present == 0 || rio-rio_dev == NULL) { retval = -ENODEV; goto err_out; } @@ -280,10 +277,7 @@ write_rio(struct file *file, const char __user *buffer, if (intr) return -EINTR; /* Sanity check to make sure rio is connected, powered, etc */ -if ( rio == NULL || - rio-present == 0 || - rio-rio_dev == NULL ) - { +if (rio-present == 0 || rio-rio_dev == NULL) { mutex_unlock((rio-lock)); return -ENODEV; } @@ -369,10 +363,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) if (intr) return -EINTR; /* Sanity check to make sure rio is connected, powered, etc */ -if ( rio == NULL || - rio-present == 0 || - rio-rio_dev == NULL ) - { +if (rio-present == 0 || rio-rio_dev == NULL) { mutex_unlock((rio-lock)); return -ENODEV; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: mos7840: Clean up old checks and stuff
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3d3ddce568b79911bc893b9e8542f7e1d3bc72c7 Commit: 3d3ddce568b79911bc893b9e8542f7e1d3bc72c7 Parent: 3328d9752f3796a5f5f8695d27a175c34407a5ed Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Mon Oct 15 20:53:35 2007 +0100 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: mos7840: Clean up old checks and stuff Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/mos7840.c | 23 ++- 1 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index f76480f..a5ced7e 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1977,11 +1977,6 @@ static void mos7840_change_port_settings(struct moschip_port *mos7840_port, tty = mos7840_port-port-tty; - if ((!tty) || (!tty-termios)) { - dbg(%s - no tty structures, __FUNCTION__); - return; - } - dbg(%s, Entering .. \n); lData = LCR_BITS_8; @@ -2151,11 +2146,6 @@ static void mos7840_set_termios(struct usb_serial_port *port, tty = port-tty; - if (!port-tty || !port-tty-termios) { - dbg(%s - no tty or termios, __FUNCTION__); - return; - } - if (!mos7840_port-open) { dbg(%s - port not opened, __FUNCTION__); return; @@ -2165,19 +2155,10 @@ static void mos7840_set_termios(struct usb_serial_port *port, cflag = tty-termios-c_cflag; - if (!cflag) { - dbg(%s %s\n, __FUNCTION__, cflag is NULL); - return; - } - dbg(%s - clfag %08x iflag %08x, __FUNCTION__, tty-termios-c_cflag, RELEVANT_IFLAG(tty-termios-c_iflag)); - - if (old_termios) { - dbg(%s - old clfag %08x old iflag %08x, __FUNCTION__, - old_termios-c_cflag, RELEVANT_IFLAG(old_termios-c_iflag)); - } - + dbg(%s - old clfag %08x old iflag %08x, __FUNCTION__, + old_termios-c_cflag, RELEVANT_IFLAG(old_termios-c_iflag)); dbg(%s - port %d, __FUNCTION__, port-number); /* change the port settings to the new ones specified */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: pl2303: remove can't happen checks, set speed properly and report baud rate
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df64c47184aedf34fd2a69a4b7f68584fe982fdf Commit: df64c47184aedf34fd2a69a4b7f68584fe982fdf Parent: 3d3ddce568b79911bc893b9e8542f7e1d3bc72c7 Author: Alan Cox [EMAIL PROTECTED] AuthorDate: Mon Oct 15 20:54:47 2007 +0100 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: pl2303: remove can't happen checks, set speed properly and report baud rate Signed-off-by: Alan Cox [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/pl2303.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 1da57fd..1103b2f 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -470,16 +470,13 @@ static void pl2303_set_termios(struct usb_serial_port *port, dbg(%s - port %d, __FUNCTION__, port-number); - if ((!port-tty) || (!port-tty-termios)) { - dbg(%s - no tty structures, __FUNCTION__); - return; - } - spin_lock_irqsave(priv-lock, flags); if (!priv-termios_initialized) { *(port-tty-termios) = tty_std_termios; port-tty-termios-c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + port-tty-termios-c_ispeed = 9600; + port-tty-termios-c_ospeed = 9600; priv-termios_initialized = 1; } spin_unlock_irqrestore(priv-lock, flags); @@ -596,6 +593,10 @@ static void pl2303_set_termios(struct usb_serial_port *port, dbg (0x40:0x1:0x0:0x0 %d, i); } + /* FIXME: Need to read back resulting baud rate */ + if (baud) + tty_encode_baud_rate(port-tty, baud, baud); + kfree(buf); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: fix ssb_ohci_probe() build bug
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b22817b3c81cdb18ffe3d2debfee968731a8b5f4 Commit: b22817b3c81cdb18ffe3d2debfee968731a8b5f4 Parent: df64c47184aedf34fd2a69a4b7f68584fe982fdf Author: Ingo Molnar [EMAIL PROTECTED] AuthorDate: Mon Oct 15 19:43:21 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: fix ssb_ohci_probe() build bug fix ssb_ohci_probe() build bug: drivers/built-in.o: In function `ssb_ohci_probe': ohci-hcd.c:(.text+0xbff39): undefined reference to `ssb_device_enable' ohci-hcd.c:(.text+0xbff6f): undefined reference to `ssb_admatch_base' ohci-hcd.c:(.text+0xbff8b): undefined reference to `ssb_admatch_size' ohci-hcd.c:(.text+0xbffe5): undefined reference to `ssb_device_disable' [...] the reason was that this Kconfig combination was allowed: CONFIG_SSB=m CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_SSB=y the fix is to require a modular USB_OHCI_HCD build when SSB is modular. Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Acked-by: Michael Buesch [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/host/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index c978d62..177e78e 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -156,7 +156,7 @@ config USB_OHCI_HCD_PCI config USB_OHCI_HCD_SSB bool OHCI support for Broadcom SSB OHCI core - depends on USB_OHCI_HCD SSB EXPERIMENTAL + depends on USB_OHCI_HCD (SSB = y || SSB = CONFIG_USB_OHCI_HCD) EXPERIMENTAL default n ---help--- Support for the Sonics Silicon Backplane (SSB) attached - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: fix interface sysfs file-creation bug
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=439a903a9663c0caa8094f3907ca60069d6c36e7 Commit: 439a903a9663c0caa8094f3907ca60069d6c36e7 Parent: b22817b3c81cdb18ffe3d2debfee968731a8b5f4 Author: Alan Stern [EMAIL PROTECTED] AuthorDate: Fri Oct 19 09:51:58 2007 -0400 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: fix interface sysfs file-creation bug This patch (as1005) fixes a rather subtle problem. When usb_set_configuration() registers the interfaces and their files in sysfs, it doesn't expect those files to exist already. But when an interface is registered, its driver may call usb_set_interface() and thereby cause the sysfs files to be created. The result is an error when usb_set_configuration() goes on to create those same files again. The (not-so-great) solution is to have usb_set_configuration() remove any existing files before creating them. Signed-off-by: Alan Stern [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/core/message.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 8bdaa15..eb4ac47 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1641,7 +1641,13 @@ free_interfaces: intf-dev.bus_id, ret); continue; } - usb_create_sysfs_intf_files (intf); + + /* The driver's probe method can call usb_set_interface(), +* which would mean the interface's sysfs files are already +* created. Just in case, we'll remove them first. +*/ + usb_remove_sysfs_intf_files(intf); + usb_create_sysfs_intf_files(intf); } usb_autosuspend_device(dev); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: fix locking in idmouse
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54d2bc068fd21bcb096660938bce7c7265613a24 Commit: 54d2bc068fd21bcb096660938bce7c7265613a24 Parent: 439a903a9663c0caa8094f3907ca60069d6c36e7 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Tue Oct 23 14:23:13 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: fix locking in idmouse Pete caused me to lock at buggy drivers in this respect. The idmouse has a race between open and disconnect. This patch - solves the open/disconnect race - switches locking to mutexes Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/idmouse.c | 45 +++ 1 files changed, 28 insertions(+), 17 deletions(-) diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index e6fd024..4bcf7fb 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -66,6 +66,7 @@ static struct usb_device_id idmouse_table[] = { USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, value, index, NULL, 0, 1000) MODULE_DEVICE_TABLE(usb, idmouse_table); +static DEFINE_MUTEX(open_disc_mutex); /* structure to hold all of our device specific stuff */ struct usb_idmouse { @@ -80,7 +81,7 @@ struct usb_idmouse { int open; /* if the port is open or not */ int present; /* if the device is not disconnected */ - struct semaphore sem; /* locks this structure */ + struct mutex lock; /* locks this structure */ }; @@ -213,13 +214,17 @@ static int idmouse_open(struct inode *inode, struct file *file) if (!interface) return -ENODEV; + mutex_lock(open_disc_mutex); /* get the device information block from the interface */ dev = usb_get_intfdata(interface); - if (!dev) + if (!dev) { + mutex_unlock(open_disc_mutex); return -ENODEV; + } /* lock this device */ - down(dev-sem); + mutex_lock(dev-lock); + mutex_unlock(open_disc_mutex); /* check if already open */ if (dev-open) { @@ -245,7 +250,7 @@ static int idmouse_open(struct inode *inode, struct file *file) error: /* unlock this device */ - up(dev-sem); + mutex_unlock(dev-lock); return result; } @@ -258,12 +263,14 @@ static int idmouse_release(struct inode *inode, struct file *file) if (dev == NULL) return -ENODEV; + mutex_lock(open_disc_mutex); /* lock our device */ - down(dev-sem); + mutex_lock(dev-lock); /* are we really open? */ if (dev-open = 0) { - up(dev-sem); + mutex_unlock(dev-lock); + mutex_unlock(open_disc_mutex); return -ENODEV; } @@ -271,10 +278,12 @@ static int idmouse_release(struct inode *inode, struct file *file) if (!dev-present) { /* the device was unplugged before the file was released */ - up(dev-sem); + mutex_unlock(dev-lock); + mutex_unlock(open_disc_mutex); idmouse_delete(dev); } else { - up(dev-sem); + mutex_unlock(dev-lock); + mutex_unlock(open_disc_mutex); } return 0; } @@ -286,18 +295,18 @@ static ssize_t idmouse_read(struct file *file, char __user *buffer, size_t count int result; /* lock this object */ - down(dev-sem); + mutex_lock(dev-lock); /* verify that the device wasn't unplugged */ if (!dev-present) { - up(dev-sem); + mutex_unlock(dev-lock); return -ENODEV; } result = simple_read_from_buffer(buffer, count, ppos, dev-bulk_in_buffer, IMGSIZE); /* unlock the device */ - up(dev-sem); + mutex_unlock(dev-lock); return result; } @@ -320,7 +329,7 @@ static int idmouse_probe(struct usb_interface *interface, if (dev == NULL) return -ENOMEM; - init_MUTEX(dev-sem); + mutex_init(dev-lock); dev-udev = udev; dev-interface = interface; @@ -372,24 +381,26 @@ static void idmouse_disconnect(struct usb_interface *interface) /* get device structure */ dev = usb_get_intfdata(interface); - usb_set_intfdata(interface, NULL); /* give back our minor */ usb_deregister_dev(interface, idmouse_class); - /* lock it */ - down(dev-sem); + mutex_lock(open_disc_mutex); + usb_set_intfdata(interface, NULL); + /* lock the device */ + mutex_lock(dev-lock); + mutex_unlock(open_disc_mutex); /* prevent device read, write and ioctl */ dev-present =
USB: fix read vs. disconnect race in cytherm driver
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d718d2b17822bb92708204cb1a9175e512520261 Commit: d718d2b17822bb92708204cb1a9175e512520261 Parent: 54d2bc068fd21bcb096660938bce7c7265613a24 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Tue Oct 23 12:26:41 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:44 2007 -0700 USB: fix read vs. disconnect race in cytherm driver the disconnect method of this driver set intfdata to NULL before removing attribute files. The attributes' read methods will happily follow the NULL pointer. Here's the correct ordering. Signed-off-by : Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/cytherm.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 2677fea..1cd9e7e 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -399,7 +399,6 @@ static void cytherm_disconnect(struct usb_interface *interface) struct usb_cytherm *dev; dev = usb_get_intfdata (interface); - usb_set_intfdata (interface, NULL); device_remove_file(interface-dev, dev_attr_brightness); device_remove_file(interface-dev, dev_attr_temp); @@ -407,6 +406,9 @@ static void cytherm_disconnect(struct usb_interface *interface) device_remove_file(interface-dev, dev_attr_port0); device_remove_file(interface-dev, dev_attr_port1); + /* first remove the files, then NULL the pointer */ + usb_set_intfdata (interface, NULL); + usb_put_dev(dev-udev); kfree(dev); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
usb: serial/pl2303: support for IO Data Device RSAQ5
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8a28dea3accda319d51a1bf4d3e280771d946f78 Commit: 8a28dea3accda319d51a1bf4d3e280771d946f78 Parent: d718d2b17822bb92708204cb1a9175e512520261 Author: Masakazu Mokuno [EMAIL PROTECTED] AuthorDate: Tue Oct 23 13:51:57 2007 +0900 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 usb: serial/pl2303: support for IO Data Device RSAQ5 This patch adds support for the IO Data Device USB-RSAQ5, PL2303 based USB-serial converter, to pl2303 driver Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/pl2303.c |1 + drivers/usb/serial/pl2303.h |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 1103b2f..2cd3f1d 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -56,6 +56,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) }, { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index c39bace..ed603e3 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -20,6 +20,7 @@ #define IODATA_VENDOR_ID 0x04bb #define IODATA_PRODUCT_ID 0x0a03 +#define IODATA_PRODUCT_ID_RSAQ50x0a0e #define ELCOM_VENDOR_ID0x056e #define ELCOM_PRODUCT_ID 0x5003 - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: usbserial - fix potential deadlock between write() and IRQ
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=acd2a847e7fee7df11817f67dba75a2802793e5d Commit: acd2a847e7fee7df11817f67dba75a2802793e5d Parent: 8a28dea3accda319d51a1bf4d3e280771d946f78 Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Sat Oct 20 00:05:19 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: usbserial - fix potential deadlock between write() and IRQ USB: usbserial - fix potential deadlock between write() and IRQ usb_serial_generic_write() doesn't disable interrupts when taking port-lock, and could therefore deadlock with usb_serial_generic_read_bulk_callback() being called from interrupt, taking the same lock. Fix it. Signed-off-by: Jiri Kosina [EMAIL PROTECTED] Acked-by: Larry Finger [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/generic.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 88a2c7d..9eb4a65 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -208,14 +208,15 @@ int usb_serial_generic_write(struct usb_serial_port *port, const unsigned char * /* only do something if we have a bulk out endpoint */ if (serial-num_bulk_out) { - spin_lock_bh(port-lock); + unsigned long flags; + spin_lock_irqsave(port-lock, flags); if (port-write_urb_busy) { - spin_unlock_bh(port-lock); + spin_unlock_irqrestore(port-lock, flags); dbg(%s - already writing, __FUNCTION__); return 0; } port-write_urb_busy = 1; - spin_unlock_bh(port-lock); + spin_unlock_irqrestore(port-lock, flags); count = (count port-bulk_out_size) ? port-bulk_out_size : count; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: amd5536udc - remove set_mwi() compiler warning
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51745281b0bf56312b78d8f56afb970cd7c91137 Commit: 51745281b0bf56312b78d8f56afb970cd7c91137 Parent: acd2a847e7fee7df11817f67dba75a2802793e5d Author: David Brownell [EMAIL PROTECTED] AuthorDate: Wed Oct 24 18:44:08 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: amd5536udc - remove set_mwi() compiler warning Get rid of pointless pci_set_mwi() compiler warning. Signed-off-by: David Brownell [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/gadget/amd5536udc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index 1c80406..c72e962 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c @@ -3289,7 +3289,7 @@ static int udc_pci_probe( dev-chiprev = pdev-revision; pci_set_master(pdev); - pci_set_mwi(pdev); + pci_try_set_mwi(pdev); /* init dma pools */ if (use_dma) { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: remove new OHCI build warnings
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=da6fb5704feeadd10b99a1025166f1a3f627825d Commit: da6fb5704feeadd10b99a1025166f1a3f627825d Parent: 51745281b0bf56312b78d8f56afb970cd7c91137 Author: David Brownell [EMAIL PROTECTED] AuthorDate: Wed Oct 24 17:23:42 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: remove new OHCI build warnings Remove various newly-introduced compiler warnings for OHCI. Signed-off-by: David Brownell [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/host/ohci-hcd.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 240c7f5..704f33f 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -80,7 +80,10 @@ static const charhcd_name [] = ohci_hcd; static void ohci_dump (struct ohci_hcd *ohci, int verbose); static int ohci_init (struct ohci_hcd *ohci); static void ohci_stop (struct usb_hcd *hcd); + +#if defined(CONFIG_PM) || defined(CONFIG_PCI) static int ohci_restart (struct ohci_hcd *ohci); +#endif #include ohci-hub.c #include ohci-dbg.c @@ -396,7 +399,7 @@ static int check_ed(struct ohci_hcd *ohci, struct ed *ed) */ static void unlink_watchdog_func(unsigned long _ohci) { - longflags; + unsigned long flags; unsignedmax; unsignedseen_count = 0; unsignedi; @@ -893,6 +896,8 @@ static void ohci_stop (struct usb_hcd *hcd) /*-*/ +#if defined(CONFIG_PM) || defined(CONFIG_PCI) + /* must not be called from interrupt context */ static int ohci_restart (struct ohci_hcd *ohci) { @@ -954,6 +959,8 @@ static int ohci_restart (struct ohci_hcd *ohci) return 0; } +#endif + /*-*/ #define DRIVER_INFO DRIVER_VERSION DRIVER_DESC - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: usb_serial_resume bug fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8abaee238ebb1ef9b8bcafac7a1833f92e7f2319 Commit: 8abaee238ebb1ef9b8bcafac7a1833f92e7f2319 Parent: da6fb5704feeadd10b99a1025166f1a3f627825d Author: Sarah Sharp [EMAIL PROTECTED] AuthorDate: Thu Oct 25 10:58:43 2007 -0700 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: usb_serial_resume bug fix Avoid potential null pointer dereference. Signed-off-by: Sarah Sharp [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/usb-serial.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 426afaa..497e29a 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1123,7 +1123,9 @@ int usb_serial_resume(struct usb_interface *intf) { struct usb_serial *serial = usb_get_intfdata(intf); - return serial-type-resume(serial); + if (serial-type-resume) + return serial-type-resume(serial); + return 0; } EXPORT_SYMBOL(usb_serial_resume); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: missing error check in emi26
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf4cf0bb89cbff95c5be8f8d3c68e55f38f94ba7 Commit: cf4cf0bb89cbff95c5be8f8d3c68e55f38f94ba7 Parent: 8abaee238ebb1ef9b8bcafac7a1833f92e7f2319 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Thu Oct 25 15:38:44 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: missing error check in emi26 this drivers lacks an error check. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/emi26.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index cd13757..4a09b87 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c @@ -114,6 +114,10 @@ static int emi26_load_firmware (struct usb_device *dev) /* De-assert reset (let the CPU run) */ err = emi26_set_reset(dev,0); + if (err 0) { + err(%s - error loading firmware: error = %d, __FUNCTION__, err); + goto wraperr; + } msleep(250);/* let device settle */ /* 2. We upload the FPGA firmware into the EMI - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: missing error check in emi62
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5919a43bbc649f4770b8b5db33f43136c7ff3153 Commit: 5919a43bbc649f4770b8b5db33f43136c7ff3153 Parent: cf4cf0bb89cbff95c5be8f8d3c68e55f38f94ba7 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Thu Oct 25 15:42:38 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:45 2007 -0700 USB: missing error check in emi62 the emi62 also lacks an error check. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/emi62.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index 4758cc5..d136241 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c @@ -123,6 +123,10 @@ static int emi62_load_firmware (struct usb_device *dev) /* De-assert reset (let the CPU run) */ err = emi62_set_reset(dev,0); + if (err 0) { + err(%s - error loading firmware: error = %d, __FUNCTION__, err); + goto wraperr; + } msleep(250);/* let device settle */ /* 2. We upload the FPGA firmware into the EMI - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: open disconnect race in iowarrior
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03f36e885fc26cb0ea299fb6df5171a51e814548 Commit: 03f36e885fc26cb0ea299fb6df5171a51e814548 Parent: 5919a43bbc649f4770b8b5db33f43136c7ff3153 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Thu Oct 25 15:46:30 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:46 2007 -0700 USB: open disconnect race in iowarrior the driver sets intfdata to NULL without lock. Data structures can be freed and accessed. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/iowarrior.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index c86c132..764696f 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -66,6 +66,7 @@ module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, debug=1 enables debugging messages); static struct usb_driver iowarrior_driver; +static DEFINE_MUTEX(iowarrior_open_disc_lock); /*--*/ /* data */ @@ -608,11 +609,15 @@ static int iowarrior_open(struct inode *inode, struct file *file) return -ENODEV; } + mutex_lock(iowarrior_open_disc_lock); dev = usb_get_intfdata(interface); - if (!dev) + if (!dev) { + mutex_unlock(iowarrior_open_disc_lock); return -ENODEV; + } mutex_lock(dev-mutex); + mutex_unlock(iowarrior_open_disc_lock); /* Only one process can open each device, no sharing. */ if (dev-opened) { @@ -866,6 +871,7 @@ static void iowarrior_disconnect(struct usb_interface *interface) int minor; dev = usb_get_intfdata(interface); + mutex_lock(iowarrior_open_disc_lock); usb_set_intfdata(interface, NULL); minor = dev-minor; @@ -879,6 +885,7 @@ static void iowarrior_disconnect(struct usb_interface *interface) dev-present = 0; mutex_unlock(dev-mutex); + mutex_unlock(iowarrior_open_disc_lock); if (dev-opened) { /* There is a process that holds a filedescriptor to the device , - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: disconnect open race in legousbtower
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78663ecc344b4694dd737deb682e81312a0684b6 Commit: 78663ecc344b4694dd737deb682e81312a0684b6 Parent: 03f36e885fc26cb0ea299fb6df5171a51e814548 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Thu Oct 25 15:48:39 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:46 2007 -0700 USB: disconnect open race in legousbtower again, possible use after free due to touching intfdata without lock. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/legousbtower.c | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 561970b..aab3200 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -198,6 +198,7 @@ static struct usb_device_id tower_table [] = { }; MODULE_DEVICE_TABLE (usb, tower_table); +static DEFINE_MUTEX(open_disc_mutex); #define LEGO_USB_TOWER_MINOR_BASE 160 @@ -350,25 +351,31 @@ static int tower_open (struct inode *inode, struct file *file) goto exit; } + mutex_lock(open_disc_mutex); dev = usb_get_intfdata(interface); if (!dev) { + mutex_unlock(open_disc_mutex); retval = -ENODEV; goto exit; } /* lock this device */ if (down_interruptible (dev-sem)) { + mutex_unlock(open_disc_mutex); retval = -ERESTARTSYS; goto exit; } + /* allow opening only once */ if (dev-open_count) { + mutex_unlock(open_disc_mutex); retval = -EBUSY; goto unlock_exit; } dev-open_count = 1; + mutex_unlock(open_disc_mutex); /* reset the tower */ result = usb_control_msg (dev-udev, @@ -437,9 +444,10 @@ static int tower_release (struct inode *inode, struct file *file) if (dev == NULL) { dbg(1, %s: object is NULL, __FUNCTION__); retval = -ENODEV; - goto exit; + goto exit_nolock; } + mutex_lock(open_disc_mutex); if (down_interruptible (dev-sem)) { retval = -ERESTARTSYS; goto exit; @@ -468,6 +476,8 @@ unlock_exit: up (dev-sem); exit: + mutex_unlock(open_disc_mutex); +exit_nolock: dbg(2, %s: leave, return value %d, __FUNCTION__, retval); return retval; } @@ -989,6 +999,7 @@ static void tower_disconnect (struct usb_interface *interface) dbg(2, %s: enter, __FUNCTION__); dev = usb_get_intfdata (interface); + mutex_lock(open_disc_mutex); usb_set_intfdata (interface, NULL); minor = dev-minor; @@ -997,6 +1008,7 @@ static void tower_disconnect (struct usb_interface *interface) usb_deregister_dev (interface, tower_class); down (dev-sem); + mutex_unlock(open_disc_mutex); /* if the device is not opened, then we clean up right now */ if (!dev-open_count) { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB: open disconnect race in usblcd
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d5d1ceac2a47645780bd07fd7a670b14c4d995db Commit: d5d1ceac2a47645780bd07fd7a670b14c4d995db Parent: 78663ecc344b4694dd737deb682e81312a0684b6 Author: Oliver Neukum [EMAIL PROTECTED] AuthorDate: Thu Oct 25 16:05:53 2007 +0200 Committer: Greg Kroah-Hartman [EMAIL PROTECTED] CommitDate: Thu Oct 25 12:18:46 2007 -0700 USB: open disconnect race in usblcd this driver has a possible use after free due to a race when disconnect and open handle intfdata without a lock. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/usblcd.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 7198420..20777d0 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -17,6 +17,7 @@ #include linux/init.h #include linux/slab.h #include linux/errno.h +#include linux/mutex.h #include asm/uaccess.h #include linux/usb.h @@ -34,6 +35,8 @@ static struct usb_device_id id_table [] = { }; MODULE_DEVICE_TABLE (usb, id_table); +static DEFINE_MUTEX(open_disc_mutex); + struct usb_lcd { struct usb_device * udev; /* init: probe_lcd */ @@ -79,12 +82,16 @@ static int lcd_open(struct inode *inode, struct file *file) return -ENODEV; } + mutex_lock(open_disc_mutex); dev = usb_get_intfdata(interface); - if (!dev) + if (!dev) { + mutex_unlock(open_disc_mutex); return -ENODEV; + } /* increment our usage count for the device */ kref_get(dev-kref); + mutex_unlock(open_disc_mutex); /* grab a power reference */ r = usb_autopm_get_interface(interface); @@ -393,8 +400,10 @@ static void lcd_disconnect(struct usb_interface *interface) struct usb_lcd *dev; int minor = interface-minor; + mutex_lock(open_disc_mutex); dev = usb_get_intfdata(interface); usb_set_intfdata(interface, NULL); + mutex_unlock(open_disc_mutex); /* give back our minor */ usb_deregister_dev(interface, lcd_class); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
bitops kernel-doc: inline instead of macro
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fb9431eb038caa027cb98cb18576f1a731e56f76 Commit: fb9431eb038caa027cb98cb18576f1a731e56f76 Parent: a60387ba3114fe087349df23fa82e5ad9d5b6ff2 Author: Randy Dunlap [EMAIL PROTECTED] AuthorDate: Thu Oct 25 14:21:49 2007 -0700 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Thu Oct 25 16:16:26 2007 -0700 bitops kernel-doc: inline instead of macro Use duplicated inline functions for test_and_set_bit_lock() on x86 instead of #define macros, thus avoiding a bad example. This allows kernel-doc to run cleanly instead of terminating with an error: Error(linux-2.6.24-rc1//include/asm-x86/bitops_32.h:188): cannot understand prototype: 'test_and_set_bit_lock test_and_set_bit ' Signed-off-by: Randy Dunlap [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- include/asm-x86/bitops_32.h |7 +-- include/asm-x86/bitops_64.h |7 +-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/asm-x86/bitops_32.h b/include/asm-x86/bitops_32.h index 36ebb5b..0b40f6d 100644 --- a/include/asm-x86/bitops_32.h +++ b/include/asm-x86/bitops_32.h @@ -183,9 +183,12 @@ static inline int test_and_set_bit(int nr, volatile unsigned long * addr) * @nr: Bit to set * @addr: Address to count from * - * This is the same as test_and_set_bit on x86 + * This is the same as test_and_set_bit on x86. */ -#define test_and_set_bit_lock test_and_set_bit +static inline int test_and_set_bit_lock(int nr, volatile unsigned long *addr) +{ + return test_and_set_bit(nr, addr); +} /** * __test_and_set_bit - Set a bit and return its old value diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h index b4d4794..bba26e0 100644 --- a/include/asm-x86/bitops_64.h +++ b/include/asm-x86/bitops_64.h @@ -173,9 +173,12 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr) * @nr: Bit to set * @addr: Address to count from * - * This is the same as test_and_set_bit on x86 + * This is the same as test_and_set_bit on x86. */ -#define test_and_set_bit_lock test_and_set_bit +static __inline__ int test_and_set_bit_lock(int nr, volatile void *addr) +{ + return test_and_set_bit(nr, addr); +} /** * __test_and_set_bit - Set a bit and return its old value - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html