arch/x86/Kconfig: not select X86_MPPARSE when SFI is present
MPS tables are not needed for systems that have proper ACPI support. This is also true for systems that have SFI in place. So this patch is to exclude X86_MPPARSE when either ACPI or SFI is present. Signed-off-by: Bin Gao bin@intel.com --- arch/x86/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 46c3bff..b1494bd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -310,7 +310,7 @@ config X86_X2APIC If you don't know what to do here, say N. config X86_MPPARSE - bool Enable MPS table if ACPI + bool Enable MPS table if ACPI || SFI default y depends on X86_LOCAL_APIC ---help--- -- 1.7.4.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [sqlite] light weight write barriers
On Thu, Oct 25, 2012 at 12:18:47AM -0500, Nico Williams wrote: By trusting fsync(). And if you don't care about immediate Durability you can run the fsync() in a background thread and mark the associated transaction as completed in the next transaction to be written after the fsync() completes. The challenge is when you have entagled metadata updates. That is, you update file A, and file B, and file A and B might share metadata. In order to sync file A, you also have to update part of the metadata for the updates to file B, which means calculating the dependencies of what you have to drag in can get very complicated. You can keep track of what bits of the metadata you have to undo and then redo before writing out the metadata for fsync(A), but that basically means you have to implement soft updates, and all of the complexity this implies: http://lwn.net/Articles/339337/ If you can keep all of the metadata separate, this can be somewhat mitigated, but usually the block allocation records (regardless of whether you use a tree, or a bitmap, or some other data structure) tends of have entanglement problems. It certainly is not impossible; RDBMS's have implemented this. On the other hand, they generally aren't as fast as file systems for non-transactional workloads, and people really care about performance on those sorts of workloads for file systems. (About a decade ago, Oracle tried to claim that you could run file system workloads using an Oracle databsae as a back-end. Everyone laughed at them, and the idea died a quick, merciful death.) Still, if you want to try to implement such a thing, by all means, give it a try. But I think you'll find that creating a file system that can compete with existing file systems for performance, and *then* also supports a transactional model, is going to be quite a challenge. - Ted -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kdump with signed images
On Wed, 2012-10-24 at 13:36 -0400, Vivek Goyal wrote: On Tue, Oct 23, 2012 at 09:19:27AM -0700, Eric W. Biederman wrote: Vivek Goyal vgo...@redhat.com writes: On Tue, Oct 23, 2012 at 09:18:54AM -0400, Vivek Goyal wrote: [..] There are 3 options for trusting /sbin/kexec. There are IMA and EMA, and it is conceivable to have ELF note sections with signatures for executables. Can you please tell more about what is EMA and IMA. I did quick google and could not find much. That should have been EVM and IMA. Look under security/integrity/. I don't know much about them but they appear to be security modules with a focus on verifying checksum or perhaps encrypted hashes of executables are consistent. I will do some quick search there and I see if I can understand something. Ok, I quickly went through following paper. http://mirror.transact.net.au/sourceforge/l/project/li/linux-ima/linux-ima/Integrity_overview.pdf So it looks like that IMA can store the hashes of files and at execute time ensure those hashes are unchanged to protect against the possibility of modification of files. IMA-appraisal originally was hashed based, but Dmitry Kasatkin added digital signature support. Both have been upstreamed. But what about creation of a new program which can call kexec_load() and execute an unsigned kernel. Doesn't look like that will be prevented using IMA. Assuming the IMA policy syntax is updated to require 'security.ima' to contain a digital signature, then it is only a question of protecting the _ima and _evm keyrings. (Dmitry has such a patch waiting to be reviewed.) So the new program would have to be vetted by someone trusted. Whole idea behind UEFI secure boot seems to be that all signing happens outside the running system and now only signed code can run with higher priviliges. No. UEFI secure boot has absolutely nothing todo with this. UEFI secure boot is about not being able to hijack the code EFI runs directly. Full stop. Some people would like to implment a security policy that says you can't boot an untrusted version of windows from linux if you have booted with UEFI secure boot, so they don't get their bootloader signatures revoked by microsoft. A security model relying on Microsoft's key is totally uniteresting to me. Either signing at the UEFI level is of no use or Microsofts key will fall again to the combined assult of every cracker and every governmental dirty cyber ops division attacking it. Not to mention that Microsoft has little incentive to keep linux booting. I think it is reasonable to be able to support a policy where we can't boot unsigned versions of Microsoft windows. However beyond being able to exclude booting windows being one criteria for our policy mechanism please don't even start to justify things with that ridiculous security policy even indirectly. IMA seems to be only protecting against only making sure existing binaries are not modifed but it does not seem to prevent against installation of new binaries and these binaries take advantage of kexec system call to load an unsigned kernel. The IMA/IMA-appraisal policy dictates what needs to be appraised. The default ima-appraisal policy appraises all files owned by root. I believe you can combine IMA with EVM signed security attributes where the EVM signing key is offline, and the verification key is in the kernel. The combination of IMA and EVM gets very close to being able to sign executables offline and be able to update them. [ Again CCing lkml and IMA/EVM folks ] After little reading, my understanding is EVM also does not support offline signing. http://sourceforge.net/apps/mediawiki/linux-ima/index.php?title=Main_Page Given the fact EVM protects IMA data (security.ima), which is generated inline, I am not sure how EVM can sign images offline. I might have misunderstood things, please correct me if that's not the case. Thanks Vivek IMA-appraisal verifies the integrity of file data, while EVM verifies the integrity of the file metadata, such as LSM and IMA-appraisal labels. Both 'security.ima' and 'security.evm' can contain digital signatures. thanks, Mimi -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC][PATCH] sched: Fix a deadlock of cpu-hotplug
On 10/25/2012 09:02 AM, Michael Wang wrote: On 10/24/2012 05:38 PM, Peter Zijlstra wrote: On Wed, 2012-10-24 at 17:25 +0800, Huacai Chen wrote: We found poweroff sometimes fails on our computers, so we have the lock debug options configured. Then, when we do poweroff or take a cpu down via cpu-hotplug, kernel complain as below. To resove this, we modify sched_ttwu_pending(), disable the local irq when acquire rq-lock. [ 83.066406] = [ 83.066406] [ INFO: inconsistent lock state ] [ 83.066406] 3.5.0-3.lemote #428 Not tainted [ 83.066406] - [ 83.066406] inconsistent {IN-HARDIRQ-W} - {HARDIRQ-ON-W} usage. [ 83.066406] migration/1/7 [HC0[0]:SC0[0]:HE1:SE1] takes: [ 83.066406] (rq-lock){?.-.-.}, at: [802585ac] sched_ttwu_pending+0x64/0x98 [ 83.066406] {IN-HARDIRQ-W} state was registered at: [ 83.066406] [8027c9ac] __lock_acquire+0x80c/0x1cc0 [ 83.066406] [8027e3d0] lock_acquire+0x60/0x9c [ 83.066406] [8074ba04] _raw_spin_lock+0x3c/0x50 [ 83.066406] [8025a2fc] scheduler_tick+0x48/0x178 [ 83.066406] [8023b334] update_process_times+0x54/0x70 [ 83.066406] [80277568] tick_handle_periodic+0x2c/0x9c [ 83.066406] [8020a818] c0_compare_interrupt+0x8c/0x94 [ 83.066406] [8029ec8c] handle_irq_event_percpu+0x7c/0x248 [ 83.066406] [802a2774] handle_percpu_irq+0x8c/0xc0 [ 83.066406] [8029e2c8] generic_handle_irq+0x48/0x58 [ 83.066406] [80205c04] do_IRQ+0x18/0x24 [ 83.066406] [802016e4] mach_irq_dispatch+0xe4/0x124 [ 83.066406] [80203ca0] ret_from_irq+0x0/0x4 [ 83.066406] [8022d114] console_unlock+0x3e8/0x4c0 [ 83.066406] [811ff0d0] con_init+0x370/0x398 [ 83.066406] [811fe3e0] console_init+0x34/0x50 [ 83.066406] [811e4844] start_kernel+0x2f8/0x4e0 [ 83.066406] irq event stamp: 971 [ 83.066406] hardirqs last enabled at (971): [8021c384] local_flush_tlb_all+0x134/0x17c [ 83.066406] hardirqs last disabled at (970): [8021c298] local_flush_tlb_all+0x48/0x17c [ 83.066406] softirqs last enabled at (0): [802298a4] copy_process+0x510/0x117c [ 83.066406] softirqs last disabled at (0): [ (null)] (null) [ 83.066406] [ 83.066406] other info that might help us debug this: [ 83.066406] Possible unsafe locking scenario: [ 83.066406] [ 83.066406]CPU0 [ 83.066406] [ 83.066406] lock(rq-lock); [ 83.066406] Interrupt [ 83.066406] lock(rq-lock); [ 83.066406] [ 83.066406] *** DEADLOCK *** [ 83.066406] [ 83.066406] no locks held by migration/1/7. [ 83.066406] [ 83.066406] stack backtrace: [ 83.066406] Call Trace: [ 83.066406] [80747544] dump_stack+0x8/0x34 [ 83.066406] [8027ba04] print_usage_bug+0x2ec/0x314 [ 83.066406] [8027be28] mark_lock+0x3fc/0x774 [ 83.066406] [8027ca48] __lock_acquire+0x8a8/0x1cc0 [ 83.066406] [8027e3d0] lock_acquire+0x60/0x9c [ 83.066406] [8074ba04] _raw_spin_lock+0x3c/0x50 [ 83.066406] [802585ac] sched_ttwu_pending+0x64/0x98 [ 83.066406] [80745ff4] migration_call+0x10c/0x2e0 [ 83.066406] [80253110] notifier_call_chain+0x44/0x94 [ 83.066406] [8022eae0] __cpu_notify+0x30/0x5c [ 83.066406] [8072b598] take_cpu_down+0x5c/0x70 [ 83.066406] [80299ba4] stop_machine_cpu_stop+0x104/0x1e8 [ 83.066406] [802997cc] cpu_stopper_thread+0x110/0x1ac [ 83.066406] [8024c940] kthread+0x88/0x90 [ 83.066406] [80205ee4] kernel_thread_helper+0x10/0x18 Weird, that's from a CPU_DYING call, I thought those were with IRQs disabled. Look at how __stop_machine() calls the function with IRQs disabled for ! stop_machine_initialized or !SMP. Also stop_machine_cpu_stop() seems to disabled interrupts, so how do we end up calling take_cpu_down() with IRQs enabled? The patch is no doubt wrong... The discuss in: https://lkml.org/lkml/2012/7/19/164 Which also faced the issue that the timer interrupt come in after apic was shut down, I'm not sure whether this could do help to Huacai, just as a clue... One interesting thing that I noted in that case was that we noticed that (stale) interrupt exactly at the call to local_irq_restore() in stop_machine_cpu_stop(). However, as Peter pointed out, migration_call's CPU_DYING notifier runs right in the middle of the stop machine dance, much much before the call to local_irq_restore().. so it doesn't look like a case of a stale interrupt being recognized.. it looks as if the sequence of local_irq_disable(), hard_irq_disable() and __cpu_disable() somehow managed to wrongly keep the interrupts still enabled... Regards, Srivatsa S. Bhat That simply doesn't make any sense.
Re: [PATCH] exec: do not leave bprm-interp on stack
On Wed, Oct 24, 2012 at 9:16 PM, Al Viro v...@zeniv.linux.org.uk wrote: On Wed, Oct 24, 2012 at 04:20:32PM -0700, Kees Cook wrote: If a series of scripts are executed, each triggering module loading via unprintable bytes in the script header, kernel stack contents can leak into the command line. Normally execution of binfmt_script and binfmt_misc happens recursively. However, when modules are enabled, and unprintable bytes exist in the bprm-buf, execution will restart after attempting to load matching binfmt modules. Unfortunately, the logic in binfmt_script and binfmt_misc does not expect to get restarted. They leave bprm-interp pointing to their local stack. This means on restart bprm-interp is left pointing into unused stack memory which can then be copied into the userspace argv areas. This changes the logic to require allocation for any changes to the bprm-interp. To avoid adding a new kmalloc to every exec, the default value is left as-is. Only when passing through binfmt_script or binfmt_misc does an allocation take place. I really don't like that. It papers over the problem, but doesn't really solve the underlying stupidity. We have no good reason to retry a binfmt we'd already attempted on this level of recursion. And your patch doesn't deal with that at all. What should the code here _actually_ be doing? The _script and _misc handlers expect to rewrite the bprm contents and recurse, but the module loader want to try again. It's not clear to me what the binfmt module handler is even there for; I don't see any binfmt- aliases in the tree. If nothing uses it, should we just rip it out? That would solve it too. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 1/3] drivers: bus: ocp2scp: add pdata support
Hi, On Wed, Oct 24, 2012 at 05:48:07PM -0700, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [121016 09:53]: * Kishon Vijay Abraham I kis...@ti.com [121007 23:01]: ocp2scp was not having pdata support which makes *musb* fail for non-dt boot in OMAP platform. The pdata will have information about the devices that is connected to ocp2scp. ocp2scp driver will now make use of this information to create the devices that is attached to ocp2scp. Signed-off-by: Kishon Vijay Abraham I kis...@ti.com This fixes the regression on my panda es for musb port: Acked-by: Tony Lindgren t...@atomide.com Looks like nobody has picked this one up and we need it to fix the musb regression on omap, so I'll queue these up. I don't seem to have the patches around in any mailbox :-( -- balbi signature.asc Description: Digital signature
Re: [PATCH 000/193] remove CONFIG_EXPERIMENTAL
On Wed, Oct 24, 2012 at 6:25 PM, valdis.kletni...@vt.edu wrote: On Tue, 23 Oct 2012 13:01:13 -0700, Kees Cook said: This config item has not carried much meaning for a while now and is almost always enabled by default (especially in distro builds). As agreed during the Linux kernel summit, it should be removed. As such, this is the patch series for removing CONFIG_EXPERIMENTAL, with the hopes of all the various maintainers pulling these changes into their trees. I'm carrying the first patch (that makes CONFIG_EXPERIMENTAL default y) in my linux-next tree, so builds there will see the impact immediately. Has anybody tested what happens if you're doing a git bisect that ends up crossing back and forth across the commit for this? I've been burned before when stuff evaporates out of my .config during a bisect when an option grows/loses a 'depends on' clause. I haven't tried a bisect, but I've been bouncing around between trees and haven't had any surprises yet. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] serial/arc-uart: Add new driver
From: Vineet Gupta vgu...@synopsys.com Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x Signed-off-by: Vineet Gupta vgu...@synopsys.com --- drivers/tty/serial/Kconfig | 25 ++ drivers/tty/serial/Makefile |1 + drivers/tty/serial/arc_uart.c| 747 ++ include/uapi/linux/serial_core.h |2 + 4 files changed, 775 insertions(+), 0 deletions(-) create mode 100644 drivers/tty/serial/arc_uart.c diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 2a53be5..efee7fe 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -1423,4 +1423,29 @@ config SERIAL_EFM32_UART_CONSOLE depends on SERIAL_EFM32_UART=y select SERIAL_CORE_CONSOLE +config SERIAL_ARC + bool ARC UART driver support + select SERIAL_CORE + default y + help + Driver for on-chip UART for ARC(Synopsys) for the legacy + FPGA Boards (ML50x/ARCAngel4) + +config SERIAL_ARC_CONSOLE + bool + select SERIAL_CORE_CONSOLE + depends on SERIAL_ARC=y + default y + help + Enable system Console on ARC UART + +config SERIAL_ARC_NR_PORTS + int 'Number of ports' + range 1 3 + default 1 + depends on SERIAL_ARC + help + Set this to the number of serial ports you want the driver + to support. + endmenu diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile index 4f694da..df1b998 100644 --- a/drivers/tty/serial/Makefile +++ b/drivers/tty/serial/Makefile @@ -82,3 +82,4 @@ obj-$(CONFIG_SERIAL_XILINX_PS_UART) += xilinx_uartps.o obj-$(CONFIG_SERIAL_SIRFSOC) += sirfsoc_uart.o obj-$(CONFIG_SERIAL_AR933X) += ar933x_uart.o obj-$(CONFIG_SERIAL_EFM32_UART) += efm32-uart.o +obj-$(CONFIG_SERIAL_ARC) += arc_uart.o diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c new file mode 100644 index 000..9215bf4 --- /dev/null +++ b/drivers/tty/serial/arc_uart.c @@ -0,0 +1,747 @@ +/* + * ARC On-Chip(fpga) UART Driver + * + * Copyright (C) 2010-2012 Synopsys, Inc. (www.synopsys.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * vineetg: July 10th 2012 + * -Decoupled the driver from arch/arc + *+Using platform_get_resource() for irq/membase (thx to bfin_uart.c) + *+Using early_platform_xxx() for early console (thx to mach-shmobile/xxx) + * + * Vineetg: Aug 21st 2010 + * -Is uart_tx_stopped() not done in tty write path as it has already been + * taken care of, in serial core + * + * Vineetg: Aug 18th 2010 + * -New Serial Core based ARC UART driver + * -Derived largely from blackfin driver albiet with some major tweaks + * + * TODO: + * -check if sysreq works + */ + +#if defined(CONFIG_SERIAL_ARC_CONSOLE) defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + +#include linux/module.h +#include linux/serial.h +#include linux/console.h +#include linux/sysrq.h +#include linux/platform_device.h +#include linux/tty.h +#include linux/tty_flip.h +#include linux/serial_core.h +#include linux/io.h + +/* + * ARC UART Hardware Specs + / +#define ARC_UART_TX_FIFO_SIZE 1 + +/* + * UART Register set (this is not a Standards Compliant IP) + * Also each reg is Word aligned, but only 8 bits wide + */ +#define R_ID0 0 +#define R_ID1 1 +#define R_ID2 2 +#define R_ID3 3 +#define R_DATA 4 +#define R_STS 5 +#define R_BAUDL6 +#define R_BAUDH7 + +/* Bits for UART Status Reg (R/W) */ +#define RXIENB 0x04 /* Receive Interrupt Enable */ +#define TXIENB 0x40 /* Transmit Interrupt Enable */ + +#define RXEMPTY 0x20 /* Receive FIFO Empty: No char receivede */ +#define TXEMPTY 0x80 /* Transmit FIFO Empty, thus char can be written into */ + +#define RXFULL 0x08 /* Receive FIFO full */ +#define RXFULL1 0x10 /* Receive FIFO has space for 1 char (tot space=4) */ + +#define RXFERR 0x01 /* Frame Error: Stop Bit not detected */ +#define RXOERR 0x02 /* OverFlow Err: Char recv but RXFULL still set */ + +/* Uart bit fiddling helpers: lowest level */ +#define RBASE(uart, reg) ((unsigned int *)uart-port.membase + reg) +#define UART_REG_SET(u, r, v) writeb((v), RBASE(u, r)) +#define UART_REG_GET(u, r)readb(RBASE(u, r)) + +#define UART_REG_OR(u, r, v) UART_REG_SET(u, r, UART_REG_GET(u, r) | (v)) +#define UART_REG_CLR(u, r, v) UART_REG_SET(u, r, UART_REG_GET(u, r) ~(v)) + +/* Uart bit fiddling helpers: API level */ +#define UART_SET_DATA(uart, val) UART_REG_SET(uart, R_DATA, val) +#define UART_GET_DATA(uart)UART_REG_GET(uart, R_DATA) + +#define UART_SET_BAUDH(uart, val) UART_REG_SET(uart, R_BAUDH, val) +#define UART_SET_BAUDL(uart, val) UART_REG_SET(uart, R_BAUDL, val) + +#define
Re: [GIT PULL] pinctrl patches for v3.7-rc3+
On Thu, Oct 25, 2012 at 2:04 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Wed, Oct 24, 2012 at 4:57 AM, Linus Walleij linus.wall...@linaro.org wrote: here are some accumulated pinctrl patches since -rc1, with a verboser description in the (signed) tag. Hmm. Your description contains several commits that were already merged long ago (well, a week ago from your previous pull request). So your shortlog etc are all bogus, and contains stuff that isn't actually new to this pull. What happened? H forgot to merge -rc1 and -rc2 into the fixes branch I guess, I'll fix it up and respin, sorry. Yours, Linus Walleij -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: dt: tegra: ventana: define pinmux for ddc
On 10/23/2012 01:14 AM, Stephen Warren wrote: On 10/22/2012 01:29 AM, Mark Zhang wrote: On 10/19/2012 11:48 PM, Stephen Warren wrote: On 10/18/2012 11:58 PM, Mark Zhang wrote: Define pinmux for DDC. The DDC pinmux in Ventana is 2 pins in I2C2. +++ b/arch/arm/boot/dts/tegra20-ventana.dts -ddc { -nvidia,pins = ddc, owc, spdi, spdo, -uac; -nvidia,function = rsvd2; -}; So that removes the entries for 5 pin groups, yet below, entries are only added for the ddc and pta pingroups, so the other 4 pin groups become unconfigured. Right. So I think it should be changed to: owc { nvidia,pins = owc, spdi, spdo, uac; nvidia,function = rsvd2; }; Is this right? Looks correct, yes. + +state_i2cmux_ddc: pinmux_i2cmux_ddc { +ddc { +nvidia,pins = ddc; +nvidia,function = i2c2; +}; +pta { +nvidia,pins = pta; +nvidia,function = rsvd4; +}; Does this actually work? The pta pingroup is configured by the hog pinctrl state of the pinctrl node itself, so this state should fail to be applied since it attempts to touch the same pingroup. I know little about kernel pinctrl subsystem. After reading some docs and codes, I think what you mean is, in Ventana's pinmux configuration, pta pingroup has been defined as hdmi function and this can't be changed(non-dynamic pinmuxing). So I want to know why we have defined pta pingroup as hdmi function? Can we remove this definition to make the i2cmux above working? I don't recall why pta was defined to be HDMI. The issue isn't that this patch changes the pinmux selection for the pta pingroup, but simply that both the pinctrl node's state definition, and the new I2C mux node's state definition both attempt to configure pingroup pta. The solution is most likely to simply remove the pta configuration from the main pinctrl node. Understood. I tried to remove the hdmi function definition of pta pingroup yesterday then found HDMI can't work anymore. The EDID of HDMI monitor can't be fetched. After some debugging, I have found that it's caused by i2c-mux-pinctrl driver is loaded after drm driver. That makes drm driver can't get EDID data via this i2c mux adapter because it doesn't exist at that time. So I think we need to promote the load level of i2c-mux-pinctrl driver. Any other ideas? Mark -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4] serial/arc-uart: Add New Driver
From: Vineet Gupta vgu...@synopsys.com Hi Greg, Rebased off of tty-next and verfied that it builds fine. Please consider applying. Thanks, Vineet v4: * UAPI disintegration fallout for serial_core.h * rebased off of tty-next v3: * Removed empty arc_serial_set_ldisc() * More set_termios fixes - CSIZE forced to CS8 (for 8N1) * global @running_on_iss replaced with platform data, saved in device specific port structure. v2: * ttyARC used as device name * Dynamic assignment of major/minor numbers. * Ref counting tty in rx routine to prevent it from disappearing in case of a hangup * set_termios fixes: - hardware flow control/parity are marked as unsupported - baud written back to termios * cosmetics such as commenting the need for @running_on_iss, empty lines etc Vineet Gupta (1): serial/arc-uart: Add new driver drivers/tty/serial/Kconfig | 25 ++ drivers/tty/serial/Makefile |1 + drivers/tty/serial/arc_uart.c| 747 ++ include/uapi/linux/serial_core.h |2 + 4 files changed, 775 insertions(+), 0 deletions(-) create mode 100644 drivers/tty/serial/arc_uart.c -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] aoe: avoid using skb member after dev_queue_xmit
On Wed, Oct 24, 2012 at 03:08:07PM -0700, Andrew Morton wrote: On Wed, 24 Oct 2012 14:26:13 -0400 Ed Cashin ecas...@coraid.com wrote: After calling dev_queue_xmit it is no longer safe to access the members of the skb. Reported-by: Dan Carpenter dan.carpen...@oracle.com hm, that was clever. How did Dan detect this bug? It was a Smatch thing, but it wasn't enabled by default. I think I will enable it. This is the second bug use after dev_queue_xmit() in two years. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] pinctrl patches for v3.7-rc3+
On Thu, Oct 25, 2012 at 8:31 AM, Linus Walleij linus.wall...@linaro.org wrote: On Thu, Oct 25, 2012 at 2:04 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Wed, Oct 24, 2012 at 4:57 AM, Linus Walleij linus.wall...@linaro.org wrote: here are some accumulated pinctrl patches since -rc1, with a verboser description in the (signed) tag. Hmm. Your description contains several commits that were already merged long ago (well, a week ago from your previous pull request). So your shortlog etc are all bogus, and contains stuff that isn't actually new to this pull. What happened? H forgot to merge -rc1 and -rc2 into the fixes branch I guess, I'll fix it up and respin, sorry. Bah I see you merged it all and let git sort it out :-) I'll be more careful next time, thanks! Yours, Linus Walleij -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC] cpufreq: Make sure target freq is within limits
Hi Rafael, __cpufreq_driver_target() must not pass target frequency beyond the limits of current policy. Today most of cpufreq platform drivers are doing this check in their target routines. Why not move it to __cpufreq_driver_target(). I wanted to get your opinion on this before making changes in all driver files. That's why this is an RFC. Signed-off-by: Viresh Kumar viresh.ku...@linaro.org --- drivers/cpufreq/cpufreq.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index f552d5f..59264f1 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1470,12 +1470,19 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int relation) { int retval = -EINVAL; + unsigned int old_target_freq = target_freq; if (cpufreq_disabled()) return -ENODEV; - pr_debug(target for CPU %u: %u kHz, relation %u\n, policy-cpu, - target_freq, relation); + /* Make sure that target_freq is within supported range */ + if (target_freq policy-max) + target_freq = policy-max; + if (target_freq policy-min) + target_freq = policy-min; + + pr_debug(target for CPU %u: %u kHz, relation %u, requested %u kHz\n, + policy-cpu, target_freq, relation, old_target_freq); if (cpu_online(policy-cpu) cpufreq_driver-target) retval = cpufreq_driver-target(policy, target_freq, relation); -- 1.7.12.rc2.18.g61b472e -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC v2 0/2] vmevent: A bit reworked pressure attribute + docs + man page
Hi Anton, On Mon, Oct 22, 2012 at 04:19:28AM -0700, Anton Vorontsov wrote: Hi all, So this is the second RFC. The main change is that I decided to go with discrete levels of the pressure. I am very happy with that because I already have yelled it several time. When I started writing the man page, I had to describe the 'reclaimer inefficiency index', and while doing this I realized that I'm describing how the kernel is doing the memory management, which we try to avoid in the vmevent. And applications don't really care about these details: reclaimers, its inefficiency indexes, scanning window sizes, priority levels, etc. -- it's all not interesting, and purely kernel's stuff. So I guess Mel Gorman was right, we need some sort of levels. What applications (well, activity managers) are really interested in is this: 1. Do we we sacrifice resources for new memory allocations (e.g. files cache)? 2. Does the new memory allocations' cost becomes too high, and the system hurts because of this? 3. Are we about to OOM soon? Good but I think 3 is never easy. But early notification would be better than late notification which can kill someone. And here are the answers: 1. VMEVENT_PRESSURE_LOW 2. VMEVENT_PRESSURE_MED 3. VMEVENT_PRESSURE_OOM There is no high pressure, since I really don't see any definition of it, but it's possible to introduce new levels without breaking ABI. The levels described in more details in the patches, and the stuff is still tunable, but now via sysctls, not the vmevent_fd() call itself (i.e. we don't need to rebuild applications to adjust window size or other mm details). What I couldn't fix in this RFC is making vmevent_{scanned,reclaimed} stuff per-CPU (there's a comment describing the problem with this). But I made it lockless and tried to make it very lightweight (plus I moved the vmevent_pressure() call to a more cold path). Your description doesn't include why we need new vmevent_fd(2). Of course, it's very flexible and potential to add new VM knob easily but the thing we is about to use now is only VMEVENT_ATTR_PRESSURE. Is there any other use cases for swap or free? or potential user? Adding vmevent_fd without them is rather overkill. And I want to avoid timer-base polling of vmevent if possbile. mem_notify of KOSAKI doesn't use such timer. I don't object but we need rationale for adding new system call which should be maintained forever once we add it. Thanks, Anton. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majord...@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: a href=mailto:d...@kvack.org; em...@kvack.org /a -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 06/21] ocfs2: drop vmtruncate
2012/10/25 Joel Becker jl...@evilplan.org: On Tue, Oct 23, 2012 at 02:48:38PM +0200, Marco Stornelli wrote: 2012/10/23 Joel Becker jl...@evilplan.org: On Tue, Oct 23, 2012 at 10:58:42AM +0200, Marco Stornelli wrote: 2012/10/23 Joel Becker jl...@evilplan.org: On Sat, Oct 20, 2012 at 02:19:00PM +0200, Marco Stornelli wrote: Removed vmtruncate Signed-off-by: Marco Stornelli marco.storne...@gmail.com Acked-by: Joel Becker jl...@evilplan.org Do you want me to pull this, or are you going to send it with your set? Joel I'd prefer to push all via Al's tree since there is a VFS change. SGTM. Thanks! Joel I've got a doubt and I ask to ocfs2 expert :) It seems i_size_write() and truncate_inode_pages() and so on, they are already called in each path of setattr for a size change, so maybe we can remove truncate_setsize() and simply to remove the vmtuncate code, can you give me your opinion? Actually, I have to revisit this, because Chrisoph points out your adjusting i_size outside of a transaction. Joel Actually i_size should be changed in a transaction previous, the code is not changed from this point of view. Indeed the call of truncate_setsize() should be a nop. Marco -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: csr: bh: fixing spaces coding style issues
Fixed some coding style issues replacing spaces for tab at the end of some lines Signed-off-by: Chihau Chau chi...@gmail.com --- drivers/staging/csr/bh.c | 19 +-- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/csr/bh.c b/drivers/staging/csr/bh.c index addee05..1a1f5c7 100644 --- a/drivers/staging/csr/bh.c +++ b/drivers/staging/csr/bh.c @@ -228,20 +228,19 @@ handle_bh_error(unifi_priv_t *priv) * * --- */ -static int -bh_thread_function(void *arg) +static int bh_thread_function(void *arg) { -unifi_priv_t *priv = (unifi_priv_t*)arg; -CsrResult csrResult; -long ret; -u32 timeout, t; -struct uf_thread *this_thread; + unifi_priv_t *priv = (unifi_priv_t *)arg; + CsrResult csrResult; + long ret; + u32 timeout, t; + struct uf_thread *this_thread; -unifi_trace(priv, UDBG2, bh_thread_function starting\n); + unifi_trace(priv, UDBG2, bh_thread_function starting\n); -this_thread = priv-bh_thread; + this_thread = priv-bh_thread; -t = timeout = 0; + t = timeout = 0; while (!kthread_should_stop()) { /* wait until an error occurs, or we need to process something. */ unifi_trace(priv, UDBG3, bh_thread goes to sleep.\n); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [tip:x86/urgent] x86, mm: Find_early_table_space based on ranges that are actually being mapped
On Wed, Oct 24, 2012 at 2:49 PM, tip-bot for Jacob Shin jacob.s...@amd.com wrote: Commit-ID: 844ab6f993b1d32eb40512503d35ff6ad0c57030 Gitweb: http://git.kernel.org/tip/844ab6f993b1d32eb40512503d35ff6ad0c57030 Author: Jacob Shin jacob.s...@amd.com AuthorDate: Wed, 24 Oct 2012 14:24:44 -0500 Committer: H. Peter Anvin h...@linux.intel.com CommitDate: Wed, 24 Oct 2012 13:37:04 -0700 x86, mm: Find_early_table_space based on ranges that are actually being mapped Current logic finds enough space for direct mapping page tables from 0 to end. Instead, we only need to find enough space to cover mr[0].start to mr[nr_range].end -- the range that is actually being mapped by init_memory_mapping() This is needed after 1e779aabe1f0768c2bf8f8c0a5583679b54a, to address the panic reported here: https://lkml.org/lkml/2012/10/20/160 https://lkml.org/lkml/2012/10/21/157 Signed-off-by: Jacob Shin jacob.s...@amd.com Link: http://lkml.kernel.org/r/20121024195311.GB11779@jshin-Toonie Tested-by: Tom Rini tr...@ti.com Signed-off-by: H. Peter Anvin h...@linux.intel.com --- arch/x86/mm/init.c | 70 ++- 1 files changed, 41 insertions(+), 29 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 8653b3a..bc287d6 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -29,36 +29,54 @@ int direct_gbpages #endif ; -static void __init find_early_table_space(unsigned long end, int use_pse, - int use_gbpages) +struct map_range { + unsigned long start; + unsigned long end; + unsigned page_size_mask; +}; + +/* + * First calculate space needed for kernel direct mapping page tables to cover + * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB + * pages. Then find enough contiguous space for those page tables. + */ +static void __init find_early_table_space(struct map_range *mr, int nr_range) { - unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; + int i; + unsigned long puds = 0, pmds = 0, ptes = 0, tables; + unsigned long start = 0, good_end; phys_addr_t base; - puds = (end + PUD_SIZE - 1) PUD_SHIFT; - tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); + for (i = 0; i nr_range; i++) { + unsigned long range, extra; - if (use_gbpages) { - unsigned long extra; + range = mr[i].end - mr[i].start; + puds += (range + PUD_SIZE - 1) PUD_SHIFT; - extra = end - ((endPUD_SHIFT) PUD_SHIFT); - pmds = (extra + PMD_SIZE - 1) PMD_SHIFT; - } else - pmds = (end + PMD_SIZE - 1) PMD_SHIFT; - - tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); + if (mr[i].page_size_mask (1 PG_LEVEL_1G)) { + extra = range - ((range PUD_SHIFT) PUD_SHIFT); + pmds += (extra + PMD_SIZE - 1) PMD_SHIFT; + } else { + pmds += (range + PMD_SIZE - 1) PMD_SHIFT; + } - if (use_pse) { - unsigned long extra; - - extra = end - ((endPMD_SHIFT) PMD_SHIFT); + if (mr[i].page_size_mask (1 PG_LEVEL_2M)) { + extra = range - ((range PMD_SHIFT) PMD_SHIFT); #ifdef CONFIG_X86_32 - extra += PMD_SIZE; + extra += PMD_SIZE; #endif - ptes = (extra + PAGE_SIZE - 1) PAGE_SHIFT; - } else - ptes = (end + PAGE_SIZE - 1) PAGE_SHIFT; + /* The first 2/4M doesn't use large pages. */ + if (mr[i].start PMD_SIZE) + extra += range; those three lines should be added back. it just get reverted in 7b16bbf9 Revert x86/mm: Fix the size calculation of mapping tables + + ptes += (extra + PAGE_SIZE - 1) PAGE_SHIFT; + } else { + ptes += (range + PAGE_SIZE - 1) PAGE_SHIFT; + } + } + tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); + tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); #ifdef CONFIG_X86_32 @@ -76,7 +94,7 @@ static void __init find_early_table_space(unsigned long end, int use_pse, pgt_buf_top = pgt_buf_start + (tables PAGE_SHIFT); printk(KERN_DEBUG kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n, - end - 1, pgt_buf_start PAGE_SHIFT, + mr[nr_range - 1].end - 1, pgt_buf_start PAGE_SHIFT, (pgt_buf_top PAGE_SHIFT) - 1); } @@ -85,12 +103,6 @@ void __init native_pagetable_reserve(u64 start, u64 end) memblock_reserve(start, end - start); } -struct map_range
[PATCH 2/3] powerpc/book3e: support kgdb for kernel space
Currently we need to skip this for supporting KGDB. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/exceptions-64e.S |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 43b654a..c5564d4 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S @@ -566,11 +566,14 @@ kernel_dbg_exc: rfdi /* Normal debug exception */ +1: +#ifndef CONFIG_KGDB /* XXX We only handle coming from userspace for now since we can't * quite save properly an interrupted kernel state yet */ -1: andi. r14,r11,MSR_PR; /* check for userspace again */ + andi. r14,r11,MSR_PR; /* check for userspace again */ beq kernel_dbg_exc; /* if from kernel mode */ +#endif /* Now we mash up things to make it look like we are coming on a * normal exception -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] powerpc/book3e: load critical/machine/debug exception stack
We always alloc critical/machine/debug check exceptions. This is different from the normal exception. So we should load these exception stack properly like we did for booke. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/exceptions-64e.S | 27 +++ 1 file changed, 27 insertions(+) diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 4684e33..43b654a 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S @@ -36,6 +36,30 @@ */ #defineSPECIAL_EXC_FRAME_SIZE INT_FRAME_SIZE +/* only on book3e */ +#define DBG_STACK_BASE dbgirq_ctx +#define MC_STACK_BASE mcheckirq_ctx +#define CRIT_STACK_BASEcritirq_ctx + +#ifdef CONFIG_SMP +#define BOOK3E_LOAD_EXC_LEVEL_STACK(level) \ + std r14,PACA_EX##level+EX_R14(r13); \ + mfspr r14,SPRN_PIR; \ + slwir14,r14,3; \ + LOAD_REG_ADDR(r10, level##_STACK_BASE); \ + add r10,r10,r14;\ + ld r10,0(r10); \ + addir10,r10,THREAD_SIZE;\ + std r10,PACA_DBG_STACK(r13);\ + ld r14,PACA_EX##level+EX_R14(r13); +#else +#define BOOK3E_LOAD_EXC_LEVEL_STACK(level) \ + LOAD_REG_ADDR(r10, level##_STACK_BASE); \ + ld r10,0(r10); \ + addir10,r10,THREAD_SIZE;\ + std r10,PACA_DBG_STACK(r13); +#endif + /* Exception prolog code for all exceptions */ #define EXCEPTION_PROLOG(n, intnum, type, addition)\ mtspr SPRN_SPRG_##type##_SCRATCH,r13; /* get spare registers */ \ @@ -68,18 +92,21 @@ #define SPRN_GDBELL_SRR1 SPRN_GSRR1 #define CRIT_SET_KSTACK \ + BOOK3E_LOAD_EXC_LEVEL_STACK(CRIT); \ ld r1,PACA_CRIT_STACK(r13);\ subir1,r1,SPECIAL_EXC_FRAME_SIZE; #define SPRN_CRIT_SRR0 SPRN_CSRR0 #define SPRN_CRIT_SRR1 SPRN_CSRR1 #define DBG_SET_KSTACK \ + BOOK3E_LOAD_EXC_LEVEL_STACK(DBG); \ ld r1,PACA_DBG_STACK(r13); \ subir1,r1,SPECIAL_EXC_FRAME_SIZE; #define SPRN_DBG_SRR0 SPRN_DSRR0 #define SPRN_DBG_SRR1 SPRN_DSRR1 #define MC_SET_KSTACK \ + BOOK3E_LOAD_EXC_LEVEL_STACK(MC); \ ld r1,PACA_MC_STACK(r13); \ subir1,r1,SPECIAL_EXC_FRAME_SIZE; #define SPRN_MC_SRR0 SPRN_MCSRR0 -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] kgdb/kgdbts: support ppc64
We can't look up the address of the entry point of the function simply via that function symbol for all architectures. For PPC64 ABI, actually there is a function descriptors structure. A function descriptor is a three doubleword data structure that contains the following values: * The first doubleword contains the address of the entry point of the function. * The second doubleword contains the TOC base address for the function. * The third doubleword contains the environment pointer for languages such as Pascal and PL/1. So we should call a wapperred dereference_function_descriptor() to get the address of the entry point of the function. Note this is also safe for other architecture after refer to include/asm-generic/sections.h since: dereference_function_descriptor(p) always is (p) if without arched definition. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- drivers/misc/kgdbts.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 3aa9a96..4799e1f 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c @@ -103,6 +103,7 @@ #include linux/delay.h #include linux/kthread.h #include linux/module.h +#include asm/sections.h #define v1printk(a...) do { \ if (verbose) \ @@ -222,6 +223,7 @@ static unsigned long lookup_addr(char *arg) addr = (unsigned long)do_fork; else if (!strcmp(arg, hw_break_val)) addr = (unsigned long)hw_break_val; + addr = (unsigned long )dereference_function_descriptor((void *)addr); return addr; } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC] Kdump with signed images
On Wed, Oct 24, 2012 at 10:43 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2012-10-24 at 13:19 -0400, Vivek Goyal wrote: On Tue, Oct 23, 2012 at 09:44:59AM -0700, Eric W. Biederman wrote: Matthew Garrett m...@redhat.com writes: On Tue, Oct 23, 2012 at 10:59:20AM -0400, Vivek Goyal wrote: But what about creation of a new program which can call kexec_load() and execute an unsigned kernel. Doesn't look like that will be prevented using IMA. Like the existing kernel modules, kexec_load() is not file descriptor based. There isn't an LSM or IMA-appraisal hook here. Right. Trusting userspace would require a new system call that passes in a signature of the userspace binary, and the kernel would then have to verify the ELF object in memory in order to ensure that it matches the signature. Verifying that the copy on the filesystem is unmodified isn't adequate - an attacker could simply have paused the process and injected code. I haven't looked at kexec_load() in detail, but like kernel modules, I think the better solution would be to pass a file descriptor, especially if you're discussing a new system call. (cc'ing Kees.) Yeah, it looks like kexec_load could use a nearly identical new syscall that uses an fd, just like init_module is getting. Another area, kind of related, is firmware loading. The interface for that is a bit weird, if the documentation is up to date: echo 1 /sys/$DEVPATH/loading cat $HOTPLUG_FW_DIR/$FIRMWARE /sysfs/$DEVPATH/data echo 0 /sys/$DEVPATH/loading It looks like there's a filp on the reader: static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buffer, loff_t offset, size_t count) But it's not clear to me yet if we'll actually get the firmware file, or if we'll get a random pipe we can't evaluate. Has anyone looked at handling signed firmware loading yet? -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC v2 0/2] vmevent: A bit reworked pressure attribute + docs + man page
On Thu, Oct 25, 2012 at 9:40 AM, Minchan Kim minc...@kernel.org wrote: Your description doesn't include why we need new vmevent_fd(2). Of course, it's very flexible and potential to add new VM knob easily but the thing we is about to use now is only VMEVENT_ATTR_PRESSURE. Is there any other use cases for swap or free? or potential user? Adding vmevent_fd without them is rather overkill. What ABI would you use instead? On Thu, Oct 25, 2012 at 9:40 AM, Minchan Kim minc...@kernel.org wrote: I don't object but we need rationale for adding new system call which should be maintained forever once we add it. Agreed. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH V2] ARM: dt: tegra: ventana: define pinmux for ddc
Tegra 2's I2C2 controller can be routed to either the PTA or DDC pin group on Ventana. So: - Remove the HDMI function definition of pta pingroup - Define child i2c adapters(ddc pta) for I2C2 controller Signed-off-by: Mark Zhang ma...@nvidia.com --- arch/arm/boot/dts/tegra20-ventana.dts | 69 ++--- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts index bec8bb2..1dde0d3 100644 --- a/arch/arm/boot/dts/tegra20-ventana.dts +++ b/arch/arm/boot/dts/tegra20-ventana.dts @@ -64,11 +64,6 @@ nvidia,pins = dap4; nvidia,function = dap4; }; - ddc { - nvidia,pins = ddc, owc, spdi, spdo, - uac; - nvidia,function = rsvd2; - }; dta { nvidia,pins = dta, dtb, dtc, dtd, dte; nvidia,function = vi; @@ -98,7 +93,7 @@ nvidia,function = pcie; }; hdint { - nvidia,pins = hdint, pta; + nvidia,pins = hdint; nvidia,function = hdmi; }; i2cp { @@ -129,6 +124,10 @@ lspi, lvp1, lvs; nvidia,function = displaya; }; + owc { + nvidia,pins = owc, spdi, spdo, uac; + nvidia,function = rsvd2; + }; pmc { nvidia,pins = pmc; nvidia,function = pwr_on; @@ -248,6 +247,39 @@ nvidia,slew-rate-falling = 3; }; }; + + state_i2cmux_ddc: pinmux_i2cmux_ddc { + ddc { + nvidia,pins = ddc; + nvidia,function = i2c2; + }; + pta { + nvidia,pins = pta; + nvidia,function = rsvd4; + }; + }; + + state_i2cmux_pta: pinmux_i2cmux_pta { + ddc { + nvidia,pins = ddc; + nvidia,function = rsvd4; + }; + pta { + nvidia,pins = pta; + nvidia,function = i2c2; + }; + }; + + state_i2cmux_idle: pinmux_i2cmux_idle { + ddc { + nvidia,pins = ddc; + nvidia,function = rsvd4; + }; + pta { + nvidia,pins = pta; + nvidia,function = rsvd4; + }; + }; }; i2s@70002800 { @@ -291,6 +323,31 @@ clock-frequency = 40; }; + i2cmux { + compatible = i2c-mux-pinctrl; + #address-cells = 1; + #size-cells = 0; + + i2c-parent = {/i2c@7000c400}; + + pinctrl-names = ddc, pta, idle; + pinctrl-0 = state_i2cmux_ddc; + pinctrl-1 = state_i2cmux_pta; + pinctrl-2 = state_i2cmux_idle; + + i2c@0 { + reg = 0; + #address-cells = 1; + #size-cells = 0; + }; + + i2c@1 { + reg = 1; + #address-cells = 1; + #size-cells = 0; + }; + }; + i2c@7000c500 { status = okay; clock-frequency = 40; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: csr: Fix coding style
Fix coding style for csr_log.h Signed-off-by: SeongJae Park sj38.p...@gmail.com --- drivers/staging/csr/csr_log.h | 165 - 1 file changed, 80 insertions(+), 85 deletions(-) diff --git a/drivers/staging/csr/csr_log.h b/drivers/staging/csr/csr_log.h index b280856..26657a5 100644 --- a/drivers/staging/csr/csr_log.h +++ b/drivers/staging/csr/csr_log.h @@ -2,11 +2,11 @@ #define CSR_LOG_H__ /* -(c) Cambridge Silicon Radio Limited 2010 -All rights reserved and confidential information of CSR + (c) Cambridge Silicon Radio Limited 2010 + All rights reserved and confidential information of CSR -Refer to LICENSE.txt included with this source for details -on the license terms. + Refer to LICENSE.txt included with this source for details + on the license terms. */ @@ -77,34 +77,31 @@ u8 CsrLogTaskIsFiltered(CsrSchedQid taskId, CsrLogLevelTask level); /* * Logging stuff */ -#define CSR_LOG_STRINGIFY_REAL(a) #a +#define CSR_LOG_STRINGIFY_REAL(a) (#a) #define CSR_LOG_STRINGIFY(a) CSR_LOG_STRINGIFY_REAL(a) #ifdef CSR_LOG_ASSERT_ENABLE -#define CSR_LOG_ASSERT(cond)\ -do {\ -if (!(cond))\ -{ \ -char *panic_arg = [ __FILE__ : CSR_LOG_STRINGIFY(__LINE__) ] - CSR_LOG_STRINGIFY(cond); \ -CsrPanic(CSR_TECH_FW, CSR_PANIC_FW_ASSERTION_FAIL, panic_arg); \ -} \ -} while (0) +#define CSR_LOG_ASSERT(cond) \ + do { \ + if (!(cond)) { \ + char *panic_arg = [ __FILE__ : CSR_LOG_STRINGIFY(__LINE__) ] - CSR_LOG_STRINGIFY(cond); \ + CsrPanic(CSR_TECH_FW, CSR_PANIC_FW_ASSERTION_FAIL, panic_arg); \ + } \ + } while (0) #else #define CSR_LOG_ASSERT(cond) #endif -typedef struct -{ -u16primitiveType; -const char *primitiveName; -CsrMsgConvMsgEntry *messageConv; /* Private - do not use */ +typedef struct { + u16primitiveType; + const char *primitiveName; + CsrMsgConvMsgEntry *messageConv; /* Private - do not use */ } CsrLogPrimitiveInformation; -typedef struct -{ -const char*techVer; -u32 primitiveInfoCount; -CsrLogPrimitiveInformation *primitiveInfo; +typedef struct { + const char*techVer; + u32 primitiveInfoCount; + CsrLogPrimitiveInformation *primitiveInfo; } CsrLogTechInformation; /*-*/ @@ -118,21 +115,19 @@ typedef u32 bitmask32_t; #ifdef CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER /* DEPRECATED - replaced by csr_log_text.h */ #define CSR_LOG_TEXT(text) \ -do { \ -if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) \ -{ \ -CsrLogTaskText(text, __LINE__, __FILE__); \ -} \ -} while (0) + do { \ + if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) { \ + CsrLogTaskText(text, __LINE__, __FILE__); \ + } \ + } while (0) #else /* DEPRECATED - replaced by csr_log_text.h */ #define CSR_LOG_TEXT(text) \ -do { \ -if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) \ -{ \ -CsrLogTaskText(text, 0, NULL); \ -} \ -} while (0) + do { \ + if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) { \ + CsrLogTaskText(text, 0, NULL); \ + } \ + } while (0) #endif #else #define CSR_LOG_TEXT(text) @@ -140,8 +135,8 @@ typedef u32 bitmask32_t; /* DEPRECATED - replaced by csr_log_text.h */ void CsrLogTaskText(const char *text, -u32 line, -const char *file); + u32 line, + const char *file); #define CSR_LOG_STATE_TRANSITION_MASK_FSM_NAME (0x001) #define CSR_LOG_STATE_TRANSITION_MASK_NEXT_STATE(0x002) @@ -153,16 +148,16 @@ void CsrLogTaskText(const char *text, /* DEPRECATED - replaced by csr_log_text.h */ void CsrLogStateTransition(bitmask16_t mask, -u32 identifier, -const char *fsm_name, -u32 prev_state, -const char *prev_state_str, -u32 in_event, -const char *in_event_str, -u32 next_state, -const char *next_state_str, -u32 line, -const char *file); + u32 identifier, + const char *fsm_name, + u32 prev_state, + const char *prev_state_str, + u32 in_event, + const char *in_event_str, + u32 next_state, + const char *next_state_str,
Re: [sqlite] light weight write barriers
On Thu, 25 Oct 2012, Theodore Ts'o wrote: On Thu, Oct 25, 2012 at 12:18:47AM -0500, Nico Williams wrote: By trusting fsync(). And if you don't care about immediate Durability you can run the fsync() in a background thread and mark the associated transaction as completed in the next transaction to be written after the fsync() completes. The challenge is when you have entagled metadata updates. That is, you update file A, and file B, and file A and B might share metadata. In order to sync file A, you also have to update part of the metadata for the updates to file B, which means calculating the dependencies of what you have to drag in can get very complicated. You can keep track of what bits of the metadata you have to undo and then redo before writing out the metadata for fsync(A), but that basically means you have to implement soft updates, and all of the complexity this implies: http://lwn.net/Articles/339337/ If you can keep all of the metadata separate, this can be somewhat mitigated, but usually the block allocation records (regardless of whether you use a tree, or a bitmap, or some other data structure) tends of have entanglement problems. hmm, two thoughts occur to me. 1. to avoid entanglement, put the two files in separate directories 2. take advantage of entaglement to enforce ordering thread 1 (repeated): write new message to file 1, spawn new thread to fsync thread 2: write to file 2 that message1-5 are being worked on thread 2 (later): write to file 2 that messages 1-5 are done when thread 1 spawns the new thread to do the fsync, the system will be forced to write the data to file 2 as of the time it does the fsync. This should make it so that you never have data written to file2 that refers to data that hasn't been written to file1 yet. It certainly is not impossible; RDBMS's have implemented this. On the other hand, they generally aren't as fast as file systems for non-transactional workloads, and people really care about performance on those sorts of workloads for file systems. the RDBMS's have implemented stronger guarantees than what we are needing A few years ago I was investigating this for logging. With the reliable (RDBMS style) , but inefficent disk queue that rsyslog has, writing to a high-end fusion-io SSD, ext2 resulted in ~8K logs/sec, ext3 resultedin ~2K logs/sec, and JFS/XFS resulted in ~4K logs/sec (ext4 wasn't considered stable enough at the time to be tested) Still, if you want to try to implement such a thing, by all means, give it a try. But I think you'll find that creating a file system that can compete with existing file systems for performance, and *then* also supports a transactional model, is going to be quite a challenge. The question is trying to figure a way to get ordering right with existing filesystms (preferrably without using something too tied to a single filesystem implementation), not try and create a new one. The frustrating thing is that when people point out how things like sqlite are so horribly slow, the reply seems to be well, that's what you get for doing so many fsyncs, don't do that, when there is a 'problem' like the KDE config loss problem a few years ago, the response is well, that's what you get for not doing fsync Both responses are correct, from a purely technical point of view. But what's missing is any way to get the result of ordered I/O that will let you do something pretty fast, but with the guarantee that, if you loose data in a crash, the only loss you are risking is that your most recent data may be missing. (either for one file, or using multiple files if that's what it takes) Since this topic came up again, I figured I'd poke a bit and try to either get educated on how to do this right or try and see if there's something that could be added to the kernel to make it possible for userspace programs to do this. What I think userspace really needs is something like a barrier function call. for this fd, don't re-order writes as they go down through the stack If the hardware is going to reorder things once it hits the hardware, this is going to hurt performance (how much depends on a lot of stuff) but the filesystems are able to make their journals work, so there should be some way to let userspace do some sort of similar ordering David Lang -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: shmem_getpage_gfp VM_BUG_ON triggered. [3.7rc2]
On Thu, 25 Oct 2012, Ni zhan Chen wrote: On 10/25/2012 12:36 PM, Hugh Dickins wrote: On Wed, 24 Oct 2012, Dave Jones wrote: Machine under significant load (4gb memory used, swap usage fluctuating) triggered this... WARNING: at mm/shmem.c:1151 shmem_getpage_gfp+0xa5c/0xa70() Pid: 29795, comm: trinity-child4 Not tainted 3.7.0-rc2+ #49 1148 error = shmem_add_to_page_cache(page, mapping, index, 1149 gfp, swp_to_radix_entry(swap)); 1150 /* We already confirmed swap, and make no allocation */ 1151 VM_BUG_ON(error); 1152 } That's very surprising. Easy enough to handle an error there, but of course I made it a VM_BUG_ON because it violates my assumptions: I rather need to understand how this can be, and I've no idea. Clutching at straws, I expect this is entirely irrelevant, but: there isn't a warning on line 1151 of mm/shmem.c in 3.7.0-rc2 nor in current linux.git; rather, there's a VM_BUG_ON on line 1149. So you've inserted a couple of lines for some reason (more useful trinity behaviour, perhaps)? And have some config option I'm unfamiliar with, that mutates a BUG_ON or VM_BUG_ON into a warning? Hi Hugh, I think it maybe caused by your commit [d189922862e03ce: shmem: fix negative rss in memcg memory.stat], one question: Well, yes, I added the VM_BUG_ON in that commit. if function shmem_confirm_swap confirm the entry has already brought back from swap by a racing thread, The reverse: true confirms that the swap entry has not been brought back from swap by a racing thread; false indicates that there has been a race. then why call shmem_add_to_page_cache to add page from swapcache to pagecache again? Adding it to pagecache again, after such a race, would set error to -EEXIST (originating from radix_tree_insert); but we don't do that, we add it to pagecache when it has not already been added. Or that's the intention: but Dave seems to have found an unexpected exception, despite us holding the page lock across all this. (But if it weren't for the memcg and replace_page issues, I'd much prefer to let shmem_add_to_page_cache discover the race as before.) Hugh otherwise, will goto unlock and then go to repeat? where I miss? Regards, Chen -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC] Kdump with signed images
On Wed, 2012-10-24 at 23:44 -0700, Kees Cook wrote: On Wed, Oct 24, 2012 at 10:43 PM, Mimi Zohar zo...@linux.vnet.ibm.com wrote: On Wed, 2012-10-24 at 13:19 -0400, Vivek Goyal wrote: On Tue, Oct 23, 2012 at 09:44:59AM -0700, Eric W. Biederman wrote: Matthew Garrett m...@redhat.com writes: On Tue, Oct 23, 2012 at 10:59:20AM -0400, Vivek Goyal wrote: But what about creation of a new program which can call kexec_load() and execute an unsigned kernel. Doesn't look like that will be prevented using IMA. Like the existing kernel modules, kexec_load() is not file descriptor based. There isn't an LSM or IMA-appraisal hook here. Right. Trusting userspace would require a new system call that passes in a signature of the userspace binary, and the kernel would then have to verify the ELF object in memory in order to ensure that it matches the signature. Verifying that the copy on the filesystem is unmodified isn't adequate - an attacker could simply have paused the process and injected code. I haven't looked at kexec_load() in detail, but like kernel modules, I think the better solution would be to pass a file descriptor, especially if you're discussing a new system call. (cc'ing Kees.) Yeah, it looks like kexec_load could use a nearly identical new syscall that uses an fd, just like init_module is getting. Another area, kind of related, is firmware loading. The interface for that is a bit weird, if the documentation is up to date: echo 1 /sys/$DEVPATH/loading cat $HOTPLUG_FW_DIR/$FIRMWARE /sysfs/$DEVPATH/data echo 0 /sys/$DEVPATH/loading It looks like there's a filp on the reader: static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buffer, loff_t offset, size_t count) But it's not clear to me yet if we'll actually get the firmware file, or if we'll get a random pipe we can't evaluate. Has anyone looked at handling signed firmware loading yet? -Kees Only looked at it enough to mention at LSS, that it's needed. Mimi -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] dt: add helper function to read u8 u16 variables arrays
On 12 October 2012 23:31, Viresh Kumar viresh.ku...@linaro.org wrote: This adds following helper routines: - of_property_read_u8_array() - of_property_read_u16_array() - of_property_read_u8() - of_property_read_u16() First two actually share most of the code with of_property_read_u32_array(), so the common part is taken out into a macro, which can be used by all three *_array() routines. Hi Rob, Any comment here? -- viresh -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: lots of suspicious RCU traces
2012/10/25 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (10/25/12 00:32), Frederic Weisbecker wrote: First of all, thanks a lot for your report. 2012/10/24 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (10/24/12 20:06), Oleg Nesterov wrote: On 10/24, Sergey Senozhatsky wrote: small question, ptrace_notify() and forward calls are able to both indirectly and directly call schedule(), /* direct call from ptrace_stop()*/, should, in this case, rcu_user_enter() be called before tracehook_report_syscall_exit(regs, step) and ptrace chain? Well, I don't really understand this magic... but why? My understanding is (I may be wrong) that we can schedule() from ptrace chain to some arbitrary task, which will continue its execution from the point where RCU assumes CPU as not idle, while CPU in fact still in idle state -- no one said rcu_idle_exit() (or similar) prior to schedule() call. Yeah but when we are in syscall_trace_leave(), the CPU shouldn't be in RCU idle mode. That's where the bug is. How do you manage to trigger this bug? strace -f anything I can't reproduce. Can you send me your config? Thanks. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] Support Elan Touchscreen eKTF product.
On Thu, Oct 25, 2012 at 12:32:39PM +0800, 劉嘉駿 wrote: Hi Dmitry, Thanks for review. -Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Thursday, October 25, 2012 2:13 AM To: Scott Liu Cc: linux-in...@vger.kernel.org; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org; Benjamin Tissoires; Jesse; Vincent Wang; Paul Subject: Re: [PATCH v2] Support Elan Touchscreen eKTF product. Hi Scott, On Wed, Oct 24, 2012 at 09:41:43AM +0800, Scott Liu wrote: This patch is for Elan eKTF Touchscreen product, I2C adpater module. Signed-off-by: Scott Liu scott@emc.com.tw --- Hi, v2 revision I have fixed some bug as your advise. 1. To target the mainline 2. No Android dependency 3. reuse those duplication code from Henrik's patchset. (input_mt_sync_frame() / input_mt_get_slot_by_key()) Just a quick run through the code, so: - please remove polling support, it is not useful in production; OK. - why do you need a separate probe work instead of doing what you need in elants_probe() will fix. - it is not a good idea to register input device first and then allocating memory for MT handling. Ooop...will fix. - I do not understand why kfifo is needed The firmware and the host would conflict by read command and finger report simultaneously. So I'm simply using kfifo in IRQ thread function. * read command: writing 4 bytes commands and the device asserts GPIO interrupt and then response 4 bytes data. There was an error if we do not use kfifo: With heavy loading by finger report / read command, the driver may get finger report as response data. So, do you understand my meaning? No I don't. Most of my confusion stems from the fact that you only put data into kfifo but not actually use it anywhere. You do fetch the data in your drop old function, but that data is just dropped. So I really do not see the point. Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [sqlite] light weight write barriers
On Thu, 25 Oct 2012, Theodore Ts'o wrote: On Wed, Oct 24, 2012 at 03:03:00PM -0700, da...@lang.hm wrote: Like what is being described for sqlite, loosing the tail end of the messages is not a big problem under normal conditions. But there is a need to be sure that what is there is complete up to the point where it's lost. this is similar in concept to write-ahead-logs done for databases (without the absolute durability requirement) If that's what you require, and you are using ext3/4, usng data journalling might meet your requirements. It's something you can enable on a per-file basis, via chattr +j; you don't have to force all file systems to use data journaling via the data=journalled mount option. The potential downsides that you may or may not care about for this particular application: (a) This will definitely have a performance impact, especially if you are doing lots of small (less than 4k) writes, since the data blocks will get run through the journal, and will only get written to their final location on disk. (b) You don't get atomicity if the write spans a 4k block boundary. All of the bytes before i_size will be written, so you don't have to worry about holes; but the last message written to the log file might be truncated. (c) There will be a performance impact, since the contents of data blocks will be written at least twice (once to the journal, and once to the final location on disk). If you do lots of small, sub-4k writes, the performance might be even worse, since data blocks might be written multiple times to the journal. I'll have to dig into this option. In the case of rsyslog it sounds like it could work (not as good as a filesystem independant way of doing things, but better than full fsyncs) Truncated messages are not great, but they are a detectable, and acceptable risk. while the average message size is much smaller than 4K (on my network it's ~250 bytes), the metadata that's broken out expands this somewhat, and we can afford to waste disk space if it makes things safer or more efficient. If we do update in place with flags with each message, each message will need to be written up to three times (on recipt, being processed, finished processed). With high message burst rates, I'm worried that we would fill up the journal, is there a good way to deal with this? I believe that ext4 can put the journal on a different device from the filesystem, would this help a lot? If you were to put the journal for an ext4 filesystem on a ram disk, you would loose the data recovery protection of the journal, but could you use this trick to get ordered data writes onto the filesystem? David Lang -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v6] Enable USB peripheral mode on dm365 EVM
Hi, On Wed, Oct 10, 2012 at 02:33:32PM +0200, Constantine Shulyupin wrote: From: Constantine Shulyupin co...@makelinux.com Sets USB PHY clock source to 24 MHz clock and call USB configuration from board initialization. Tested with OTG configuration, usb gadget g_zero on DM365 EVM connected to PC. References: Definition of USB_PHY_CTRL and PHYCLKFREQ: - http://www.makelinux.com/lib/ti/DM36x_ARM/doc-141 Original patch by miguel.agui...@ridgerun.com three years ago: - http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg14741.html Signed-off-by: Constantine Shulyupin co...@makelinux.com --- Note: Changelog Changes since v5 http://www.spinics.net/lists/kernel/msg1413120.html accordingy feedback of nsek...@ti.com http://www.spinics.net/lists/kernel/msg1414914.html - phy configuration moved to drivers/usb/musb/davinci.c - USB_OTG configuration is submitted in separated patch: http://www.spinics.net/lists/kernel/msg1414964.html - Setting current limit to 1000 mA. Any way the current is limited to 510 mA in davinci_setup_usb. Changes since v4 http://www.spinics.net/lists/kernel/msg1412995.html - removed fix of dev_info in musb_init_controller Changes since v3 http://www.spinics.net/lists/kernel/msg1412544.html: - removed optional altering of pr_info Changes since v1 http://marc.info/?l=linux-kernelm=130894150803661w=2: - removed optional code and reordered - removed alternation of GPIO33, which is multiplexed with DRVVBUS, because is not need for peripheral USB This patch is based on code from projects Arago, Angstom and RidgeRun. --- arch/arm/mach-davinci/board-dm365-evm.c |2 ++ drivers/usb/musb/davinci.c |3 +++ drivers/usb/musb/davinci.h |1 + 3 files changed, 6 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 688a9c5..ba5ffc1 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -38,6 +38,7 @@ #include mach/mmc.h #include mach/nand.h #include mach/keyscan.h +#include mach/usb.h #include media/tvp514x.h @@ -610,6 +611,7 @@ static __init void dm365_evm_init(void) dm365_init_spi0(BIT(0), dm365_evm_spi_info, ARRAY_SIZE(dm365_evm_spi_info)); + davinci_setup_usb(1000, 8); } MACHINE_START(DAVINCI_DM365_EVM, DaVinci DM365 EVM) diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 472c8b4..af09ebf 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -428,6 +428,9 @@ static int davinci_musb_init(struct musb *musb) __raw_writel(deepsleep, DM355_DEEPSLEEP); } + if (machine_is_davinci_dm365_evm()) + writel(readl(USB_PHY_CTRL) | USBPHY_CLKFREQ_24MHZ, USB_PHY_CTRL); no such checks in drivers. Please find another way to do this. -- balbi signature.asc Description: Digital signature
Re: [BUG] lkvm crash on crashkernel boot
On Wed, Oct 24, 2012 at 6:27 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hi, I've tried to play with kexec using lkvm. Unfortunately, lkvm crashes when I try to switch to crashkernel. I use Linus tree + penberg/kvmtool/next + one x86 mm patch[1]. Kernel is defconfig + kvmconfig. I use the same kernel image for system and crash env. Host: % lkvm run --cpus 1 -m 1024 --params 'crashkernel=256M loglevel=8' Guest: # kexec -p bzImage --reuse-cmdline # echo c /proc/sysrq-trigger ... [0.947984] loop: module loaded [0.950078] virtio-pci :00:01.0: irq 40 for MSI/MSI-X [0.950925] virtio-pci :00:01.0: irq 41 for MSI/MSI-X [0.952944] virtio-pci :00:01.0: irq 42 for MSI/MSI-X zsh: segmentation fault (core dumped) lkvm run --cpus 1 -m 1024 --params 'crashkernel=256M loglevel=8' This seems to work OK on my machine. Guest kernel is somewhere in virtio_net initialization (for the second time). I'm too lazy to find exact line. Backtrace: 0 irq__add_msix_route (kvm=kvm@entry=0xbf8010, msg=0xe3d090) at x86/irq.c:210 #1 0x0041b3bf in virtio_pci__specific_io_out.isra.5 (offset=optimized out, data=optimized out, kvm=0xbf8010) at virtio/pci.c:150 #2 virtio_pci__io_out.9406 (ioport=optimized out, kvm=0xbf8010, port=optimized out, data=optimized out, size=optimized out) at virtio/pci.c:208 #3 0x0040f8c3 in kvm__emulate_io (count=optimized out, size=2, direction=1, data=optimized out, port=25108, kvm=0xbf8010) at ioport.c:165 #4 kvm_cpu__start (cpu=optimized out) at x86/include/kvm/kvm-cpu-arch.h:41 #5 0x00416ca2 in kvm_cpu_thread.2824 (arg=optimized out) at builtin-run.c:176 #6 0x7f701ebd0b50 in start_thread (arg=optimized out) at pthread_create.c:304 #7 0x7f701e1fe70d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 #8 0x in ?? () Looks like vpci-msix_table might not be initialized properly. Sasha, Asias, care to take a look at this? Pekka -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC][PATCH 00/16] sched: SCHED_DEADLINE v6
* Juri Lelli juri.le...@gmail.com wrote: kernel/sched/dl.c | 1650 I've got a stupid nit here: please make that deadline.c. Same for cpudl.c. (Just to stop future generations from wondering why the Linux scheduler has a downloading module.) Thanks, Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net/ipv4/ipconfig: add device address to a KERN_INFO message
adds a hwaddr to the IP-Config: Complete KERN_INFO message with the dev_addr of the device selected for auto configuration. Signed-off-by: Claudio Fontana claudio.font...@huawei.com --- net/ipv4/ipconfig.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 798358b..d763701 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1500,8 +1500,10 @@ static int __init ip_auto_config(void) * Clue in the operator. */ pr_info(IP-Config: Complete:\n); - pr_info( device=%s, addr=%pI4, mask=%pI4, gw=%pI4\n, - ic_dev-name, ic_myaddr, ic_netmask, ic_gateway); + + pr_info( device=%s, hwaddr=%*phC, ipaddr=%pI4, mask=%pI4, gw=%pI4\n, + ic_dev-name, ic_dev-addr_len, ic_dev-dev_addr, + ic_myaddr, ic_netmask, ic_gateway); pr_info( host=%s, domain=%s, nis-domain=%s\n, utsname()-nodename, ic_domain, utsname()-domainname); pr_info( bootserver=%pI4, rootserver=%pI4, rootpath=%s, -- 1.7.4.4 Hello, while troubleshooting an issue I was having trying to mount the root filesystem using nfsroot running on a software emulation (solved), I found it useful to be able to see the selected device address in the IP-Config: Complete message during boot as I was troubleshooting, and I thought it might be good in general, and a good way to try to submit my first patch :) The patch is against latest mainline. Thank you for your help and comments, Claudio Fontana -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net/ipv4/ipconfig: add device address to a KERN_INFO message
From: Claudio Fontana claudio.font...@huawei.com Date: Thu, 25 Oct 2012 09:13:49 +0200 - pr_info( device=%s, addr=%pI4, mask=%pI4, gw=%pI4\n, - ic_dev-name, ic_myaddr, ic_netmask, ic_gateway); + + pr_info( device=%s, hwaddr=%*phC, ipaddr=%pI4, mask=%pI4, gw=%pI4\n, + ic_dev-name, ic_dev-addr_len, ic_dev-dev_addr, + ic_myaddr, ic_netmask, ic_gateway); Either you or your email client have destroyed the indentation of these statements. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Xen-devel] linux-next: Tree for Oct 24 (xen)
On 24.10.12 at 23:33, Randy Dunlap rdun...@xenotime.net wrote: On 10/23/2012 09:19 PM, Stephen Rothwell wrote: Hi all, Changes since 201201023: on x86_64: drivers/built-in.o: In function `dbgp_reset_prep': (.text+0xb96b5): undefined reference to `xen_dbgp_reset_prep' drivers/built-in.o: In function `dbgp_external_startup': (.text+0xb9d95): undefined reference to `xen_dbgp_external_startup' Full randconfig file is attached. So this is because with !USB_SUPPORT but EARLY_PRINTK_DBGP dbgp_reset_prep() and dbgp_external_startup() get pointlessly defined and exported. This got broken by the merge recommendation for the ARM side changes (originally compilation of drivers/xen/dbgp.c depended on just CONFIG_XEN_DOM0). From my pov, fixing the USB side would be the clean solution (i.e. putting those function definitions inside a CONFIG_USB_SUPPORT conditional). The alternative of a smaller change would be to extend the conditional around the respective xen_dbgp_...() declarations in include/linux/usb/ehci_def.h to become #if defined(CONFIG_XEN_DOM0) defined(CONFIG_USB_SUPPORT) Please advise towards your preference. Jan -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver
On Wed, 24 Oct 2012, Linus Walleij wrote: On Wed, Oct 24, 2012 at 4:45 PM, Lee Jones lee.jo...@linaro.org wrote: The clock framework has changed somewhat and it's now better to invoke clock_prepare_enable() and clk_disable_unprepare() rather than the legacy clk_enable() and clk_disable() calls. This patch converts the Nomadik Pin Control driver to the new framework. Signed-off-by: Lee Jones lee.jo...@linaro.org (...) - clk_enable(chip-clk); + clk_prepare_enable(chip-clk); (...) - clk_disable(chip-clk); + clk_disable_unprepare(chip-clk); (Repeated for each occurence.) Is this *really* causing a regression? I mean the driver begin like this in nmk_gpio_probe(): clk = devm_clk_get(dev-dev, NULL); if (IS_ERR(clk)) { ret = PTR_ERR(clk); goto out; } clk_prepare(clk); Then it leaves the clock prepared. So the clock is always prepared. You would only need to enable/disable it at times. And the semantics of the clk_enable/clk_disable call pair is such that it is fastpath and should be real quick, and that is exactly why we're using it repeatedly like that. Inserting clk_unprepare() effectively could make the whole driver a lot slower, so convince me on this one. ... I suspect the real bug (if there is one) must be in the clock implementation. This certainly doesn't fix the bug we spoke about. I believe Ulf is still working on that one. So do you want me to remove this patch? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL 00/12] perf/core improvements and fixes
* Arnaldo Carvalho de Melo a...@infradead.org wrote: Hi Ingo, Please consider pulling. I'll continue processing patchsets by Jiri, Namhyung, David, Irina and others tomorrow. I also have to rework the pagefaults patches, as the code it touches changed lately, will add that NUMA node info you suggested. - Arnaldo The following changes since commit ce37f400336a34bb6e72c4700f9dcc2a41ff7163: x86: Allow tracing of functions in arch/x86/kernel/rtc.c (2012-10-24 13:14:22 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to af3df2cf17f5df079189c3cc88870d28e219496b: perf tools: Try to build Documentation when installing (2012-10-24 19:30:48 -0200) perf/core improvements and fixes . Align the 'Ok'/'FAILED!' test results in 'perf test. . Support interrupted syscalls in 'trace' . Add an event duration column and filter in 'trace'. . There are references to the man pages in some tools, so try to build Documentation when installing, warning the user if that is not possible, from Borislav Petkov. . Give user better message if precise is not supported, from David Ahern. . Try to find cross-built objdump path by using the session environment information in the perf.data file header, from Irina Tirdea, original patch and idea by Namhyung Kim. . Diplays more output on features check for make V=1, so that one can figure out what is happening by looking at gcc output, etc. From Jiri Olsa. . Account the nr_entries in rblist properly, fix by Suzuki K. Poulose. Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com Arnaldo Carvalho de Melo (7): perf tools: Remove noise in python version feature test perf test: Align the 'Ok'/'FAILED!' test results perf trace: Support interrupted syscalls perf trace: Add an event duration column perf trace: Add duration filter perf tools: Pretty print errno for some more functions perf trace: Print the name of a syscall when failing to read its info Borislav Petkov (1): perf tools: Try to build Documentation when installing David Ahern (1): perf tools: Give user better message if precise is not supported Irina Tirdea (1): perf tools: Try to find cross-built objdump path Jiri Olsa (1): perf tools: Diplays more output on features check for make V=1 Suzuki K. Poulose (1): Account the nr_entries in rblist properly tools/perf/Documentation/Makefile | 31 +++- tools/perf/Documentation/perf-trace.txt |3 + tools/perf/Makefile | 53 --- tools/perf/arch/common.c| 178 ++ tools/perf/arch/common.h| 10 ++ tools/perf/builtin-annotate.c |7 + tools/perf/builtin-record.c |5 + tools/perf/builtin-report.c |7 + tools/perf/builtin-test.c | 18 ++- tools/perf/builtin-top.c|4 + tools/perf/builtin-trace.c | 250 --- tools/perf/config/feature-tests.mak |5 +- tools/perf/config/utilities.mak | 11 +- tools/perf/util/annotate.h |1 - tools/perf/util/parse-events.c |2 +- tools/perf/util/rblist.c|4 +- tools/perf/util/util.h |4 + 17 files changed, 535 insertions(+), 58 deletions(-) create mode 100644 tools/perf/arch/common.c create mode 100644 tools/perf/arch/common.h Pulled, thanks a lot Arnado! Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Xen-devel] [PATCH 4/5] xen: arm: implement remap interfaces needed for privcmd mappings.
On Thu, 2012-10-25 at 01:07 +0100, Mukesh Rathor wrote: On Wed, 24 Oct 2012 16:44:11 -0700 Mukesh Rathor mukesh.rat...@oracle.com wrote: #ifndef HYPERVISOR_VIRT_START diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index ad0dff5..5de2b36 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h @@ -188,6 +188,24 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); /*** REMOVED ***/ /*#define XENMEM_translate_gpfn_list 8*/ +#define XENMEM_add_to_physmap_range 23 +struct xen_add_to_physmap_range { +/* Which domain to change the mapping for. */ +domid_t domid; +uint16_t space; /* = enum phys_map_space */ + +/* Number of pages to go through */ +uint16_t size; +domid_t foreign_domid; /* IFF gmfn_foreign */ + +/* Indexes into space being mapped. */ +GUEST_HANDLE(xen_ulong_t) idxs; + +/* GPFN in domid where the source mapping page should appear. */ +GUEST_HANDLE(xen_pfn_t) gpfns; Looking at your arm implementation in xen, doesn't look like you are expecting idxs and gpfns to be contigous. In that case, shouldn't idxs and gpfns be pointers, ie, they are sent down as arrays? Or does GUEST_HANDLE do that, I can't seem to find where it's defined quickly. Never mind, I see it got corrected to XEN_GUEST_HANDLE in staging tree. The macro is called XEN_GUEST_HANDLE in Xen and just GUEST_HANDLE in Linux. Still doesn't compile tho: public/memory.h:246: error: expected specifier-qualifier-list before ‘__guest_handle_xen_ulong_t’ I'll figure it out. Looks like you've got it all sorted? Ian. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/5] vtime: Provide an irq safe version of vtime_account_system()
I've Cc:-ed the S390 folks - patch is quoted below. Thanks, Ingo * Frederic Weisbecker fweis...@gmail.com wrote: vtime_account_system() currently has only one caller with vtime_account() that is irq safe. Now we are going to call it from other places like kvm, so let's provide an irqsafe version. Signed-off-by: Frederic Weisbecker fweis...@gmail.com Cc: Peter Zijlstra pet...@infradead.org Cc: Ingo Molnar mi...@kernel.org Cc: Thomas Gleixner t...@linutronix.de Cc: Steven Rostedt rost...@goodmis.org Cc: Paul Gortmaker paul.gortma...@windriver.com --- arch/s390/kernel/vtime.c |4 include/linux/vtime.h|2 ++ kernel/sched/cputime.c |9 + 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 7903344..80d1dbc 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -140,6 +140,10 @@ void vtime_account(struct task_struct *tsk) } EXPORT_SYMBOL_GPL(vtime_account); +void vtime_account_system(struct task_struct *tsk) +__attribute__((alias(vtime_account))); +EXPORT_SYMBOL_GPL(vtime_account_system); + void __kprobes vtime_stop_cpu(void) { struct s390_idle_data *idle = __get_cpu_var(s390_idle); diff --git a/include/linux/vtime.h b/include/linux/vtime.h index 7199c24..57f290e 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h @@ -6,9 +6,11 @@ struct task_struct; #ifdef CONFIG_VIRT_CPU_ACCOUNTING extern void vtime_task_switch(struct task_struct *prev); extern void vtime_account_system(struct task_struct *tsk); +extern void vtime_account_system_irqsafe(struct task_struct *tsk); extern void vtime_account_idle(struct task_struct *tsk); #else static inline void vtime_task_switch(struct task_struct *prev) { } +static inline void vtime_account_system_irqsafe(struct task_struct *tsk) { } #endif #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) !defined(CONFIG_IRQ_TIME_ACCOUNTING) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 81b763b..3ccbea0 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -433,6 +433,15 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) *st = cputime.stime; } +void vtime_account_system_irqsafe(struct task_struct *tsk) +{ + unsigned long flags; + + local_irq_save(flags); + vtime_account_system(tsk); + local_irq_restore(flags); +} + /* * Archs that account the whole time spent in the idle task * (outside irq) as idle time can rely on this and just implement -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch
On 25/10/12 02:51, Frederic Weisbecker wrote: Switching to or from guest context is done on ioctl context. So by the time we call kvm_guest_enter() or kvm_guest_exit() we know we are not running the idle task. As a result, we can directly account the cputime using vtime_account_system_irqsafe(). There are two good reasons to do this: * We avoid some useless checks on guest switch. It optimizes a bit this fast path. * In the case of CONFIG_IRQ_TIME_ACCOUNTING, calling vtime_account() checks for irq time to account. This is pointless since we know we are not in an irq on guest switch. This is wasting cpu cycles for no good reason. vtime_account_system() OTOH is a no-op in this config option. * s390 doesn't disable irqs in its implementation of vtime_account(). If vtime_account() in kvm races with an irq, the pending time might be accounted twice. With vtime_account_system_irqsafe() we are protected. We disable irqs before we call kvm_guest_enter/exit, see kvm-s390.c: [...] if (!kvm_is_ucontrol(vcpu-kvm)) kvm_s390_deliver_pending_interrupts(vcpu); vcpu-arch.sie_block-icptcode = 0; local_irq_disable(); kvm_guest_enter(); local_irq_enable(); [...] -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v8 2/5] ipc: add sysctl to specify desired next object id
25.10.2012 01:41, Andrew Morton пишет: On Wed, 24 Oct 2012 19:35:09 +0400 Stanislav Kinsbursky skinsbur...@parallels.com wrote: This patch adds 3 new variables and sysctls to tune them (by one next_id variable for messages, semaphores and shared memory respectively). This variable can be used to set desired id for next allocated IPC object. By default it's equal to -1 and old behaviour is preserved. If this variable is non-negative, then desired idr will be extracted from it and used as a start value to search for free IDR slot. Notes: 1) this patch doesn't garantee, that new object will have desired id. So it's up to user space how to handle new object with wrong id. 2) After sucessfull id allocation attempt, next_id will be set back to -1 (if it was non-negative). --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -158,6 +158,7 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, static int zero; static int one = 1; +static int int_max = INT_MAX; static struct ctl_table ipc_kern_table[] = { { @@ -227,6 +228,33 @@ static struct ctl_table ipc_kern_table[] = { .extra1 = zero, .extra2 = one, }, + { + .procname = sem_next_id, + .data = init_ipc_ns.ids[IPC_SEM_IDS].next_id, + .maxlen = sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id), + .mode = 0644, + .proc_handler = proc_ipc_dointvec_minmax, + .extra1 = zero, + .extra2 = int_max, + }, + { + .procname = msg_next_id, + .data = init_ipc_ns.ids[IPC_MSG_IDS].next_id, + .maxlen = sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id), + .mode = 0644, + .proc_handler = proc_ipc_dointvec_minmax, + .extra1 = zero, + .extra2 = int_max, + }, + { + .procname = shm_next_id, + .data = init_ipc_ns.ids[IPC_SHM_IDS].next_id, + .maxlen = sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id), + .mode = 0644, + .proc_handler = proc_ipc_dointvec_minmax, + .extra1 = zero, + .extra2 = int_max, + }, {} }; ipc_kern_table[] is (badly) documented in Documentation/sysctl/kernel.txt. Can we at least mention these controls in there? Better, create a new way of properly documenting each control and document these three in that manner? Better still, document all the other ones as well ;) Yes, sure. I'll do my best. The patch adds these controls to CONFIG_CHECKPOINT_RESTORE=n kernels. Why is this? I'll fix this. -- Best regards, Stanislav Kinsbursky -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [tip:x86/urgent] x86, mm: Find_early_table_space based on ranges that are actually being mapped
* Yinghai Lu ying...@kernel.org wrote: On Wed, Oct 24, 2012 at 2:49 PM, tip-bot for Jacob Shin jacob.s...@amd.com wrote: Commit-ID: 844ab6f993b1d32eb40512503d35ff6ad0c57030 Gitweb: http://git.kernel.org/tip/844ab6f993b1d32eb40512503d35ff6ad0c57030 Author: Jacob Shin jacob.s...@amd.com AuthorDate: Wed, 24 Oct 2012 14:24:44 -0500 Committer: H. Peter Anvin h...@linux.intel.com CommitDate: Wed, 24 Oct 2012 13:37:04 -0700 x86, mm: Find_early_table_space based on ranges that are actually being mapped Current logic finds enough space for direct mapping page tables from 0 to end. Instead, we only need to find enough space to cover mr[0].start to mr[nr_range].end -- the range that is actually being mapped by init_memory_mapping() This is needed after 1e779aabe1f0768c2bf8f8c0a5583679b54a, to address the panic reported here: https://lkml.org/lkml/2012/10/20/160 https://lkml.org/lkml/2012/10/21/157 Signed-off-by: Jacob Shin jacob.s...@amd.com Link: http://lkml.kernel.org/r/20121024195311.GB11779@jshin-Toonie Tested-by: Tom Rini tr...@ti.com Signed-off-by: H. Peter Anvin h...@linux.intel.com --- arch/x86/mm/init.c | 70 ++- 1 files changed, 41 insertions(+), 29 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 8653b3a..bc287d6 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -29,36 +29,54 @@ int direct_gbpages #endif ; -static void __init find_early_table_space(unsigned long end, int use_pse, - int use_gbpages) +struct map_range { + unsigned long start; + unsigned long end; + unsigned page_size_mask; +}; + +/* + * First calculate space needed for kernel direct mapping page tables to cover + * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB + * pages. Then find enough contiguous space for those page tables. + */ +static void __init find_early_table_space(struct map_range *mr, int nr_range) { - unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; + int i; + unsigned long puds = 0, pmds = 0, ptes = 0, tables; + unsigned long start = 0, good_end; phys_addr_t base; - puds = (end + PUD_SIZE - 1) PUD_SHIFT; - tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); + for (i = 0; i nr_range; i++) { + unsigned long range, extra; - if (use_gbpages) { - unsigned long extra; + range = mr[i].end - mr[i].start; + puds += (range + PUD_SIZE - 1) PUD_SHIFT; - extra = end - ((endPUD_SHIFT) PUD_SHIFT); - pmds = (extra + PMD_SIZE - 1) PMD_SHIFT; - } else - pmds = (end + PMD_SIZE - 1) PMD_SHIFT; - - tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); + if (mr[i].page_size_mask (1 PG_LEVEL_1G)) { + extra = range - ((range PUD_SHIFT) PUD_SHIFT); + pmds += (extra + PMD_SIZE - 1) PMD_SHIFT; + } else { + pmds += (range + PMD_SIZE - 1) PMD_SHIFT; + } - if (use_pse) { - unsigned long extra; - - extra = end - ((endPMD_SHIFT) PMD_SHIFT); + if (mr[i].page_size_mask (1 PG_LEVEL_2M)) { + extra = range - ((range PMD_SHIFT) PMD_SHIFT); #ifdef CONFIG_X86_32 - extra += PMD_SIZE; + extra += PMD_SIZE; #endif - ptes = (extra + PAGE_SIZE - 1) PAGE_SHIFT; - } else - ptes = (end + PAGE_SIZE - 1) PAGE_SHIFT; + /* The first 2/4M doesn't use large pages. */ + if (mr[i].start PMD_SIZE) + extra += range; those three lines should be added back. it just get reverted in 7b16bbf9 Could you please send a delta patch against tip:x86/urgent? Thanks, Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:perf/core] perf tools: Diplays more output on features check for make V=1
Commit-ID: 28d213bac4649a1868fa78dab2d3b1ef09235171 Gitweb: http://git.kernel.org/tip/28d213bac4649a1868fa78dab2d3b1ef09235171 Author: Jiri Olsa jo...@redhat.com AuthorDate: Tue, 9 Oct 2012 17:50:01 +0200 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 14:20:10 -0200 perf tools: Diplays more output on features check for make V=1 Adding more verbose output for compile time features checking, to ease up debuging of feature detection failures. Suggested-by: Ingo Molnar mi...@kernel.org Signed-off-by: Jiri Olsa jo...@redhat.com Cc: Corey Ashford cjash...@linux.vnet.ibm.com Cc: Frederic Weisbecker fweis...@gmail.com Cc: Namhyung Kim namhy...@kernel.org Cc: Paul Mackerras pau...@samba.org Cc: Peter Zijlstra a.p.zijls...@chello.nl Link: http://lkml.kernel.org/n/tip-fbjha6xs5soyaiek8j414...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/Makefile | 46 +++--- tools/perf/config/utilities.mak | 11 +++- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index f530502..6790cb4 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -155,15 +155,15 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ -include config/feature-tests.mak -ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all),y) +ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) CFLAGS := $(CFLAGS) -fstack-protector-all endif -ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector),y) +ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y) CFLAGS := $(CFLAGS) -Wstack-protector endif -ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var),y) +ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y) CFLAGS := $(CFLAGS) -Wvolatile-register-var endif @@ -172,7 +172,7 @@ endif BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE BASIC_LDFLAGS = -ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS)),y) +ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) BIONIC := 1 EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) @@ -477,9 +477,9 @@ ifdef NO_LIBELF NO_LIBUNWIND := 1 else FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) +ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) - ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) + ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) LIBC_SUPPORT := 1 endif ifeq ($(BIONIC),1) @@ -494,7 +494,7 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) endif else FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) - ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) + ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev); NO_DWARF := 1 endif # Dwarf support @@ -510,7 +510,7 @@ ifdef LIBUNWIND_DIR endif FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) -ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND)),y) +ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] = 0.99); NO_LIBUNWIND := 1 endif # Libunwind support @@ -539,7 +539,7 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o else # NO_LIBELF BASIC_CFLAGS += -DLIBELF_SUPPORT -ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y) +ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON),-DLIBELF_MMAP),y) BASIC_CFLAGS += -DLIBELF_MMAP endif @@ -565,7 +565,7 @@ endif ifndef NO_LIBAUDIT FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit - ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT)),y) + ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); else BASIC_CFLAGS += -DLIBAUDIT_SUPPORT @@ -576,7 +576,7 @@ endif ifndef NO_NEWT FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt - ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y) + ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y)
Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch
2012/10/25 Christian Borntraeger borntrae...@de.ibm.com: On 25/10/12 02:51, Frederic Weisbecker wrote: Switching to or from guest context is done on ioctl context. So by the time we call kvm_guest_enter() or kvm_guest_exit() we know we are not running the idle task. As a result, we can directly account the cputime using vtime_account_system_irqsafe(). There are two good reasons to do this: * We avoid some useless checks on guest switch. It optimizes a bit this fast path. * In the case of CONFIG_IRQ_TIME_ACCOUNTING, calling vtime_account() checks for irq time to account. This is pointless since we know we are not in an irq on guest switch. This is wasting cpu cycles for no good reason. vtime_account_system() OTOH is a no-op in this config option. * s390 doesn't disable irqs in its implementation of vtime_account(). If vtime_account() in kvm races with an irq, the pending time might be accounted twice. With vtime_account_system_irqsafe() we are protected. We disable irqs before we call kvm_guest_enter/exit, see kvm-s390.c: [...] if (!kvm_is_ucontrol(vcpu-kvm)) kvm_s390_deliver_pending_interrupts(vcpu); vcpu-arch.sie_block-icptcode = 0; local_irq_disable(); kvm_guest_enter(); local_irq_enable(); [...] Ah ok. Hmm I still need to keep it irqsafe for the other archs though, as it is currently with vtime_account(). So perhaps I can remove your local_irq_disable there and use vtime_account_system_irqsafe() instead? thanks. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org 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] input: gpio-keys: Add runtime support
On Fri, 12 Oct 2012, Linus Walleij wrote: On Thu, Oct 11, 2012 at 4:22 PM, Shubhrajyoti Datta omaplinuxker...@gmail.com wrote: @@ -526,6 +527,7 @@ static int gpio_keys_open(struct input_dev *input) { struct gpio_keys_drvdata *ddata = input_get_drvdata(input); + pm_runtime_get_sync(input-dev.parent); I am not an expert of the runtime. However would be grateful if you explain me what it actually do. This increase the reference count of the runtime status container for the device. _sync makes sure it happens now. Consult: Documentation/power/runtime_pm.txt Also I did not see any runtime suspend/ resume handlers populated. It is not necessary to handle the power state at the driver level, it can just as well be handled by the voltage/power domain, or at the class, type or bus level. But the individual driver has to notify the system upward if it needs to be powered on or when it may or must be relaxed. Yours, Linus Walleij Friendly poke. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver
On 10/25/2012 09:31 AM, Lee Jones wrote: This certainly doesn't fix the bug we spoke about. I believe Ulf is still working on that one. So do you want me to remove this patch? Yeah drop it for now. Yours, Linus Walleij -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC][PATCH 0/5] tools, perf: Fix up for x86 UAPI disintegration
Borislav Petkov b...@alien8.de wrote: David, where can get that x86 UAPI disintegration patch? The tip tree has it in branch x86/uapi or you can get it from: git://git.infradead.org/users/dhowells/linux-headers.git branch disintegrate-x86 or tag disintegrate-x86-20121009. I've posted a couple of additional patches to deal with files that became empty, but they're only for dealing with people who construct their kernel sources with the patch program. David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: arch/x86/Kconfig: not select X86_MPPARSE when SFI is present
* Bin Gao bin@linux.intel.com wrote: MPS tables are not needed for systems that have proper ACPI support. This is also true for systems that have SFI in place. So this patch is to exclude X86_MPPARSE when either ACPI or SFI is present. Signed-off-by: Bin Gao bin@intel.com --- arch/x86/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 46c3bff..b1494bd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -310,7 +310,7 @@ config X86_X2APIC If you don't know what to do here, say N. config X86_MPPARSE - bool Enable MPS table if ACPI + bool Enable MPS table if ACPI || SFI default y depends on X86_LOCAL_APIC ---help--- The changelog does not seem to match the patch. Did you want to say: So this patch allows the configuration (turning off) of CONFIG_X86_MPPARSE when either ACPI or SFI is present. ? Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: fixes for 3.7-rc3
Arnd, Olof, This is the first Atmel AT91 fixes update for the 3.7 kernel. The following changes since commit 6f0c0580b70c89094b3422ba81118c7b959c7556: Linux 3.7-rc2 (2012-10-20 12:11:32 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 08d04a135a1c2e24c4d4bc7bbafee5e0e58f80c6: ARM: at91: drop duplicated config SOC_AT91SAM9 entry (2012-10-24 18:08:48 +0200) A mix of typos and critical fixes. The most important ones are a duplicated definition of a Kconfig variable and the handling of external interrupts for non-DT case. The new at91sam9g10 was suffering a recognition issue due to an ID mis-interpreted: this was leading to a kernel panic. Bo Shen (2): ARM: at91/i2c: change id to let i2c-gpio work ARM: at91/i2c: change id to let i2c-at91 work Ivan Shugov (1): ARM: at91: at91sam9g10: fix SOC type detection Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: drop duplicated config SOC_AT91SAM9 entry Josh Wu (1): ARM: at91/tc: fix typo in the DT document Marek Belisko (1): ARM: at91/dts: at91sam9g20ek_common: Fix typos in buttons labels. Nicolas Ferre (2): ARM: at91: fix external interrupts in non-DT case ARM: at91: fix external interrupt specification in board code Documentation/devicetree/bindings/arm/atmel-at91.txt | 2 +- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 ++-- arch/arm/mach-at91/Kconfig | 10 ++ arch/arm/mach-at91/at91rm9200.c | 2 +- arch/arm/mach-at91/at91rm9200_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9260.c | 4 ++-- arch/arm/mach-at91/at91sam9260_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9261.c | 4 ++-- arch/arm/mach-at91/at91sam9261_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9rl_devices.c | 4 ++-- arch/arm/mach-at91/board-neocore926.c| 2 +- arch/arm/mach-at91/board-sam9261ek.c | 2 +- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/generic.h | 3 ++- arch/arm/mach-at91/irq.c | 9 +++-- arch/arm/mach-at91/setup.c | 4 ++-- 18 files changed, 35 insertions(+), 35 deletions(-) Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch
On 25/10/12 09:56, Frederic Weisbecker wrote: [...] * s390 doesn't disable irqs in its implementation of vtime_account(). If vtime_account() in kvm races with an irq, the pending time might be accounted twice. With vtime_account_system_irqsafe() we are protected. We disable irqs before we call kvm_guest_enter/exit, see kvm-s390.c: [...] if (!kvm_is_ucontrol(vcpu-kvm)) kvm_s390_deliver_pending_interrupts(vcpu); vcpu-arch.sie_block-icptcode = 0; local_irq_disable(); kvm_guest_enter(); local_irq_enable(); [...] Ah ok. Hmm I still need to keep it irqsafe for the other archs though, as it is currently with vtime_account(). So perhaps I can remove your local_irq_disable there and use vtime_account_system_irqsafe() instead? Yes. We added the local_irq_disable code just for the vtime accounting. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:perf/core] Account the nr_entries in rblist properly
Commit-ID: 03f2f93ae00762eb881424df1c688d034fd341ee Gitweb: http://git.kernel.org/tip/03f2f93ae00762eb881424df1c688d034fd341ee Author: Suzuki K. Poulose suz...@in.ibm.com AuthorDate: Fri, 31 Aug 2012 12:39:18 +0530 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 14:20:11 -0200 Account the nr_entries in rblist properly The nr_entries in rblist is never decremented when an element is deleted. Also, use rblist__remove_node to delete a node in rblist__delete(). This would keep the nr_entries sane. Signed-off-by: Suzuki K. Poulose suz...@in.ibm.com Acked-by: David S. Ahern dsah...@gmail.com Cc: David S. Ahern dsah...@gmail.com Link: http://lkml.kernel.org/r/20120831070834.14806.87398.st...@suzukikp.in.ibm.com Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/util/rblist.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/rblist.c b/tools/perf/util/rblist.c index 0171fb6..a16cdd2 100644 --- a/tools/perf/util/rblist.c +++ b/tools/perf/util/rblist.c @@ -44,6 +44,7 @@ int rblist__add_node(struct rblist *rblist, const void *new_entry) void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node) { rb_erase(rb_node, rblist-entries); + --rblist-nr_entries; rblist-node_delete(rblist, rb_node); } @@ -87,8 +88,7 @@ void rblist__delete(struct rblist *rblist) while (next) { pos = next; next = rb_next(pos); - rb_erase(pos, rblist-entries); - rblist-node_delete(rblist, pos); + rblist__remove_node(rblist, pos); } free(rblist); } -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:perf/core] perf tools: Try to find cross-built objdump path
Commit-ID: 68e94f4eb56d92ccb617a98fcac5e575702ec4fd Gitweb: http://git.kernel.org/tip/68e94f4eb56d92ccb617a98fcac5e575702ec4fd Author: Irina Tirdea irina.tir...@intel.com AuthorDate: Tue, 16 Oct 2012 02:33:38 +0300 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 14:20:11 -0200 perf tools: Try to find cross-built objdump path As we have architecture information of saved perf.data file, we can try to find cross-built objdump path. The triplets include support for Android (arm, x86 and mips architectures). Signed-off-by: Irina Tirdea irina.tir...@intel.com Originally-by: Namhyung Kim namhy...@kernel.org Acked-by: Namhyung Kim namhy...@kernel.org Cc: David Ahern dsah...@gmail.com Cc: Ingo Molnar mi...@kernel.org Cc: Jiri Olsa jo...@redhat.com Cc: Namhyung Kim namhyung@lge.com Cc: Paul Mackerras pau...@samba.org Cc: Pekka Enberg penb...@kernel.org Cc: Peter Zijlstra a.p.zijls...@chello.nl Cc: Steven Rostedt rost...@goodmis.org Link: http://lkml.kernel.org/r/1350344020-8071-5-git-send-email-irina.tir...@gmail.com Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/Makefile |2 + tools/perf/arch/common.c | 178 + tools/perf/arch/common.h | 10 +++ tools/perf/builtin-annotate.c |7 ++ tools/perf/builtin-report.c |7 ++ tools/perf/util/annotate.h|1 - 6 files changed, 204 insertions(+), 1 deletions(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 6790cb4..78a81ed 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -426,6 +426,8 @@ LIB_OBJS += $(OUTPUT)ui/helpline.o LIB_OBJS += $(OUTPUT)ui/hist.o LIB_OBJS += $(OUTPUT)ui/stdio/hist.o +LIB_OBJS += $(OUTPUT)arch/common.o + BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o # Benchmark modules diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c new file mode 100644 index 000..2367b25 --- /dev/null +++ b/tools/perf/arch/common.c @@ -0,0 +1,178 @@ +#include stdio.h +#include sys/utsname.h +#include common.h +#include ../util/debug.h + +const char *const arm_triplets[] = { + arm-eabi-, + arm-linux-androideabi-, + arm-unknown-linux-, + arm-unknown-linux-gnu-, + arm-unknown-linux-gnueabi-, + NULL +}; + +const char *const powerpc_triplets[] = { + powerpc-unknown-linux-gnu-, + powerpc64-unknown-linux-gnu-, + NULL +}; + +const char *const s390_triplets[] = { + s390-ibm-linux-, + NULL +}; + +const char *const sh_triplets[] = { + sh-unknown-linux-gnu-, + sh64-unknown-linux-gnu-, + NULL +}; + +const char *const sparc_triplets[] = { + sparc-unknown-linux-gnu-, + sparc64-unknown-linux-gnu-, + NULL +}; + +const char *const x86_triplets[] = { + x86_64-pc-linux-gnu-, + x86_64-unknown-linux-gnu-, + i686-pc-linux-gnu-, + i586-pc-linux-gnu-, + i486-pc-linux-gnu-, + i386-pc-linux-gnu-, + i686-linux-android-, + i686-android-linux-, + NULL +}; + +const char *const mips_triplets[] = { + mips-unknown-linux-gnu-, + mipsel-linux-android-, + NULL +}; + +static bool lookup_path(char *name) +{ + bool found = false; + char *path, *tmp; + char buf[PATH_MAX]; + char *env = getenv(PATH); + + if (!env) + return false; + + env = strdup(env); + if (!env) + return false; + + path = strtok_r(env, :, tmp); + while (path) { + scnprintf(buf, sizeof(buf), %s/%s, path, name); + if (access(buf, F_OK) == 0) { + found = true; + break; + } + path = strtok_r(NULL, :, tmp); + } + free(env); + return found; +} + +static int lookup_triplets(const char *const *triplets, const char *name) +{ + int i; + char buf[PATH_MAX]; + + for (i = 0; triplets[i] != NULL; i++) { + scnprintf(buf, sizeof(buf), %s%s, triplets[i], name); + if (lookup_path(buf)) + return i; + } + return -1; +} + +static int perf_session_env__lookup_binutils_path(struct perf_session_env *env, + const char *name, + const char **path) +{ + int idx; + char *arch, *cross_env; + struct utsname uts; + const char *const *path_list; + char *buf = NULL; + + if (uname(uts) 0) + goto out; + + /* +* We don't need to try to find objdump path for native system. +* Just use default binutils path (e.g.: objdump). +*/ + if (!strcmp(uts.machine, env-arch)) + goto out; + + cross_env = getenv(CROSS_COMPILE); + if (cross_env) { + if (asprintf(buf, %s%s, cross_env, name) 0) +
Re: [PATCH 2/2] input: gpio-keys: Add runtime support
On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones lee.jo...@linaro.org wrote: On Fri, 12 Oct 2012, Linus Walleij wrote: Yours, Linus Walleij Friendly poke. This makes it look like you're poking me as I'm in the To: field but I suspect the intent must be to poke Dmitry ... I was just providing background for Shubhrajyoti's question. Maybe this helps: Reviewed-by: Linus Walleij linus.wall...@linaro.org Yours, Linus Walleij -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:perf/core] perf test: Align the 'Ok'/'FAILED!' test results
Commit-ID: 9a8e85ad0b61ec0720df7d24392163c2a12626d0 Gitweb: http://git.kernel.org/tip/9a8e85ad0b61ec0720df7d24392163c2a12626d0 Author: Arnaldo Carvalho de Melo a...@redhat.com AuthorDate: Wed, 24 Oct 2012 15:44:41 -0200 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 15:44:41 -0200 perf test: Align the 'Ok'/'FAILED!' test results And also print 'FAILED!' in red. Suggested-by: Ingo Molnar mi...@kernel.org Cc: David Ahern dsah...@gmail.com Cc: Frederic Weisbecker fweis...@gmail.com Cc: Jiri Olsa jo...@redhat.com Cc: Mike Galbraith efa...@gmx.de Cc: Namhyung Kim namhy...@gmail.com Cc: Paul Mackerras pau...@samba.org Cc: Peter Zijlstra pet...@infradead.org Cc: Stephane Eranian eran...@google.com Link: http://lkml.kernel.org/n/tip-rkisq85w24il3e2yl3nzu...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/builtin-test.c | 18 -- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index e2d9872d..a04276e 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c @@ -6,6 +6,7 @@ #include builtin.h #include util/cache.h +#include util/color.h #include util/debug.h #include util/debugfs.h #include util/evlist.h @@ -1485,18 +1486,31 @@ static bool perf_test__matches(int curr, int argc, const char *argv[]) static int __cmd_test(int argc, const char *argv[]) { int i = 0; + int width = 0; while (tests[i].func) { + int len = strlen(tests[i].desc); + + if (width len) + width = len; + ++i; + } + + i = 0; + while (tests[i].func) { int curr = i++, err; if (!perf_test__matches(curr, argc, argv)) continue; - pr_info(%2d: %s:, i, tests[curr].desc); + pr_info(%2d: %-*s:, i, width, tests[curr].desc); pr_debug(\n--- start ---\n); err = tests[curr].func(); pr_debug( end \n%s:, tests[curr].desc); - pr_info( %s\n, err ? FAILED!\n : Ok); + if (err) + color_fprintf(stderr, PERF_COLOR_RED, FAILED!\n); + else + pr_info( Ok\n); } return 0; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] RFC: leds-pwm: don't disable pwm when setting brightness to 0
On Wed, Oct 24, 2012 at 03:52:46PM +0200, Uwe Kleine-König wrote: This fixes disabling the LED on i.MX28. The PWM hardware delays using the newly set pwm-config until the beginning of a new period. It's very likely that pwm_disable is called before the current period ends. In case the LED was on brightness=max before the LED stays on because in the disabled PWM block the period never ends. It's unclear if the mxs-pwm driver doesn't implement the API as expected (i.e. it should block until the newly set config is effective) or if the leds-pwm driver makes wrong assumptions. This patch assumes the latter. Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de --- Hello, I'm not sure this is correct, but this is the workaround I'm using until I get some feed back. I'm fine with it, since it fixes a real problem. Let's see what Thierry says. Shawn Best regards Uwe drivers/leds/leds-pwm.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index f2e44c7..a909f4f 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -38,13 +38,8 @@ static void led_pwm_set(struct led_classdev *led_cdev, unsigned int max = led_dat-cdev.max_brightness; unsigned int period = led_dat-period; - if (brightness == 0) { - pwm_config(led_dat-pwm, 0, period); - pwm_disable(led_dat-pwm); - } else { - pwm_config(led_dat-pwm, brightness * period / max, period); - pwm_enable(led_dat-pwm); - } + pwm_config(led_dat-pwm, brightness * period / max, period); + pwm_enable(led_dat-pwm); } static int led_pwm_probe(struct platform_device *pdev) -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:perf/core] perf trace: Support interrupted syscalls
Commit-ID: 752fde44fd1c4a411d709c7d4ad0f121f427f234 Gitweb: http://git.kernel.org/tip/752fde44fd1c4a411d709c7d4ad0f121f427f234 Author: Arnaldo Carvalho de Melo a...@redhat.com AuthorDate: Sat, 6 Oct 2012 18:43:19 -0300 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 17:23:03 -0200 perf trace: Support interrupted syscalls Using the same strategies as in the tmp.perf/trace2, i.e. the 'trace' tool implemented by tglx, just updated to the current codebase. Example: [root@sandy linux]# perf trace usleep 1 | tail 2.003: mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0 ) = -2128396288 2.017: mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0 ) = -2128400384 2.029: arch_prctl(option: 4098, arg2: 140146949441280, arg3: 140146949435392, arg4: 34, arg5: 4294967295) = 0 2.084: mprotect(start: 208741634048, len: 16384, prot: 1 ) = 0 2.098: mprotect(start: 208735956992, len: 4096, prot: 1 ) = 0 2.122: munmap(addr: 140146949447680, len: 91882 ) = 0 2.359: brk(brk: 0 ) = 28987392 2.371: brk(brk: 29122560 ) = 29122560 2.490: nanosleep(rqtp: 140735694241504, rmtp: 0 ) = 0 2.507: exit_group(error_code: 0 [root@sandy linux]# For now the timestamp and duration are always on, will be selectable. Also if multiple threads are being monitored, its tid will appear. The ret output continues to be interpreted a la strace. Cc: David Ahern dsah...@gmail.com Cc: Frederic Weisbecker fweis...@gmail.com Cc: Jiri Olsa jo...@redhat.com Cc: Mike Galbraith efa...@gmx.de Cc: Namhyung Kim namhy...@gmail.com Cc: Paul Mackerras pau...@samba.org Cc: Peter Zijlstra pet...@infradead.org Cc: Stephane Eranian eran...@google.com Link: http://lkml.kernel.org/n/tip-ly9ulroru4my5isn0xe9g...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/builtin-trace.c | 199 +++- tools/perf/util/util.h |4 + 2 files changed, 181 insertions(+), 22 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 14b3229..873f50b 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1,5 +1,8 @@ #include builtin.h +#include util/color.h #include util/evlist.h +#include util/machine.h +#include util/thread.h #include util/parse-options.h #include util/thread_map.h #include event-parse.h @@ -43,6 +46,36 @@ struct syscall { struct syscall_fmt *fmt; }; +struct thread_trace { + u64 entry_time; + u64 exit_time; + bool entry_pending; + char *entry_str; +}; + +static struct thread_trace *thread_trace__new(void) +{ + return zalloc(sizeof(struct thread_trace)); +} + +static struct thread_trace *thread__trace(struct thread *thread) +{ + if (thread == NULL) + goto fail; + + if (thread-priv == NULL) + thread-priv = thread_trace__new(); + + if (thread-priv == NULL) + goto fail; + + return thread-priv; +fail: + color_fprintf(stdout, PERF_COLOR_RED, + WARNING: not enough memory, dropping samples!\n); + return NULL; +} + struct trace { int audit_machine; struct { @@ -50,8 +83,18 @@ struct trace { struct syscall *table; } syscalls; struct perf_record_opts opts; + struct machine host; + u64 base_time; + boolmultiple_threads; }; +static size_t trace__fprintf_tstamp(struct trace *trace, u64 tstamp, FILE *fp) +{ + double ts = (double)(tstamp - trace-base_time) / NSEC_PER_MSEC; + + return fprintf(fp, %10.3f: , ts); +} + static bool done = false; static void sig_handler(int sig __maybe_unused) @@ -59,6 +102,67 @@ static void sig_handler(int sig __maybe_unused) done = true; } +static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, + u64 tstamp, FILE *fp) +{ + size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); + + if (trace-multiple_threads) + printed += fprintf(fp, %d , thread-pid); + + return printed; +} + +static int trace__process_event(struct machine *machine, union perf_event *event) +{ + int ret = 0; + + switch (event-header.type) { + case PERF_RECORD_LOST: + color_fprintf(stdout, PERF_COLOR_RED, + LOST % PRIu64 events!\n, event-lost.lost); + ret = machine__process_lost_event(machine, event); + default: + ret = machine__process_event(machine,
[tip:perf/core] perf trace: Add an event duration column
Commit-ID: 60c907abc635622964f7862c8f2977182124f89d Gitweb: http://git.kernel.org/tip/60c907abc635622964f7862c8f2977182124f89d Author: Arnaldo Carvalho de Melo a...@redhat.com AuthorDate: Wed, 24 Oct 2012 17:24:47 -0200 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 17:24:47 -0200 perf trace: Add an event duration column # perf trace usleep 1 | tail -10 0.453 ( 0.002 ms): mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0 ) = -763342848 0.456 ( 0.001 ms): mmap(addr: 0, len: 4096, prot: 3, flags: 34, fd: 4294967295, off: 0 ) = -763346944 0.459 ( 0.001 ms): arch_prctl(option: 4098, arg2: 140126839658240, arg3: 140126839652352, arg4: 34, arg5: 4294967295) = 0 0.473 ( 0.003 ms): mprotect(start: 208741634048, len: 16384, prot: 1 ) = 0 0.477 ( 0.003 ms): mprotect(start: 208735956992, len: 4096, prot: 1 ) = 0 0.483 ( 0.004 ms): munmap(addr: 140126839664640, len: 91882 ) = 0 0.540 ( 0.001 ms): brk(brk: 0 ) = 31928320 0.542 ( 0.002 ms): brk(brk: 32063488 ) = 32063488 1.456 ( 0.901 ms): nanosleep(rqtp: 140735472817168, rmtp: 0 ) = 0 1.462 ( 0.000 ms): exit_group(error_code: 0 # This also comes from the tmp.perf/trace2 branch. Cc: David Ahern dsah...@gmail.com Cc: Frederic Weisbecker fweis...@gmail.com Cc: Jiri Olsa jo...@redhat.com Cc: Mike Galbraith efa...@gmx.de Cc: Namhyung Kim namhy...@gmail.com Cc: Paul Mackerras pau...@samba.org Cc: Peter Zijlstra pet...@infradead.org Cc: Stephane Eranian eran...@google.com Cc: Thomas Gleixner t...@linutronix.de Link: http://lkml.kernel.org/n/tip-g9akh5hjw2kvjerpo9xro...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/builtin-trace.c | 27 +++ 1 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 873f50b..ddb6e37 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -46,6 +46,20 @@ struct syscall { struct syscall_fmt *fmt; }; +static size_t fprintf_duration(unsigned long t, FILE *fp) +{ + double duration = (double)t / NSEC_PER_MSEC; + size_t printed = fprintf(fp, (); + + if (duration = 1.0) + printed += color_fprintf(fp, PERF_COLOR_RED, %6.3f ms, duration); + else if (duration = 0.01) + printed += color_fprintf(fp, PERF_COLOR_YELLOW, %6.3f ms, duration); + else + printed += color_fprintf(fp, PERF_COLOR_NORMAL, %6.3f ms, duration); + return printed + fprintf(stdout, ): ); +} + struct thread_trace { u64 entry_time; u64 exit_time; @@ -92,7 +106,7 @@ static size_t trace__fprintf_tstamp(struct trace *trace, u64 tstamp, FILE *fp) { double ts = (double)(tstamp - trace-base_time) / NSEC_PER_MSEC; - return fprintf(fp, %10.3f: , ts); + return fprintf(fp, %10.3f , ts); } static bool done = false; @@ -103,9 +117,10 @@ static void sig_handler(int sig __maybe_unused) } static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, - u64 tstamp, FILE *fp) + u64 duration, u64 tstamp, FILE *fp) { size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); + printed += fprintf_duration(duration, fp); if (trace-multiple_threads) printed += fprintf(fp, %d , thread-pid); @@ -292,7 +307,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, printed += syscall__scnprintf_args(sc, msg + printed, 1024 - printed, args); if (!strcmp(sc-name, exit_group) || !strcmp(sc-name, exit)) { - trace__fprintf_entry_head(trace, thread, sample-time, stdout); + trace__fprintf_entry_head(trace, thread, 1, sample-time, stdout); printf(%-70s\n, ttrace-entry_str); } else ttrace-entry_pending = true; @@ -304,6 +319,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, struct perf_sample *sample) { int ret; + u64 duration = 0; struct thread *thread = machine__findnew_thread(trace-host, sample-tid); struct thread_trace *ttrace = thread__trace(thread); struct syscall *sc = trace__syscall_info(trace, evsel, sample); @@ -317,7 +333,10 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, ttrace-exit_time = sample-time; - trace__fprintf_entry_head(trace, thread, sample-time, stdout); + if (ttrace-entry_time) + duration = sample-time - ttrace-entry_time; + +
[tip:perf/core] perf trace: Add duration filter
Commit-ID: ae9ed03579c9745e85a88e80522770df7ae5c9b7 Gitweb: http://git.kernel.org/tip/ae9ed03579c9745e85a88e80522770df7ae5c9b7 Author: Arnaldo Carvalho de Melo a...@redhat.com AuthorDate: Mon, 8 Oct 2012 09:56:00 -0300 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 18:41:04 -0200 perf trace: Add duration filter Example: [acme@sandy linux]$ perf trace --duration 0.025 usleep 1 2.221 ( 0.958 ms): 6724 execve(arg0: 140733557168278, arg1: 140733557178768, arg2: 16134304, arg3: 140733557167840, arg4: 7955998171588342573, arg5: 6723) = -2 3.690 ( 1.443 ms): 6724 execve(arg0: 140733557168295, arg1: 140733557178768, arg2: 16134304, arg3: 140733557167840, arg4: 7955998171588342573, arg5: 6723) = 0 3.979 ( 0.048 ms): 6724 open(filename: 208733843841, flags: 0, mode: 1 ) = 3 4.071 ( 0.075 ms): 6724 open(filename: 139744419925673, flags: 0, mode: 0 ) = 3 4.318 ( 0.056 ms): 6724 nanosleep(rqtp: 140734030404608, rmtp: 0 ) = 0 [acme@sandy linux]$ perf trace --duration 0.100 usleep 1 1.143 ( 1.021 ms): 6726 execve(arg0: 140736323962279, arg1: 140736323972752, arg2: 34926752, arg3: 140736323961824, arg4: 7955998171588342573, arg5: 6725) = 0 [acme@sandy linux]$ Cherry picked from tmp.perf/trace2 branch. Cc: David Ahern dsah...@gmail.com Cc: Frederic Weisbecker fweis...@gmail.com Cc: Jiri Olsa jo...@redhat.com Cc: Mike Galbraith efa...@gmx.de Cc: Namhyung Kim namhy...@gmail.com Cc: Paul Mackerras pau...@samba.org Cc: Peter Zijlstra pet...@infradead.org Cc: Stephane Eranian eran...@google.com Cc: Thomas Gleixner t...@linutronix.de Link: http://lkml.kernel.org/n/tip-oslw2j2958we9qf0ctra4...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/Documentation/perf-trace.txt |3 ++ tools/perf/builtin-trace.c | 32 +++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt index 3a2ae37..38d4b68 100644 --- a/tools/perf/Documentation/perf-trace.txt +++ b/tools/perf/Documentation/perf-trace.txt @@ -48,6 +48,9 @@ comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0- In per-thread mode with inheritance mode on (default), Events are captured only when the thread executes on the designated CPUs. Default is to monitor all CPUs. +--duration: + Show only events that had a duration greater than N.M ms. + SEE ALSO linkperf:perf-record[1], linkperf:perf-script[1] diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index ddb6e37..82ffa6c 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -100,8 +100,14 @@ struct trace { struct machine host; u64 base_time; boolmultiple_threads; + double duration_filter; }; +static bool trace__filter_duration(struct trace *trace, double t) +{ + return t (trace-duration_filter * NSEC_PER_MSEC); +} + static size_t trace__fprintf_tstamp(struct trace *trace, u64 tstamp, FILE *fp) { double ts = (double)(tstamp - trace-base_time) / NSEC_PER_MSEC; @@ -307,8 +313,10 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, printed += syscall__scnprintf_args(sc, msg + printed, 1024 - printed, args); if (!strcmp(sc-name, exit_group) || !strcmp(sc-name, exit)) { - trace__fprintf_entry_head(trace, thread, 1, sample-time, stdout); - printf(%-70s\n, ttrace-entry_str); + if (!trace-duration_filter) { + trace__fprintf_entry_head(trace, thread, 1, sample-time, stdout); + printf(%-70s\n, ttrace-entry_str); + } } else ttrace-entry_pending = true; @@ -333,8 +341,12 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, ttrace-exit_time = sample-time; - if (ttrace-entry_time) + if (ttrace-entry_time) { duration = sample-time - ttrace-entry_time; + if (trace__filter_duration(trace, duration)) + goto out; + } else if (trace-duration_filter) + goto out; trace__fprintf_entry_head(trace, thread, duration, sample-time, stdout); @@ -358,7 +370,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, printf() = %d, ret); putchar('\n'); - +out: ttrace-entry_pending = false; return 0; @@ -495,6 +507,15 @@ out: return err; } +static int trace__set_duration(const struct option *opt, const char *str, + int unset __maybe_unused) +{ + struct trace *trace = opt-value; + + trace-duration_filter = atof(str);
[tip:perf/core] perf tools: Try to build Documentation when installing
Commit-ID: af3df2cf17f5df079189c3cc88870d28e219496b Gitweb: http://git.kernel.org/tip/af3df2cf17f5df079189c3cc88870d28e219496b Author: Borislav Petkov borislav.pet...@amd.com AuthorDate: Fri, 28 Sep 2012 19:47:07 +0200 Committer: Arnaldo Carvalho de Melo a...@redhat.com CommitDate: Wed, 24 Oct 2012 19:30:48 -0200 perf tools: Try to build Documentation when installing There's a portion in the perf list output refering to the exact specification of raw hardware events. Since this description is in the perf-list manpage, try to build and install the man pages, warning the user when that is not possible due to missing packages (xmlto and asciidoc). Signed-off-by: Borislav Petkov borislav.pet...@amd.com Tested-by: Arnaldo Carvalho de Melo a...@redhat.com Cc: Namhyung Kim namhy...@kernel.org Link: http://lkml.kernel.org/n/tip-ij71ysszkdvz3fy3wr331...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com --- tools/perf/Documentation/Makefile | 31 +-- tools/perf/Makefile |5 - tools/perf/util/parse-events.c|2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile index 9f2e44f..ef6d22e 100644 --- a/tools/perf/Documentation/Makefile +++ b/tools/perf/Documentation/Makefile @@ -1,3 +1,5 @@ +include ../config/utilities.mak + OUTPUT := ./ ifeq ($(origin O), command line) ifneq ($(O),) @@ -64,6 +66,7 @@ MAKEINFO=makeinfo INSTALL_INFO=install-info DOCBOOK2X_TEXI=docbook2x-texi DBLATEX=dblatex +XMLTO=xmlto ifndef PERL_PATH PERL_PATH = /usr/bin/perl endif @@ -71,6 +74,16 @@ endif -include ../config.mak.autogen -include ../config.mak +_tmp_tool_path := $(call get-executable,$(ASCIIDOC)) +ifeq ($(_tmp_tool_path),) + missing_tools = $(ASCIIDOC) +endif + +_tmp_tool_path := $(call get-executable,$(XMLTO)) +ifeq ($(_tmp_tool_path),) + missing_tools += $(XMLTO) +endif + # # For asciidoc ... # -7.1.2, no extra settings are needed. @@ -170,7 +183,12 @@ pdf: $(OUTPUT)user-manual.pdf install: install-man -install-man: man +check-man-tools: +ifdef missing_tools + $(error You need to install $(missing_tools) for man pages) +endif + +do-install-man: man $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) @@ -178,6 +196,15 @@ install-man: man # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) +install-man: check-man-tools man + +try-install-man: +ifdef missing_tools + $(warning Please install $(missing_tools) to have the man pages installed) +else + $(MAKE) do-install-man +endif + install-info: info $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir) @@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml $(QUIET_XMLTO)$(RM) $@ \ - xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $ + $(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $ $(OUTPUT)%.xml : %.txt $(QUIET_ASCIIDOC)$(RM) $@+ $@ \ diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 78a81ed..b14eeb8 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -1041,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir) endif perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir)) -install: all +install: all try-install-man $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' @@ -1067,6 +1067,9 @@ install-doc: install-man: $(MAKE) -C Documentation install-man +try-install-man: + $(MAKE) -C Documentation try-install-man + install-html: $(MAKE) -C Documentation install-html diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 2fe1587..3a3efcf 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1081,7 +1081,7 @@ void print_events(const char *event_glob, bool name_only) printf( %-50s [%s]\n, cpu/t1=v1[,t2=v2,t3 ...]/modifier, event_type_descriptors[PERF_TYPE_RAW]); - printf( (see 'perf list --help' on how to encode it)\n); + printf( (see 'man perf-list' on how to encode it)\n); printf(\n); printf( %-50s [%s]\n, -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: android: binder: Fixed multi-line strings
Changed all user visible multi-line strings to single line. Removed 'binder:' prefix on stings. Signed-off-by: Anmol Sarma unmole...@gmail.com --- drivers/staging/android/binder.c | 358 +++--- 1 file changed, 143 insertions(+), 215 deletions(-) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 7b0ba92..32f9175 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -15,6 +15,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME : fmt + #include asm/cacheflush.h #include linux/fdtable.h #include linux/file.h @@ -420,12 +422,12 @@ static void binder_set_nice(long nice) } min_nice = 20 - current-signal-rlim[RLIMIT_NICE].rlim_cur; binder_debug(BINDER_DEBUG_PRIORITY_CAP, -binder: %d: nice value %ld not allowed use -%ld instead\n, current-pid, nice, min_nice); +%d: nice value %ld not allowed use %ld instead\n, + current-pid, nice, min_nice); set_user_nice(current, min_nice); if (min_nice 20) return; - binder_user_error(binder: %d RLIMIT_NICE not set\n, current-pid); + binder_user_error(%d RLIMIT_NICE not set\n, current-pid); } static size_t binder_buffer_size(struct binder_proc *proc, @@ -452,8 +454,8 @@ static void binder_insert_free_buffer(struct binder_proc *proc, new_buffer_size = binder_buffer_size(proc, new_buffer); binder_debug(BINDER_DEBUG_BUFFER_ALLOC, -binder: %d: add free buffer, size %zd, -at %p\n, proc-pid, new_buffer_size, new_buffer); +%d: add free buffer, size %zd, at %p\n, + proc-pid, new_buffer_size, new_buffer); while (*p) { parent = *p; @@ -531,7 +533,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, struct mm_struct *mm; binder_debug(BINDER_DEBUG_BUFFER_ALLOC, -binder: %d: %s pages %p-%p\n, proc-pid, +%d: %s pages %p-%p\n, proc-pid, allocate ? allocate : free, start, end); if (end = start) @@ -546,7 +548,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, down_write(mm-mmap_sem); vma = proc-vma; if (vma mm != proc-vma_vm_mm) { - pr_err(binder: %d: vma mm and task mm mismatch\n, + pr_err(%d: vma mm and task mm mismatch\n, proc-pid); vma = NULL; } @@ -556,8 +558,8 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, goto free_range; if (vma == NULL) { - pr_err(binder: %d: binder_alloc_buf failed to - map pages in userspace, no vma\n, proc-pid); + pr_err(%d: binder_alloc_buf failed to map pages in userspace, no vma\n, +proc-pid); goto err_no_vma; } @@ -569,8 +571,8 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, BUG_ON(*page); *page = alloc_page(GFP_KERNEL | __GFP_ZERO); if (*page == NULL) { - pr_err(binder: %d: binder_alloc_buf failed - for page at %p\n, proc-pid, page_addr); + pr_err(%d: binder_alloc_buf failed for page at %p\n, +proc-pid, page_addr); goto err_alloc_page_failed; } tmp_area.addr = page_addr; @@ -578,8 +580,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, page_array_ptr = page; ret = map_vm_area(tmp_area, PAGE_KERNEL, page_array_ptr); if (ret) { - pr_err(binder: %d: binder_alloc_buf failed - to map page at %p in kernel\n, + pr_err(%d: binder_alloc_buf failed to map page at %p in kernel\n, proc-pid, page_addr); goto err_map_kernel_failed; } @@ -587,8 +588,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, (uintptr_t)page_addr + proc-user_buffer_offset; ret = vm_insert_page(vma, user_page_addr, page[0]); if (ret) { - pr_err(binder: %d: binder_alloc_buf failed - to map page at %lx in userspace\n, + pr_err(%d: binder_alloc_buf failed to map page at %lx in userspace\n, proc-pid, user_page_addr); goto err_vm_insert_page_failed; } @@ -636,7 +636,7 @@ static struct
RE: [PATCH 0/3] f2fs: move proc files to debugfs
On Tue, Oct 23, 2012 at 11:20:55AM -0700, Greg KH wrote: Here are 3 patches, moving the proc file usage on f2fs to debugfs. The first one fixes a bug in the gc.h file preventing it from being able to be included by any other files. The second patch moves all current proc file accesses to a single file, removing all #ifdefs from the .c files. This should have been done in the first place. The last file converts the files to use debugfs instead of proc. Note, these patches have been compile tested only, I haven't tested them out, as I haven't had the chance to yet. I'll go do that this afternoon after I catch up on some other pending kernel work. One question, it seems that the proc files show all information for all super blocks in the system, no matter which subdirectory you are reading from in the proc f2fs tree. Is that really what you want? Shouldn't we only be showing the stats of the superblock we are saying we will report? I'll test that later today, and if it really is wrong, will fix the debugfs code up to handle this properly. I just tested your patch set, and it looks like I see all partition information in each file, no matter what subdir it is in. So, do you want this to be broken up per partition/superblock, in a subdir, like you intended? Or just 3 files, for all superblocks in the system? Thank you for great patches. I really appreciate that. When I merged your patches, I found some unnecessary codes and memory structures such as gc_info in the original codes. So I've done some works additionally based on the patches. Furthermore, for readability, I merged 3 stat files into one file, and let it show all the superblocks together, no breakdown per partition. I'll submit v3-series applying these changes soon. Thanks, Oh, the third patch is buggy, don't apply it, I got the subdir logic wrong, I'll go fix that up now. thanks, greg k-h --- Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [RESEND 2] Take over futex of dead task only if FUTEX_WAITERS is not set
On Wed, 24 Oct 2012, Darren Hart wrote: On 10/23/2012 01:29 PM, Thomas Gleixner wrote: Now the proposed change - if (unlikely(ownerdied || !(curval FUTEX_TID_MASK))) { + if (unlikely(ownerdied || + !(curval (FUTEX_TID_MASK | FUTEX_WAITERS { solves the problem, but it's not obvious why and it wreckages the stale WAITERS bit case. In what scenario does the WAITERS bit become stale for pi futexes? This corner case seems rather core to your solution, so I would like to understand it a bit better. Hmm. I can't reconstruct the scenario anymore, though this has been an issue some time ago. Either we fixed up that case in course of the big restructuring of the code or it's just there and I cant decode it. Brain hurts. Now there is a different solution to that problem. Do not look at the user space value at all and enforce a lookup of possibly available pi_state. If pi_state can be found, then the new incoming locker T3 blocks on that pi_state and legitimately races with T2 to acquire the rt_mutex and the pi_state and therefor the proper ownership of the user space futex. My first concern here is performance impact by forcing the pi_state lookup, however, if we got this far, we already took the syscall, and our performance sucks anyway. Correctness obviously trumps performance here. Right, the pi_state lookup is cheap compared to the syscall, locking And even without the stale WAITERS bit issue, the bit below is a good reason to do it this way. Another benefit of changing the code this way is that it makes it less dependent on untrusted user space values and therefor minimizes the possible wreckage which might be inflicted. That's a definite plus! Indeed. I was surprised at how fast you were able to page all this in after all that travel - or is this what you did for 12 hours on the plane? Nah. I'm just too paranoid to apply any futex patch w/o understanding the root cause of it. Darn, if I only could remember how that stale waiters bit issue got inflicted Thanks, tglx -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [drm:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
On Thu, Oct 25, 2012 at 7:22 AM, Justin P. Mattock justinmatt...@gmail.com wrote: here is a link to the file..: intel_error_decode http://www.filefactory.com/file/22bypyjhs4mx I haven't figured out how to access this thing. Can you please file a bug report on bugs.freedesktop.org and attach it there? Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] Enable A20 using KBC for some MSI laptops to fix S3 resume
On Wednesday 24 October 2012, H. Peter Anvin wrote: On 10/24/2012 02:16 PM, Ondrej Zary wrote: Some MSI laptop BIOSes are broken - INT 15h code uses port 92h to enable A20 line but resume code assumes that KBC was used. The laptop will not resume from S3 otherwise but powers off after a while and then powers on again stuck with a blank screen. Fix it by enabling A20 using KBC. Affected laptop list and DMI data are from bug reports at Ubuntu Launchpad. Also add kernel parameter to easily activate this quirk on any system. Only compile tested. The original patch was tested with EX600 and PR200. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878 Are we guaranteed that this executes *before* the keyboard driver initializes? If not, this needs to use the i8042 interface in the input subsystem or at least acquire i8042_lock. -hpa The code is called in: start_kernel()-setup_arch()-acpi_boot_table_init() I think that it's before any drivers are initialized. -- Ondrej Zary -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [RESEND 2] Take over futex of dead task only if FUTEX_WAITERS is not set
On 10/25/2012 01:14 AM, Thomas Gleixner wrote: On Wed, 24 Oct 2012, Darren Hart wrote: On 10/23/2012 01:29 PM, Thomas Gleixner wrote: Nah. I'm just too paranoid to apply any futex patch w/o understanding the root cause of it. Darn, if I only could remember how that stale waiters bit issue got inflicted Stale waiters happens in userspace for non-pi mutexes and there we make one extra FUTEX_WAKE syscall just in case. The futex value policy is much more rigid with PI obviously, so I wasn't aware this could happen there. -- Darren Hart Intel Open Source Technology Center Yocto Project - Technical Lead - Linux Kernel -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv3 0/6] dw_dmac: few cleanups to the driver
On Thu, 2012-10-18 at 17:34 +0300, Andy Shevchenko wrote: There are few cleanups to the driver which partialy acked and reviewed. Since v2: - add one more clean up (patch 6/6) - make a separate patch to WARN a user in dwc_handle_error (suggested by Felipe Balbi) - add a description to patch 4/6 Andy Shevchenko (4): dw_dmac: change dev_printk() to corresponding macros dw_dmac: don't call platform_get_drvdata twice dw_dmac: change dev_crit to dev_WARN in dwc_handle_error dw_dmac: introduce to_dw_desc() macro Heikki Krogerus (2): dmaengine: dw_dmac: remove CLK dependency dmaengine: dw_dmac: amend description and indentation drivers/dma/Kconfig|1 - drivers/dma/dw_dmac.c | 33 ++--- drivers/dma/dw_dmac_regs.h |2 ++ 3 files changed, 16 insertions(+), 20 deletions(-) Applied thanks -- Vinod Koul Intel Corp. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org 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] input: gpio-keys: Add runtime support
On Thu, 25 Oct 2012, Linus Walleij wrote: On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones lee.jo...@linaro.org wrote: On Fri, 12 Oct 2012, Linus Walleij wrote: Yours, Linus Walleij Friendly poke. This makes it look like you're poking me as I'm in the To: field but I suspect the intent must be to poke Dmitry ... I was just providing background for Shubhrajyoti's question. Maybe this helps: Reviewed-by: Linus Walleij linus.wall...@linaro.org Yes, that was also the intention of the other poke. Sorry about that, I should have moved you into Cc: instead. Yes, the poke was for Dmitry. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver
On Thu, 25 Oct 2012, Linus Walleij wrote: On 10/25/2012 09:31 AM, Lee Jones wrote: This certainly doesn't fix the bug we spoke about. I believe Ulf is still working on that one. So do you want me to remove this patch? Yeah drop it for now. Actually, a quick question before I do: If it's better/faster to prepare the clock and keep it prepared while you do clk_enable/clk_disable, why don't we do that in all drivers? Why do we bother to prepare/unprepare each time if all it does is take up cycles? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH V2 5/6] Thermal: Add ST-Ericsson DB8500 thermal dirver.
[...] +/* Callback to get temperature changing trend */ +static int db8500_sys_get_trend(struct thermal_zone_device *thermal, + int trip, enum thermal_trend *trend) +{ + struct db8500_thermal_zone *pzone = thermal-devdata; + + *trend = pzone-trend; + + return 0; Can make it return void. No, it is callback of thermal layer, prototype it to return int. [...] +static int __devinit db8500_thermal_probe(struct platform_device *pdev) +{ + struct db8500_thermal_zone *pzone = NULL; + struct db8500_thsens_platform_data *ptrips = NULL; + int low_irq, high_irq, ret = 0; + unsigned long dft_low, dft_high; + + pzone = devm_kzalloc(pdev-dev, sizeof(*pzone), GFP_KERNEL); + if (!pzone) + return -ENOMEM; + + ptrips = db8500_thermal_parse_dt(pdev); This is what u have in this routine at the very first line: if (!np) { dev_err(pdev-dev, Missing device tree data\n); So, you will end up printing this line for every non-DT case. Not good. What u can do is, give preference to normal pdata here. I moved this if(!np) into parse_dt function, no problem again. (in fact have already done this, but it is missed in this sending) + if (!ptrips) + ptrips = dev_get_platdata(pdev-dev); + + if (!ptrips) [...] + } + + ret = devm_request_threaded_irq(pdev-dev, low_irq, NULL, why threaded irq? In fact PRCMU firmware is polling the thermal sensor, and if it meets threshold, the PRCMU will write this event into share memory (shared between PRCMU and ARM) and trigger an interrupt to ARM. There may be other events passed via share memory, so it is better to handle this kind of irq as fast as possible(it is always the policy), and threaded irq satisfies this case better then the traditional one. + prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT, + dbx500_temp_low, pzone); + if (ret 0) { + dev_err(pdev-dev, Failed to allocate temp low irq.\n); + return ret; + } + + high_irq = platform_get_irq_byname(pdev, IRQ_HOTMON_HIGH); + if (high_irq 0) { + dev_err(pdev-dev, Get IRQ_HOTMON_HIGH failed.\n); + return high_irq; don't want to free resources? devm_* is used to allocate resources, so no need to free them manually. + } + + ret = devm_request_threaded_irq(pdev-dev, high_irq, NULL, + prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT, + dbx500_temp_high, pzone); + if (ret 0) { + dev_err(pdev-dev, Failed to allocate temp high irq.\n); + return ret; + } + [...] -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org 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] input: gpio-keys: Add runtime support
On Thu, Oct 25, 2012 at 09:21:45AM +0100, Lee Jones wrote: On Thu, 25 Oct 2012, Linus Walleij wrote: On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones lee.jo...@linaro.org wrote: On Fri, 12 Oct 2012, Linus Walleij wrote: Yours, Linus Walleij Friendly poke. This makes it look like you're poking me as I'm in the To: field but I suspect the intent must be to poke Dmitry ... I was just providing background for Shubhrajyoti's question. Maybe this helps: Reviewed-by: Linus Walleij linus.wall...@linaro.org Yes, that was also the intention of the other poke. Sorry about that, I should have moved you into Cc: instead. Yes, the poke was for Dmitry. Still do not have the right signoffs: person who sends me the patch needs to put signed-off-by, not acked-by. Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 -tip 0/3] x86, MSI, AHCI: Support multiple MSIs
Hi Ingo, I am resending this series with changes based on your review of v3: I have not noticed that v3 2/5 patch x86, MSI: Allocate as many multiple IRQs as requested is redundant, since the AHCI code tries to allocate maximum possible number of MSIs. As there are no other users of this functionality, I removed v3 2/5 patch for now; v3 patch 3/5 x86, MSI: Minor readability fixes merged into v4 patch 1/3 x86, MSI: Support multiple MSIs in presense of IRQ remapping; 1/3:- racy can_create_irqs() check removed; - multi-line comments fixed; - loops 'for (; i; i--)' changed to 'for (i--; i = 0; i--)'; v1 was conditionally acked by Suresh v2 concerned Yinghai's comments 2/3:v2 is acked by Bjorn, no changes since 3/3:- ahci_host_activate() failure path tested; - ahci_port_priv::lock field commented; - multi-line comments fixed; - loops 'for (; i; i--)' changed to 'for (i--; i = 0; i--)'; v3 was acked by Jeff Alexander Gordeev (3): 1/3 x86, MSI: Support multiple MSIs in presense of IRQ remapping 2/3 PCI, MSI: Enable multiple MSIs with pci_enable_msi_block_auto() 3/3 AHCI: Support multiple MSIs Documentation/PCI/MSI-HOWTO.txt | 37 - arch/x86/kernel/apic/io_apic.c | 165 +++ drivers/ata/ahci.c | 93 +- drivers/ata/ahci.h |6 ++ drivers/ata/libahci.c | 118 ++-- drivers/pci/msi.c | 26 ++ include/linux/irq.h |5 + include/linux/pci.h |7 ++ kernel/irq/chip.c | 30 +-- 9 files changed, 432 insertions(+), 55 deletions(-) -- 1.7.7.6 -- Regards, Alexander Gordeev agord...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3] Add support for AMD64 EDAC on multiple PCI domains
The AMD Northbridge initialisation code and EDAC assume the Northbridge IDs are contiguous, which no longer holds on federated systems with multiple HyperTransport fabrics and multiple PCI domains, eg on Numascale's Numaconnect systems with NumaChip. Address this assumption by searching the Northbridge ID array, rather than directly indexing it, using the upper bits for the PCI domain. RFC-v2: Correct array initialisation v2-v3: Add Boris's neater linked list approach Todo: 1. fix kobject/sysfs oops (see http://quora.org/2012/16-server-boot.txt later) 2. reorder amd64_edac.c or add amd64_per_family_init/pci_get_related_function forward declarations, based on feedback Signed-off-by: Daniel J Blueman dan...@numascale-asia.com --- arch/x86/include/asm/amd_nb.h| 63 +++- arch/x86/include/asm/numachip/numachip.h | 22 ++ arch/x86/kernel/amd_gart_64.c|8 +- arch/x86/kernel/amd_nb.c | 85 - arch/x86/pci/numachip.c | 121 ++ drivers/char/agp/amd64-agp.c | 12 +-- drivers/edac/amd64_edac.c| 34 + drivers/edac/amd64_edac.h|6 -- 8 files changed, 283 insertions(+), 68 deletions(-) create mode 100644 arch/x86/include/asm/numachip/numachip.h create mode 100644 arch/x86/pci/numachip.c diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h index b3341e9..6a27226 100644 --- a/arch/x86/include/asm/amd_nb.h +++ b/arch/x86/include/asm/amd_nb.h @@ -4,6 +4,8 @@ #include linux/ioport.h #include linux/pci.h +#define NUM_POSSIBLE_NBS 8 + struct amd_nb_bus_dev_range { u8 bus; u8 dev_base; @@ -51,12 +53,22 @@ struct amd_northbridge { struct pci_dev *link; struct amd_l3_cache l3_cache; struct threshold_bank *bank4; + u16 node; + struct list_head nbl; }; struct amd_northbridge_info { u16 num; u64 flags; - struct amd_northbridge *nb; + + /* +* The first 8 elems are for fast lookup of NB descriptors on single- +* system setups, i.e. normal boxes. The nb_list, OTOH, is list of +* additional NB descriptors which exist on confederate systems +* like using Numascale's Numaconnect/NumaChip. +*/ + struct amd_northbridge *nbs[NUM_POSSIBLE_NBS]; + struct list_head nb_list; }; extern struct amd_northbridge_info amd_northbridges; @@ -78,7 +90,54 @@ static inline bool amd_nb_has_feature(unsigned feature) static inline struct amd_northbridge *node_to_amd_nb(int node) { - return (node amd_northbridges.num) ? amd_northbridges.nb[node] : NULL; + struct amd_northbridge_info *nbi = amd_northbridges; + struct amd_northbridge *nb; + int i; + + /* Quick search for first domain */ + if (node NUM_POSSIBLE_NBS) { + if (node nbi-num) + return nbi-nbs[node]; + else + return NULL; + } + + /* Search for NBs from later domains in array */ + for (i = 0; i NUM_POSSIBLE_NBS; i++) + if (nbi-nbs[i]-node == node) + return nbi-nbs[i]; + + list_for_each_entry(nb, nbi-nb_list, nbl) + if (node == nb-node) + return nb; + + return NULL; +} + +static inline struct amd_northbridge *index_to_amd_nb(int index) +{ + struct amd_northbridge_info *nbi = amd_northbridges; + struct amd_northbridge *nb; + int count = NUM_POSSIBLE_NBS; + + if (index NUM_POSSIBLE_NBS) { + if (index nbi-num) + return nbi-nbs[index]; + else + return NULL; + } + + list_for_each_entry(nb, nbi-nb_list, nbl) { + if (count++ == index) + return nb; + } + + return NULL; +} + +static inline u16 amd_get_node_id(struct pci_dev *pdev) +{ + return (pci_domain_nr(pdev-bus) 3) | (PCI_SLOT(pdev-devfn) - 0x18); } #else diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index e663112..4f56487 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -573,7 +573,7 @@ static void enable_gart_translations(void) return; for (i = 0; i amd_nb_num(); i++) { - struct pci_dev *dev = node_to_amd_nb(i)-misc; + struct pci_dev *dev = index_to_amd_nb(i)-misc; enable_gart_translation(dev, __pa(agp_gatt_table)); } @@ -610,7 +610,7 @@ static void gart_fixup_northbridges(void) pr_info(PCI-DMA: Restoring GART aperture settings\n); for (i = 0; i amd_nb_num(); i++) { - struct pci_dev *dev = node_to_amd_nb(i)-misc; + struct pci_dev *dev = index_to_amd_nb(i)-misc; /* * Don't enable
Re: [RFC 1/2] vmevent: Implement pressure attribute
On Wed, Oct 24, 2012 at 07:23:21PM -0700, Anton Vorontsov wrote: Hello Pekka, Thanks for taking a look into this! On Wed, Oct 24, 2012 at 12:03:10PM +0300, Pekka Enberg wrote: On Mon, 22 Oct 2012, Anton Vorontsov wrote: This patch introduces VMEVENT_ATTR_PRESSURE, the attribute reports Linux virtual memory management pressure. There are three discrete levels: VMEVENT_PRESSURE_LOW: Notifies that the system is reclaiming memory for new allocations. Monitoring reclaiming activity might be useful for maintaining overall system's cache level. VMEVENT_PRESSURE_MED: The system is experiencing medium memory pressure, there is some mild swapping activity. Upon this event applications may decide to free any resources that can be easily reconstructed or re-read from a disk. Nit: s/VMEVENT_PRESSURE_MED/VMEVENT_PRESSUDE_MEDIUM/ Sure thing, will change. Other than that, I'm OK with this. Mel and others, what are your thoughts on this? Anton, have you tested this with real world scenarios? Yup, I was mostly testing it on a desktop. I.e. in a KVM instance I was running a full fedora17 desktop w/ a lot of apps opened. The pressure index was pretty good in the sense that it was indeed reflecting the sluggishness in the system during swap activity. It's not ideal, i.e. the index might drop slightly for some time, but we usually interested in above some value threshold, so it should be fine. The _LOW level is defined very strictly, and cannot be tuned anyhow. So it's very solid, and that's what we mostly use for Android. The _OOM level is also defined quite strict, so from the API point of view, it's also solid, and should not be a problem. The one of the concern when I see the code is that whether we should consider high order page allocation. Now OOM killer doesn't kill anyone when VM suffer from higher order allocation because it doesn't help getting physical contiguos memory in normal case. Same rule could be applied. Although the problem with _OOM is delivering the event in time (i.e. we must be quick in predicting it, before OOMK triggers). Today the patch has Absolutely. It was a biggest challenge. a shortcut for _OOM level: we send _OOM notification when reclaimer's priority is below empirically found value '3' (we might make it tunable via sysctl too, but that would expose another mm detail -- although sysctl sounds not that bad as exposing something in the C API; we have plenty of mm knobs in /proc/sys/vm/ already). Hmm, I'm not sure depending on such magic value is good idea but I have no idea so I will shut up :( The real tunable is _MED level, and this should be tuned based on the desired system's behaviour that I described in more detail in this long post: http://lkml.org/lkml/2012/10/7/29. Based on my observations, I wouldn't say that we have plenty of room to tune the value, though. Usual swapping activity causes index to rise to say to 30%, and when the system can't keep up, it raises to 50..90 (but we still have plenty of swap space, so the system is far away from OOM, although it is thrashing. Ideally I'd prefer to not have any sysctl, but I believe _MED level is really based on user's definition of medium. How does it stack up against Android's low memory killer, for example? The LMK driver is effectively using what we call _LOW pressure notifications here, so by definition it is enough to build a full replacement for the in-kernel LMK using just the _LOW level. But in the future, we might want to use _MED as well, e.g. kill unneeded services based not on the cache level, but based on the pressure. Good idea. Thanks for keeping trying this, Anton! Thanks, Anton. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majord...@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: a href=mailto:d...@kvack.org; em...@kvack.org /a -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 -tip 1/3] x86, MSI: Support multiple MSIs in presense of IRQ remapping
The MSI specification has several constraints in comparison with MSI-X, most notable of them is the inability to configure MSIs independently. As a result, it is impossible to dispatch interrupts from different queues to different CPUs. This is largely devalues the support of multiple MSIs in SMP systems. Also, a necessity to allocate a contiguous block of vector numbers for devices capable of multiple MSIs might cause a considerable pressure on x86 interrupt vector allocator and could lead to fragmentation of the interrupt vectors space. This patch overcomes both drawbacks in presense of IRQ remapping and lets devices take advantage of multiple queues and per-IRQ affinity assignments. Signed-off-by: Alexander Gordeev agord...@redhat.com --- arch/x86/kernel/apic/io_apic.c | 165 include/linux/irq.h|5 + kernel/irq/chip.c | 30 +-- 3 files changed, 160 insertions(+), 40 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index c265593..02ec1c6 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -300,9 +300,9 @@ static struct irq_cfg *alloc_irq_and_cfg_at(unsigned int at, int node) return cfg; } -static int alloc_irq_from(unsigned int from, int node) +static int alloc_irqs_from(unsigned int from, unsigned int count, int node) { - return irq_alloc_desc_from(from, node); + return irq_alloc_descs_from(from, count, node); } static void free_irq_at(unsigned int at, struct irq_cfg *cfg) @@ -2991,37 +2991,58 @@ device_initcall(ioapic_init_ops); /* * Dynamic irq allocate and deallocation */ -unsigned int create_irq_nr(unsigned int from, int node) +unsigned int __create_irqs(unsigned int from, unsigned int count, int node) { - struct irq_cfg *cfg; + struct irq_cfg **cfg; unsigned long flags; - unsigned int ret = 0; - int irq; + int irq, i; if (from nr_irqs_gsi) from = nr_irqs_gsi; - irq = alloc_irq_from(from, node); - if (irq 0) - return 0; - cfg = alloc_irq_cfg(irq, node); - if (!cfg) { - free_irq_at(irq, NULL); + cfg = kzalloc_node(count * sizeof(cfg[0]), GFP_KERNEL, node); + if (!cfg) return 0; + + irq = alloc_irqs_from(from, count, node); + if (irq 0) + goto out_cfgs; + + for (i = 0; i count; i++) { + cfg[i] = alloc_irq_cfg(irq + i, node); + if (!cfg[i]) + goto out_irqs; } raw_spin_lock_irqsave(vector_lock, flags); - if (!__assign_irq_vector(irq, cfg, apic-target_cpus())) - ret = irq; + for (i = 0; i count; i++) + if (__assign_irq_vector(irq + i, cfg[i], apic-target_cpus())) + goto out_vecs; raw_spin_unlock_irqrestore(vector_lock, flags); - if (ret) { - irq_set_chip_data(irq, cfg); - irq_clear_status_flags(irq, IRQ_NOREQUEST); - } else { - free_irq_at(irq, cfg); + for (i = 0; i count; i++) { + irq_set_chip_data(irq + i, cfg[i]); + irq_clear_status_flags(irq + i, IRQ_NOREQUEST); } - return ret; + + kfree(cfg); + return irq; + +out_vecs: + for (i--; i = 0; i--) + __clear_irq_vector(irq + i, cfg[i]); + raw_spin_unlock_irqrestore(vector_lock, flags); +out_irqs: + for (i = 0; i count; i++) + free_irq_at(irq + i, cfg[i]); +out_cfgs: + kfree(cfg); + return 0; +} + +unsigned int create_irq_nr(unsigned int from, int node) +{ + return __create_irqs(from, 1, node); } int create_irq(void) @@ -3054,6 +3075,14 @@ void destroy_irq(unsigned int irq) free_irq_at(irq, cfg); } +static inline void destroy_irqs(unsigned int irq, unsigned int count) +{ + unsigned int i; + + for (i = 0; i count; i++) + destroy_irq(irq + i); +} + /* * MSI message composition */ @@ -3080,7 +3109,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, if (irq_remapped(cfg)) { compose_remapped_msi_msg(pdev, irq, dest, msg, hpet_id); - return err; + return 0; } if (x2apic_enabled()) @@ -3107,7 +3136,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, MSI_DATA_DELIVERY_LOWPRI) | MSI_DATA_VECTOR(cfg-vector); - return err; + return 0; } static int @@ -3145,18 +3174,26 @@ static struct irq_chip msi_chip = { .irq_retrigger = ioapic_retrigger_irq, }; -static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) +static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, +unsigned int irq_base,
[PATCH v4 -tip 2/3] PCI, MSI: Enable multiple MSIs with pci_enable_msi_block_auto()
The new function pci_enable_msi_block_auto() tries to allocate maximum possible number of MSIs up to the number the device supports. It generalizes a pattern when pci_enable_msi_block() is contiguously called until it succeeds or fails. Opposite to pci_enable_msi_block() which takes the number of MSIs to allocate as a input parameter, pci_enable_msi_block_auto() could be used by device drivers to obtain the number of assigned MSIs and the number of MSIs the device supports. Signed-off-by: Alexander Gordeev agord...@redhat.com Acked-by: Bjorn Helgaas bhelg...@google.com --- Documentation/PCI/MSI-HOWTO.txt | 37 - drivers/pci/msi.c | 26 ++ include/linux/pci.h |7 +++ 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt index 53e6fca..a091780 100644 --- a/Documentation/PCI/MSI-HOWTO.txt +++ b/Documentation/PCI/MSI-HOWTO.txt @@ -127,15 +127,42 @@ on the number of vectors that can be allocated; pci_enable_msi_block() returns as soon as it finds any constraint that doesn't allow the call to succeed. -4.2.3 pci_disable_msi +4.2.3 pci_enable_msi_block_auto + +int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *count) + +This variation on pci_enable_msi() call allows a device driver to request +the maximum possible number of MSIs. The MSI specification only allows +interrupts to be allocated in powers of two, up to a maximum of 2^5 (32). + +If this function returns a positive number, it indicates that it has +succeeded and the returned value is the number of allocated interrupts. In +this case, the function enables MSI on this device and updates dev-irq to +be the lowest of the new interrupts assigned to it. The other interrupts +assigned to the device are in the range dev-irq to dev-irq + returned +value - 1. + +If this function returns a negative number, it indicates an error and +the driver should not attempt to request any more MSI interrupts for +this device. + +If the device driver needs to know the number of interrupts the device +supports it can pass the pointer count where that number is stored. The +device driver must decide what action to take if pci_enable_msi_block_auto() +succeeds, but returns a value less than the number of interrupts supported. +If the device driver does not need to know the number of interrupts +supported, it can set the pointer count to NULL. + +4.2.4 pci_disable_msi void pci_disable_msi(struct pci_dev *dev) This function should be used to undo the effect of pci_enable_msi() or -pci_enable_msi_block(). Calling it restores dev-irq to the pin-based -interrupt number and frees the previously allocated message signaled -interrupt(s). The interrupt may subsequently be assigned to another -device, so drivers should not cache the value of dev-irq. +pci_enable_msi_block() or pci_enable_msi_block_auto(). Calling it restores +dev-irq to the pin-based interrupt number and frees the previously +allocated message signaled interrupt(s). The interrupt may subsequently be +assigned to another device, so drivers should not cache the value of +dev-irq. Before calling this function, a device driver must always call free_irq() on any interrupt for which it previously called request_irq(). diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index a825d78..6ec44e2 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -839,6 +839,32 @@ int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) } EXPORT_SYMBOL(pci_enable_msi_block); +int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) +{ + int ret, pos, nvec; + u16 msgctl; + + pos = pci_find_capability(dev, PCI_CAP_ID_MSI); + if (!pos) + return -EINVAL; + + pci_read_config_word(dev, pos + PCI_MSI_FLAGS, msgctl); + ret = 1 ((msgctl PCI_MSI_FLAGS_QMASK) 1); + + if (maxvec) + *maxvec = ret; + + do { + nvec = ret; + ret = pci_enable_msi_block(dev, nvec); + } while (ret 0); + + if (ret 0) + return ret; + return nvec; +} +EXPORT_SYMBOL(pci_enable_msi_block_auto); + void pci_msi_shutdown(struct pci_dev *dev) { struct msi_desc *desc; diff --git a/include/linux/pci.h b/include/linux/pci.h index 5faa831..b8a9454 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1070,6 +1070,12 @@ static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) return -1; } +static inline int +pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) +{ + return -1; +} + static inline void pci_msi_shutdown(struct pci_dev *dev) { } static inline void pci_disable_msi(struct pci_dev *dev) @@ -1101,6 +1107,7 @@ static inline int pci_msi_enabled(void) } #else extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
[PATCH v4 -tip 3/3] AHCI: Support multiple MSIs
Take advantage of multiple MSIs implementation on x86 - on systems with IRQ remapping AHCI ports not only get assigned separate MSI vectors - but also separate IRQs. As result, interrupts generated by different ports could be serviced on different CPUs rather than on a single one. In cases when number of allocated MSIs is less than requested the Sharing Last MSI mode does not get used, no matter implemented in hardware or not. Instead, the driver assumes the advantage of multiple MSIs is negated and falls back to the single MSI mode as if MRSM bit was set (some Intel chips implement this strategy anyway - MRSM bit gets set even if the number of allocated MSIs exceeds the number of implemented ports). Signed-off-by: Alexander Gordeev agord...@redhat.com --- drivers/ata/ahci.c| 93 +-- drivers/ata/ahci.h|6 +++ drivers/ata/libahci.c | 118 ++--- 3 files changed, 207 insertions(+), 10 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 7862d17..29ed8a8 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1057,6 +1057,86 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) {} #endif +int ahci_init_interrupts(struct pci_dev *pdev, struct ahci_host_priv *hpriv) +{ + int rc; + unsigned int maxvec; + + if (!(hpriv-flags AHCI_HFLAG_NO_MSI)) { + rc = pci_enable_msi_block_auto(pdev, maxvec); + if (rc 0) { + if ((rc == maxvec) || (rc == 1)) + return rc; + /* +* Assume that advantage of multipe MSIs is negated, +* so fallback to single MSI mode to save resources +*/ + pci_disable_msi(pdev); + if (!pci_enable_msi(pdev)) + return 1; + } + } + + pci_intx(pdev, 1); + return 0; +} + +/** + * ahci_host_activate - start AHCI host, request IRQs and register it + * @host: target ATA host + * @irq: base IRQ number to request + * @n_msis: number of MSIs allocated for this host + * @irq_handler: irq_handler used when requesting IRQs + * @irq_flags: irq_flags used when requesting IRQs + * + * Similar to ata_host_activate, but requests IRQs according to AHCI-1.1 + * when multiple MSIs were allocated. That is one MSI per port, starting + * from @irq. + * + * LOCKING: + * Inherited from calling layer (may sleep). + * + * RETURNS: + * 0 on success, -errno otherwise. + */ +int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis) +{ + int i, rc; + + /* Sharing Last Message among several ports is not supported */ + if (n_msis host-n_ports) + return -EINVAL; + + rc = ata_host_start(host); + if (rc) + return rc; + + for (i = 0; i host-n_ports; i++) { + rc = devm_request_threaded_irq(host-dev, + irq + i, ahci_hw_interrupt, ahci_thread_fn, IRQF_SHARED, + dev_driver_string(host-dev), host-ports[i]); + if (rc) + goto out_free_irqs; + } + + for (i = 0; i host-n_ports; i++) + ata_port_desc(host-ports[i], irq %d, irq + i); + + rc = ata_host_register(host, ahci_sht); + if (rc) + goto out_free_all_irqs; + + return 0; + +out_free_all_irqs: + i = host-n_ports; +out_free_irqs: + for (i--; i = 0; i--) + devm_free_irq(host-dev, irq + i, host-ports[i]); + + return rc; +} + static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { unsigned int board_id = ent-driver_data; @@ -1065,7 +1145,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) struct device *dev = pdev-dev; struct ahci_host_priv *hpriv; struct ata_host *host; - int n_ports, i, rc; + int n_ports, n_msis, i, rc; int ahci_pci_bar = AHCI_PCI_BAR_STANDARD; VPRINTK(ENTER\n); @@ -1150,11 +1230,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (ahci_sb600_enable_64bit(pdev)) hpriv-flags = ~AHCI_HFLAG_32BIT_ONLY; - if ((hpriv-flags AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev)) - pci_intx(pdev, 1); - hpriv-mmio = pcim_iomap_table(pdev)[ahci_pci_bar]; + n_msis = ahci_init_interrupts(pdev, hpriv); + if (n_msis 1) + hpriv-flags |= AHCI_HFLAG_MULTI_MSI; + /* save initial config */ ahci_pci_save_initial_config(pdev, hpriv); @@ -1250,6 +1331,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ahci_pci_print_info(host); pci_set_master(pdev); +
Re: RE: [PATCH] extcon : callback function to read cable property
Subject: Re: [PATCH] extcon : callback function to read cable property On 10/19/2012 12:13 PM, Tc, Jenny wrote: The rold of extcon inform only attached/detached state of extcon consumer driver from extcon provider driver. After extcon consumer driver detect the state of cable through extcon, extcon consumer driver or framework should get the additional information of cable from other device driver except of extcon. Also, extcon manage various cables (e.g., USB, TA, MHL, JIG-USB-ON, JIG- USB-OFF, Dock) What are common properties among many cables expect attached or detached state? For charger cable the current each cable can provide will be common. But may not be relevant for other cables. I understand your point on extcon role. But my concern is, when the consumer driver gets a notification on cable state change, how does the consumer query the cable properties in a generic way. Do you have any suggestions for this? A use case can be as below When a USB host cable (SDP) connected to the platform, without USB enumeration it can support only up to 100mA(USB2.)/150mA(USB 3.0) (As per USB charging spec). Once the enumeration is done this can be 500mA/950mA. If the consumer charger driver need to configure the charger chip, it need to know the charger cable capabilities. For example a platform PLAT1 may have charger driver CHRGR1 and OTG driver OTG1. But platform PLAT2 may have CHGR1 but different OTG driver OTG2. How CHGR1 driver can detect the cable properties without having any platform layer hooks? The platform layer hooks (using platform data)will work only if the consumer is a platform driver. What if it's a framework which will have the same flow in all platforms? In general, an extcon user (extcon notifee) knows who's the extcon notifier; the user is supposed to know the name of the notifier. Thus, the extcon user should be able to get the appropriate object; i.e., a regulator struct in this case. Then, according to the USB state, the current limit of the USB can be changed by the notifier; which may notify (regulator subsystem has one) the extcon user to react (change current limit of charger?) Anyway, in your case of PLAT2, doesn't CHGR1 has (or is) a regulator controlling the charger current and if the OTG2 regulator affects the behavior of CHGR1, (the current of OTG2-reg goes to CHGR1-reg) the consumer-supplier chain should be setup (if the BSP is ideal). OR If it is impossible to have any objects of OTG2 (looks strange, but..), you may have two cables, USB (data) and Fast-charger.04 (add +400mA to USB), where Fast-charger.04 is enabled when USB2 enumeration is done with 5. However, the following callback might be considered if there are cases where an extcon user has information of extcon_name and cable_name while the user CANNOT get any information on which device or object is related with the specific cable; in struct extcon, with optional user initializing data section: + struct device **cable_device; OR + char **cable_device_name; With any relevant changes in the status with cable_device, we may notify any notifier-block that are interested in the specific cable. Then, the notifier-block (for register_interest) is going to handle extcon-state changes and cable_device notifications. Currently, the user's nb is for cable attach/detach events with true/false value in the place of 32bit value (val). However, if we add the third possible value for that parameter (0: cable detached, 1: cable attached, 2: cable status changed; go find out what's going on), it is still compatible. I considered using a void pointer instead of cable_device, too. However, that would spoil the subsystem too much; we'll be creating a total chaos: USB-A driver uses struct regulator, USB-B driver uses struct device, USB-C driver uses true/false, and so on. Cheers, MyungJoo
Re: [PATCH V2 5/6] Thermal: Add ST-Ericsson DB8500 thermal dirver.
On 25 October 2012 13:56, Hongbo Zhang hongbo.zh...@linaro.org wrote: While replying to mails, don't remove lines like above. They help identifying who wrote what. [...] +/* Callback to get temperature changing trend */ +static int db8500_sys_get_trend(struct thermal_zone_device *thermal, For example, you can't tell who wrote this line... +static int __devinit db8500_thermal_probe(struct platform_device *pdev) +{ + struct db8500_thermal_zone *pzone = NULL; + struct db8500_thsens_platform_data *ptrips = NULL; + int low_irq, high_irq, ret = 0; + unsigned long dft_low, dft_high; + + pzone = devm_kzalloc(pdev-dev, sizeof(*pzone), GFP_KERNEL); + if (!pzone) + return -ENOMEM; + + ptrips = db8500_thermal_parse_dt(pdev); This is what u have in this routine at the very first line: if (!np) { dev_err(pdev-dev, Missing device tree data\n); So, you will end up printing this line for every non-DT case. Not good. What u can do is, give preference to normal pdata here. I moved this if(!np) into parse_dt function, no problem again. (in fact have already done this, but it is missed in this sending) Sorry couldn't get your point. :( Can you share diff of latest code in the same mail thread? + ret = devm_request_threaded_irq(pdev-dev, low_irq, NULL, why threaded irq? In fact PRCMU firmware is polling the thermal sensor, and if it meets threshold, the PRCMU will write this event into share memory (shared between PRCMU and ARM) and trigger an interrupt to ARM. There may be other events passed via share memory, so it is better to handle this kind of irq as fast as possible(it is always the policy), and threaded irq satisfies this case better then the traditional one. Its been long that i prepared for an interview, but i believe purpose of threaded irq is something else. There can be two use cases of request_irq() - We don't want to sleep from interrupt handler, because we don't need to sleep for reading hardware's register. And so handler must be called from interrupt context. We use normal request_irq() here. This is the fastest one. - We have to sleep from some part of interrupt handler, because we don't have peripherals register on AMBA bus. But we have it on SPI or I2C bus, where read/ write to SPI/I2C can potentially sleep. So, we want handler to execute from process context and so use request_threaded_irq(), i.e. handler will be called from a thread. This will surely be slow. Now in threaded irq case, we can give two handlers, one that must be called from interrupt context and other that must be called from process context. Both will be called one by one. Sorry if i am wrong in my theory :( @Amit: Am i correct?? Now, the same question again. Are you sure you want threaded irq here. + prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT, + dbx500_temp_low, pzone); -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC v2 0/2] vmevent: A bit reworked pressure attribute + docs + man page
Hi Pekka, On Thu, Oct 25, 2012 at 09:44:52AM +0300, Pekka Enberg wrote: On Thu, Oct 25, 2012 at 9:40 AM, Minchan Kim minc...@kernel.org wrote: Your description doesn't include why we need new vmevent_fd(2). Of course, it's very flexible and potential to add new VM knob easily but the thing we is about to use now is only VMEVENT_ATTR_PRESSURE. Is there any other use cases for swap or free? or potential user? Adding vmevent_fd without them is rather overkill. What ABI would you use instead? I thought /dev/some_knob like mem_notify and epoll is enough but please keep in mind that I'm not against vmevent_fd strongly. My point is that description should include explain about why other candidate is not good or why vmevent_fd is better. (But at least, I don't like vmevent timer polling still and I hope we use it as last resort once we can find another) On Thu, Oct 25, 2012 at 9:40 AM, Minchan Kim minc...@kernel.org wrote: I don't object but we need rationale for adding new system call which should be maintained forever once we add it. Agreed. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majord...@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: a href=mailto:d...@kvack.org; em...@kvack.org /a -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [drm:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
On Thu, 25 Oct 2012 10:16:08 +0200, Daniel Vetter dan...@ffwll.ch wrote: On Thu, Oct 25, 2012 at 7:22 AM, Justin P. Mattock justinmatt...@gmail.com wrote: here is a link to the file..: intel_error_decode http://www.filefactory.com/file/22bypyjhs4mx I haven't figured out how to access this thing. Can you please file a bug report on bugs.freedesktop.org and attach it there? No worries, it is another ILK hang similar to the ones reported earlier - it just seems the ring stops advancing. Hopefully it is a missing w/a from http://cgit.freedesktop.org/~danvet/drm/log/?h=ilk-wa-pile -Chris -- Chris Wilson, Intel Open Source Technology Centre -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/26] pstore: allow for big files
On Tue, Oct 23, 2012 at 7:48 PM, Kees Cook keesc...@chromium.org wrote: On Tue, Oct 23, 2012 at 6:47 AM, Irina Tirdea irina.tir...@intel.com wrote: From: Adrian Hunter adrian.hun...@intel.com pstore reads all files into memory at mount time. To allow for back ends that will store arbitrarily large files, enhance pstore also to be able to read from the back end as needed. Signed-off-by: Adrian Hunter adrian.hun...@intel.com Signed-off-by: Irina Tirdea irina.tir...@intel.com --- drivers/acpi/apei/erst.c | 16 +--- fs/pstore/inode.c| 26 -- fs/pstore/internal.h |5 +++-- fs/pstore/platform.c | 11 +++ fs/pstore/ram.c | 15 +++ include/linux/pstore.h |7 +-- 6 files changed, 51 insertions(+), 29 deletions(-) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index e4d9d24..f70ba37 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -931,9 +931,9 @@ static int erst_check_table(struct acpi_table_erst *erst_tab) static int erst_open_pstore(struct pstore_info *psi); static int erst_close_pstore(struct pstore_info *psi); -static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, - struct timespec *time, char **buf, - struct pstore_info *psi); +static int erst_reader(u64 *id, enum pstore_type_id *type, + struct timespec *time, char **buf, loff_t *size, + struct pstore_info *psi); static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, u64 *id, unsigned int part, size_t size, struct pstore_info *psi); @@ -987,9 +987,9 @@ static int erst_close_pstore(struct pstore_info *psi) return 0; } -static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, - struct timespec *time, char **buf, - struct pstore_info *psi) +static int erst_reader(u64 *id, enum pstore_type_id *type, + struct timespec *time, char **buf, loff_t *size, + struct pstore_info *psi) { int rc; ssize_t len = 0; @@ -1051,7 +1051,9 @@ skip: out: kfree(rcd); - return (rc 0) ? rc : (len - sizeof(*rcd)); + if (!rc) + *size = len - sizeof(*rcd); + return rc; } static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 4ab572e..ff0970f 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -49,7 +49,8 @@ struct pstore_private { struct pstore_info *psi; enum pstore_type_id type; u64 id; - ssize_t size; + loff_t size; + boolbig; chardata[]; }; @@ -65,12 +66,13 @@ static void *pstore_ftrace_seq_start(struct seq_file *s, loff_t *pos) { struct pstore_private *ps = s-private; struct pstore_ftrace_seq_data *data; + loff_t size = ps-size; data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return NULL; - data-off = ps-size % REC_SIZE; + data-off = do_div(size, REC_SIZE); This modifies ps-size. I don't think you want that? ps-size is not modified. The locally stored size variable is used to avoid modifying ps-size. Thanks, Dragos -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: remove obsolete comment from asm/xen/hypervisor.h
Signed-off-by: Olaf Hering o...@aepfle.de --- arch/x86/include/asm/xen/hypervisor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 66d0fff..125f344 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -33,7 +33,6 @@ #ifndef _ASM_X86_XEN_HYPERVISOR_H #define _ASM_X86_XEN_HYPERVISOR_H -/* arch/i386/kernel/setup.c */ extern struct shared_info *HYPERVISOR_shared_info; extern struct start_info *xen_start_info; -- 1.7.12.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
mfd: rc5t583-irq.c build warning: array subscript is above array bounds
hi Laxman, I got below compile warning when build this driver. CC drivers/mfd/rc5t583-irq.o drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_sync_unlock': drivers/mfd/rc5t583-irq.c:227: warning: array subscript is above array bounds drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_init': drivers/mfd/rc5t583-irq.c:349: warning: array subscript is above array bounds Regards, Axel -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] xen PVonHVM: move shared_info to reserved memory area
This is a respin of 00e37bdb0113a98408de42db85be002f21dbffd3 (xen PVonHVM: move shared_info to MMIO before kexec). Currently kexec in a PVonHVM guest fails with a triple fault because the new kernel overwrites the shared info page. The exact failure depends on the size of the kernel image. This patch moves the pfn from RAM into an E820 reserved memory area. The pfn containing the shared_info is located somewhere in RAM. This will cause trouble if the current kernel is doing a kexec boot into a new kernel. The new kernel (and its startup code) can not know where the pfn is, so it can not reserve the page. The hypervisor will continue to update the pfn, and as a result memory corruption occours in the new kernel. The toolstack marks the memory area FC00- as reserved in the E820 map. Within that range newer toolstacks will keep 1MB starting from FE70 as reserved for guest use. Older toolstacks will usually not allocate areas up to FE70, so FE70 is expected to work also with older toolstacks. Signed-off-by: Olaf Hering o...@aepfle.de --- arch/x86/xen/enlighten.c | 46 ++ arch/x86/xen/suspend.c | 2 +- arch/x86/xen/xen-ops.h | 2 +- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 586d838..11a7b8b 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -101,7 +101,6 @@ struct shared_info xen_dummy_shared_info; void *xen_initial_gdt; -RESERVE_BRK(shared_info_page_brk, PAGE_SIZE); __read_mostly int xen_have_vector_callback; EXPORT_SYMBOL_GPL(xen_have_vector_callback); @@ -1495,38 +1494,53 @@ asmlinkage void __init xen_start_kernel(void) #endif } -void __ref xen_hvm_init_shared_info(void) +#ifdef CONFIG_XEN_PVHVM +#define HVM_SHARED_INFO_ADDR 0xFE70UL +static struct shared_info *xen_hvm_shared_info; + +static void xen_hvm_connect_shared_info(unsigned long pfn) { - int cpu; struct xen_add_to_physmap xatp; - static struct shared_info *shared_info_page = 0; - if (!shared_info_page) - shared_info_page = (struct shared_info *) - extend_brk(PAGE_SIZE, PAGE_SIZE); xatp.domid = DOMID_SELF; xatp.idx = 0; xatp.space = XENMAPSPACE_shared_info; - xatp.gpfn = __pa(shared_info_page) PAGE_SHIFT; + xatp.gpfn = pfn; if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, xatp)) BUG(); - HYPERVISOR_shared_info = (struct shared_info *)shared_info_page; +} +static void xen_hvm_set_shared_info(struct shared_info *sip) +{ + int cpu; + + HYPERVISOR_shared_info = sip; /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info * page, we use it in the event channel upcall and in some pvclock * related functions. We don't need the vcpu_info placement * optimizations because we don't use any pv_mmu or pv_irq op on -* HVM. -* When xen_hvm_init_shared_info is run at boot time only vcpu 0 is -* online but xen_hvm_init_shared_info is run at resume time too and -* in that case multiple vcpus might be online. */ - for_each_online_cpu(cpu) { +* HVM. */ + for_each_online_cpu(cpu) per_cpu(xen_vcpu, cpu) = HYPERVISOR_shared_info-vcpu_info[cpu]; - } } -#ifdef CONFIG_XEN_PVHVM +/* Reconnect the shared_info pfn to a (new) mfn */ +void xen_hvm_resume_shared_info(void) +{ + xen_hvm_connect_shared_info(HVM_SHARED_INFO_ADDR PAGE_SHIFT); +} + +/* Obtain an address to the pfn in reserved area */ +void __init xen_hvm_init_shared_info(void) +{ + set_fixmap(FIX_PARAVIRT_BOOTMAP, HVM_SHARED_INFO_ADDR); + xen_hvm_shared_info = + (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); + xen_hvm_connect_shared_info(HVM_SHARED_INFO_ADDR PAGE_SHIFT); + xen_hvm_set_shared_info(xen_hvm_shared_info); +} + static void __init init_hvm_pv_info(void) { int major, minor; diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index 45329c8..ae8a00c 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c @@ -30,7 +30,7 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled) { #ifdef CONFIG_XEN_PVHVM int cpu; - xen_hvm_init_shared_info(); + xen_hvm_resume_shared_info(); xen_callback_vector(); xen_unplug_emulated_devices(); if (xen_feature(XENFEAT_hvm_safe_pvclock)) { diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index a95b417..d2e73d1 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -40,7 +40,7 @@ void xen_enable_syscall(void); void xen_vcpu_restore(void); void xen_callback_vector(void); -void xen_hvm_init_shared_info(void); +void xen_hvm_resume_shared_info(void); void xen_unplug_emulated_devices(void); void __init xen_build_dynamic_phys_to_machine(void); -- 1.7.12.4 -- To
Re: [PATCH v4 -tip 3/3] AHCI: Support multiple MSIs
* Alexander Gordeev agord...@redhat.com wrote: Take advantage of multiple MSIs implementation on x86 - on systems with IRQ remapping AHCI ports not only get assigned separate MSI vectors - but also separate IRQs. As result, interrupts generated by different ports could be serviced on different CPUs rather than on a single one. In cases when number of allocated MSIs is less than requested the Sharing Last MSI mode does not get used, no matter implemented in hardware or not. Instead, the driver assumes the advantage of multiple MSIs is negated and falls back to the single MSI mode as if MRSM bit was set (some Intel chips implement this strategy anyway - MRSM bit gets set even if the number of allocated MSIs exceeds the number of implemented ports). Signed-off-by: Alexander Gordeev agord...@redhat.com --- drivers/ata/ahci.c| 93 +-- drivers/ata/ahci.h|6 +++ drivers/ata/libahci.c | 118 ++--- 3 files changed, 207 insertions(+), 10 deletions(-) Has Jeff acked this patch? Thanks, Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC v2 0/2] vmevent: A bit reworked pressure attribute + docs + man page
Hello Minchan, Thanks a lot for the email! On Thu, Oct 25, 2012 at 03:40:09PM +0900, Minchan Kim wrote: [...] What applications (well, activity managers) are really interested in is this: 1. Do we we sacrifice resources for new memory allocations (e.g. files cache)? 2. Does the new memory allocations' cost becomes too high, and the system hurts because of this? 3. Are we about to OOM soon? Good but I think 3 is never easy. But early notification would be better than late notification which can kill someone. Well, basically these are two fixed (strictly defined) levels (low and oom) + one flexible level (med), which meaning can be slightly tuned (but we still have a meaningful definition for it). So, I guess it's a good start. :) And here are the answers: 1. VMEVENT_PRESSURE_LOW 2. VMEVENT_PRESSURE_MED 3. VMEVENT_PRESSURE_OOM There is no high pressure, since I really don't see any definition of it, but it's possible to introduce new levels without breaking ABI. The levels described in more details in the patches, and the stuff is still tunable, but now via sysctls, not the vmevent_fd() call itself (i.e. we don't need to rebuild applications to adjust window size or other mm details). What I couldn't fix in this RFC is making vmevent_{scanned,reclaimed} stuff per-CPU (there's a comment describing the problem with this). But I made it lockless and tried to make it very lightweight (plus I moved the vmevent_pressure() call to a more cold path). Your description doesn't include why we need new vmevent_fd(2). Of course, it's very flexible and potential to add new VM knob easily but the thing we is about to use now is only VMEVENT_ATTR_PRESSURE. Is there any other use cases for swap or free? or potential user? Number of idle pages by itself might be not that interesting, but cache+idle level is quite interesting. By definition, _MED happens when performance already degraded, slightly, but still -- we can be swapping. But _LOW notifications are coming when kernel is just reclaiming, so by using _LOW notifications + watching for cache level we can very easily predict the swapping activity long before we have even _MED pressure. E.g. if idle+cache drops below amount of memory that userland can free, we'd indeed like to start freeing stuff (this somewhat resembles current logic that we have in the in-kernel LMK). Sure, we can read and parse /proc/vmstat upon _LOW events (and that was my backup plan), but reporting stuff together would make things much nicer. Although, I somewhat doubt that it is OK to report raw numbers, so this needs some thinking to develop more elegant solution. Maybe it makes sense to implement something like PRESSURE_MILD with an additional nr_pages threshold, which basically hits the kernel about how many easily reclaimable pages userland has (that would be a part of our definition for the mild pressure level). So, essentially it will be if (pressure_index = oom_level) return PRESSURE_OOM; else if (pressure_index = med_level) return PRESSURE_MEDIUM; else if (userland_reclaimable_pages = nr_reclaimable_pages) return PRESSURE_MILD; return PRESSURE_LOW; I must admit I like the idea more than exposing NR_FREE and stuff, but the scheme reminds me the blended attributes, which we abandoned. Although, the definition sounds better now, and we seem to be doing it in the right place. And if we go this way, then sure, we won't need any other attributes, and so we could make the API much simpler. Adding vmevent_fd without them is rather overkill. And I want to avoid timer-base polling of vmevent if possbile. mem_notify of KOSAKI doesn't use such timer. For pressure notifications we don't use the timers. We also read the vmstat counters together with the pressure, so pressure + counters effectively turns it into non-timer based polling. :) But yes, hopefully we can get rid of the raw counters and timers, I don't them it too. I don't object but we need rationale for adding new system call which should be maintained forever once we add it. We can do it via eventfd, or /dev/chardev (which has been discussed and people didn't like it, IIRC), or signals (which also has been discussed and there are problems with this approach as well). I'm not sure why having a syscall is a big issue. If we're making eventfd interface, then we'd need to maintain /sys/.../ ABI the same way as we maintain the syscall. What's the difference? A dedicated syscall is just a simpler interface, we don't need to mess with opening and passing things through /sys/.../. Personally I don't have any preference (except that I distaste chardev and ioctls :), I just want to see pros and cons of all the solutions, and so far the syscall seems like an easiest way? Anyway, I'm totally open to changing it into whatever fits best. Thanks, Anton. -- To unsubscribe from this
Re: [PATCH V2 7/7] perf, x86: Discard zero length call entries in LBR call stack
Hi, On Wed, 24 Oct 2012 13:59:10 +0800, Zheng Yan wrote: From: Yan, Zheng zheng.z@intel.com Zero length calls may confuse the hardware and make the recorded call stack incorrect. Try fixing the call stack by discarding zero length call entries. It would be great adding an explanation what is the zero length call and why it makes a confusion. Thanks, Namhyung -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv4] Input: keypad: Add smsc ece1099 keypad driver
Hi Dmitry, On Wednesday 24 October 2012 12:05 PM, Dmitry Torokhov wrote: Hi Sourav, On Fri, Oct 05, 2012 at 12:56:26PM +0530, Sourav Poddar wrote: From: G, Manjunath Kondaiah manj...@ti.com SMSC ECE1099 is a keyboard scan or GPIO expansion device.The device supports a keypad scan matrix of 23*8.This driver uses this device as a keypad driver. Tested on omap5430 evm with 3.6-rc6 custom kernel. Cc: Benoit Cousson b-cous...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Santosh Shilimkar santosh.shilim...@ti.com Signed-off-by: G, Manjunath Kondaiah manj...@ti.com Signed-off-by: Sourav Poddar sourav.pod...@ti.com Acked-by: Felipe Balbi ba...@ti.com --- This patch was posted as a series initially http://www.spinics.net/lists/linux-omap/msg78772.html But the parent mfd driver has beeen already picked by mfd maintainer. So this patch can now posted as an standalone patch. v3-v4: Fix Dmitry's comments: - Error patch(input_free_device/input_unregister_device). - Few cleanups. - Included INPUT_MATRIXKMAP drivers/input/keyboard/Kconfig | 12 + drivers/input/keyboard/Makefile |1 + drivers/input/keyboard/smsc-ece1099-keypad.c | 303 ++ 3 files changed, 316 insertions(+), 0 deletions(-) create mode 100644 drivers/input/keyboard/smsc-ece1099-keypad.c diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index c50fa75..e370b03 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -593,6 +593,18 @@ config KEYBOARD_TWL4030 To compile this driver as a module, choose M here: the module will be called twl4030_keypad. +config KEYBOARD_SMSC + tristate SMSC ECE1099 keypad support + depends on I2C + select INPUT_MATRIXKMAP While I do not see hard dependencies in the driver itself, should we also depend on MFD_SMSC? Ahh, may be yes. This driver will get probed only after parent driver get probed. So may be we can follow the same order for building also. + help + Say Y here if your board use the smsc keypad controller + for omap5 defconfig. It's safe to say enable this + even on boards that don't use the keypad controller. + + To compile this driver as a module, choose M here: the + module will be called smsc-ece1099-keypad. + config KEYBOARD_XTKBD tristate XT keyboard select SERIO diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 44e7600..0f2aa26 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile @@ -52,5 +52,6 @@ obj-$(CONFIG_KEYBOARD_TC3589X)+= tc3589x-keypad.o obj-$(CONFIG_KEYBOARD_TEGRA) += tegra-kbc.o obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o obj-$(CONFIG_KEYBOARD_TWL4030)+= twl4030_keypad.o +obj-$(CONFIG_KEYBOARD_SMSC)+= smsc-ece1099-keypad.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_W90P910)+= w90p910_keypad.o diff --git a/drivers/input/keyboard/smsc-ece1099-keypad.c b/drivers/input/keyboard/smsc-ece1099-keypad.c new file mode 100644 index 000..a4a0dfe --- /dev/null +++ b/drivers/input/keyboard/smsc-ece1099-keypad.c @@ -0,0 +1,303 @@ +/* + * SMSC_ECE1099 Keypad driver + * + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/i2c.h +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/interrupt.h +#include linux/input.h +#include linux/gpio.h +#include linux/slab.h +#include linux/jiffies.h +#include linux/input/matrix_keypad.h +#include linux/delay.h +#include linux/mfd/core.h +#include linux/mfd/smsc.h +#include linux/of_gpio.h +#include linux/of.h + +#define KEYPRESS_TIME 200 + +struct smsc_keypad { + struct smsc *smsc; I do not see this being actually used. Yes, will remove. + struct matrix_keymap_data *keymap_data; Does not seem to be used. Yes, will remove. + unsigned int last_key_state[16]; + unsigned int last_col; + unsigned int last_key_ms[16]; + unsigned short *keymap; + struct i2c_client *client; + struct input_dev *input; + int rows, cols; + int row_shift; + bool no_autorepeat; + unsignedirq; I do not think you need to store irq if you are using managed resources. Don't, we need some variable to keep the irq number received after parsing the dt data.? This variable is basically used as a parameter in request_irq api. I saw the patch on omap4_keypad switching to managed resource, and there also we are keeping the keypad_data-irq intact?? + struct device *dev; +}; + +static void smsc_kp_scan(struct smsc_keypad
Re: [Xen-devel] [PATCH] xen PVonHVM: move shared_info to reserved memory area
On 25.10.12 at 11:04, Olaf Hering o...@aepfle.de wrote: @@ -1495,38 +1494,53 @@ asmlinkage void __init xen_start_kernel(void) #endif } -void __ref xen_hvm_init_shared_info(void) Was the __ref here in fact unnecessary (i.e. did you check that its removal doesn't cause any section mismatch warnings)? +#ifdef CONFIG_XEN_PVHVM +#define HVM_SHARED_INFO_ADDR 0xFE70UL +static struct shared_info *xen_hvm_shared_info; + +static void xen_hvm_connect_shared_info(unsigned long pfn) { - int cpu; struct xen_add_to_physmap xatp; - static struct shared_info *shared_info_page = 0; - if (!shared_info_page) - shared_info_page = (struct shared_info *) - extend_brk(PAGE_SIZE, PAGE_SIZE); xatp.domid = DOMID_SELF; xatp.idx = 0; xatp.space = XENMAPSPACE_shared_info; - xatp.gpfn = __pa(shared_info_page) PAGE_SHIFT; + xatp.gpfn = pfn; if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, xatp)) BUG(); - HYPERVISOR_shared_info = (struct shared_info *)shared_info_page; +} +static void xen_hvm_set_shared_info(struct shared_info *sip) With its sole caller being __init, this should also be __init. Jan +{ + int cpu; + + HYPERVISOR_shared_info = sip; /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info * page, we use it in the event channel upcall and in some pvclock * related functions. We don't need the vcpu_info placement * optimizations because we don't use any pv_mmu or pv_irq op on - * HVM. - * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is - * online but xen_hvm_init_shared_info is run at resume time too and - * in that case multiple vcpus might be online. */ - for_each_online_cpu(cpu) { + * HVM. */ + for_each_online_cpu(cpu) per_cpu(xen_vcpu, cpu) = HYPERVISOR_shared_info-vcpu_info[cpu]; - } } -#ifdef CONFIG_XEN_PVHVM +/* Reconnect the shared_info pfn to a (new) mfn */ +void xen_hvm_resume_shared_info(void) +{ + xen_hvm_connect_shared_info(HVM_SHARED_INFO_ADDR PAGE_SHIFT); +} + +/* Obtain an address to the pfn in reserved area */ +void __init xen_hvm_init_shared_info(void) +{ + set_fixmap(FIX_PARAVIRT_BOOTMAP, HVM_SHARED_INFO_ADDR); + xen_hvm_shared_info = + (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); + xen_hvm_connect_shared_info(HVM_SHARED_INFO_ADDR PAGE_SHIFT); + xen_hvm_set_shared_info(xen_hvm_shared_info); +} + static void __init init_hvm_pv_info(void) { int major, minor; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mm: fix build warning in try_to_unmap_cluster()
Fix build warning in try_to_unmap_cluster() as below: mm/rmap.c: In function 'try_to_unmap_cluster': mm/rmap.c:1364:9: warning: unused variable 'pud' [-Wunused-variable] mm/rmap.c:1363:9: warning: unused variable 'pgd' [-Wunused-variable] This build warning is introduced by commit 0981230 mm: introduce mm_find_pmd(). Signed-off-by: Jingoo Han jg1@samsung.com Cc: Bob Liu lliu...@gmail.com --- This patch is based on linux-next-20121025 code tree. mm/rmap.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 6c686c2..98b100e 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1360,8 +1360,6 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, struct vm_area_struct *vma, struct page *check_page) { struct mm_struct *mm = vma-vm_mm; - pgd_t *pgd; - pud_t *pud; pmd_t *pmd; pte_t *pte; pte_t pteval; -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] add some drop_caches documentation and info messsge
On Wed, Oct 24, 2012 at 08:56:45PM -0400, KOSAKI Motohiro wrote: That effectively means removing it from the kernel since distros ship with those config options off. We don't want to do that since there _are_ valid, occasional uses like benchmarking that we want to be consistent. Agreed. we don't want to remove valid interface never. Ok, duly noted. But let's discuss this a bit further. So, for the benchmarking aspect, you're either going to have to always require dmesg along with benchmarking results or /proc/vmstat, depending on where the drop_caches stats end up. Is this how you envision it? And then there are the VM bug cases, where you might not always get full dmesg from a panicked system. In that case, you'd want the kernel tainting thing too, so that it at least appears in the oops backtrace. Although the tainting thing might not be enough - a user could drop_caches at some point in time and the oops happening much later could be unrelated but that can't be expressed in taint flags. So you'd need some sort of a drop_caches counter, I'd guess. Or a last drop_caches timestamp something. Am I understanding the intent correctly? Thanks. -- Regards/Gruss, Boris. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: RE: [PATCH] extcon : callback function to read cable property
Subject: Re: RE: [PATCH] extcon : callback function to read cable property For charger cable the current each cable can provide will be common. But may not be relevant for other cables. I understand your point on extcon role. But my concern is, when the consumer driver gets a notification on cable state change, how does the consumer query the cable properties in a generic way. Do you have any suggestions for this? A use case can be as below When a USB host cable (SDP) connected to the platform, without USB enumeration it can support only up to 100mA(USB2.)/150mA(USB 3.0) (As per USB charging spec). Once the enumeration is done this can be 500mA/950mA. If the consumer charger driver need to configure the charger chip, it need to know the charger cable capabilities. For example a platform PLAT1 may have charger driver CHRGR1 and OTG driver OTG1. But platform PLAT2 may have CHGR1 but different OTG driver OTG2. How CHGR1 driver can detect the cable properties without having any platform layer hooks? The platform layer hooks (using platform data)will work only if the consumer is a platform driver. What if it's a framework which will have the same flow in all platforms? In general, an extcon user (extcon notifee) knows who's the extcon notifier; the user is supposed to know the name of the notifier. Thus, the extcon user should be able to get the appropriate object; i.e., a regulator struct in this case. Then, according to the USB state, the current limit of the USB can be changed by the notifier; which may notify (regulator subsystem has one) the extcon user to react (change current limit of charger?) The flow we have is notifier (OTG driver/cable notifier driver) - extcon- charging framework-charger driver When the framework gets notification from the extcon, it just know cable is connected/disconnected For a USB charging the state machine can be For USB2.0 1) CONNECT (100mA)-UPDATE(500mA)-DISCONNECT(0mA) 2)CONNECT (100mA)-UPDATE(500mA)-HOST SUSPEND(2.5mA/500mA)-DISCONNECT(0mA) 3) CONNECT (100mA)-UPDATE(500mA)-HOST SUSPEND(2.5mA/500mA)-HOST RESUME(500mA)-DISCONNECT(0mA) For USB 3.0 4) CONNECT (150mA)-UPDATE(900mA)-DISCONNECT(0mA) 5) CONNECT (150mA)-UPDATE(900mA)- HOST SUSPEND(2.5mA/900mA)-DISCONNECT(0mA) 6) CONNECT (100mA)-UPDATE(900mA)-HOST SUSPEND(2.5mA/900mA)-HOST RESUME(900mA)-DISCONNECT(0mA) Anyway, in your case of PLAT2, doesn't CHGR1 has (or is) a regulator controlling the charger current and if the OTG2 regulator affects the behavior of CHGR1, (the current of OTG2-reg goes to CHGR1-reg) the consumer- supplier chain should be setup (if the BSP is ideal). OR If it is impossible to have any objects of OTG2 (looks strange, but..), you may have two cables, USB (data) and Fast-charger.04 (add +400mA to USB), where Fast-charger.04 is enabled when USB2 enumeration is done with 5 I got your point. It's not just 2 cables we may need 4 cables to support USB2.0 and USB3.0 since the charge current can be 100/500 for USB2.0 and 150/900 for USB 3.0. But what about the states? . However, the following callback might be considered if there are cases where an extcon user has information of extcon_name and cable_name while the user CANNOT get any information on which device or object is related with the specific cable; in struct extcon, with optional user initializing data section: + struct device **cable_device; OR + char **cable_device_name; With any relevant changes in the status with cable_device, we may notify any notifier-block that are interested in the specific cable. Then, the notifier- block (for register_interest) is going to handle extcon-state changes and cable_device notifications. Currently, the user's nb is for cable attach/detach events with true/false value in the place of 32bit value (val). However, if we add the third possible value for that parameter (0: cable detached, 1: cable attached, 2: cable status changed; go find out what's going on), it is still compatible. I considered using a void pointer instead of cable_device, too. However, that would spoil the subsystem too much; we'll be creating a total chaos: USB-A driver uses struct regulator, USB-B driver uses struct device, USB-C driver uses true/false, and so on. But just by getting the device instance how do we extract the cable properties like cable state and the charge current in a generic way?
Re: [PATCH v4 -tip 3/3] AHCI: Support multiple MSIs
On Thu, Oct 25, 2012 at 11:09:57AM +0200, Ingo Molnar wrote: Has Jeff acked this patch? Yep, http://lkml.indiana.edu/hypermail/linux/kernel/1210.0/00795.html -- Regards, Alexander Gordeev agord...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 05/10] compiler{,-gcc4}.h, bug.h: Remove duplicate macros
On Wed, Oct 24, 2012 at 11:33:56AM -0500, danielfsan...@att.net wrote: __linktime_error() does the same thing as __compiletime_error() and is only used in bug.h. Since the macro defines a function attribute that will cause a failure at compile-time (not link-time), it makes more sense to keep __compiletime_error(), which is also neatly mated with __compiletime_warning(). Signed-off-by: Daniel Santos daniel.san...@pobox.com Acked-by: David Rientjes rient...@google.com Acked-by: Borislav Petkov b...@alien8.de -- Regards/Gruss, Boris. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC v2 0/2] vmevent: A bit reworked pressure attribute + docs + man page
On Thu, Oct 25, 2012 at 02:08:14AM -0700, Anton Vorontsov wrote: [...] Maybe it makes sense to implement something like PRESSURE_MILD with an additional nr_pages threshold, which basically hits the kernel about how many easily reclaimable pages userland has (that would be a part of our definition for the mild pressure level). So, essentially it will be if (pressure_index = oom_level) return PRESSURE_OOM; else if (pressure_index = med_level) return PRESSURE_MEDIUM; else if (userland_reclaimable_pages = nr_reclaimable_pages) return PRESSURE_MILD; ...or we can call it PRESSURE_BALANCE, just to be precise and clear. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [BUG 3.7-rc1] nouveau cli-mutex possible recursive locking detected
On 10/24/2012 02:45 PM, Arend van Spriel wrote: On 10/24/2012 01:14 PM, Arend van Spriel wrote: On 10/16/2012 02:43 PM, Stanislaw Gruszka wrote: I have this lockdep warning on wireless-testing tree based on 3.7-rc1 (no other patches except wireless bits). = Restarting tasks ... done. [ INFO: possible recursive locking detected ] 3.7.0-rc1-wl+ #2 Not tainted - Xorg/2269 is trying to acquire lock: (cli-mutex){+.+.+.}, at: [a012a27f] nouveau_bo_move_m2mf+0x5f/0x170 [nouveau] but task is already holding lock: (cli-mutex){+.+.+.}, at: [a012f3c4] nouveau_abi16_get+0x34/0x100 [nouveau] I have observed the same bug so I built and tested v3.7-rc2 tag with lockdep enabled. It has the same problem and it results in a failure to resume after suspend. See below. Gr. AvS digging into the trace: nouveau_gem_ioctl_pushbuf() calls nouveau_abi16_get() which grabs the mutex. Assume this should protect the chan variable passed to nouveau_gem_pushbuf_validate(), which does a bit more that validate as it ends up in nouveau_bo_move_m2mf() which uses the drm-chan. However, it deadlocks before that. Gr. AvS Maybe this helps. The two locations where the lock is grabbed are from the same commit (see below). Gr. AvS commit ebb945a94bba2ce8dff7b0942ff2b3f2a52a0a69 Author: Ben Skeggs bske...@redhat.com Date: Fri Jul 20 08:17:34 2012 +1000 drm/nouveau: port all engines to new engine module format This is a HUGE commit, but it's not nearly as bad as it looks - any problems can be isolated to a particular chipset and engine combination. It was simply too difficult to port each one at a time, the compat layers are *already* ridiculous. Most of the changes here are simply to the glue, the process for each of the engine modules was to start with a standard skeleton and copy+paste the old code into the appropriate places, fixing up variable names etc as needed. v2: Marcin Slusarz marcin.slus...@gmail.com - fix find/replace bug in license header v3: Ben Skeggs bske...@redhat.com - bump indirect pushbuf size to 8KiB, 4KiB barely enough for userspace and left no space for kernel's requirements during GEM pushbuf submission. - fix duplicate assignments noticed by clang v4: Marcin Slusarz marcin.slus...@gmail.com - add sparse annotations to nv04_fifo_pause/nv04_fifo_start - use ioread32_native/iowrite32_native for fifo control registers v5: Ben Skeggs bske...@redhat.com - rebase on v3.6-rc4, modified to keep copy engine fix intact - nv10/fence: unmap fence bo before destroying - fixed fermi regression when using nvidia gr fuc - fixed typo in supported dma_mask checking Signed-off-by: Ben Skeggs bske...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86, intel, power: Modify the MSR_IA32_ENERGY_PERF_BIAS message from warning to info
Intel IA32 program guild doesn't mention that this MSR should be set by BIOS, instead, it mentions Software can use whatever criteria it sees fit to program the MSR with the appropriate value.. Discuss with IBV, they'd like to keep this MSR as default, and let OS to change value if desired. This message should be more proper set as an info than a warning. Signed-off-by: Ivan Hu ivan...@canonical.com --- arch/x86/kernel/cpu/intel.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 198e019..2bdc6bf 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -466,7 +466,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); if ((epb 0xF) == ENERGY_PERF_BIAS_PERFORMANCE) { - printk_once(KERN_WARNING ENERGY_PERF_BIAS: + printk_once(KERN_INFO ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/