Re: linux-2.6.24 compile error in drivers/net/b44.c
Li Zefan wrote: > Add CCs: > > CC: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED] > > Li Zefan wrote: >> drivers/net/b44.c: In function 'b44_remove_one': >> drivers/net/b44.c:2231: error: implicit declaration of function >> 'ssb_pcihost_set_power_state' >> make[2]: *** [drivers/net/b44.o] Error 1 >> make[1]: *** [drivers/net] Error 2 >> >> I think it is caused by: >> >> CONFIG_SSB_PCIHOST=n >> CONFIG_B44=y >> > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ This patch should fix b44 errors when 'SSB_PCIHOST' is not enabled. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/net/b44.c b/drivers/net/b44.c index ea2a2b5..d081234 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -2228,7 +2228,9 @@ static void __devexit b44_remove_one(struct ssb_device *sdev) unregister_netdev(dev); ssb_bus_may_powerdown(sdev->bus); free_netdev(dev); +#ifdef B44_PCI ssb_pcihost_set_power_state(sdev, PCI_D3hot); +#endif ssb_set_drvdata(sdev, NULL); } @@ -2257,7 +2259,9 @@ static int b44_suspend(struct ssb_device *sdev, pm_message_t state) b44_setup_wol(bp); } +#ifdef B44_PCI ssb_pcihost_set_power_state(sdev, PCI_D3hot); +#endif return 0; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: reboot_{32|64}.c unification
reboot_{32|64}.c unification patch. This patch unifies the code from the reboot_32.c and reboot_64.c files. It has been tested in computers with X86_32 and X86_64 kernels and it looks like all reboot modes work fine (EFI restart system hasn't been tested yet). Probably I made some mistakes (like I usually do) so I hope we can identify and fix them soon. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 0903bbf..0cd4085 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -30,8 +30,8 @@ obj-y += step.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += cpu/ obj-y += acpi/ -obj-$(CONFIG_X86_BIOS_REBOOT) += reboot_32.o -obj-$(CONFIG_X86_64)+= reboot_64.o +obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o +obj-$(CONFIG_X86_64) += reboot.o obj-$(CONFIG_MCA) += mca_32.o obj-$(CONFIG_X86_MSR) += msr.o obj-$(CONFIG_X86_CPUID)+= cpuid.o diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c new file mode 100644 index 000..bf9b106 --- /dev/null +++ b/arch/x86/kernel/reboot.c @@ -0,0 +1,441 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_X86_32 +# include +# include +# include +# include +#else +# include +#endif + +/* + * Power off function, if any + */ +void (*pm_power_off)(void); +EXPORT_SYMBOL(pm_power_off); + +static long no_idt[3]; +static int reboot_mode; +enum reboot_type reboot_type = BOOT_KBD; +int reboot_force; + +#if defined(CONFIG_X86_32) && defined(CONFIG_SMP) +static int reboot_cpu = -1; +#endif + +/* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old] + warm Don't set the cold reboot flag + cold Set the cold reboot flag + bios Reboot by jumping through the BIOS (only for X86_32) + smpReboot by executing reset on BSP or other CPU (only for X86_32) + triple Force a triple fault (init) + kbdUse the keyboard controller. cold reset (default) + acpi Use the RESET_REG in the FADT + efiUse efi reset_system runtime service + force Avoid anything that could hang. + */ +static int __init reboot_setup(char *str) +{ + for (;;) { + switch (*str) { + case 'w': + reboot_mode = 0x1234; + break; + + case 'c': + reboot_mode = 0; + break; + +#ifdef CONFIG_X86_32 +#ifdef CONFIG_SMP + case 's': + if (isdigit(*(str+1))) { + reboot_cpu = (int) (*(str+1) - '0'); + if (isdigit(*(str+2))) + reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0'); + } + /* we will leave sorting out the final value + when we are ready to reboot, since we might not + have set up boot_cpu_id or smp_num_cpu */ + break; +#endif /* CONFIG_SMP */ + + case 'b': +#endif + case 'a': + case 'k': + case 't': + case 'e': + reboot_type = *str; + break; + + case 'f': + reboot_force = 1; + break; + } + + str = strchr(str, ','); + if (str) + str++; + else + break; + } + return 1; +} + +__setup("reboot=", reboot_setup); + + +#ifdef CONFIG_X86_32 +/* + * Reboot options and system auto-detection code provided by + * Dell Inc. so their systems "just work". :-) + */ + +/* + * Some machines require the "reboot=b" commandline option, + * this quirk makes that automatic. + */ +static int __init set_bios_reboot(const struct dmi_system_id *d) +{ + if (reboot_type != BOOT_BIOS) { + reboot_type = BOOT_BIOS; + printk(KERN_INFO "%s series board detected. Selecting BIOS-method for reboots.\n", d->ident); + } + return 0; +} + +static struct dmi_system_id __initdata reboot_dmi_table[] = { + { /* Handle problems with rebooting on Dell E520's */ + .callback = set_bios_reboot, + .ident = "Dell E520", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061&q
Re: [PATCH] x86: reboot_{32|64}.c unification
On Friday 04 January 2008 14:03:31 Ingo Molnar wrote: > * Miguel Botón <[EMAIL PROTECTED]> wrote: > > reboot_{32|64}.c unification patch. > > > > This patch unifies the code from the reboot_32.c and reboot_64.c > > files. > > > > It has been tested in computers with X86_32 and X86_64 kernels and it > > looks like all reboot modes work fine (EFI restart system hasn't been > > tested yet). > > thanks, applied. > > > Probably I made some mistakes (like I usually do) so I hope we can > > identify and fix them soon. > > well you sent it via Kmail, which is notorious for not wanting to send > proper plain-text patches. Yours was: > > Content-Type: text/plain; >charset="utf-8" > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > so i had to hand-apply it. There's a Kmail section in > Documentation/email-clients.txt, please read it. > > Ingo Yep, I used Kmail. Thanks for the warning. -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
This patch fixes a compilation warning in 'iwl-4965.c'. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 74999af..92237cd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c @@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv, if (skb_headroom(skb) < sizeof(*iwl4965_rt)) { if (net_ratelimit()) printk(KERN_ERR "not enough headroom [%d] for " - "radiotap head [%d]\n", + "radiotap head [%ld]\n", skb_headroom(skb), sizeof(*iwl4965_rt)); return; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: little fix in 'include/asm-x86/topology.h'
Before 'topology_32.h' and 'topology_64.h' were unified, topology defines in a X86_64 kernel were declared if CONFIG_SMP was enabled. Now, post unification, these same defines in a X86_64 kernel are only being declared if CONFIG_NUMA and CONFIG_SMP are enabled. This, for example, breaks 'perfmon_amd64.c' compilation. This patch defines ENABLE_TOPO_DEFINE if this is a X86_64 kernel and we have SMP support enabled. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index 9c25160..f95b3cc 100644 --- a/include/asm-x86/topology.h +++ b/include/asm-x86/topology.h @@ -79,10 +79,6 @@ extern unsigned long node_remap_size[]; #else -# ifdef CONFIG_SMP -# define ENABLE_TOPO_DEFINES -# endif - # define SD_CACHE_NICE_TRIES 2 # define SD_IDLE_IDX 2 # define SD_NEWIDLE_IDX0 @@ -129,6 +125,10 @@ extern int __node_distance(int, int); extern cpumask_t cpu_coregroup_map(int cpu); +#if defined(CONFIG_X86_64) && defined(CONFIG_SMP) +# define ENABLE_TOPO_DEFINES +#endif + #ifdef ENABLE_TOPO_DEFINES #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] iwlwifi: fix compilation warning in 'iwl-4965.c'
Ok, there's a new patch. This patch fixes a compilation warning in 'iwl-4965.c'. "warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’" Signed-off-by: Miguel Botón <[EMAIL PROTECTED] diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 74999af..92237cd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c @@ -3616,7 +3616,7 @@ static void iwl4965_add_radiotap(struct iwl4965_priv *priv, if (skb_headroom(skb) < sizeof(*iwl4965_rt)) { if (net_ratelimit()) printk(KERN_ERR "not enough headroom [%d] for " - "radiotap head [%d]\n", + "radiotap head [%zd]\n", skb_headroom(skb), sizeof(*iwl4965_rt)); return; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: little fix in 'include/asm-x86/topology.h'
On Saturday 05 January 2008 16:09:44 Ingo Molnar wrote: > * Miguel Botón <[EMAIL PROTECTED]> wrote: > > Before 'topology_32.h' and 'topology_64.h' were unified, topology > > defines in a X86_64 kernel were declared if CONFIG_SMP was enabled. > > Now, post unification, these same defines in a X86_64 kernel are only > > being declared if CONFIG_NUMA and CONFIG_SMP are enabled. > > > > This, for example, breaks 'perfmon_amd64.c' compilation. > > > > This patch defines ENABLE_TOPO_DEFINE if this is a X86_64 kernel and > > we have SMP support enabled. > > hm, do you have a .config that fails to build? > > Ingo I had a .config (I deleted it) that fails to build *but* using the tree from http://git.kernel.org/?p=linux/kernel/git/eranian/linux-2.6.git;a=summary The problem was that CONFIG_NUMA wasn't defined so ENABLE_TOPO_DEFINE wasn't defined too and then we get an error about an implicit declaration of 'topology_physical_package_id'. -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: paravirt_patch_{32|64}.c unification
paravirt_patch_{32|64}.c unification. This patch unifies the code from the paravirt_patcht_32.c and paravirt_patch_64.c files. I couldn't test this modification but it shouldn't have any bugs (it's a very simple modification). Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 5ed68b4..92d9ac6 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -66,7 +66,7 @@ obj-$(CONFIG_K8_NB) += k8.o obj-$(CONFIG_MGEODE_LX)+= geode_32.o mfgpt_32.o obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o -obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch_$(BITS).o +obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt_patch.o obj-y += pcspeaker.o obj-$(CONFIG_SCx200) += scx200_32.o diff --git a/arch/x86/kernel/paravirt_patch.c b/arch/x86/kernel/paravirt_patch.c new file mode 100644 index 000..7e756ea --- /dev/null +++ b/arch/x86/kernel/paravirt_patch.c @@ -0,0 +1,69 @@ +#include + +DEF_NATIVE(pv_irq_ops, irq_enable, "sti"); +DEF_NATIVE(pv_irq_ops, irq_disable, "cli"); +DEF_NATIVE(pv_cpu_ops, clts, "clts"); + +#ifdef CONFIG_X86_32 +DEF_NATIVE(pv_irq_ops, restore_fl, "push %eax; popf"); +DEF_NATIVE(pv_irq_ops, save_fl, "pushf; pop %eax"); +DEF_NATIVE(pv_cpu_ops, iret, "iret"); +DEF_NATIVE(pv_cpu_ops, irq_enable_syscall_ret, "sti; sysexit"); +DEF_NATIVE(pv_mmu_ops, read_cr2, "mov %cr2, %eax"); +DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax"); +DEF_NATIVE(pv_mmu_ops, write_cr3, "mov %eax, %cr3"); +DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc"); +#else +DEF_NATIVE(pv_irq_ops, restore_fl, "pushq %rdi; popfq"); +DEF_NATIVE(pv_irq_ops, save_fl, "pushfq; popq %rax"); +DEF_NATIVE(pv_cpu_ops, iret, "iretq"); +DEF_NATIVE(pv_cpu_ops, irq_enable_syscall_ret, "movq %gs:" __stringify(pda_oldrsp) ", %rsp; swapgs; sysretq;"); +DEF_NATIVE(pv_mmu_ops, read_cr2, "movq %cr2, %rax"); +DEF_NATIVE(pv_mmu_ops, read_cr3, "movq %cr3, %rax"); +DEF_NATIVE(pv_mmu_ops, write_cr3, "movq %rdi, %cr3"); +DEF_NATIVE(pv_mmu_ops, flush_tlb_single, "invlpg (%rdi)"); +DEF_NATIVE(pv_cpu_ops, wbinvd, "wbinvd"); +DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs"); +#endif + +unsigned native_patch(u8 type, u16 clobbers, void *ibuf, + unsigned long addr, unsigned len) +{ + const unsigned char *start, *end; + unsigned ret; + +#define PATCH_SITE(ops, x) \ + case PARAVIRT_PATCH(ops.x): \ + start = start_##ops##_##x; \ + end = end_##ops##_##x; \ + goto patch_site + switch (type) { + PATCH_SITE(pv_irq_ops, irq_enable); + PATCH_SITE(pv_irq_ops, irq_disable); + PATCH_SITE(pv_irq_ops, restore_fl); + PATCH_SITE(pv_irq_ops, save_fl); + PATCH_SITE(pv_cpu_ops, iret); + PATCH_SITE(pv_cpu_ops, irq_enable_syscall_ret); + PATCH_SITE(pv_mmu_ops, read_cr2); + PATCH_SITE(pv_mmu_ops, read_cr3); + PATCH_SITE(pv_mmu_ops, write_cr3); + PATCH_SITE(pv_cpu_ops, clts); +#ifdef CONFIG_X86_32 + PATCH_SITE(pv_cpu_ops, read_tsc); +#else + PATCH_SITE(pv_mmu_ops, flush_tlb_single); + PATCH_SITE(pv_cpu_ops, wbinvd); + PATCH_SITE(pv_cpu_ops, swapgs); +#endif + +patch_site: + ret = paravirt_patch_insns(ibuf, len, start, end); + break; + +default: + ret = paravirt_patch_default(type, clobbers, ibuf, addr, len); + break; + } +#undef PATCH_SITE + return ret; +} diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c deleted file mode 100644 index 82fc5fc..000 --- a/arch/x86/kernel/paravirt_patch_32.c +++ /dev/null @@ -1,49 +0,0 @@ -#include - -DEF_NATIVE(pv_irq_ops, irq_disable, "cli"); -DEF_NATIVE(pv_irq_ops, irq_enable, "sti"); -DEF_NATIVE(pv_irq_ops, restore_fl, "push %eax; popf"); -DEF_NATIVE(pv_irq_ops, save_fl, "pushf; pop %eax"); -DEF_NATIVE(pv_cpu_ops, iret, "iret"); -DEF_NATIVE(pv_cpu_ops, irq_enable_syscall_ret, "sti; sysexit"); -DEF_NATIVE(pv_mmu_ops, read_cr2, "mov %cr2, %eax"); -DEF_NATIVE(pv_mmu_ops, write_cr3, "mov %eax, %cr3"); -DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax"); -DEF_NATIVE(pv_cpu_ops, clts, "clts"); -DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc"); - -unsigned native_patch(u8 type, u16 clobbers, void *ibuf, - unsigned long addr, unsigned len) -{ -
[PATCH] x86: ioport_{32|64}.c unification
ioport_{32|64}.c unification. This patch unifies the code from the ioport_32.c and ioport_64.c files. Tested and working fine with i386 and x86_64 kernels. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 0903bbf..5ed68b4 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -10,7 +10,7 @@ CFLAGS_vsyscall_64.o := $(PROFILING) -g0 obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o -obj-y += time_$(BITS).o ioport_$(BITS).o ldt.o +obj-y += time_$(BITS).o ioport.o ldt.o obj-y += setup_$(BITS).o i8259_$(BITS).o obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c new file mode 100644 index 000..be3d521 --- /dev/null +++ b/arch/x86/kernel/ioport.c @@ -0,0 +1,138 @@ +/* + * This contains the io-permission bitmap code - written by obz, with changes + * by Linus. 32/64 bits code unification by Miguel Botón. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ +static void set_bitmap(unsigned long *bitmap, unsigned int base, + unsigned int extent, int new_value) +{ + unsigned int i; + + for (i = base; i < base + extent; i++) { + if (new_value) + __set_bit(i, bitmap); + else + __clear_bit(i, bitmap); + } +} + +/* + * this changes the io permissions bitmap in the current task. + */ +asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) +{ + struct thread_struct *t = ¤t->thread; + struct tss_struct *tss; + unsigned int i, max_long, bytes, bytes_updated; + + if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) + return -EINVAL; + if (turn_on && !capable(CAP_SYS_RAWIO)) + return -EPERM; + + /* +* If it's the first ioperm() call in this thread's lifetime, set the +* IO bitmap up. ioperm() is much less timing critical than clone(), +* this is why we delay this operation until now: +*/ + if (!t->io_bitmap_ptr) { + unsigned long *bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); + + if (!bitmap) + return -ENOMEM; + + memset(bitmap, 0xff, IO_BITMAP_BYTES); + t->io_bitmap_ptr = bitmap; + set_thread_flag(TIF_IO_BITMAP); + } + + /* +* do it in the per-thread copy and in the TSS ... +* +* Disable preemption via get_cpu() - we must not switch away +* because the ->io_bitmap_max value must match the bitmap +* contents: +*/ + tss = &per_cpu(init_tss, get_cpu()); + + set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); + + /* +* Search for a (possibly new) maximum. This is simple and stupid, +* to keep it obviously correct: +*/ + max_long = 0; + for (i = 0; i < IO_BITMAP_LONGS; i++) + if (t->io_bitmap_ptr[i] != ~0UL) + max_long = i; + + bytes = (max_long + 1) * sizeof(unsigned long); + bytes_updated = max(bytes, t->io_bitmap_max); + + t->io_bitmap_max = bytes; + +#ifdef CONFIG_X86_32 + /* +* Sets the lazy trigger so that the next I/O operation will +* reload the correct bitmap. +* Reset the owner so that a process switch will not set +* tss->io_bitmap_base to IO_BITMAP_OFFSET. +*/ + tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY; + tss->io_bitmap_owner = NULL; +#else + /* Update the TSS: */ + memcpy(tss->io_bitmap, t->io_bitmap_ptr, bytes_updated); +#endif + + put_cpu(); + + return 0; +} + +/* + * sys_iopl has to be used when you want to access the IO ports + * beyond the 0x3ff range: to get the full 65536 ports bitmapped + * you'd need 8kB of bitmaps/process, which is a bit excessive. + * + * Here we just change the flags value on the stack: we allow + * only the super-user to do it. This depends on the stack-layout + * on system-call entry - see also fork() and the signal handling + * code. + */ +#ifdef CONFIG_X86_32 +asmlinkage long sys_iopl(unsigned long regsp) +#else +asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs) +#endif +{ +#ifdef CONFIG_X86_32 + volatile struct pt_regs *regs = (struct pt_regs *)®sp; + unsigned int level = regs->bx; +#endif + unsigned int old = (regs->flags >> 12) & 3; + + if (level > 3
Re: [PATCH] x86: ioport_{32|64}.c unification
I just realize that in some cases 'regs->flags' is a long instead of an unsigned long so... this would be a proper solution? static long do_iopl(unsigned int level, long *flags) { ... } #ifdef CONFIG_X86_32 asmlinkage long sys_iopl(unsigned long regsp) { volatile struct pt_regs *regs = (struct pt_regs *)®sp; unsigned int level = regs->bx; #else asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs) { #endif return do_iopl(level, (long *)®s->flags); } Or maybe would be better if 'do_iopl' prototype is: static long do_iopl(unsigned int level, struct pt_regs *regs); -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: ioport_{32|64}.c unification
On Sunday 06 January 2008 01:47:47 Arnd Bergmann wrote: > This #ifdef overload could probably be avoided if you just move > the body of this function into an extra place and do > > static int do_iopl(unsigned int level, unsigned long *flags) > { > unsigned int old = (*flags >> 12) & 3; > ... > *flags = (*flags & ~X86_EFLAGS_IOPL) | (level << 12);; > } > > #ifdef CONFIG_X86_32 > asmlinkage long sys_iopl(unsigned long regsp) > { > /* why is this volatle anyway? */ > volatile struct pt_regs *regs = (struct pt_regs *)®sp; > unsigned int level = regs->bx; > return do_iopl(regs->bx, ®s->flags); > } > #else > asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs) > { > return do_iopl(level, ®s->flags); > } > #endif > > Arnd <>< I agree. I'll send the a proper patch soon. -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: paravirt_patch_{32|64}.c unification
en) -{ - const unsigned char *start, *end; - unsigned ret; - -#define PATCH_SITE(ops, x) \ - case PARAVIRT_PATCH(ops.x): \ - start = start_##ops##_##x; \ - end = end_##ops##_##x; \ - goto patch_site - switch(type) { - PATCH_SITE(pv_irq_ops, irq_disable); - PATCH_SITE(pv_irq_ops, irq_enable); - PATCH_SITE(pv_irq_ops, restore_fl); - PATCH_SITE(pv_irq_ops, save_fl); - PATCH_SITE(pv_cpu_ops, iret); - PATCH_SITE(pv_cpu_ops, irq_enable_syscall_ret); - PATCH_SITE(pv_mmu_ops, read_cr2); - PATCH_SITE(pv_mmu_ops, read_cr3); - PATCH_SITE(pv_mmu_ops, write_cr3); - PATCH_SITE(pv_cpu_ops, clts); - PATCH_SITE(pv_cpu_ops, read_tsc); - - patch_site: - ret = paravirt_patch_insns(ibuf, len, start, end); - break; - - default: - ret = paravirt_patch_default(type, clobbers, ibuf, addr, len); - break; - } -#undef PATCH_SITE - return ret; -} diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c deleted file mode 100644 index cbfc4f3..000 --- a/arch/x86/kernel/paravirt_patch_64.c +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include - -DEF_NATIVE(pv_irq_ops, irq_disable, "cli"); -DEF_NATIVE(pv_irq_ops, irq_enable, "sti"); -DEF_NATIVE(pv_irq_ops, restore_fl, "pushq %rdi; popfq"); -DEF_NATIVE(pv_irq_ops, save_fl, "pushfq; popq %rax"); -DEF_NATIVE(pv_cpu_ops, iret, "iretq"); -DEF_NATIVE(pv_mmu_ops, read_cr2, "movq %cr2, %rax"); -DEF_NATIVE(pv_mmu_ops, read_cr3, "movq %cr3, %rax"); -DEF_NATIVE(pv_mmu_ops, write_cr3, "movq %rdi, %cr3"); -DEF_NATIVE(pv_mmu_ops, flush_tlb_single, "invlpg (%rdi)"); -DEF_NATIVE(pv_cpu_ops, clts, "clts"); -DEF_NATIVE(pv_cpu_ops, wbinvd, "wbinvd"); - -/* the three commands give us more control to how to return from a syscall */ -DEF_NATIVE(pv_cpu_ops, irq_enable_syscall_ret, "movq %gs:" __stringify(pda_oldrsp) ", %rsp; swapgs; sysretq;"); -DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs"); - -unsigned native_patch(u8 type, u16 clobbers, void *ibuf, - unsigned long addr, unsigned len) -{ - const unsigned char *start, *end; - unsigned ret; - -#define PATCH_SITE(ops, x) \ - case PARAVIRT_PATCH(ops.x): \ - start = start_##ops##_##x; \ - end = end_##ops##_##x; \ - goto patch_site - switch(type) { - PATCH_SITE(pv_irq_ops, restore_fl); - PATCH_SITE(pv_irq_ops, save_fl); - PATCH_SITE(pv_irq_ops, irq_enable); - PATCH_SITE(pv_irq_ops, irq_disable); - PATCH_SITE(pv_cpu_ops, iret); - PATCH_SITE(pv_cpu_ops, irq_enable_syscall_ret); - PATCH_SITE(pv_cpu_ops, swapgs); - PATCH_SITE(pv_mmu_ops, read_cr2); - PATCH_SITE(pv_mmu_ops, read_cr3); - PATCH_SITE(pv_mmu_ops, write_cr3); - PATCH_SITE(pv_cpu_ops, clts); - PATCH_SITE(pv_mmu_ops, flush_tlb_single); - PATCH_SITE(pv_cpu_ops, wbinvd); - - patch_site: - ret = paravirt_patch_insns(ibuf, len, start, end); - break; - - default: - ret = paravirt_patch_default(type, clobbers, ibuf, addr, len); - break; - } -#undef PATCH_SITE - return ret; -} --- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: ioport_{32|64}.c unification -v2
ioport_{32|64}.c unification. This patch unifies the code from the ioport_32.c and ioport_64.c files. Tested and working fine with i386 and x86_64 kernels. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 0903bbf..92d9ac6 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -10,7 +10,7 @@ CFLAGS_vsyscall_64.o := $(PROFILING) -g0 obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o -obj-y += time_$(BITS).o ioport_$(BITS).o ldt.o +obj-y += time_$(BITS).o ioport.o ldt.o obj-y += setup_$(BITS).o i8259_$(BITS).o obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c new file mode 100644 index 000..b37cf2c --- /dev/null +++ b/arch/x86/kernel/ioport.c @@ -0,0 +1,150 @@ +/* + * This contains the io-permission bitmap code - written by obz, with changes + * by Linus. 32/64 bits code unification by Miguel Botón. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ +static void set_bitmap(unsigned long *bitmap, unsigned int base, + unsigned int extent, int new_value) +{ + unsigned int i; + + for (i = base; i < base + extent; i++) { + if (new_value) + __set_bit(i, bitmap); + else + __clear_bit(i, bitmap); + } +} + +/* + * this changes the io permissions bitmap in the current task. + */ +asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) +{ + struct thread_struct * t = ¤t->thread; + struct tss_struct * tss; + unsigned int i, max_long, bytes, bytes_updated; + + if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) + return -EINVAL; + if (turn_on && !capable(CAP_SYS_RAWIO)) + return -EPERM; + + /* +* If it's the first ioperm() call in this thread's lifetime, set the +* IO bitmap up. ioperm() is much less timing critical than clone(), +* this is why we delay this operation until now: +*/ + if (!t->io_bitmap_ptr) { + unsigned long *bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); + + if (!bitmap) + return -ENOMEM; + + memset(bitmap, 0xff, IO_BITMAP_BYTES); + t->io_bitmap_ptr = bitmap; + set_thread_flag(TIF_IO_BITMAP); + } + + /* +* do it in the per-thread copy and in the TSS ... +* +* Disable preemption via get_cpu() - we must not switch away +* because the ->io_bitmap_max value must match the bitmap +* contents: +*/ + tss = &per_cpu(init_tss, get_cpu()); + + set_bitmap(t->io_bitmap_ptr, from, num, !turn_on); + + /* +* Search for a (possibly new) maximum. This is simple and stupid, +* to keep it obviously correct: +*/ + max_long = 0; + for (i = 0; i < IO_BITMAP_LONGS; i++) + if (t->io_bitmap_ptr[i] != ~0UL) + max_long = i; + + bytes = (max_long + 1) * sizeof(unsigned long); + bytes_updated = max(bytes, t->io_bitmap_max); + + t->io_bitmap_max = bytes; + +#ifdef CONFIG_X86_32 + /* +* Sets the lazy trigger so that the next I/O operation will +* reload the correct bitmap. +* Reset the owner so that a process switch will not set +* tss->io_bitmap_base to IO_BITMAP_OFFSET. +*/ + tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY; + tss->io_bitmap_owner = NULL; +#else + /* Update the TSS: */ + memcpy(tss->io_bitmap, t->io_bitmap_ptr, bytes_updated); +#endif + + put_cpu(); + + return 0; +} + +/* + * sys_iopl has to be used when you want to access the IO ports + * beyond the 0x3ff range: to get the full 65536 ports bitmapped + * you'd need 8kB of bitmaps/process, which is a bit excessive. + * + * Here we just change the flags value on the stack: we allow + * only the super-user to do it. This depends on the stack-layout + * on system-call entry - see also fork() and the signal handling + * code. + */ +#ifdef CONFIG_X86_32 +asmlinkage long sys_iopl(unsigned long regsp) +{ + volatile struct pt_regs *regs = (struct pt_regs *)®sp; + unsigned int level = regs->bx; + unsigned int old = (regs->flags >> 12) & 3; + + if (level > 3) + return -EINVAL; + /* Trying to gain more privileges? */ + if (level > old) {
Re: [PATCH] x86: ioport_{32|64}.c unification -v2
Ingo Molnar wrote: > * Miguel Botón <[EMAIL PROTECTED]> wrote: > >> ioport_{32|64}.c unification. >> >> This patch unifies the code from the ioport_32.c and ioport_64.c >> files. >> >> Tested and working fine with i386 and x86_64 kernels. > > in what way have you tested it? Have you tried iopl() and ioperm() > syscalls to check whether they properly block/allow port IO? > > Ingo > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ I made a little app to check that iopl() and ioperm() were working properly. --- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: ioport_{32|64}.c unification -v2
Ingo Molnar wrote: > * Miguel Botón <[EMAIL PROTECTED]> wrote: > >>> in what way have you tested it? Have you tried iopl() and ioperm() >>> syscalls to check whether they properly block/allow port IO? >> I made a little app to check that iopl() and ioperm() were working >> properly. > > cool, thx. Could you check whether LTP includes something like that > already - and if not, send it to the LTP maintainers? > > Ingo > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ of course ;) --- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ps3: "mm/Kconfig" fix
sparsemem-make-sparsemem-vmemmap-selectable.patch introduces a little bug. SPARSEMEM_VMEMMAP can be enabled in an architecture that doesn't support it. If the architecture supports SPARSEMEM_VMEMMAP, SPARSEMEM_VMEMMAP_ENABLE is enabled, so SPARSEMEM_VMEMMAP should depend on it. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/mm/Kconfig b/mm/Kconfig index c0f5cbb..010a261 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -117,8 +117,8 @@ config SPARSEMEM_VMEMMAP_ENABLE config SPARSEMEM_VMEMMAP bool "Sparse Memory virtual memmap" - depends on SPARSEMEM - default y if (SPARSEMEM_VMEMMAP_ENABLE) + depends on SPARSEMEM_VMEMMAP_ENABLE + default y help SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise pfn_to_page and page_to_pfn operations. This is the most -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ps3: "mm/Kconfig" fix
Previous patch had another bug. This one works fine. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/mm/Kconfig b/mm/Kconfig index 010a261..9ef9741 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -117,7 +117,7 @@ config SPARSEMEM_VMEMMAP_ENABLE config SPARSEMEM_VMEMMAP bool "Sparse Memory virtual memmap" - depends on SPARSEMEM_VMEMMAP_ENABLE + depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE default y help SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Cute feature: colored printk output
On 10/5/07, Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > Colored kernel message output > > Let's work more on Linux's cuteness! [http://lkml.org/lkml/2007/10/4/431] > The following patch makes it possible to give kernel messages a > selectable color which helps to distinguish it from other noise, > such as boot messages. NetBSD has it, OpenBSD has it, FreeBSD to some > extent, so I think Linux should too. > > Inspired by cko (http://freshmeat.net/p/cko/), but independently > written, later contributed forth and back. > > Already posted at: http://lkml.org/lkml/2007/4/1/162 Pretty interesting feature. I modified your lastest patch a little bit so now you can set the message color for each log level in the kernel config. diff -ruN linux-2.6.23.orig/arch/x86_64/kernel/early_printk.c linux-2.6.23/arch/x86_64/kernel/early_printk.c --- linux-2.6.23.orig/arch/x86_64/kernel/early_printk.c 2007-10-02 05:24:52.0 +0200 +++ linux-2.6.23/arch/x86_64/kernel/early_printk.c 2007-10-06 23:00:39.0 +0200 @@ -20,7 +20,8 @@ static int max_ypos = 25, max_xpos = 80; static int current_ypos = 25, current_xpos = 0; -static void early_vga_write(struct console *con, const char *str, unsigned n) +static void early_vga_write(struct console *con, const char *str, unsigned n, +unsigned int loglevel) { char c; int i, k, j; @@ -89,7 +90,8 @@ return timeout ? 0 : -1; } -static void early_serial_write(struct console *con, const char *s, unsigned n) +static void early_serial_write(struct console *con, const char *s, unsigned n, + unsigned int loglevel) { while (*s && n-- > 0) { if (*s == '\n') @@ -185,7 +187,8 @@ simnow_fd = simnow(XOPEN, (unsigned long)fn, O_WRONLY|O_APPEND|O_CREAT, 0644); } -static void simnow_write(struct console *con, const char *s, unsigned n) +static void simnow_write(struct console *con, const char *s, unsigned n, + unsigned int loglevel) { simnow(XWRITE, simnow_fd, (unsigned long)s, n); } @@ -209,7 +212,7 @@ va_start(ap,fmt); n = vscnprintf(buf,512,fmt,ap); - early_console->write(early_console,buf,n); + early_console->write(early_console, buf, n, 0); va_end(ap); } diff -ruN linux-2.6.23.orig/drivers/char/Kconfig linux-2.6.23/drivers/char/Kconfig --- linux-2.6.23.orig/drivers/char/Kconfig 2007-10-02 05:24:52.0 +0200 +++ linux-2.6.23/drivers/char/Kconfig 2007-10-06 23:06:55.0 +0200 @@ -58,6 +58,111 @@ If unsure, say Y. +config VT_CKO + bool "Colored kernel message output" + depends on VT_CONSOLE + ---help--- + This option enables kernel messages to be emitted in + colors other than the default. + + The color value you need to enter is composed (OR-ed) + of a foreground and a background color. + + Foreground: + 0x00 = black, 0x08 = dark gray, + 0x01 = red, 0x09 = light red, + 0x02 = green, 0x0A = light green, + 0x03 = brown, 0x0B = yellow, + 0x04 = blue,0x0C = light blue, + 0x05 = magenta, 0x0D = light magenta, + 0x06 = cyan,0x0E = light cyan, + 0x07 = gray,0x0F = white, + + (Foreground colors 0x08 to 0x0F do not work when a VGA + console font with 512 glyphs is used.) + + Background: + 0x00 = black, 0x40 = blue, + 0x10 = red, 0x50 = magenta, + 0x20 = green, 0x60 = cyan, + 0x30 = brown, 0x70 = gray, + + For example, 0x1F would yield white on red. + + If unsure, say N. + +config VT_PRINTK_EMERG_COLOR + hex "Emergency messages color" + range 0x00 0xFF + depends on VT_CKO + default 0x07 + ---help--- + This option defines with which color kernel emergency messages will + be printed to the console. + +config VT_PRINTK_ALERT_COLOR + hex "Alert messages color" + range 0x00 0xFF + depends on VT_CKO + default 0x07 + ---help--- + This option defines with which color kernel alert messages will + be printed to the console. + +config VT_PRINTK_CRIT_COLOR + hex "Critical messages color" + range 0x00 0xFF + depends on VT_CKO + default 0x07 + ---help--- + This option defines with which color kernel critical messages will + be printed to the console. + +config VT_PRINTK_ERR_COLOR + hex "Error messages color" + range 0x00 0xFF + depends on VT_CKO + default 0x07 + ---help--- + This option defines with which color kernel error messages will + be printed to the console. + +config VT_PRINTK_WARNING_COLOR + hex "Warning messages color" + range 0x00 0xFF + depends on VT_CKO + default 0x07 + ---help--- + This option defines with which color kernel warn
[PATCH] x86: export 'leave_mm' symbol
This patch fixes a linking error if CONFIG_ACPI_PROCESSOR=m (this error occurs in the 'mm' branch of linux-2.6-x86.git). We need to export the 'leave_mm' symbol so it can be accessible for the ACPI processor module. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index 596d002..dc0cde9 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -263,6 +263,7 @@ void leave_mm(int cpu) cpu_clear(cpu, per_cpu(cpu_tlbstate, cpu).active_mm->cpu_vm_mask); load_cr3(swapper_pg_dir); } +EXPORT_SYMBOL(leave_mm); /* * diff --git a/arch/x86/kernel/smp_64.c b/arch/x86/kernel/smp_64.c index 1334afe..2fd74b0 100644 --- a/arch/x86/kernel/smp_64.c +++ b/arch/x86/kernel/smp_64.c @@ -76,6 +76,7 @@ void leave_mm(int cpu) cpu_clear(cpu, read_pda(active_mm)->cpu_vm_mask); load_cr3(swapper_pg_dir); } +EXPORT_SYMBOL(leave_mm); /* * -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Fwd: laptop / computer hardlocks during execution of 32bit applications(binaries) on 64bit system (Gentoo)
On Sunday 30 December 2007 00:04:17 Matthew wrote: > so I was wrong XD > > sorry, > > the error was found in the meantime: > > see: http://forums.gentoo.org/viewtopic-p-4667858.html#4667858 > > Don't need to do more testing. The culprit is the unification of the > x86 i387 code. > > The culprit is 57c3da2f5bb3fafedc31284117ae43bc593b65ab or > f10c1cfd359660c01446807b6c2bc8ce3aee919a > > see http://forums.gentoo.org/viewtopic-p-4667906.html#4667906 and next post > > Greetings > > Mat > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ These hardlocks start to appear with commit f10c1cfd359660c01446807b6c2bc8ce3aee919a -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] alsa: fix compilation warning in GCC
This is just a little patch to shut up GCC. 'snd_shutdown_f_ops' is not a pointer so its address will never be NULL. GCC will complain because 'fops_get' will do an unnecessary check because '&snd_shutdown_f_ops' is always true. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/sound/core/init.c b/sound/core/init.c index 48d38a7..2215ba8 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -340,8 +340,8 @@ int snd_card_disconnect(struct snd_card *card) list_add(&mfile->shutdown_list, &shutdown_files); spin_unlock(&shutdown_lock); - fops_get(&snd_shutdown_f_ops); mfile->file->f_op = &snd_shutdown_f_ops; + fops_get(mfile->file->f_op); mfile = mfile->next; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] ssb: add 'ssb_pcihost_set_power_state' function
This patch adds the 'ssb_pcihost_set_power_state' function. This function allows us to set the power state of a PCI device (for example b44 ethernet device). Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index a21ab29..aa70fd0 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h @@ -349,6 +349,13 @@ static inline void ssb_pcihost_unregister(struct pci_driver *driver) { pci_unregister_driver(driver); } + +static inline +void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) +{ + if (sdev->bus->bustype == SSB_BUSTYPE_PCI) + pci_set_power_state(sdev->bus->host_pci, state); +} #endif /* CONFIG_SSB_PCIHOST */ -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] b44: power down PHY when interface down
This is just this patch (http://lkml.org/lkml/2007/7/1/51) but adapted to the 'b44' ssb driver. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 49e9172..ea2a2b5 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -128,6 +128,8 @@ static void b44_init_rings(struct b44 *); #define B44_FULL_RESET 1 #define B44_FULL_RESET_SKIP_PHY2 #define B44_PARTIAL_RESET 3 +#define B44_CHIP_RESET_FULL4 +#define B44_CHIP_RESET_PARTIAL 5 static void b44_init_hw(struct b44 *, int); @@ -1259,7 +1261,7 @@ static void b44_clear_stats(struct b44 *bp) } /* bp->lock is held. */ -static void b44_chip_reset(struct b44 *bp) +static void b44_chip_reset(struct b44 *bp, int reset_kind) { struct ssb_device *sdev = bp->sdev; @@ -1281,6 +1283,13 @@ static void b44_chip_reset(struct b44 *bp) ssb_device_enable(bp->sdev, 0); b44_clear_stats(bp); + /* +* Don't enable PHY if we are doing a partial reset +* we are probably going to power down +*/ + if (reset_kind == B44_CHIP_RESET_PARTIAL) + return; + switch (sdev->bus->bustype) { case SSB_BUSTYPE_SSB: bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE | @@ -1316,7 +1325,14 @@ static void b44_chip_reset(struct b44 *bp) static void b44_halt(struct b44 *bp) { b44_disable_ints(bp); - b44_chip_reset(bp); + /* reset PHY */ + b44_phy_reset(bp); + /* power down PHY */ + printk(KERN_INFO PFX "%s: powering down PHY\n", bp->dev->name); + bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN); + /* now reset the chip, but without enabling the MAC&PHY +* part of it. This has to be done _after_ we shut down the PHY */ + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL); } /* bp->lock is held. */ @@ -1365,7 +1381,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind) { u32 val; - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_FULL); if (reset_kind == B44_FULL_RESET) { b44_phy_reset(bp); b44_setup_phy(bp); @@ -1422,7 +1438,7 @@ static int b44_open(struct net_device *dev) err = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(err < 0)) { napi_disable(&bp->napi); - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL); b44_free_rings(bp); b44_free_consistent(bp); goto out; @@ -2188,7 +2204,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev, /* Chip reset provides power to the b44 MAC & PCI cores, which * is necessary for MAC register access. */ - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_FULL); printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %s\n", dev->name, print_mac(mac, dev->dev_addr)); @@ -2212,6 +2228,7 @@ static void __devexit b44_remove_one(struct ssb_device *sdev) unregister_netdev(dev); ssb_bus_may_powerdown(sdev->bus); free_netdev(dev); + ssb_pcihost_set_power_state(sdev, PCI_D3hot); ssb_set_drvdata(sdev, NULL); } @@ -2240,6 +2257,7 @@ static int b44_suspend(struct ssb_device *sdev, pm_message_t state) b44_setup_wol(bp); } + ssb_pcihost_set_power_state(sdev, PCI_D3hot); return 0; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] acpi: remove duplicated warning message
Remove duplicated warning message in acpi_power_transition() This warning message is printed by acpi_bus_set_power() so we don't need to print it again. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index af1769a..b4af974 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -458,11 +458,9 @@ int acpi_power_transition(struct acpi_device *device, int state) } end: - if (result) { + if (result) device->power.state = ACPI_STATE_UNKNOWN; - printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", - device->pnp.bus_id, state); - } else { + else { /* We shouldn't change the state till all above operations succeed */ device->power.state = state; } -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] iwlwifi: remove redundant declaration of 'iwl3945_priv' and 'iwl4965_priv' structs
This patch removes a redundant declaration of 'iwl3945_priv' and 'iwl4965_priv' structs. Signed-off-by: Miguel Boton <[EMAIL PROTECTED]> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 49556e6..70f3fc0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h @@ -31,8 +31,6 @@ #include #include -struct iwl3945_priv; - /* Hardware specific file defines the PCI IDs table for that hardware module */ extern struct pci_device_id iwl3945_hw_card_ids[]; diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 5944b4b..949630c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -30,8 +30,6 @@ #include #include -struct iwl4965_priv; - /* Hardware specific file defines the PCI IDs table for that hardware module */ extern struct pci_device_id iwl4965_hw_card_ids[]; -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] iwlwifi: add power management support -v2
On Saturday 17 November 2007 07:15:05 Tomas Winkler wrote: > Why power management shouldn't be enabled while in AC? The semantic of this > ioctls is quite unclear. IWL_POWER_AC and IWL_POWER_BATTERY are just two power modes. IWL_POWER_AC would be the default power mode when we're in AC (no power saving) and IWL_POWER_BATTERY would be the default power mode when we're in battery (power saving mode). That's why we set IWL_POWER_ENABLED flag with IWL_POWER_BATTERY, because it is the only power mode that saves power. We can change to IWL_POWER_BATTERY or IWL_POWER_AC in any moment. This patch, depending if power management is enabled or not, sets which power mode we should use, Then, it checks if we're already using this mode or not. -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: hwclock failure in x86.git
On Friday 11 January 2008 15:03:47 Ingo Molnar wrote: > * Kevin Winchester <[EMAIL PROTECTED]> wrote: > > Bisect says... > > > > 4b5ea240a0c05ff90c4959fd91f0caec7b9bef1b is first bad commit > > commit 4b5ea240a0c05ff90c4959fd91f0caec7b9bef1b > > Author: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > Date: Wed Jan 9 13:31:11 2008 +0100 > > > > x86: ioport_{32|64}.c unification > > thanks for tracking it down. I pulled that commit for now. But it would > be nice to figure out what's going on there. > > Ingo mmm, i'll try to reproduce it tomorrow and find a fix. thanks for notifying this problem. -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support
This happens when trying to compile memory stick support inside the kernel. drivers/memstick/core/mspro_block.o: In function `memstick_priv': mspro_block.c:(.text+0x0): multiple definition of `memstick_priv' drivers/memstick/core/memstick.o:memstick.c:(.text+0x0): first defined here drivers/memstick/core/mspro_block.o: In function `memstick_get_drvdata': mspro_block.c:(.text+0x6): multiple definition of `memstick_get_drvdata' drivers/memstick/core/memstick.o:memstick.c:(.text+0x6): first defined here drivers/memstick/core/mspro_block.o: In function `memstick_set_drvdata': mspro_block.c:(.text+0xd): multiple definition of `memstick_set_drvdata' drivers/memstick/core/memstick.o:memstick.c:(.text+0xd): first defined here This is because those three functions are not defined as static in "include/linux/memstick.h". Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/linux/memstick.h b/include/linux/memstick.h index dc5ac9d..53a8741 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h @@ -271,17 +271,17 @@ void memstick_new_req(struct memstick_host *host); int memstick_set_rw_addr(struct memstick_dev *card); -inline void *memstick_priv(struct memstick_host *host) +static inline void *memstick_priv(struct memstick_host *host) { return (void *)host->private; } -inline void *memstick_get_drvdata(struct memstick_dev *card) +static inline void *memstick_get_drvdata(struct memstick_dev *card) { return dev_get_drvdata(&card->dev); } -inline void memstick_set_drvdata(struct memstick_dev *card, void *data) +static inline void memstick_set_drvdata(struct memstick_dev *card, void *data) { dev_set_drvdata(&card->dev, data); } --- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] alsa: fix SNDRV_PCM_IOCTL_TTSTAMP value.
"[ALSA] Use posix clock monotonic for PCM and timer timestamps" introduces a bug that makes audio device unusable in some computers. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/sound/asound.h b/include/sound/asound.h index 475eb71..d35aa44 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -443,7 +443,7 @@ enum { enum { SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info), - SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int), + SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x02, int), SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params), SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params), SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] iwlwifi: fix typo in 'drivers/net/wireless/iwlwifi/Kconfig'
This patch fixes a typo in 'drivers/net/wireless/iwlwifi/Kconfig'. Signed-off-by: Miguel Boton <[EMAIL PROTECTED]> diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index f495466..ca8597a 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig @@ -43,7 +43,7 @@ config IWL4965_HT for the iwl4965 driver. config IWL4965_SPECTRUM_MEASUREMENT - bool "Enable Spectrum Measurement in iw4965 driver" + bool "Enable Spectrum Measurement in iwl4965 driver" depends on IWL4965 ---help--- This option will enable spectrum measurement for the iwl4965 driver. -- Miguel Botón -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] iwlwifi: Remove unnecessary code in iwl3945 and iwl4965 drivers
Remove unnecesary code in iwl3945 and iwl4965 drivers. "final_mode" variable is already initialized with the value of the "mode" variable. Signed-off-by: Miguel Boton <[EMAIL PROTECTED]> Index: linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl3945-base.c === --- linux-2.6.24-rc2.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -2377,9 +2377,6 @@ case IWL_POWER_AC: final_mode = IWL_POWER_MODE_CAM; break; - default: - final_mode = mode; - break; } iwl_update_power_cmd(priv, &cmd, final_mode); Index: linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl4965-base.c === --- linux-2.6.24-rc2.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -2233,9 +2233,6 @@ case IWL_POWER_AC: final_mode = IWL_POWER_MODE_CAM; break; - default: - final_mode = mode; - break; } cmd.keep_alive_beacons = 0; -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] mac80211: add power management support
This patch adds power management support in mac80211. This allows us to enable power management through the "iwconfig power " command. The code is based on "mac80211-10.0.0" but it is a little bit modified. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec..f5eebec 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -674,6 +687,51 @@ static int ieee80211_ioctl_giwtxpower(struct net_device *dev, return 0; } +static int ieee80211_ioctl_siwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + if (wrqu->power.disabled) { + conf->power_management_enable = 0; + if (ieee80211_hw_config(local)) + return -EINVAL; + return 0; + } + + switch (wrqu->power.flags & IW_POWER_MODE) { + case IW_POWER_ON: /* If not specified */ + case IW_POWER_MODE: /* If set all mask */ + case IW_POWER_ALL_R:/* If explicitely state all */ + break; + default:/* Otherwise we don't support it */ + return -EINVAL; + } + + conf->power_management_enable = 1; + + if (ieee80211_hw_config(local)) + return -EINVAL; + + return 0; +} + +static int ieee80211_ioctl_giwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + wrqu->power.disabled = !conf->power_management_enable; + + return 0; +} + static int ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) @@ -,8 +1166,8 @@ static const iw_handler ieee80211_handler[] = (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ - (iw_handler) NULL, /* SIOCSIWPOWER */ - (iw_handler) NULL, /* SIOCGIWPOWER */ + (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ + (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] iwlwifi: add power management support
This patch adds power management support in iwl3945 and iwl4965 drivers. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 9baf8de..5c7b422 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -6951,6 +7187,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co struct iwl3945_priv *priv = hw->priv; const struct iwl3945_channel_info *ch_info; unsigned long flags; + int power_mode; mutex_lock(&priv->mutex); IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel); @@ -7001,6 +7238,21 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co } #endif + if (conf->power_management_enable) + power_mode = IWL_POWER_BATTERY | IWL_POWER_ENABLED; + else + power_mode = IWL_POWER_AC; + + if (priv->power_mode != power_mode) { + int rc; + + rc = iwl3945_send_power_mode(priv, power_mode); + if (rc) + IWL_DEBUG_MAC80211("failed setting power mode.\n"); + else + priv->power_mode = power_mode; + } + iwl3945_radio_kill_sw(priv, !conf->radio_enabled); if (!conf->radio_enabled) { diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index df011ea..8d303c5 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -7352,6 +7352,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co struct iwl4965_priv *priv = hw->priv; const struct iwl4965_channel_info *ch_info; unsigned long flags; + int power_mode; mutex_lock(&priv->mutex); IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel); @@ -7414,6 +7415,21 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co } #endif + if (conf->power_management_enable) + power_mode = IWL_POWER_BATTERY | IWL_POWER_ENABLED; + else + power_mode = IWL_POWER_AC; + + if (priv->power_mode != power_mode) { + int rc; + + rc = iwl4965_send_power_mode(priv, power_mode); + if (rc) + IWL_DEBUG_MAC80211("failed setting power mode.\n"); + else + priv->power_mode = power_mode; + } + iwl4965_radio_kill_sw(priv, !conf->radio_enabled); if (!conf->radio_enabled) { -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] mac80211: add power management support
Ok, the previous patch had a little error. -- This patch adds power management support in mac80211. This allows us to enable power management through the "iwconfig power " command. The code is based on "mac80211-10.0.0" but it is a little bit modified. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5fcc4c1..c82b6fa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -452,6 +452,8 @@ struct ieee80211_conf { u8 antenna_max; u8 antenna_sel_tx; u8 antenna_sel_rx; + + u8 power_management_enable; /* flag to enable/disable power management */ }; /** diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec..f5eebec 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -674,6 +687,51 @@ static int ieee80211_ioctl_giwtxpower(struct net_device *dev, return 0; } +static int ieee80211_ioctl_siwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + if (wrqu->power.disabled) { + conf->power_management_enable = 0; + if (ieee80211_hw_config(local)) + return -EINVAL; + return 0; + } + + switch (wrqu->power.flags & IW_POWER_MODE) { + case IW_POWER_ON: /* If not specified */ + case IW_POWER_MODE: /* If set all mask */ + case IW_POWER_ALL_R:/* If explicitely state all */ + break; + default:/* Otherwise we don't support it */ + return -EINVAL; + } + + conf->power_management_enable = 1; + + if (ieee80211_hw_config(local)) + return -EINVAL; + + return 0; +} + +static int ieee80211_ioctl_giwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + wrqu->power.disabled = !conf->power_management_enable; + + return 0; +} + static int ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) @@ -,8 +1166,8 @@ static const iw_handler ieee80211_handler[] = (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ - (iw_handler) NULL, /* SIOCSIWPOWER */ - (iw_handler) NULL, /* SIOCGIWPOWER */ + (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ + (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] mac80211: add power management support
Today is not a good day for me... I sent the previous patch with wordwrap enabled. This one is the correct. -- This patch adds power management support in mac80211. This allows us to enable power management through the "iwconfig power " command. The code is based on "mac80211-10.0.0" but it is a little bit modified. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5fcc4c1..c82b6fa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -452,6 +452,8 @@ struct ieee80211_conf { u8 antenna_max; u8 antenna_sel_tx; u8 antenna_sel_rx; + + u8 power_management_enable; /* flag to enable/disable power management */ }; /** diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec..f5eebec 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -674,6 +687,51 @@ static int ieee80211_ioctl_giwtxpower(struct net_device *dev, return 0; } +static int ieee80211_ioctl_siwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + if (wrqu->power.disabled) { + conf->power_management_enable = 0; + if (ieee80211_hw_config(local)) + return -EINVAL; + return 0; + } + + switch (wrqu->power.flags & IW_POWER_MODE) { + case IW_POWER_ON: /* If not specified */ + case IW_POWER_MODE: /* If set all mask */ + case IW_POWER_ALL_R:/* If explicitely state all */ + break; + default:/* Otherwise we don't support it */ + return -EINVAL; + } + + conf->power_management_enable = 1; + + if (ieee80211_hw_config(local)) + return -EINVAL; + + return 0; +} + +static int ieee80211_ioctl_giwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + wrqu->power.disabled = !conf->power_management_enable; + + return 0; +} + static int ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) @@ -,8 +1166,8 @@ static const iw_handler ieee80211_handler[] = (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ - (iw_handler) NULL, /* SIOCSIWPOWER */ - (iw_handler) NULL, /* SIOCGIWPOWER */ + (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ + (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] iwlwifi: add power management support -v2
This patch adds power management support in iwl3945 and iwl4965 drivers. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 9baf8de..5c7b422 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -6951,6 +7187,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co struct iwl3945_priv *priv = hw->priv; const struct iwl3945_channel_info *ch_info; unsigned long flags; + int power_mode; mutex_lock(&priv->mutex); IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel); @@ -7001,6 +7238,23 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co } #endif + if (conf->power_management_enable) + power_mode = IWL_POWER_BATTERY | IWL_POWER_ENABLED; + else + power_mode = IWL_POWER_AC; + + if (priv->power_mode != power_mode) { + int rc; + + rc = iwl3945_send_power_mode(priv, power_mode); + if (rc) { + IWL_DEBUG_MAC80211("failed setting power mode.\n"); + mutex_unlock(&priv->mutex); + return -EINVAL; + } + priv->power_mode = power_mode; + } + iwl3945_radio_kill_sw(priv, !conf->radio_enabled); if (!conf->radio_enabled) { diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index df011ea..8d303c5 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -7352,6 +7352,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co struct iwl4965_priv *priv = hw->priv; const struct iwl4965_channel_info *ch_info; unsigned long flags; + int power_mode; mutex_lock(&priv->mutex); IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel); @@ -7414,6 +7415,23 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co } #endif + if (conf->power_management_enable) + power_mode = IWL_POWER_BATTERY | IWL_POWER_ENABLED; + else + power_mode = IWL_POWER_AC; + + if (priv->power_mode != power_mode) { + int rc; + + rc = iwl4965_send_power_mode(priv, power_mode); + if (rc) { + IWL_DEBUG_MAC80211("failed setting power mode.\n"); + mutex_unlock(&priv->mutex); + return -EINVAL; + } + priv->power_mode = power_mode; + } + iwl4965_radio_kill_sw(priv, !conf->radio_enabled); if (!conf->radio_enabled) { -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] mac80211: add power management support -v2
This patch adds power management support in mac80211. This allows us to enable power management through the "iwconfig power " command. The code is based on "mac80211-10.0.0" but it is a little bit modified. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5fcc4c1..c82b6fa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -452,6 +452,8 @@ struct ieee80211_conf { u8 antenna_max; u8 antenna_sel_tx; u8 antenna_sel_rx; + + u8 power_management_enable; /* flag to enable/disable power management */ }; /** diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec..f5eebec 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -674,6 +687,46 @@ static int ieee80211_ioctl_giwtxpower(struct net_device *dev, return 0; } +static int ieee80211_ioctl_siwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + if (wrqu->power.disabled) { + conf->power_management_enable = 0; + return ieee80211_hw_config(local); + } + + switch (wrqu->power.flags & IW_POWER_MODE) { + case IW_POWER_ON: /* If not specified */ + case IW_POWER_MODE: /* If set all mask */ + case IW_POWER_ALL_R:/* If explicitely state all */ + break; + default:/* Otherwise we don't support it */ + return -EINVAL; + } + + conf->power_management_enable = 1; + + return ieee80211_hw_config(local); +} + +static int ieee80211_ioctl_giwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + wrqu->power.disabled = !conf->power_management_enable; + + return 0; +} + static int ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) @@ -,8 +1166,8 @@ static const iw_handler ieee80211_handler[] = (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ - (iw_handler) NULL, /* SIOCSIWPOWER */ - (iw_handler) NULL, /* SIOCGIWPOWER */ + (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ + (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] mac80211: add power management support -v2
Well, the previous patch wasn't correct. This one is valid. -- This patch adds power management support in mac80211. This allows us to enable power management through the "iwconfig power " command. The code is based on "mac80211-10.0.0" but it is a little bit modified. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5fcc4c1..c82b6fa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -452,6 +452,8 @@ struct ieee80211_conf { u8 antenna_max; u8 antenna_sel_tx; u8 antenna_sel_rx; + + u8 power_management_enable; /* flag to enable/disable power management */ }; /** diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec..f5eebec 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -674,6 +687,51 @@ static int ieee80211_ioctl_giwtxpower(struct net_device *dev, return 0; } +static int ieee80211_ioctl_siwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + if (wrqu->power.disabled) { + conf->power_management_enable = 0; + if (ieee80211_hw_config(local)) + return -EINVAL; + return 0; + } + + switch (wrqu->power.flags & IW_POWER_MODE) { + case IW_POWER_ON: /* If not specified */ + case IW_POWER_MODE: /* If set all mask */ + case IW_POWER_ALL_R:/* If explicitely state all */ + break; + default:/* Otherwise we don't support it */ + return -EINVAL; + } + + conf->power_management_enable = 1; + + if (ieee80211_hw_config(local)) + return -EINVAL; + + return 0; +} + +static int ieee80211_ioctl_giwpower(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra) +{ + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); + struct ieee80211_conf *conf = &local->hw.conf; + + wrqu->power.disabled = !conf->power_management_enable; + + return 0; +} + static int ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra) @@ -,8 +1166,8 @@ static const iw_handler ieee80211_handler[] = (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ - (iw_handler) NULL, /* SIOCSIWPOWER */ - (iw_handler) NULL, /* SIOCGIWPOWER */ + (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ + (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: remove duplicated #include entry
"#include " is duplicated in "arch/x86/mm/fault_32.c". We just remove one of the entries. Signed-off-by: Miguel Botón <[EMAIL PROTECTED]> Index: linux-2.6.24-rc1/arch/x86/mm/fault_32.c === --- linux-2.6.24-rc1.orig/arch/x86/mm/fault_32.c +++ linux-2.6.24-rc1/arch/x86/mm/fault_32.c @@ -22,7 +22,6 @@ #include /* for max_low_pfn */ #include #include -#include #include #include #include -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mac80211: fix "format '%d' expects type 'int', but argument 7 has type 'long unsigned int'" warning
printf() expects an "integer" value but we give it a "long unsigned integer". diff -ruN linux-2.6.24-rc1.orig/net/mac80211/ieee80211_sta.c linux-2.6.24-rc1/net/mac80211/ieee80211_sta.c --- linux-2.6.24-rc1.orig/net/mac80211/ieee80211_sta.c 2007-10-24 16:06:49.0 +0200 +++ linux-2.6.24-rc1/net/mac80211/ieee80211_sta.c 2007-10-24 16:12:05.0 +0200 @@ -1182,7 +1182,7 @@ aid = le16_to_cpu(mgmt->u.assoc_resp.aid); printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x " - "status=%d aid=%d)\n", + "status=%d aid=%ld)\n", dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa), capab_info, status_code, aid & ~(BIT(15) | BIT(14))); -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] fix "passing argument # of '__memcpy' discards qualifiers from pointer target type" warnings
This patch fixes the warnings "passing argument 1 of '__memcpy' discards qualifiers from pointer target type" and "passing argument 2 of '__memcpy' discards qualifiers from pointer target type" when compiling some files. I don't really know if this is the best way but at least I don't get more warnings. diff -ruN linux-2.6.24-rc1.orig/fs/cifs/dir.c linux-2.6.24-rc1/fs/cifs/dir.c --- linux-2.6.24-rc1.orig/fs/cifs/dir.c 2007-10-24 16:06:42.0 +0200 +++ linux-2.6.24-rc1/fs/cifs/dir.c 2007-10-24 15:49:44.0 +0200 @@ -585,6 +585,7 @@ struct qstr *b) { struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls; + unsigned char *dstname = (unsigned char *)a->name; if ((a->len == b->len) && (nls_strnicmp(codepage, a->name, b->name, a->len) == 0)) { @@ -593,7 +594,7 @@ * case take precedence. If a is not a negative dentry, this * should have no side effects */ - memcpy((unsigned char *)a->name, b->name, a->len); + memcpy(dstname, b->name, a->len); return 0; } return 1; diff -ruN linux-2.6.24-rc1.orig/fs/jfs/namei.c linux-2.6.24-rc1/fs/jfs/namei.c --- linux-2.6.24-rc1.orig/fs/jfs/namei.c2007-10-24 16:06:43.0 +0200 +++ linux-2.6.24-rc1/fs/jfs/namei.c 2007-10-24 15:40:34.0 +0200 @@ -1580,6 +1580,7 @@ static int jfs_ci_compare(struct dentry *dir, struct qstr *a, struct qstr *b) { + unsigned char *dstname = (unsigned char *)a->name; int i, result = 1; if (a->len != b->len) @@ -1597,7 +1598,7 @@ * dentry, we blindly replace it with b. This should be harmless if * a is not a negative dentry. */ - memcpy((unsigned char *)a->name, b->name, a->len); + memcpy(dstname, b->name, a->len); out: return result; } diff -ruN linux-2.6.24-rc1.orig/fs/smbfs/cache.c linux-2.6.24-rc1/fs/smbfs/cache.c --- linux-2.6.24-rc1.orig/fs/smbfs/cache.c 2007-10-09 22:31:38.0 +0200 +++ linux-2.6.24-rc1/fs/smbfs/cache.c 2007-10-24 16:01:46.0 +0200 @@ -145,9 +145,10 @@ if (!newdent) goto end_advance; } else { + char *dstname = (char *)newdent->d_name.name; + hashed = 1; - memcpy((char *) newdent->d_name.name, qname->name, - newdent->d_name.len); + memcpy(dstname, qname->name, newdent->d_name.len); } if (!newdent->d_inode) { diff -ruN linux-2.6.24-rc1.orig/include/asm-x86/io_32.h linux-2.6.24-rc1/include/asm-x86/io_32.h --- linux-2.6.24-rc1.orig/include/asm-x86/io_32.h 2007-10-24 16:06:45.0 +0200 +++ linux-2.6.24-rc1/include/asm-x86/io_32.h2007-10-24 15:56:42.0 +0200 @@ -208,7 +208,8 @@ static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) { - __memcpy(dst, (const void __force *)src, count); + const void __force *src1 = (const void __force *)src; + __memcpy(dst, src1, count); } static inline void -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] b44: power down PHY when interface down
This is just http://lkml.org/lkml/2007/7/1/51 but adapted to b44 ssb driver. I couldn't test it as I don't have a b44 ethernet device. diff -ruN linux-2.6.23.orig/drivers/net/b44.c linux-2.6.23/drivers/net/b44.c --- linux-2.6.23.orig/drivers/net/b44.c 2007-10-24 19:02:33.0 +0200 +++ linux-2.6.23/drivers/net/b44.c 2007-10-24 19:50:46.0 +0200 @@ -113,6 +113,8 @@ static void b44_init_rings(struct b44 *); #define B44_FULL_RESET 1 #define B44_FULL_RESET_SKIP_PHY2 #define B44_PARTIAL_RESET 3 +#define B44_CHIP_RESET_FULL 4 +#define B44_CHIP_RESET_PARTIAL 5 static void b44_init_hw(struct b44 *, int); @@ -1283,7 +1285,7 @@ static void b44_clear_stats(struct b44 *bp) } /* bp->lock is held. */ -static void b44_chip_reset(struct b44 *bp) +static void b44_chip_reset(struct b44 *bp, int reset_kind) { if (ssb_is_core_up(bp)) { bw32(bp, B44_RCV_LAZY, 0); @@ -1307,6 +1309,13 @@ static void b44_chip_reset(struct b44 *bp) ssb_device_enable(bp->sdev, 0); b44_clear_stats(bp); + /* +* Don't enable PHY if we are doing a partial reset +* we are probably going to power down +*/ + if (reset_kind == B44_CHIP_RESET_PARTIAL) + return; + switch (sdev->bus->bustype) { case SSB_BUSTYPE_SSB: bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE | @@ -1332,7 +1341,14 @@ static void b44_chip_reset(struct b44 *bp) static void b44_halt(struct b44 *bp) { b44_disable_ints(bp); - b44_chip_reset(bp); + /* reset PHY */ + b44_phy_reset(bp); + /* power down PHY */ + printk(KERN_INFO PFX "%s: powering down PHY\n", bp->dev->name); + bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN); + /* now reset the chip, but without enabling the MAC&PHY +* part of it. This has to be done _after_ we shut down the PHY */ + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL); } /* bp->lock is held. */ @@ -1376,7 +1392,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind) { u32 val; - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_FULL); if (reset_kind == B44_FULL_RESET) { b44_phy_reset(bp); b44_setup_phy(bp); @@ -1430,7 +1446,7 @@ static int b44_open(struct net_device *dev) err = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(err < 0)) { - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL); b44_free_rings(bp); b44_free_consistent(bp); goto out; @@ -2250,7 +2266,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev, /* Chip reset provides power to the b44 MAC & PCI cores, which * is necessary for MAC register access. */ - b44_chip_reset(bp); + b44_chip_reset(bp, B44_CHIP_RESET_FULL); printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name); for (i = 0; i < 6; i++) @@ -2284,4 +2300,5 @@ static void __devexit b44_remove_one(struct ssb_dev *sdev) free_netdev(dev); + ssb_pci_set_power_state(sdev, PCI_D3hot); ssb_set_drvdata(sdev, NULL); } @@ -2312,6 +2329,7 @@ static int b44_suspend(struct ssb_dev *sdev, pm_message_t state) b44_setup_wol(bp); } + ssb_pci_set_power_state(sdev, PCI_D3hot); return 0; } -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] ssb: Add "ssb_pci_set_power_state" function
Add "ssb_pci_set_power_state" function. This allows set the power state of a PCI device (for example b44 ethernet device). diff -ruN linux-2.6.23/include/linux/ssb/ssb.h linux-2.6.23.orig/include/linux/ssb/ssb.h --- linux-2.6.23.orig/include/linux/ssb/ssb.h 2007-10-24 19:02:33.0 +0200 +++ linux-2.6.23/include/linux/ssb/ssb.h2007-10-24 19:49:37.0 +0200 @@ -402,6 +402,14 @@ { pci_unregister_driver(driver); } + +/* Set PCI device power state */ +static inline +void ssb_pci_set_power_state(struct ssb_device *dev, pci_power_t state) +{ + if(dev->bus->bustype == SSB_BUSTYPE_PCI) + pci_set_power_state(dev->bus->host_pci, state); +} #endif /* CONFIG_SSB_PCIHOST */ -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Linux 2.6.24-rc2 build fails: implicit declaration of function ‘smp_call_function_mask'
On Wednesday 07 November 2007 10:55:55 Matthias Kaehlcke wrote: > > v2.6.24-rc2 fails to build on my box with the following error: > > CC [M] drivers/kvm/kvm_main.o > drivers/kvm/kvm_main.c: In function ???kvm_flush_remote_tlbs???: > drivers/kvm/kvm_main.c:220: error: implicit declaration of function > ???smp_call_function_mask??? > make[3]: *** [drivers/kvm/kvm_main.o] Error 1 > make[2]: *** [drivers/kvm] Error 2 > make[1]: *** [drivers] Error 2 > make[1]: Leaving directory `/data/kernel/linux-2.6.24-rc2' > make: *** [debian/stamp-build-kernel] Error 2 > > the .config file is attached This patch should fix this error. Signed-off-by: Miguel Boton <[EMAIL PROTECTED]> Index: linux-2.6.24-rc2/drivers/kvm/kvm_main.c === --- linux-2.6.24-rc2.orig/drivers/kvm/kvm_main.c +++ linux-2.6.24-rc2/drivers/kvm/kvm_main.c @@ -217,7 +217,10 @@ if (cpu != -1 && cpu != raw_smp_processor_id()) cpu_set(cpu, cpus); } + +#ifdef CONFIG_SMP smp_call_function_mask(cpus, ack_flush, NULL, 1); +#endif } int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id) -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: v2.6.21.4-rt11
On Sunday 10 June 2007 15:17, Ingo Molnar wrote: > -rt11 is a bit more experimental than usual: it includes the CFS > scheduler. Great! Finally CFS is included ;) Right now I'm using a patched kernel (2.6.21.4) with realtime-preemption patch and it works fine but I noticed something that I think you should know. There's a problem with mac80211. I'm using "mac80211-8.0.1" and "iwlwifi-0.0.25" driver with my "Intel Pro Wireless 3945ABG" card. When loading the "iwl3945" module or when an application (like wpa_supplicant, dhcpcd...) tries to do something with the card, I get this message in dmesg: BUG: using smp_processor_id() in preemptible [] code: wpa_supplicant/11659 caller is ieee80211_set_multicast_list+0x40/0x163 [mac80211] [] debug_smp_processor_id+0xad/0xb0 [] ieee80211_set_multicast_list+0x40/0x163 [mac80211] [] __dev_mc_upload+0x22/0x23 [] dev_mc_upload+0x24/0x37 [] dev_change_flags+0x26/0xf6 [] devinet_ioctl+0x539/0x6aa [] sock_ioctl+0xa2/0x1d5 [] sock_ioctl+0x0/0x1d5 [] do_ioctl+0x1f/0x6d [] vfs_ioctl+0x50/0x273 [] sys_ioctl+0x34/0x50 [] sysenter_past_esp+0x5f/0x85 [] pfkey_add+0x7c7/0x8d9 === --- | preempt count: 0001 ] | 1-level deep critical section nesting: .. [] debug_smp_processor_id+0x54/0xb0 .[<>] .. ( <= _stext+0x3fefed0c/0xc) Anyway, the wifi card works fine. I got rid of this message by commenting the code of the function "ieee80211_set_multicast_list()" that's on "net/mac80211/ieee80211.c" but this isn't a proper fix. I think you should know about this because kernel 2.6.22 already includes mac80211. Greetings. -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch] CFS scheduler, -v17
On Friday 15 June 2007 18:28, Luiz Fernando N. Capitulino wrote: > Hmm, I'm getting this while compiling: > > """ > LD .tmp_vmlinux1 > kernel/built-in.o: In function `rq_clock': > /home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: > undefined reference to `cpu_of' > /home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: > undefined reference to `cpu_of' > /home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: > undefined reference to `cpu_of' > /home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: > undefined reference to `cpu_of' > /home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: > undefined reference to `cpu_of' > kernel/built-in.o:/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kern >el/sched.c:321: more undefined references to `cpu_of' follow make: *** > [.tmp_vmlinux1] Error 1 > """ > > The code in question is really strange: > > #ifdef CONFIG_SMP > ... > static inline int cpu_of(struct rq *rq) > #ifdef CONFIG_SMP > return rq->cpu; > #else > return 0; > #endif > } > ... > #endif I patched kernel 2.6.21.5 with CFS v17 and I didn't experience this problem (I checked that piece of code and I didn't see something wrong). Looks like it only appears in kernel 2.6.22-rc4. -- Miguel Botón - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/