[PATCH] .gitignore: ignore Module.symvers in all directories
When using `make M=/path/to/driver modules` to build a module, file Module.symvers will be created in that directory, so it's better to ignore it in all directories. Slightly reordered, let specific file names behind general ones. Cc: Andrew Morton Cc: Kyungsik Lee Cc: Markus Trippelsdorf Signed-off-by: Zhao, Gang --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7e9932e..3aa8145 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ *.lst *.symtypes *.order -modules.builtin *.elf *.bin *.gz @@ -33,6 +32,8 @@ modules.builtin *.lzo *.patch *.gcno +modules.builtin +Module.symvers # # Top-level generic files @@ -44,7 +45,6 @@ modules.builtin /vmlinuz /System.map /Module.markers -/Module.symvers # # Debian directory (make deb-pkg) -- 1.9.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] workqueue: fix double unlock bug
On 04/14/2014 08:58 AM, Daeseok Youn wrote: > > mutex_unlock() and put_pwq_unlocked() do not need to be called > when alloc_unbound_pwq() is failed. > > Signed-off-by: Daeseok Youn > --- > kernel/workqueue.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 0ee63af..e6e9f6a 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -4100,7 +4100,7 @@ static void wq_update_unbound_numa(struct > workqueue_struct *wq, int cpu, > if (!pwq) { > pr_warning("workqueue: allocation failed while updating NUMA > affinity of \"%s\"\n", > wq->name); > - goto out_unlock; > + return; > } > > /* Nice catch!!! The supposed correct behavior is documented in the head of this function. We forgot to do it. * If NUMA affinity can't be adjusted due to memory allocation failure, it * falls back to @wq->dfl_pwq which may not be optimal but is always * correct. Could you use the following code instead of "goto out_unlock": mutex_lock(&wq->mutex); if (pwq == wq->dfl_pwq) goto out_unlock; else goto use_dfl_pwq; Correct&BAD. There are two blocks of suck code in this function: if (pwq == wq->dfl_pwq) goto out_unlock; else goto use_dfl_pwq; You can replace both these two blocks code to the following code: goto use_dfl_pwq; The result is the same as before except it adds some small overhead. I don't care the small overhead in this function. Thanks Lai -- 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] btrfs: remove redundant null check in btrfs_dentry_release()
It doesn't need to check NULL for kfree() Signed-off-by: Daeseok Youn --- fs/btrfs/inode.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 06e9a41..d9f54b0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5141,8 +5141,7 @@ static int btrfs_dentry_delete(const struct dentry *dentry) static void btrfs_dentry_release(struct dentry *dentry) { - if (dentry->d_fsdata) - kfree(dentry->d_fsdata); + kfree(dentry->d_fsdata); } static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, -- 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: [PATCH 01/27] ARM: EXYNOS: Add Exynos3250 SoC ID
Dear Kukjin and Tomasz, On 04/11/2014 10:31 AM, Chanwoo Choi wrote: > Hi, > > On 04/10/2014 06:43 PM, Arnd Bergmann wrote: >> On Thursday 10 April 2014 18:28:18 Chanwoo Choi wrote: >>> This patch add Exynos3250's SoC ID. Exynos 3250 is System-On-Chip(SoC) that >>> is based on the 32-bit RISC processor for Smartphone. Exynos3250 uses >>> Cortex-A7 >>> dual cores and has a target speed of 1.0GHz. >>> >>> Signed-off-by: Chanwoo Choi >>> Signed-off-by: Kyungmin Park >>> --- >>> arch/arm/mach-exynos/Kconfig | 22 ++ >>> arch/arm/mach-exynos/exynos.c| 1 + >>> arch/arm/plat-samsung/include/plat/cpu.h | 10 ++ >>> 3 files changed, 33 insertions(+) >>> >>> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig >>> index fc8bf18..6da8a68 100644 >>> --- a/arch/arm/mach-exynos/Kconfig >>> +++ b/arch/arm/mach-exynos/Kconfig >>> @@ -11,6 +11,17 @@ if ARCH_EXYNOS >>> >>> menu "SAMSUNG EXYNOS SoCs Support" >>> >>> +config ARCH_EXYNOS3 >>> + bool "SAMSUNG EXYNOS3" >>> + select ARM_AMBA >>> + select CLKSRC_OF >>> + select HAVE_ARM_SCU if SMP >>> + select HAVE_SMP >>> + select PINCTRL >>> + select PM_GENERIC_DOMAINS if PM_RUNTIME >>> + help >>> + Samsung EXYNOS3 SoCs based systems >>> + >> >> Isn't S5PV210 also called an Exynos3 these days? Are we going to get >> any conflicts here when merging that code into Exynos as Tomasz has >> suggested in the past? > > I knew. But, S5PV210/S5PC110 has not yet included in Exynos3 category on > mainline. > Need opinion of Exynos SoC Maintainer to clear this ambiguous stuff. > > Dear Kukjin and Tomasz, > I need your opinion about this patch. > Please review this patch and reply about Arnd's comment. Best Regards, Chanwoo Choi -- 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] kernel/panic: Add "late_kdump" option for kdump in unstable condition
(2014/04/14 14:14), Eric W. Biederman wrote: > Masami Hiramatsu writes: > >> Add a "late_kdump" option to run kdump after running panic >> notifiers and dump kmsg. This can help rare situations which >> kdump drops in failure because of unstable crashed kernel >> or hardware failure (memory corruption on critical data/code), >> or the 2nd kernel is broken by the 1st kernel (it's a broken >> behavior, but who can guarantee that the "crashed" kernel >> works correctly?). >> >> Usage: add "late_kdump" to kernel boot option. That's all. >> >> Note that this actually increases risks of the failure of >> kdump. This option should be set only if you worry about >> the rare case of kdump failure rather than increasing the >> chance of success. > > This is better than some others, but every time I have seen a request > to do this it is because someone wants to do something horrible that > makes kdump more brittle and generally unsupportable. I see, with such horrible handlers, kdump should be unreliable. However, that is not introduced by this option. > You seem to in general understand that. > > But how can we support an option to make the kernel flakier? I think it's user's own risk. We do not need to (individual) support it but just give them a chance. And distros decide to provide support on such option or not. For example, some users may choose enabling this without any kdump guarantee from distro, or will pay more for them to extra support. OTOH, other users who don't enable this, will not pay much for extra support :) > I suspect it would be more productive to work on the lkcd (spelling?) > test module and show that crash dump actually works in the situation > people are worried about. No, I think there are some situation which the kdump/lkcd actually doesn't work (e.g. software/hardware memory corruptions involving 2nd kernel image). And in those cases, to leave the minimum information on serial console, NVM or somewhere safe, this option may give a chance. Note that those output action can make the situation worse, because some of such actions are not well tested and may be immature. Thus I added a warning message on the path of "late_kdump" :) > Just thinking about this send shivers up my spine. Ick. I hope everyone correctly understand the risk of this option, and not sending bug reports to you. Thank you, > > Eric > >> Signed-off-by: Masami Hiramatsu >> Cc: Eric Biederman >> Cc: Vivek Goyal >> Cc: Andrew Morton >> Cc: Yoshihiro YUNOMAE >> Cc: Satoru MORIYA >> Cc: Motohiro Kosaki >> Cc: Takenori Nagano >> --- >> Documentation/kernel-parameters.txt |7 +++ >> kernel/panic.c | 24 ++-- >> 2 files changed, 29 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/kernel-parameters.txt >> b/Documentation/kernel-parameters.txt >> index 03e50b4..1ba58da 100644 >> --- a/Documentation/kernel-parameters.txt >> +++ b/Documentation/kernel-parameters.txt >> @@ -2339,6 +2339,13 @@ bytes respectively. Such letter suffixes can also be >> entirely omitted. >> timeout < 0: reboot immediately >> Format: >> >> +late_kdump Run kdump after running panic-notifiers and dumping >> +kmsg. This only for the users who doubt kdump always >> +succeeds in any situation. >> +Note that this also increases risks of kdump failure, >> +because some panic notifiers can make the crashed >> +kernel more unstable. >> + >> parkbd.port=[HW] Parallel port number the keyboard adapter is >> connected to, default is 0. >> Format: >> diff --git a/kernel/panic.c b/kernel/panic.c >> index d02fa9f..bba42b5 100644 >> --- a/kernel/panic.c >> +++ b/kernel/panic.c >> @@ -32,6 +32,7 @@ static unsigned long tainted_mask; >> static int pause_on_oops; >> static int pause_on_oops_flag; >> static DEFINE_SPINLOCK(pause_on_oops_lock); >> +static bool late_kdump; >> >> int panic_timeout = CONFIG_PANIC_TIMEOUT; >> EXPORT_SYMBOL_GPL(panic_timeout); >> @@ -112,9 +113,14 @@ void panic(const char *fmt, ...) >> /* >> * If we have crashed and we have a crash kernel loaded let it handle >> * everything else. >> - * Do we want to call this before we try to display a message? >> + * If we want to call this after we try to display a message, pass >> + * the "late_kdump" option to the kernel. >> */ >> -crash_kexec(NULL); >> +if (!late_kdump) >> +crash_kexec(NULL); >> +else >> +pr_emerg("Warning: late_kdump option is set. Please DO NOT " >> +"report bugs about kdump failure with this option.\n"); >> >> /* >> * Note smp_send_stop is the usual smp shutdown function, which >> @@ -131,6 +137,13 @@ void panic(const char *fmt, ...) >> >> kmsg_dump(KMSG_DUMP_PANIC); >> >> +/
[PATCH] befs: replace goto with while
The goto in befs_readdir() can be replaced with while. And also fix smatch warnings: fs/befs/linuxvfs.c:283 befs_readdir() info: ignoring unreachable code. fs/befs/linuxvfs.c:283 befs_readdir() info: ignoring unreachable code. Signed-off-by: Daeseok Youn --- fs/befs/linuxvfs.c | 86 +++- 1 files changed, 45 insertions(+), 41 deletions(-) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index d626756..640f8775 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -227,6 +227,7 @@ befs_readdir(struct file *file, struct dir_context *ctx) befs_data_stream *ds = &BEFS_I(inode)->i_data.ds; befs_off_t value; int result; + int ret = 0; size_t keysize; unsigned char d_type; char keybuf[BEFS_NAME_LEN + 1]; @@ -235,54 +236,57 @@ befs_readdir(struct file *file, struct dir_context *ctx) befs_debug(sb, "---> %s name %s, inode %ld, ctx->pos %lld", __func__, dirname, inode->i_ino, ctx->pos); -more: - result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1, -keybuf, &keysize, &value); + while (1) { + result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1, +keybuf, &keysize, &value); - if (result == BEFS_ERR) { - befs_debug(sb, "<--- %s ERROR", __func__); - befs_error(sb, "IO error reading %s (inode %lu)", - dirname, inode->i_ino); - return -EIO; + if (result == BEFS_ERR) { + befs_debug(sb, "<--- %s ERROR", __func__); + befs_error(sb, "IO error reading %s (inode %lu)", + dirname, inode->i_ino); + ret = -EIO; + break; - } else if (result == BEFS_BT_END) { - befs_debug(sb, "<--- %s END", __func__); - return 0; + } else if (result == BEFS_BT_END) { + befs_debug(sb, "<--- %s END", __func__); + break; - } else if (result == BEFS_BT_EMPTY) { - befs_debug(sb, "<--- %s Empty directory", __func__); - return 0; - } + } else if (result == BEFS_BT_EMPTY) { + befs_debug(sb, "<--- %s Empty directory", __func__); + break; + } - d_type = DT_UNKNOWN; + d_type = DT_UNKNOWN; - /* Convert to NLS */ - if (BEFS_SB(sb)->nls) { - char *nlsname; - int nlsnamelen; - result = - befs_utf2nls(sb, keybuf, keysize, &nlsname, &nlsnamelen); - if (result < 0) { - befs_debug(sb, "<--- %s ERROR", __func__); - return result; - } - if (!dir_emit(ctx, nlsname, nlsnamelen, -(ino_t) value, d_type)) { + /* Convert to NLS */ + if (BEFS_SB(sb)->nls) { + char *nlsname; + int nlsnamelen; + + result = befs_utf2nls(sb, keybuf, keysize, &nlsname, + &nlsnamelen); + + if (result < 0) { + befs_debug(sb, "<--- %s ERROR", __func__); + ret = result; + break; + } + if (!dir_emit(ctx, nlsname, nlsnamelen, + (ino_t) value, d_type)) { + kfree(nlsname); + break; + } kfree(nlsname); - return 0; + } else { + if (!dir_emit(ctx, keybuf, keysize, + (ino_t) value, d_type)) + break; } - kfree(nlsname); - } else { - if (!dir_emit(ctx, keybuf, keysize, -(ino_t) value, d_type)) - return 0; + ctx->pos++; + befs_debug(sb, "<--- %s pos %lld", __func__, ctx->pos); } - ctx->pos++; - goto more; - befs_debug(sb, "<--- %s pos %lld", __func__, ctx->pos); - - return 0; + return ret; } static struct inode * -- 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: [PATCH 03/27] ARM: EXYNOS: Add IO mapping for PMU of Exynos3250
Dear Arnd and Kukjin, On 04/10/2014 06:46 PM, Arnd Bergmann wrote: > On Thursday 10 April 2014 18:28:20 Chanwoo Choi wrote: >> This patch add memory mapping for PMU (Power Management Unit) which is used >> for power control of Exynos3250. >> >> Signed-off-by: Chanwoo Choi >> Signed-off-by: Kyungmin Park > > Same thing as for the SRAM here, can you work on making this a proper > driver instead? > As Chanho Park said, Sachin already submitted the DT support[1] for SYSRAM area. [1] : http://www.spinics.net/lists/linux-samsung-soc/msg27647.html But, this patch has not yet to merge git repository(linux-samsung.git, arm-soc.git). So, I'll make a driver to handle PMU memory mapping after Sachin's patch is merged. Best Regards, Chanwoo Choi -- 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] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
pcpu_chunk_struct_size = sizeof(struct pcpu_chunk) + BITS_TO_LONGS(pcpu_unit_pages) * sizeof(unsigned long) It hardly could be ever bigger than PAGE_SIZE even for large-scale machine, but for consistency with its couterpart pcpu_mem_zalloc(), use pcpu_mem_free() instead. Commit b4916cb17c261a6043bcb2a98d0d6512497a7cf8 addressed this problem, but missed this one. Signed-off-by: Jianyu Zhan --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c index 63e24fb..2ddf9a9 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -610,7 +610,7 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void) chunk->map = pcpu_mem_zalloc(PCPU_DFL_MAP_ALLOC * sizeof(chunk->map[0])); if (!chunk->map) { - kfree(chunk); + pcpu_mem_free(chunk, pcpu_chunk_struct_size); return NULL; } -- 1.9.0.GIT -- 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] tuntap: add flow control to support back pressure
On Sun, Apr 13, 2014 at 09:28:51PM -0400, Steven Galgano wrote: > On 04/13/2014 10:14 AM, Michael S. Tsirkin wrote: > > > > Steven, Brian, > > > > thanks for reporting this issue. > > Please see my comments below. > > > > On Fri, Apr 11, 2014 at 12:41:42PM -0400, Brian Adamson wrote: > >> To weigh in on the desire to have support (at least as an optional > >> behavior) for the legacy flow control behavior, there are many existing > >> uses of it. Many these are related to experimental purposes where the > >> tuntap driver can be used (with a little user space code) as a surrogate > >> for a network interface type that may not even yet exist. And in some > >> cases these experimental purposes have had utility for actual deployment > >> (e.g. disaster relief wireless networks where the TAP device has provided > >> some intermediate assistance for routing or other protocols, even an > >> underwater acoustic sensor network proposed for reef monitoring, etc where > >> a TAP device provides a network interface and the sound card is used as a > >> modem on an embedded system). Some of these networks have low data rates > >> or packet loss and delays that make TCP (which provides flow control as > >> part of its usual reliable transport for more typical networking purpose) > >> not an ideal protocol to use and so UDP or oth! > er alterna > tives or used. To keep this short, I'll list a few use cases here I know > (and was involved with the implementation of some) with some links (where I > know them): > >> > >> 1) CORE network emulation tool (http://code.google.com/p/coreemu/) > >> > >> 2) EMANE network emulation tool (https://github.com/adjacentlink/emane) > >> > >> (likely other network emulation tools exist that have used tuntap as > >> surrogates for real physical interfaces and expect the same backpressure > >> to sockets and queues that physical interfaces provide) > >> > >> 3) I don't have a link to it but I implemented an experimental IP > >> interface/ MAC protocol called SLIDE (serial-link internet daemon) that > >> implemented a user-space CSMA MAC protocol where an underwater acoustic > >> modem was connected to the serial port and TAP was used to present a > >> virtual network interface to the IP stack. Because of the low data rates > >> involved, the back pressure flow control to application sockets (and > >> protocol daemons and qdiscs applied) was important. > >> > >> 4) User space implementation of Simplified Multicast Forwarding (SMF) of > >> RFC 6621 has a "device" option that establishes TAP interfaces to perform > >> distributed "backpressure" based flow control (and potentially routing) > >> for MANET wireless networks. > >> (http://www.nrl.navy.mil/itd/ncs/products/smf) > >> > >> There are probably some more, among the more esoteric wireless and other > >> special networking communities, where host (or routing/gateway/proxy > >> non-host), e.g. special embedded system devices based on Linux such as > >> sensors, etc) have a first hop network attachment that is _not_ the > >> typical Ethernet or something and may be using tuntap along with a sort of > >> user-space "driver" to present an IP interface to the network stack. some > >> of this stuff, especially embedded systems, tend to lag behind with > >> respect to kernel versions and this behavior change in Linux may be yet > >> undiscovered so far even though the change was put in a couple years ago. > >> > >> Several of these are implemented across multiple platforms, and, for > >> example, BSD-based systems tuntap provides the same flow control behavior. > >> Even if it was never formally documented, I think this behavior was > >> fairly well known (at least for these sorts of experimental purposes) and > >> used. I understand the concern that a single bad behaving flow can > >> possibly block the flow of others unless traffic control queuing > >> disciplines (as done for other network interfaces). For the purposes of > >> which I'm aware, I think having this behavior as _optional_ is probably OK > >> … If accepted, and something is implemented here, it may be a good > >> opportunity to have it documented (and the pros and cons of its use) for > >> the more general Linux community. > > > > Yes, a UDP socket with sufficiently deep qdisc and tun queues > > would previously get slowed down so it matches the speed of > > the interface. > > > > But IIUC this was not really designed to be a flow control measure, > > so depending on what else is in the qdisc you could easily get > > into a setup where it behaves exactly as it does now. > > For example, have several UDP sockets send data out a single > > interface. > > > > Another problem is that this depends on userspace to be > > well-behaved and consume packets in a timely manner: > > a misbehaving userspace operating a tun device can cause other > > tun devices and/or sockets to get blocked forever and prevent them > > from commu
[PATCH] thermal: samsung: Only update available threshold limits
Currently the threshold limits are updated in 2 stages, once for all software trigger levels and again for hardware trip point. While updating the software trigger levels, it overwrites the threshold limit for hardware trip point thereby forcing the Exynos core to issue an emergency shutdown. Updating only the required fields in threshold register fixes this issue. Signed-off-by: Tushar Behera --- Based on v3.15-rc1. drivers/thermal/samsung/exynos_tmu.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0d96a51..ffccc89 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -225,6 +225,8 @@ skip_calib_data: trigger_levs++; } + rising_threshold = readl(data->base + reg->threshold_th0); + if (data->soc == SOC_ARCH_EXYNOS4210) { /* Write temperature code for threshold */ threshold_code = temp_to_code(data, pdata->threshold); @@ -249,6 +251,7 @@ skip_calib_data: ret = threshold_code; goto out; } + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; if (pdata->threshold_falling) { threshold_code = temp_to_code(data, @@ -281,6 +284,7 @@ skip_calib_data: } if (i == EXYNOS_MAX_TRIGGER_PER_REG - 1) { /* 1-4 level to be assigned in th0 reg */ + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; writel(rising_threshold, data->base + reg->threshold_th0); -- 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: Re: [RFC PATCH 4/6] uprobes/x86: Emulate rip-relative call's
(2014/04/11 2:02), Denys Vlasenko wrote: >> The (f64) modifier in x86-opcode-map.txt means that inat_is_force64() >> is true for call opcode. So we won't reach "case 2:" in __get_immv32(): >> insn_get_prefixes() did set insn->opnd_bytes to 2 when it saw 0x66 prefix, >> but it was before we reach this place, and here we overrode it. >> This is a bug in insn decoder. > > I tested it on both Intel and AMD CPUs and my worst fears came true: > this instruction has different widths on different CPUs. > > This program: > > # compile with: gcc -nostartfiles -nostdlib -o int3 int3.S > _start: .globl _start > .byte 0x66,0xe9,0,0 > .byte 0,0 > 1: jmp 1b > > compiles to this: > > 004000b0 <_start>: > 4000b0: 66 e9 00 00 jmpw b4 <_start-0x3c> > 4000b4: 00 00 add%al,(%rax) > 4000b6: eb fe jmp4000b6 <_start+0x6> > > and it will reach 0x4000b6 on Intel CPU. > IOW, Intel SandyBridge CPU thinks that insn is in fact 66 e9 00 00 00 00, > no RIP truncation occurs. > > On AMD K10 CPU, the very same binary jumps to 0x00b4 > and gets SIGSEGV with MAPERR. > AMD thinks that the insn is 66 e9 00 00 as shown above. Hmm, interesting. > Thus, insn.c decoder implements Intel's idea of this insn > while binutils (objdump, gdb) implement AMD decode. Yeah, insn.c relays on intel's opcode map. > This same program can be compiled to 32-bit code, > in this mode both CPUs treat insn as 66 e9 00 00. In 32 bit mode, insn.c treats it as 66 e9 00 00 correctly. > Oleg, I'm sure you are very sympathetic by now to the idea > of just not supporting this insn at all. ;) > > You can check whether insn had any prefix by checking > insn->prefixes->nbytes != 0... No, since there are other prefixes (and it may be meaningless) you should find 0x66 in insn->prefixes->bytes[]. > ..but there is a problem with that. P4 introduced branch hints, > which are implemented using segment prefixes on conditional jumps. > Meaning that some compilers produce > > 2e 0f 82 nn nn nn nn > > as (hint not taken) JBinsn. > > 2e is CS segment prefix. insn->prefixes->nbytes == 1 for this insn. > DS prefix (3e) hints that branch is taken. > > They were nearly useless on P4 anyway and ignored by all CPUs > before or since, but they can be seen in some programs. Hm, this could be done. > > Looks like we'll need this: > > /* > * 16-bit overrides such as CALLW (66 e8 nn nn) are not supported. > * Intel and AMD behavior differ in 64-bit mode: Intel ignores 66 prefix. > * No one uses these insns. > * To filter them out, reject any branch insns with prefixes... > */ > if (insn->prefixes->nbytes > 1) > bail_out; As I said above, check insn->prefixes.bytes[0..nbytes]. > /* > * ...Except a single 3e or 2e "branch taken/not taken" hint prefix. > * These are (rarely) used, but ignored by any CPU except P4. > * Example: 2e 0f 82 nn nn nn nn is JB,PN > */ > if (insn->prefixes->nbytes == 1 && (insn->prefixes->bytes[0] | 0x10) != 0x3e)) > bail_out; > Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu...@hitachi.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] kernel/panic: Add "late_kdump" option for kdump in unstable condition
Masami Hiramatsu writes: > Add a "late_kdump" option to run kdump after running panic > notifiers and dump kmsg. This can help rare situations which > kdump drops in failure because of unstable crashed kernel > or hardware failure (memory corruption on critical data/code), > or the 2nd kernel is broken by the 1st kernel (it's a broken > behavior, but who can guarantee that the "crashed" kernel > works correctly?). > > Usage: add "late_kdump" to kernel boot option. That's all. > > Note that this actually increases risks of the failure of > kdump. This option should be set only if you worry about > the rare case of kdump failure rather than increasing the > chance of success. This is better than some others, but every time I have seen a request to do this it is because someone wants to do something horrible that makes kdump more brittle and generally unsupportable. You seem to in general understand that. But how can we support an option to make the kernel flakier? I suspect it would be more productive to work on the lkcd (spelling?) test module and show that crash dump actually works in the situation people are worried about. Just thinking about this send shivers up my spine. Ick. Eric > Signed-off-by: Masami Hiramatsu > Cc: Eric Biederman > Cc: Vivek Goyal > Cc: Andrew Morton > Cc: Yoshihiro YUNOMAE > Cc: Satoru MORIYA > Cc: Motohiro Kosaki > Cc: Takenori Nagano > --- > Documentation/kernel-parameters.txt |7 +++ > kernel/panic.c | 24 ++-- > 2 files changed, 29 insertions(+), 2 deletions(-) > > diff --git a/Documentation/kernel-parameters.txt > b/Documentation/kernel-parameters.txt > index 03e50b4..1ba58da 100644 > --- a/Documentation/kernel-parameters.txt > +++ b/Documentation/kernel-parameters.txt > @@ -2339,6 +2339,13 @@ bytes respectively. Such letter suffixes can also be > entirely omitted. > timeout < 0: reboot immediately > Format: > > + late_kdump Run kdump after running panic-notifiers and dumping > + kmsg. This only for the users who doubt kdump always > + succeeds in any situation. > + Note that this also increases risks of kdump failure, > + because some panic notifiers can make the crashed > + kernel more unstable. > + > parkbd.port=[HW] Parallel port number the keyboard adapter is > connected to, default is 0. > Format: > diff --git a/kernel/panic.c b/kernel/panic.c > index d02fa9f..bba42b5 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -32,6 +32,7 @@ static unsigned long tainted_mask; > static int pause_on_oops; > static int pause_on_oops_flag; > static DEFINE_SPINLOCK(pause_on_oops_lock); > +static bool late_kdump; > > int panic_timeout = CONFIG_PANIC_TIMEOUT; > EXPORT_SYMBOL_GPL(panic_timeout); > @@ -112,9 +113,14 @@ void panic(const char *fmt, ...) > /* >* If we have crashed and we have a crash kernel loaded let it handle >* everything else. > - * Do we want to call this before we try to display a message? > + * If we want to call this after we try to display a message, pass > + * the "late_kdump" option to the kernel. >*/ > - crash_kexec(NULL); > + if (!late_kdump) > + crash_kexec(NULL); > + else > + pr_emerg("Warning: late_kdump option is set. Please DO NOT " > + "report bugs about kdump failure with this option.\n"); > > /* >* Note smp_send_stop is the usual smp shutdown function, which > @@ -131,6 +137,13 @@ void panic(const char *fmt, ...) > > kmsg_dump(KMSG_DUMP_PANIC); > > + /* > + * If you doubt kdump always works perfectly in any situation, > + * "late_kdump" offers you to try kdump after running panic_notifier > + * and dumping kmsg. > + */ > + crash_kexec(NULL); > + > bust_spinlocks(0); > > if (!panic_blink) > @@ -472,6 +485,13 @@ EXPORT_SYMBOL(__stack_chk_fail); > core_param(panic, panic_timeout, int, 0644); > core_param(pause_on_oops, pause_on_oops, int, 0644); > > +static int __init setup_late_kdump(char *s) > +{ > + late_kdump = true; > + return 0; > +} > +early_param("late_kdump", setup_late_kdump); > + > static int __init oops_setup(char *s) > { > if (!s) -- 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/27] ARM: EXYNOS: Add Exynos3250 SoC ID
Dear Olof and Tomasz, On 04/11/2014 05:39 PM, Tomasz Figa wrote: > On 11.04.2014 08:32, Chanwoo Choi wrote: >> Hi, >> >> On 04/11/2014 10:46 AM, Olof Johansson wrote: >>> On Thu, Apr 10, 2014 at 06:37:12PM +0900, Chanwoo Choi wrote: This patch add Exynos3250's SoC ID. Exynos 3250 is System-On-Chip(SoC) that is based on the 32-bit RISC processor for Smartphone. Exynos3250 uses Cortex-A7 dual cores and has a target speed of 1.0GHz. Signed-off-by: Chanwoo Choi Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos/Kconfig | 22 ++ arch/arm/mach-exynos/exynos.c| 1 + arch/arm/plat-samsung/include/plat/cpu.h | 10 ++ 3 files changed, 33 insertions(+) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index fc8bf18..6da8a68 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -11,6 +11,17 @@ if ARCH_EXYNOS menu "SAMSUNG EXYNOS SoCs Support" +config ARCH_EXYNOS3 +bool "SAMSUNG EXYNOS3" +select ARM_AMBA +select CLKSRC_OF +select HAVE_ARM_SCU if SMP +select HAVE_SMP +select PINCTRL +select PM_GENERIC_DOMAINS if PM_RUNTIME +help + Samsung EXYNOS3 SoCs based systems + config ARCH_EXYNOS4 bool "SAMSUNG EXYNOS4" default y @@ -41,6 +52,17 @@ config ARCH_EXYNOS5 comment "EXYNOS SoCs" +config SOC_EXYNOS3250 +bool "SAMSUNG EXYNOS3250" +default y +depends on ARCH_EXYNOS3 +select ARCH_HAS_BANDGAP +select ARM_CPU_SUSPEND if PM +select PINCTRL_EXYNOS +select SAMSUNG_DMADEV +help + Enable EXYNOS3250 CPU support + config CPU_EXYNOS4210 bool "SAMSUNG EXYNOS4210" default y diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index b32a907..b134868 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -370,6 +370,7 @@ static void __init exynos_dt_machine_init(void) } static char const *exynos_dt_compat[] __initconst = { +"samsung,exynos3250", >>> >>> Please consider samsung,exynos3 instead, so you don't have to update this >>> table >>> for every SoC. We've talked about this before.. >> >> This patchset included only exynos3250.dtsi without exynos3.dtsi. >> So, I added only "samsung,exynos3250" compatible name. > > There is no direct relation between dts file names and compatible string > (although usually they correspond). You don't need exynos3.dtsi (at least > until another SoC from this family shows up). > >> >> Do you prefer to add SoC version as following? >> + "samsung,exynos3", >> + "samsung,exynos3250", >> >> or ? >> + "samsung,exynos3", > > This is actually a good question. If adding exynos3 anyway, it probably > wouldn't hurt to add exynos3250 anyway, to avoid adding it in future if some > SoC specific quirks show up, especially when both of compatible strings need > to be documented anyway. > >> >>> "samsung,exynos4", "samsung,exynos4210", "samsung,exynos4212", diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index 5992b8d..3d808f6b 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h @@ -43,6 +43,9 @@ extern unsigned long samsung_cpu_id; #define S5PV210_CPU_ID0x4311 #define S5PV210_CPU_MASK0xF000 +#define EXYNOS3250_SOC_ID 0xE3472000 +#define EXYNOS3_SOC_MASK0xF000 + #define EXYNOS4210_CPU_ID0x4321 #define EXYNOS4212_CPU_ID0x4322 #define EXYNOS4412_CPU_ID0xE4412200 @@ -68,6 +71,7 @@ IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK) IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK) IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK) IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK) +IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) @@ -126,6 +130,12 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) # define soc_is_s5pv210()0 #endif +#if defined(CONFIG_SOC_EXYNOS3250) +# define soc_is_exynos3250()is_samsung_exynos3250() +#else +# define soc_is_exynos3250()0 +#endif >>> >>> In general, I think we have too much code littered with soc_is_() going >>> on, so please try to avoid adding more fo
[PATCH] kernel/panic: Add "late_kdump" option for kdump in unstable condition
Add a "late_kdump" option to run kdump after running panic notifiers and dump kmsg. This can help rare situations which kdump drops in failure because of unstable crashed kernel or hardware failure (memory corruption on critical data/code), or the 2nd kernel is broken by the 1st kernel (it's a broken behavior, but who can guarantee that the "crashed" kernel works correctly?). Usage: add "late_kdump" to kernel boot option. That's all. Note that this actually increases risks of the failure of kdump. This option should be set only if you worry about the rare case of kdump failure rather than increasing the chance of success. Signed-off-by: Masami Hiramatsu Cc: Eric Biederman Cc: Vivek Goyal Cc: Andrew Morton Cc: Yoshihiro YUNOMAE Cc: Satoru MORIYA Cc: Motohiro Kosaki Cc: Takenori Nagano --- Documentation/kernel-parameters.txt |7 +++ kernel/panic.c | 24 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 03e50b4..1ba58da 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2339,6 +2339,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. timeout < 0: reboot immediately Format: + late_kdump Run kdump after running panic-notifiers and dumping + kmsg. This only for the users who doubt kdump always + succeeds in any situation. + Note that this also increases risks of kdump failure, + because some panic notifiers can make the crashed + kernel more unstable. + parkbd.port=[HW] Parallel port number the keyboard adapter is connected to, default is 0. Format: diff --git a/kernel/panic.c b/kernel/panic.c index d02fa9f..bba42b5 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -32,6 +32,7 @@ static unsigned long tainted_mask; static int pause_on_oops; static int pause_on_oops_flag; static DEFINE_SPINLOCK(pause_on_oops_lock); +static bool late_kdump; int panic_timeout = CONFIG_PANIC_TIMEOUT; EXPORT_SYMBOL_GPL(panic_timeout); @@ -112,9 +113,14 @@ void panic(const char *fmt, ...) /* * If we have crashed and we have a crash kernel loaded let it handle * everything else. -* Do we want to call this before we try to display a message? +* If we want to call this after we try to display a message, pass +* the "late_kdump" option to the kernel. */ - crash_kexec(NULL); + if (!late_kdump) + crash_kexec(NULL); + else + pr_emerg("Warning: late_kdump option is set. Please DO NOT " + "report bugs about kdump failure with this option.\n"); /* * Note smp_send_stop is the usual smp shutdown function, which @@ -131,6 +137,13 @@ void panic(const char *fmt, ...) kmsg_dump(KMSG_DUMP_PANIC); + /* +* If you doubt kdump always works perfectly in any situation, +* "late_kdump" offers you to try kdump after running panic_notifier +* and dumping kmsg. +*/ + crash_kexec(NULL); + bust_spinlocks(0); if (!panic_blink) @@ -472,6 +485,13 @@ EXPORT_SYMBOL(__stack_chk_fail); core_param(panic, panic_timeout, int, 0644); core_param(pause_on_oops, pause_on_oops, int, 0644); +static int __init setup_late_kdump(char *s) +{ + late_kdump = true; + return 0; +} +early_param("late_kdump", setup_late_kdump); + static int __init oops_setup(char *s) { if (!s) -- 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] tuntap: add flow control to support back pressure
Please do not post new versions of a patch as a reply to an existing discussion. Instead, post a fresh new email for the patch. -- 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 v4 1/6] devres: introduce API "devm_kmemdup
On Sun, 2014-04-13 at 21:27 -0700, Srinivas Pandruvada wrote: > Introduce devm_kmemdup, which uses resource managed kmalloc. > There are several request from maintainers to add this instead > of using kmemdup. [] > diff --git a/include/linux/device.h b/include/linux/device.h [] > @@ -629,6 +629,8 @@ static inline void *devm_kcalloc(struct device *dev, > } > extern void devm_kfree(struct device *dev, void *p); > extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); > +extern void *devm_kmemdup(struct device *dev, const void *src, size_t len, > + gfp_t gfp); Please align the arguments to the open parenthesis. -- 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 5/6] iio: hid-sensors: Added device rotation support
Added usage id processing for device rotation. This uses IIO interfaces for triggered buffer to present data to user mode.This uses HID sensor framework for registering callback events from the sensor hub. Data is exported to user space in the form of quaternion rotation format. Signed-off-by: Srinivas Pandruvada --- drivers/iio/orientation/Kconfig | 12 + drivers/iio/orientation/Makefile | 1 + drivers/iio/orientation/hid-sensor-rotation.c | 348 ++ include/linux/hid-sensor-ids.h| 1 + 4 files changed, 362 insertions(+) create mode 100644 drivers/iio/orientation/hid-sensor-rotation.c diff --git a/drivers/iio/orientation/Kconfig b/drivers/iio/orientation/Kconfig index 58c62c8..e3aa1e5 100644 --- a/drivers/iio/orientation/Kconfig +++ b/drivers/iio/orientation/Kconfig @@ -16,4 +16,16 @@ config HID_SENSOR_INCLINOMETER_3D Say yes here to build support for the HID SENSOR Inclinometer 3D. +config HID_SENSOR_DEVICE_ROTATION + depends on HID_SENSOR_HUB + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + select HID_SENSOR_IIO_COMMON + select HID_SENSOR_IIO_TRIGGER + tristate "HID Device Rotation" + help + Say yes here to build support for the HID SENSOR + device rotation. The output of a device rotation sensor + is presented using quaternion format. + endmenu diff --git a/drivers/iio/orientation/Makefile b/drivers/iio/orientation/Makefile index 2c97572..4734dab 100644 --- a/drivers/iio/orientation/Makefile +++ b/drivers/iio/orientation/Makefile @@ -4,3 +4,4 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_HID_SENSOR_INCLINOMETER_3D) += hid-sensor-incl-3d.o +obj-$(CONFIG_HID_SENSOR_DEVICE_ROTATION) += hid-sensor-rotation.o diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c new file mode 100644 index 000..51387bb --- /dev/null +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -0,0 +1,348 @@ +/* + * HID Sensors Driver + * Copyright (c) 2014, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../common/hid-sensors/hid-sensor-trigger.h" + +struct dev_rot_state { + struct hid_sensor_hub_callbacks callbacks; + struct hid_sensor_common common_attributes; + struct hid_sensor_hub_attribute_info quaternion; + u32 sampled_vals[4]; +}; + +/* Channel definitions */ +static const struct iio_chan_spec dev_rot_channels[] = { + { + .type = IIO_ROT, + .modified = 1, + .channel2 = IIO_MOD_QUATERNION, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ) | + BIT(IIO_CHAN_INFO_HYSTERESIS) + } +}; + +/* Adjust channel real bits based on report descriptor */ +static void dev_rot_adjust_channel_bit_mask(struct iio_chan_spec *chan, + int size) +{ + chan->scan_type.sign = 's'; + /* Real storage bits will change based on the report desc. */ + chan->scan_type.realbits = size * 8; + /* Maximum size of a sample to capture is u32 */ + chan->scan_type.storagebits = sizeof(u32) * 8; + chan->scan_type.repeat = 4; +} + +/* Channel read_raw handler */ +static int dev_rot_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int size, int *vals, int *val_len, + long mask) +{ + struct dev_rot_state *rot_state = iio_priv(indio_dev); + int ret_type; + int i; + + vals[0] = 0; + vals[1] = 0; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + if (size >= 4) { + for (i = 0; i < 4; ++i) + vals[i] = rot_state->sampled_vals[i]; + ret_type = IIO_VAL_INT_MULTIPLE; + *val_len = 4; + } else + ret_type = -EINVAL; + break; + case IIO_CHAN_INFO_SAMP_FREQ: + ret_type = hid_sensor_read_samp_freq_value( + &rot_state->common_attributes, &vals[0], &vals[1]); + break; + case IIO_CHAN_INFO_HYSTERESIS: +
[Patch v4 2/6] IIO: core: Introduce read_raw_multi
This callback is introduced to overcome some limitations of existing read_raw callback. The functionality of both existing read_raw and read_raw_multi is similar, both are used to request values from the device. The current read_raw callback allows only two return values. The new read_raw_multi allows returning multiple values. Instead of passing just address of val and val2, it passes length and pointer to values. Depending on the type and length of passed buffer, iio client drivers can return multiple values. Signed-off-by: Srinivas Pandruvada --- drivers/iio/iio_core.h | 2 +- drivers/iio/industrialio-core.c | 65 ++-- drivers/iio/industrialio-event.c | 6 ++-- drivers/iio/inkern.c | 16 -- include/linux/iio/iio.h | 17 +++ include/linux/iio/types.h| 1 + 6 files changed, 80 insertions(+), 27 deletions(-) diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h index f6db6af..30327ad 100644 --- a/drivers/iio/iio_core.h +++ b/drivers/iio/iio_core.h @@ -35,7 +35,7 @@ int __iio_add_chan_devattr(const char *postfix, struct list_head *attr_list); void iio_free_chan_devattr_list(struct list_head *attr_list); -ssize_t iio_format_value(char *buf, unsigned int type, int val, int val2); +ssize_t iio_format_value(char *buf, unsigned int type, int size, int *val); /* Event interface flags */ #define IIO_BUSY_BIT_POS 1 diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index ede16aec..e22a984 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -373,41 +373,53 @@ EXPORT_SYMBOL_GPL(iio_enum_write); * @buf: The buffer to which the formated value gets written * @type: One of the IIO_VAL_... constants. This decides how the val and val2 *parameters are formatted. - * @val: First part of the value, exact meaning depends on the type parameter. - * @val2: Second part of the value, exact meaning depends on the type parameter. + * @vals: pointer to the values, exact meaning depends on the type parameter. */ -ssize_t iio_format_value(char *buf, unsigned int type, int val, int val2) +ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) { unsigned long long tmp; bool scale_db = false; switch (type) { case IIO_VAL_INT: - return sprintf(buf, "%d\n", val); + return sprintf(buf, "%d\n", vals[0]); case IIO_VAL_INT_PLUS_MICRO_DB: scale_db = true; case IIO_VAL_INT_PLUS_MICRO: - if (val2 < 0) - return sprintf(buf, "-%ld.%06u%s\n", abs(val), -val2, + if (vals[1] < 0) + return sprintf(buf, "-%ld.%06u%s\n", abs(vals[0]), + -vals[1], scale_db ? " dB" : ""); else - return sprintf(buf, "%d.%06u%s\n", val, val2, + return sprintf(buf, "%d.%06u%s\n", vals[0], vals[1], scale_db ? " dB" : ""); case IIO_VAL_INT_PLUS_NANO: - if (val2 < 0) - return sprintf(buf, "-%ld.%09u\n", abs(val), -val2); + if (vals[1] < 0) + return sprintf(buf, "-%ld.%09u\n", abs(vals[0]), + -vals[1]); else - return sprintf(buf, "%d.%09u\n", val, val2); + return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); case IIO_VAL_FRACTIONAL: - tmp = div_s64((s64)val * 10LL, val2); - val2 = do_div(tmp, 10LL); - val = tmp; - return sprintf(buf, "%d.%09u\n", val, val2); + tmp = div_s64((s64)vals[0] * 10LL, vals[1]); + vals[1] = do_div(tmp, 10LL); + vals[0] = tmp; + return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); case IIO_VAL_FRACTIONAL_LOG2: - tmp = (s64)val * 10LL >> val2; - val2 = do_div(tmp, 10LL); - val = tmp; - return sprintf(buf, "%d.%09u\n", val, val2); + tmp = (s64)vals[0] * 10LL >> vals[1]; + vals[1] = do_div(tmp, 10LL); + vals[0] = tmp; + return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); + case IIO_VAL_INT_MULTIPLE: + { + int i; + int len = 0; + + for (i = 0; i < size; ++i) + len += snprintf(&buf[len], PAGE_SIZE - len, "%d ", + vals[i]); + len += snprintf(&buf[len], PAGE_SIZE - len, "\n"); + return len; + } default: return 0; } @@ -419,14 +431,23
[Patch v4 1/6] devres: introduce API "devm_kmemdup
Introduce devm_kmemdup, which uses resource managed kmalloc. There are several request from maintainers to add this instead of using kmemdup. Signed-off-by: Srinivas Pandruvada --- Documentation/driver-model/devres.txt | 1 + drivers/base/devres.c | 21 + include/linux/device.h| 2 ++ 3 files changed, 24 insertions(+) diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 4f7897e..4999518 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt @@ -236,6 +236,7 @@ certainly invest a bit more effort into libata core layer). MEM devm_kzalloc() devm_kfree() + devm_kmemdup() IIO devm_iio_device_alloc() diff --git a/drivers/base/devres.c b/drivers/base/devres.c index db4e264..d0914cb 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -831,3 +831,24 @@ void devm_kfree(struct device *dev, void *p) WARN_ON(rc); } EXPORT_SYMBOL_GPL(devm_kfree); + +/** + * devm_kmemdup - Resource-managed kmemdup + * @dev: Device this memory belongs to + * @src: Memory region to duplicate + * @len: Memory region length + * @gfp: GFP mask to use + * + * Duplicate region of a memory using resource managed kmalloc + */ +void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp) +{ + void *p; + + p = devm_kmalloc(dev, len, gfp); + if (p) + memcpy(p, src, len); + + return p; +} +EXPORT_SYMBOL_GPL(devm_kmemdup); diff --git a/include/linux/device.h b/include/linux/device.h index 233bbbe..0b3117a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -629,6 +629,8 @@ static inline void *devm_kcalloc(struct device *dev, } extern void devm_kfree(struct device *dev, void *p); extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); +extern void *devm_kmemdup(struct device *dev, const void *src, size_t len, + gfp_t gfp); void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); void __iomem *devm_request_and_ioremap(struct device *dev, -- 1.9.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/
[Patch v4 4/6] IIO: core: Add quaternion modifier
Added quaternion in the list of supported modifiers. Signed-off-by: Srinivas Pandruvada --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index e22a984..dcc1849 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -84,6 +84,7 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_LIGHT_RED] = "red", [IIO_MOD_LIGHT_GREEN] = "green", [IIO_MOD_LIGHT_BLUE] = "blue", + [IIO_MOD_QUATERNION] = "quaternion", }; /* relies on pairs of these shared then separate */ diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index a13c224..4fdab2e 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -53,6 +53,7 @@ enum iio_modifier { IIO_MOD_LIGHT_RED, IIO_MOD_LIGHT_GREEN, IIO_MOD_LIGHT_BLUE, + IIO_MOD_QUATERNION, }; enum iio_event_type { -- 1.9.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/
[Patch v4 3/6] IIO: core: Modify scan element type
The current scan element type uses the following format: [be|le]:[s|u]bits/storagebits[>>shift]. To specify multiple elements in this type, added a repeat value. So new format is: [be|le]:[s|u]bits/storagebits{X[repeat]}[>>shift]. Here X is specifying how may times, real/storage bits are repeating. When X is value is 0 or 1, then repeat value is not used in the format, and it will be same as existing format. Signed-off-by: Srinivas Pandruvada --- drivers/iio/industrialio-buffer.c | 41 +-- include/linux/iio/iio.h | 9 + 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index e108f2a..aa90c68 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -150,7 +150,16 @@ static ssize_t iio_show_fixed_type(struct device *dev, type = IIO_BE; #endif } - return sprintf(buf, "%s:%c%d/%d>>%u\n", + if (this_attr->c->scan_type.repeat > 1) + return sprintf(buf, "%s:%c%d/%d{%d[repeat]}>>%u\n", + iio_endian_prefix[type], + this_attr->c->scan_type.sign, + this_attr->c->scan_type.realbits, + this_attr->c->scan_type.storagebits, + this_attr->c->scan_type.repeat, + this_attr->c->scan_type.shift); + else + return sprintf(buf, "%s:%c%d/%d>>%u\n", iio_endian_prefix[type], this_attr->c->scan_type.sign, this_attr->c->scan_type.realbits, @@ -474,14 +483,22 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, for_each_set_bit(i, mask, indio_dev->masklength) { ch = iio_find_channel_from_si(indio_dev, i); - length = ch->scan_type.storagebits / 8; + if (ch->scan_type.repeat > 1) + length = ch->scan_type.storagebits / 8 * + ch->scan_type.repeat; + else + length = ch->scan_type.storagebits / 8; bytes = ALIGN(bytes, length); bytes += length; } if (timestamp) { ch = iio_find_channel_from_si(indio_dev, indio_dev->scan_index_timestamp); - length = ch->scan_type.storagebits / 8; + if (ch->scan_type.repeat > 1) + length = ch->scan_type.storagebits / 8 * + ch->scan_type.repeat; + else + length = ch->scan_type.storagebits / 8; bytes = ALIGN(bytes, length); bytes += length; } @@ -957,7 +974,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, indio_dev->masklength, in_ind + 1); ch = iio_find_channel_from_si(indio_dev, in_ind); - length = ch->scan_type.storagebits/8; + if (ch->scan_type.repeat > 1) + length = ch->scan_type.storagebits / 8 * + ch->scan_type.repeat; + else + length = ch->scan_type.storagebits / 8; /* Make sure we are aligned */ in_loc += length; if (in_loc % length) @@ -969,7 +990,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, goto error_clear_mux_table; } ch = iio_find_channel_from_si(indio_dev, in_ind); - length = ch->scan_type.storagebits/8; + if (ch->scan_type.repeat > 1) + length = ch->scan_type.storagebits / 8 * + ch->scan_type.repeat; + else + length = ch->scan_type.storagebits / 8; if (out_loc % length) out_loc += length - out_loc % length; if (in_loc % length) @@ -990,7 +1015,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev, } ch = iio_find_channel_from_si(indio_dev, indio_dev->scan_index_timestamp); - length = ch->scan_type.storagebits/8; + if (ch->scan_type.repeat > 1) + length = ch->scan_type.storagebits / 8 * + ch->scan_type.repeat; + else + length = ch->scan_type.storagebits / 8; if (out_loc % length) out_loc += length - out_loc % length; if (in_loc % length) diff --git a/include/l
[Patch v4 6/6] iio: Added ABI description for quaternion
Added documentation for reading quaternion components for 3D rotations. Signed-off-by: Srinivas Pandruvada --- Documentation/ABI/testing/sysfs-bus-iio | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6e02c50..d2c59f9 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -784,6 +784,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en What: /sys/.../iio:deviceX/scan_elements/in_pressure_en +What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_en KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -799,6 +800,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type What: /sys/.../iio:deviceX/scan_elements/in_pressure_type +What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_type KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -845,6 +847,7 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index What: /sys/.../iio:deviceX/scan_elements/in_pressure_index +What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_index KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -891,3 +894,12 @@ Contact: linux-...@vger.kernel.org Description: This attribute is used to get/set the integration time in seconds. + +What: /sys/bus/iio/devices/iio:deviceX/in_rot_quaternion_raw +KernelVersion: 3.15 +Contact: linux-...@vger.kernel.org +Description: + Raw value of quaternion components using a format + x y z w. Here x, y, and z component represents the axis about + which a rotation will occur and w component represents the + amount of rotation. -- 1.9.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 v2] tuntap: add flow control to support back pressure
On 04/13/2014 09:40 PM, David Miller wrote: > From: Steven Galgano > Date: Sun, 13 Apr 2014 21:30:27 -0400 > >> Added optional per queue flow control support using IFF_FLOW_CONTROL. When >> the IFF_FLOW_CONTROL TUNSETIFF flag is specified it will set a per queue >> flag to indicate that the queue should be stopped using >> netif_tx_stop_queue(), rather than discarding frames once full. After >> reading a frame from the respective stopped queue, a netif_tx_wake_queue() >> is issued to signal resource availability. >> >> The per queue TUN_FLOW_CONTROL flag is stored in struct tun_file. This >> provides the flexibility to enable flow control on all, none or some queues >> when using IFF_MULTI_QUEUE. When not using IFF_MULTI_QUEUE, IFF_FLOW_CONTROL >> will apply to the single queue. No changes were made to the default drop >> frame policy. >> >> This change adds support for back pressure use cases. >> >> Reported-by: Brian Adamson >> Tested-by: Joseph Giovatto >> Signed-off-by: Steven Galgano > > Please format your commit messages to ~80 columns of text. > > It won't be automatically formatted by GIT and in fact it looks ugly > with all the wrapping in text based tools. > Added optional per queue flow control support using IFF_FLOW_CONTROL. When the IFF_FLOW_CONTROL TUNSETIFF flag is specified it will set a per queue flag to indicate that the queue should be stopped using netif_tx_stop_queue(), rather than discarding frames once full. After reading a frame from the respective stopped queue, a netif_tx_wake_queue() is issued to signal resource availability. The per queue TUN_FLOW_CONTROL flag is stored in struct tun_file. This provides the flexibility to enable flow control on all, none or some queues when using IFF_MULTI_QUEUE. When not using IFF_MULTI_QUEUE, IFF_FLOW_CONTROL will apply to the single queue. No changes were made to the default drop frame policy. This change adds support for back pressure use cases. Reported-by: Brian Adamson Tested-by: Joseph Giovatto Signed-off-by: Steven Galgano -- 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] module: Introduce MODULE_STATE_COMING_FINAL to avoid ftrace warning
(2014/04/14 11:49), Takao Indoh wrote: > ping, any comments? > > (2014/04/02 16:54), Takao Indoh wrote: >> This patch adds new module state MODULE_STATE_COMING_FINAL to avoid >> ftrace waring message when loading two modules simultaneously. >> >> The original patch was written by Steven Rostedt, see below. >> https://lkml.org/lkml/2014/3/24/242 >> >> Ftrace waring message below is got when insmod two modules almost at the >> same time and at least one of them uses register_kprobe() in its >> module_init. >> >> [ 409.337936] [ cut here ] >> [ 409.337945] WARNING: CPU: 12 PID: 10028 at >> /mnt/repos/linux/kernel/trace/ftrace.c:1716 ftrace_bug+0x206/0x270() >> (snip) >> [ 409.337983] Call Trace: >> [ 409.337990] [] dump_stack+0x45/0x56 >> [ 409.337993] [] warn_slowpath_common+0x7d/0xa0 >> [ 409.337997] [] ? 0xa0363fff >> [ 409.337999] [] warn_slowpath_null+0x1a/0x20 >> [ 409.338001] [] ftrace_bug+0x206/0x270 >> [ 409.338004] [] ? 0xa0363fff >> [ 409.338006] [] ftrace_process_locs+0x32e/0x710 >> [ 409.338008] [] ftrace_module_notify_enter+0x96/0xf0 >> [ 409.338012] [] notifier_call_chain+0x4c/0x70 >> [ 409.338018] [] __blocking_notifier_call_chain+0x4d/0x70 >> [ 409.338020] [] blocking_notifier_call_chain+0x16/0x20 >> [ 409.338026] [] load_module+0x1f54/0x25d0 >> [ 409.338028] [] ? store_uevent+0x40/0x40 >> [ 409.338031] [] SyS_finit_module+0x86/0xb0 >> [ 409.338036] [] system_call_fastpath+0x16/0x1b >> [ 409.338037] ---[ end trace e7e27c36e7a65831 ]--- >> [ 409.338040] ftrace faulted on writing [] >> handler_pre+0x0/0x10 [test2] >> >> This is the sequence when this problem occurs. >> >> >> init_module >>load_module >> do_init_module >>do_one_initcall >> (module_init) >>register_kprobe >> arm_kprobe >>arm_kprobe_ftrace >> register_ftrace_function >>mutex_lock(&ftrace_lock) --- (1) >>ftrace_startup >> ftrace_startup_enable >>ftrace_run_update_code >> ftrace_arch_code_modify_post_process >>set_all_modules_text_ro (2) >>mutex_unlock(&ftrace_lock) - (3) >> >> >> init_module >>load_module >> do_init_module >>blocking_notifier_call_chain >> ftrace_module_notify_enter >>ftrace_init_module >> ftrace_process_locs >> mutex_lock(&ftrace_lock) (4) >> ftrace_update_code >> __ftrace_replace_code >> ftrace_make_nop >> ftrace_modify_code_direct >> do_ftrace_mod_code >> probe_kernel_write (5) >> >> o Module A gets ftrace_lock at (1) >> o Module B also tries to get ftrace_lock at (4) somewhat late, and waits >>here because module A got it. >> o Module A sets all modules text to ReadOnly at (2), and then release >>ftrace_lock at (3) >> o Module B wakes up and tries to rewrite its text at (5), but it fails >>because it is already changed to RO at (2) by modules A. The ftrace >>waring message is outputted. >> >> This patch introduces MODULE_STATE_COMING_FINAL which means that the >> module is ready to be changed to ReadOnly. By this, the modules B is not >> change to RO at (2) because its state is still MODULE_STATE_COMING, so >> this warning message is avoided. Module B is changed to RO in the >> do_init_module() after comes back from notifier. >> >> Signed-off-by: Takao Indoh As Steven said, it should have his signed-off too, anyway, Reviewed-by: Masami Hiramatsu Thank you, >> --- >> include/linux/module.h | 9 + >> kernel/module.c| 13 - >> 2 files changed, 17 insertions(+), 5 deletions(-) >> >> diff --git a/include/linux/module.h b/include/linux/module.h >> index eaf60ff..32f4481 100644 >> --- a/include/linux/module.h >> +++ b/include/linux/module.h >> @@ -207,10 +207,11 @@ struct module_use { >> }; >> >> enum module_state { >> -MODULE_STATE_LIVE, /* Normal state. */ >> -MODULE_STATE_COMING,/* Full formed, running module_init. */ >> -MODULE_STATE_GOING, /* Going away. */ >> -MODULE_STATE_UNFORMED, /* Still setting it up. */ >> +MODULE_STATE_LIVE, /* Normal state. */ >> +MODULE_STATE_COMING,/* Full formed, running module_init. */ >> +MODULE_STATE_COMING_FINAL, /* Ready to be changed to read only. */ >> +MODULE_STATE_GOING, /* Going away. */ >> +MODULE_STATE_UNFORMED, /* Still setting it up. */ >> }; >> >> /** >> diff --git a/kernel/module.c b/kernel/module.c >> index 8dc7f5e..94b9f91 100644 >> --- a/kernel/module.c >> +++ b/kernel/module.c >> @@ -1033,6 +1033,9 @@ static ssize_t s
Re: [PATCH 1/1] kernel/rcu/tree.c: remove duplicate extern definition
On Sun, Apr 13, 2014 at 11:18 PM, Joe Perches wrote: >> As the comment mentions, resched_cpu is internal to the scheduler and >> hence is in sched/sched.h file and not in linux/sched.h. > > Note the use of quotes and lack of angle brackets. > >> sched/sched.h cannot be included in other subsystems directly. > > If functions from it can be declared extern, > then likely it could be used in an #include. > > All the users of resched_cpu are in kernel/sched/ and in kernel/rcu/tree.c. I think the only reason this was declared extern was for the special use in rcu/tree.c. -- Pranith -- 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 1/1] kernel/rcu/tree.c: remove duplicate extern definition
On Sun, 2014-04-13 at 23:03 -0400, Pranith Kumar wrote: > On Sun, Apr 13, 2014 at 10:50 PM, Joe Perches wrote: > >> -/* > >> - * This function really isn't for public consumption, but RCU is special > >> in > >> - * that context switches can allow the state machine to make progress. > >> - */ > >> -extern void resched_cpu(int cpu); > > > > why not #include "sched.h" > > and remove both declarations? > As the comment mentions, resched_cpu is internal to the scheduler and > hence is in sched/sched.h file and not in linux/sched.h. Note the use of quotes and lack of angle brackets. > sched/sched.h cannot be included in other subsystems directly. If functions from it can be declared extern, then likely it could be used in an #include. -- 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 1/1] kernel/rcu/tree.c: remove duplicate extern definition
On Sun, Apr 13, 2014 at 10:50 PM, Joe Perches wrote: >> >> -/* >> - * This function really isn't for public consumption, but RCU is special in >> - * that context switches can allow the state machine to make progress. >> - */ >> -extern void resched_cpu(int cpu); > > why not #include "sched.h" > > and remove both declarations? > > As the comment mentions, resched_cpu is internal to the scheduler and hence is in sched/sched.h file and not in linux/sched.h. sched/sched.h cannot be included in other subsystems directly. Regards, -- Pranith -- 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: current group_info should be put after using.
From: "Wang, Xiaoming" Date: Mon, 14 Apr 2014 12:30:45 -0400 > Plug a group_info refcount leak in ping_init. > group_info is only needed during initialization and > the code failed to release the reference on exit. > While here move grabbing the reference to a place > where it is actually needed. > > Signed-off-by: Chuansheng Liu > Signed-off-by: Zhang Dongxing > Signed-off-by: xiaoming wang Applied and queued up for -stable, 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 4/4] mvolatile: Add page purging logic & SIGBUS trap
On Fri, Apr 11, 2014 at 01:15:40PM -0700, John Stultz wrote: > This patch adds the hooks in the vmscan logic to purge volatile pages > and mark their pte as purged. With this, volatile pages will be purged > under pressure, and their ptes swap entry's marked. If the purged pages > are accessed before being marked non-volatile, we catch this and send a > SIGBUS. > > This is a simplified implementation that uses logic from Minchan's earlier > efforts, so credit to Minchan for his work. > > Cc: Andrew Morton > Cc: Android Kernel Team > Cc: Johannes Weiner > Cc: Robert Love > Cc: Mel Gorman > Cc: Hugh Dickins > Cc: Dave Hansen > Cc: Rik van Riel > Cc: Dmitry Adamushko > Cc: Neil Brown > Cc: Andrea Arcangeli > Cc: Mike Hommey > Cc: Taras Glek > Cc: Jan Kara > Cc: KOSAKI Motohiro > Cc: Michel Lespinasse > Cc: Minchan Kim > Cc: Keith Packard > Cc: linux...@kvack.org > Signed-off-by: John Stultz > --- > include/linux/mvolatile.h | 2 + > mm/internal.h | 2 - > mm/memory.c | 8 > mm/mvolatile.c| 120 > ++ > mm/rmap.c | 5 ++ > mm/vmscan.c | 12 + > 6 files changed, 147 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mvolatile.h b/include/linux/mvolatile.h > index 973bb3b..8cfe6e0 100644 > --- a/include/linux/mvolatile.h > +++ b/include/linux/mvolatile.h > @@ -5,4 +5,6 @@ > > #define MVOLATILE_VALID_FLAGS (0) /* Don't yet support any flags */ > > +extern int purge_volatile_page(struct page *page); > + > #endif /* _LINUX_MVOLATILE_H */ > diff --git a/mm/internal.h b/mm/internal.h > index 29e1e76..ea66bf9 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -225,10 +225,8 @@ static inline void mlock_migrate_page(struct page > *newpage, struct page *page) > > extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma); > > -#ifdef CONFIG_TRANSPARENT_HUGEPAGE > extern unsigned long vma_address(struct page *page, >struct vm_area_struct *vma); > -#endif > #else /* !CONFIG_MMU */ > static inline int mlocked_vma_newpage(struct vm_area_struct *v, struct page > *p) > { > diff --git a/mm/memory.c b/mm/memory.c > index 22dfa61..9043e4c 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -60,6 +60,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -3643,6 +3644,8 @@ static int handle_pte_fault(struct mm_struct *mm, > > entry = *pte; > if (!pte_present(entry)) { > + swp_entry_t mvolatile_entry; > + > if (pte_none(entry)) { > if (vma->vm_ops) { > if (likely(vma->vm_ops->fault)) > @@ -3652,6 +3655,11 @@ static int handle_pte_fault(struct mm_struct *mm, > return do_anonymous_page(mm, vma, address, >pte, pmd, flags); > } > + > + mvolatile_entry = pte_to_swp_entry(entry); > + if (unlikely(is_purged_entry(mvolatile_entry))) > + return VM_FAULT_SIGBUS; > + There is no pte lock so that is_purged_entry isn't safe so if race happens, do_swap_page could have a problem so it would be better to handle it do_swap_page with pte lock because we used swp_pte to indicate purged pte. I tried to solve it while we were in Napa(you could remember I sent crap patchset to you privately but failed to fix and I still didn't get a time to fix it :( ) but I'd like to inform this problem. > if (pte_file(entry)) > return do_nonlinear_fault(mm, vma, address, > pte, pmd, flags, entry); > diff --git a/mm/mvolatile.c b/mm/mvolatile.c > index 38c8315..16dccee 100644 > --- a/mm/mvolatile.c > +++ b/mm/mvolatile.c > @@ -279,3 +279,123 @@ SYSCALL_DEFINE5(mvolatile, unsigned long, start, > size_t, len, > out: > return ret; > } > + > + > +/** > + * try_to_purge_one - Purge a volatile page from a vma > + * @page: page to purge > + * @vma: vma to purge page from > + * > + * Finds the pte for a page in a vma, marks the pte as purged > + * and release the page. > + */ > +static void try_to_purge_one(struct page *page, struct vm_area_struct *vma) > +{ > + struct mm_struct *mm = vma->vm_mm; > + pte_t *pte; > + pte_t pteval; > + spinlock_t *ptl; > + unsigned long addr; > + > + VM_BUG_ON(!PageLocked(page)); > + > + addr = vma_address(page, vma); > + pte = page_check_address(page, mm, addr, &ptl, 0); > + if (!pte) > + return; > + > + BUG_ON(vma->vm_flags & (VM_SPECIAL|VM_LOCKED|VM_MIXEDMAP|VM_HUGETLB)); > + > + flush_cache_page(vma, addr, page_to_pfn(page)); > + pteval = ptep_clear_flush(vma, addr, pte); > + > + update_hiwater_rss(mm); > + if (PageAnon(page)) > + dec_mm_counter(mm, MM_ANONPAGES); > + else > + dec_mm_c
Re: [PATCH 1/1] kernel/rcu/tree.c: remove duplicate extern definition
On Sun, 2014-04-13 at 21:39 -0400, Pranith Kumar wrote: [] > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c [] > @@ -947,12 +947,6 @@ static void print_other_cpu_stall(struct rcu_state *rsp) > force_quiescent_state(rsp); /* Kick them all. */ > } > > -/* > - * This function really isn't for public consumption, but RCU is special in > - * that context switches can allow the state machine to make progress. > - */ > -extern void resched_cpu(int cpu); why not #include "sched.h" and remove both declarations? -- 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] module: Introduce MODULE_STATE_COMING_FINAL to avoid ftrace warning
ping, any comments? (2014/04/02 16:54), Takao Indoh wrote: > This patch adds new module state MODULE_STATE_COMING_FINAL to avoid > ftrace waring message when loading two modules simultaneously. > > The original patch was written by Steven Rostedt, see below. > https://lkml.org/lkml/2014/3/24/242 > > Ftrace waring message below is got when insmod two modules almost at the > same time and at least one of them uses register_kprobe() in its > module_init. > > [ 409.337936] [ cut here ] > [ 409.337945] WARNING: CPU: 12 PID: 10028 at > /mnt/repos/linux/kernel/trace/ftrace.c:1716 ftrace_bug+0x206/0x270() > (snip) > [ 409.337983] Call Trace: > [ 409.337990] [] dump_stack+0x45/0x56 > [ 409.337993] [] warn_slowpath_common+0x7d/0xa0 > [ 409.337997] [] ? 0xa0363fff > [ 409.337999] [] warn_slowpath_null+0x1a/0x20 > [ 409.338001] [] ftrace_bug+0x206/0x270 > [ 409.338004] [] ? 0xa0363fff > [ 409.338006] [] ftrace_process_locs+0x32e/0x710 > [ 409.338008] [] ftrace_module_notify_enter+0x96/0xf0 > [ 409.338012] [] notifier_call_chain+0x4c/0x70 > [ 409.338018] [] __blocking_notifier_call_chain+0x4d/0x70 > [ 409.338020] [] blocking_notifier_call_chain+0x16/0x20 > [ 409.338026] [] load_module+0x1f54/0x25d0 > [ 409.338028] [] ? store_uevent+0x40/0x40 > [ 409.338031] [] SyS_finit_module+0x86/0xb0 > [ 409.338036] [] system_call_fastpath+0x16/0x1b > [ 409.338037] ---[ end trace e7e27c36e7a65831 ]--- > [ 409.338040] ftrace faulted on writing [] > handler_pre+0x0/0x10 [test2] > > This is the sequence when this problem occurs. > > > init_module >load_module > do_init_module >do_one_initcall > (module_init) >register_kprobe > arm_kprobe >arm_kprobe_ftrace > register_ftrace_function >mutex_lock(&ftrace_lock) --- (1) >ftrace_startup > ftrace_startup_enable >ftrace_run_update_code > ftrace_arch_code_modify_post_process >set_all_modules_text_ro (2) >mutex_unlock(&ftrace_lock) - (3) > > > init_module >load_module > do_init_module >blocking_notifier_call_chain > ftrace_module_notify_enter >ftrace_init_module > ftrace_process_locs > mutex_lock(&ftrace_lock) (4) > ftrace_update_code > __ftrace_replace_code > ftrace_make_nop > ftrace_modify_code_direct > do_ftrace_mod_code > probe_kernel_write (5) > > o Module A gets ftrace_lock at (1) > o Module B also tries to get ftrace_lock at (4) somewhat late, and waits >here because module A got it. > o Module A sets all modules text to ReadOnly at (2), and then release >ftrace_lock at (3) > o Module B wakes up and tries to rewrite its text at (5), but it fails >because it is already changed to RO at (2) by modules A. The ftrace >waring message is outputted. > > This patch introduces MODULE_STATE_COMING_FINAL which means that the > module is ready to be changed to ReadOnly. By this, the modules B is not > change to RO at (2) because its state is still MODULE_STATE_COMING, so > this warning message is avoided. Module B is changed to RO in the > do_init_module() after comes back from notifier. > > Signed-off-by: Takao Indoh > --- > include/linux/module.h | 9 + > kernel/module.c| 13 - > 2 files changed, 17 insertions(+), 5 deletions(-) > > diff --git a/include/linux/module.h b/include/linux/module.h > index eaf60ff..32f4481 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -207,10 +207,11 @@ struct module_use { > }; > > enum module_state { > - MODULE_STATE_LIVE, /* Normal state. */ > - MODULE_STATE_COMING,/* Full formed, running module_init. */ > - MODULE_STATE_GOING, /* Going away. */ > - MODULE_STATE_UNFORMED, /* Still setting it up. */ > + MODULE_STATE_LIVE, /* Normal state. */ > + MODULE_STATE_COMING,/* Full formed, running module_init. */ > + MODULE_STATE_COMING_FINAL, /* Ready to be changed to read only. */ > + MODULE_STATE_GOING, /* Going away. */ > + MODULE_STATE_UNFORMED, /* Still setting it up. */ > }; > > /** > diff --git a/kernel/module.c b/kernel/module.c > index 8dc7f5e..94b9f91 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -1033,6 +1033,9 @@ static ssize_t show_initstate(struct module_attribute > *mattr, > case MODULE_STATE_COMING: > state = "coming"; > break; > + case MODULE_STATE_COMING_FINAL: > + state = "coming_final"; > + break; >
[PATCH V2] Gadget: race between ffs_epfile_io() and ffs_func_eps_disable()
ffs_epfile_io() is called from userspace, while ffs_func_esp_disable() might be called from USB disconnect interrupt, the two functions would run in parallel but they are not well protected, that epfile->ep would be removed by ffs_func_esp_disable() during ffs_epfile_io() is referring this pointer, then it leads to kernel PANIC. The scenario is as below: Thread 1 Thread 2 || SyS_read dwc3_gadget_disconnect_interrupt || ffs_epfile_read reset_config || ffs_epfile_io ffs_func_eps_disable || - usb_ep_disable(): epfile->ep->ep->desc = NULL || usb_ep_align_maybe(): - it refers ep->desc->wMaxPacketSize- Signed-off-by: Chao Bi --- drivers/usb/gadget/f_fs.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 2e164dc..1e12b3e 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c @@ -745,6 +745,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) */ struct usb_gadget *gadget = epfile->ffs->gadget; + spin_lock_irq(&epfile->ffs->eps_lock); + /* In the meantime, endpoint got disabled or changed. */ + if (epfile->ep != ep) { + spin_unlock_irq(&epfile->ffs->eps_lock); + return -ESHUTDOWN; + } /* * Controller may require buffer size to be aligned to * maxpacketsize of an out endpoint. @@ -752,6 +758,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) data_len = io_data->read ? usb_ep_align_maybe(gadget, ep->ep, io_data->len) : io_data->len; + spin_unlock_irq(&epfile->ffs->eps_lock); data = kmalloc(data_len, GFP_KERNEL); if (unlikely(!data)) -- 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] pinctrl-baytrail: workaround for irq descriptor conflict on ASUS T100TA
A crash is triggered on the ASUS T100TA Baytrail-T because of a IRQ descriptor conflict. There are two gpio triggered acpi events in this device, GPIO 6 and 18. These gpios are translated to irqs by calling gpio_to_irq which in turn will call irq_create_mapping(vg->domain, offset). irq_create_mapping will take care of allocating the irq descriptor, taking the first available number starting from the given value (6 in our case). The 0-15 are already reserved by legacy ISA code, so it gets the first free irq descriptor which is number 16. The i915 driver also uses irq 16, it loads later than gpio and crashes in probe. The bug is reported here: https://bugzilla.kernel.org/show_bug.cgi?id=68291 The rootcause we know now is a low level irq issue. It needs a long term solution to fix the issue in irq system. This patch is a workaround which changes the Baytrail GPIO driver to avoid the IRQ conflict. It still uses the irq domain to allocate irq descriptor but start from a predefined irq base number (256). Signed-off-by: Jin Yao --- drivers/pinctrl/pinctrl-baytrail.c | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c index 6e8301f..45b2d81 100644 --- a/drivers/pinctrl/pinctrl-baytrail.c +++ b/drivers/pinctrl/pinctrl-baytrail.c @@ -124,6 +124,18 @@ static struct pinctrl_gpio_range byt_ranges[] = { }, }; +/* + * Start from an irq base number above x86 ioapic range to work around some + * nasty, which is still in 3.14 unresolved irq descriptor conflicts. + */ +#define BYT_GPIO_PIN_IRQBASE 256 + +static int byt_pin_irqbase[] = { + BYT_GPIO_PIN_IRQBASE, + BYT_GPIO_PIN_IRQBASE + BYT_NGPIO_SCORE, + BYT_GPIO_PIN_IRQBASE + BYT_NGPIO_SCORE + BYT_NGPIO_NCORE, +}; + struct byt_gpio { struct gpio_chipchip; struct irq_domain *domain; @@ -131,6 +143,7 @@ struct byt_gpio { spinlock_t lock; void __iomem*reg_base; struct pinctrl_gpio_range *range; + int pin_irqbase; }; #define to_byt_gpio(c) container_of(c, struct byt_gpio, chip) @@ -481,7 +494,7 @@ static int byt_gpio_probe(struct platform_device *pdev) struct pinctrl_gpio_range *range; acpi_handle handle = ACPI_HANDLE(dev); unsigned hwirq; - int ret; + int ret, i; if (acpi_bus_get_device(handle, &acpi_dev)) return -ENODEV; @@ -496,6 +509,12 @@ static int byt_gpio_probe(struct platform_device *pdev) if (!strcmp(acpi_dev->pnp.unique_id, range->name)) { vg->chip.ngpio = range->npins; vg->range = range; + ret = kstrtol(range->name, 10, &i); + if (ret != 0) + return ret; + + i--; + vg->pin_irqbase = byt_pin_irqbase[i]; break; } } @@ -527,19 +546,14 @@ static int byt_gpio_probe(struct platform_device *pdev) gc->can_sleep = false; gc->dev = dev; - ret = gpiochip_add(gc); - if (ret) { - dev_err(&pdev->dev, "failed adding byt-gpio chip\n"); - return ret; - } - /* set up interrupts */ irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (irq_rc && irq_rc->start) { hwirq = irq_rc->start; gc->to_irq = byt_gpio_to_irq; - vg->domain = irq_domain_add_linear(NULL, gc->ngpio, + vg->domain = irq_domain_add_simple(NULL, gc->ngpio, + vg->pin_irqbase, &byt_gpio_irq_ops, vg); if (!vg->domain) return -ENXIO; @@ -550,6 +564,12 @@ static int byt_gpio_probe(struct platform_device *pdev) irq_set_chained_handler(hwirq, byt_gpio_irq_handler); } + ret = gpiochip_add(gc); + if (ret) { + dev_err(&pdev->dev, "failed adding byt-gpio chip\n"); + return ret; + } + pm_runtime_enable(dev); return 0; @@ -572,6 +592,7 @@ static const struct dev_pm_ops byt_gpio_pm_ops = { static const struct acpi_device_id byt_gpio_acpi_match[] = { { "INT33B2", 0 }, + { "INT33FC", 0 }, { } }; MODULE_DEVICE_TABLE(acpi, byt_gpio_acpi_match); -- 1.8.3.2 -- 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/4] mvolatile: Add purged page detection on setting memory non-volatile
On Fri, Apr 11, 2014 at 01:15:39PM -0700, John Stultz wrote: > Users of volatile ranges will need to know if memory was discarded. > This patch adds the purged state tracking required to inform userland > when it marks memory as non-volatile that some memory in that range > was purged and needs to be regenerated. > > This simplified implementation which uses some of the logic from > Minchan's earlier efforts, so credit to Minchan for his work. > > Cc: Andrew Morton > Cc: Android Kernel Team > Cc: Johannes Weiner > Cc: Robert Love > Cc: Mel Gorman > Cc: Hugh Dickins > Cc: Dave Hansen > Cc: Rik van Riel > Cc: Dmitry Adamushko > Cc: Neil Brown > Cc: Andrea Arcangeli > Cc: Mike Hommey > Cc: Taras Glek > Cc: Jan Kara > Cc: KOSAKI Motohiro > Cc: Michel Lespinasse > Cc: Minchan Kim > Cc: Keith Packard > Cc: linux...@kvack.org > Acked-by: Jan Kara > Signed-off-by: John Stultz > --- > include/linux/swap.h| 5 +++ > include/linux/swapops.h | 10 ++ > mm/mvolatile.c | 86 > + > 3 files changed, 101 insertions(+) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index a90ea95..c372ca7 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -55,6 +55,7 @@ enum { >* 1<* new entries here at the top of the enum, not at the bottom >*/ > + SWP_MVOLATILE_PURGED_NR, > #ifdef CONFIG_MEMORY_FAILURE > SWP_HWPOISON_NR, > #endif > @@ -81,6 +82,10 @@ enum { > #define SWP_HWPOISON (MAX_SWAPFILES + SWP_HWPOISON_NR) > #endif > > +/* > + * Purged volatile range pages > + */ > +#define SWP_MVOLATILE_PURGED (MAX_SWAPFILES + SWP_MVOLATILE_PURGED_NR) > > /* > * Magic header for a swap area. The first part of the union is > diff --git a/include/linux/swapops.h b/include/linux/swapops.h > index c0f7526..fe9c026 100644 > --- a/include/linux/swapops.h > +++ b/include/linux/swapops.h > @@ -161,6 +161,16 @@ static inline int is_write_migration_entry(swp_entry_t > entry) > > #endif > > +static inline swp_entry_t make_purged_entry(void) > +{ > + return swp_entry(SWP_MVOLATILE_PURGED, 0); > +} > + > +static inline int is_purged_entry(swp_entry_t entry) > +{ > + return swp_type(entry) == SWP_MVOLATILE_PURGED; > +} > + > #ifdef CONFIG_MEMORY_FAILURE > /* > * Support for hardware poisoned pages > diff --git a/mm/mvolatile.c b/mm/mvolatile.c > index d4d2eed..38c8315 100644 > --- a/mm/mvolatile.c > +++ b/mm/mvolatile.c > @@ -12,8 +12,91 @@ > #include > #include > #include > +#include > +#include > #include "internal.h" > > +struct mvolatile_walker { > + struct vm_area_struct *vma; > + int page_was_purged; > +}; > + > + > +/** > + * mvolatile_check_purged_pte - Checks ptes for purged pages > + * @pmd: pmd to walk > + * @addr: starting address > + * @end: end address > + * @walk: mm_walk ptr (contains ptr to mvolatile_walker) > + * > + * Iterates over the ptes in the pmd checking if they have > + * purged swap entries. > + * > + * Sets the mvolatile_walker.page_was_purged to 1 if any were purged. Just nitpick: This function zaps ptes as well as checking purging so it would be better to mention it and "Why we should do it" in description. > + */ > +static int mvolatile_check_purged_pte(pmd_t *pmd, unsigned long addr, > + unsigned long end, struct mm_walk *walk) > +{ > + struct mvolatile_walker *vw = walk->private; > + pte_t *pte; > + spinlock_t *ptl; > + int ret = 0; > + > + if (pmd_trans_huge(*pmd)) > + return 0; > + if (pmd_trans_unstable(pmd)) > + return 0; > + > + pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); > + for (; addr != end; pte++, addr += PAGE_SIZE) { > + if (!pte_present(*pte)) { > + swp_entry_t mvolatile_entry = pte_to_swp_entry(*pte); > + > + if (unlikely(is_purged_entry(mvolatile_entry))) { > + > + vw->page_was_purged = 1; > + > + /* clear the pte swp entry */ > + flush_cache_page(vw->vma, addr, pte_pfn(*pte)); > + ptep_clear_flush(vw->vma, addr, pte); > + } > + } > + } > + pte_unmap_unlock(pte - 1, ptl); > + cond_resched(); > + > + return ret; > +} > + > + > +/** > + * mvolatile_check_purged - Sets up a mm_walk to check for purged pages > + * @vma: ptr to vma we're starting with > + * @start: start address to walk > + * @end: end address of walk > + * > + * Sets up and calls wa_page_range() to check for purge pages. > + * > + * Returns 1 if pages in the range were purged, 0 otherwise. > + */ > +static int mvolatile_check_purged(struct vm_area_struct *vma, > + unsigned long start, > + unsigned long end) > +{ > + struct mvolatile_walker vw; > +
[PATCH] net: ipv4: current group_info should be put after using.
Plug a group_info refcount leak in ping_init. group_info is only needed during initialization and the code failed to release the reference on exit. While here move grabbing the reference to a place where it is actually needed. Signed-off-by: Chuansheng Liu Signed-off-by: Zhang Dongxing Signed-off-by: xiaoming wang --- net/ipv4/ping.c | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index f4b19e5..8210964 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -252,26 +252,33 @@ int ping_init_sock(struct sock *sk) { struct net *net = sock_net(sk); kgid_t group = current_egid(); - struct group_info *group_info = get_current_groups(); - int i, j, count = group_info->ngroups; + struct group_info *group_info; + int i, j, count; kgid_t low, high; + int ret = 0; inet_get_ping_group_range_net(net, &low, &high); if (gid_lte(low, group) && gid_lte(group, high)) return 0; + group_info = get_current_groups(); + count = group_info->ngroups; for (i = 0; i < group_info->nblocks; i++) { int cp_count = min_t(int, NGROUPS_PER_BLOCK, count); for (j = 0; j < cp_count; j++) { kgid_t gid = group_info->blocks[i][j]; if (gid_lte(low, gid) && gid_lte(gid, high)) - return 0; + goto out_release_group; } count -= cp_count; } - return -EACCES; + ret = -EACCES; + +out_release_group: + put_group_info(group_info); + return ret; } EXPORT_SYMBOL_GPL(ping_init_sock); -- 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/
is there a central index of subsystem- & cross-border - issues with progress on these ?
hi kernel-developers _ from recent coverage of the LSFMM-Summit on LWN.net, i again got the impression that there are performance- & behaviour - issues, that persistently don´t seem to get resolved & stay around for the next summit. Additionally many things come to light at such meetings of different user & development-sections, which often seem to get lost again, as there is no central index, page or wiki, .. of cross-border issues & progress on these . There are more specific mailiglists for e.g. LF - workgroups or vendor- & distributor - specific kernel - pages, -portals & -wikis, but the only thing similar to a central index, that i could find, is the LWN - kernel-page index ( http://lwn.net/Kernel/Index/ ). Documentation being a weakness of the development process, LWN might be the only place. Additionally there is the issue of, again undocumented, kernel features ; this all seems to me like unnecessarily hindering to coordination & progress. or does this kind of place exist somewhere ? please cc me as i am not subscribed - thank-you _ vincent . -- 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] nfc: remove unneeded nfc_put_device() calls
Hi, Can you review this patch? Thanks. Daeseok Youn 2014-04-02 16:56 GMT+09:00 Daeseok Youn : > > If local is NULL, nfs_put_device() is called twice. > So nfs_put_device() in "if (!local)" is removed. > > Signed-off-by: Daeseok Youn > --- > net/nfc/netlink.c |1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c > index b2ad570..3e0a676 100644 > --- a/net/nfc/netlink.c > +++ b/net/nfc/netlink.c > @@ -1038,7 +1038,6 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, > struct genl_info *info) > > local = nfc_llcp_find_local(dev); > if (!local) { > - nfc_put_device(dev); > rc = -ENODEV; > goto exit; > } > -- > 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: [PATCH 1/2] nfc: fix NULL pointer dereference
Hi, Can you review this patch? Thanks. Daeseok Youn 2014-04-02 16:55 GMT+09:00 Daeseok Youn : > > dev is NULL when nfc_get_device() is failed but > dev is used for handling error. > > coccicheck says: > net/nfc/netlink.c:1092:21-24: ERROR: > dev is NULL but dereferenced. > > Signed-off-by: Daeseok Youn > --- > net/nfc/netlink.c |6 ++ > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c > index 43cb1c1..b2ad570 100644 > --- a/net/nfc/netlink.c > +++ b/net/nfc/netlink.c > @@ -1026,10 +1026,8 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, > struct genl_info *info) > idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); > > dev = nfc_get_device(idx); > - if (!dev) { > - rc = -ENODEV; > - goto exit; > - } > + if (!dev) > + return -ENODEV; > > device_lock(&dev->dev); > > -- > 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/
[PATCH v2] virtio-scsi: Skip setting affinity on uninitialized vq
virtscsi_init calls virtscsi_remove_vqs on err, even before initializing the vqs. The latter calls virtscsi_set_affinity, so let's check the pointer there before setting affinity on it. This fixes a panic when setting device's num_queues=2 on RHEL 6.5: qemu-system-x86_64 ... \ -device virtio-scsi-pci,id=scsi0,addr=0x13,...,num_queues=2 \ -drive file=/stor/vm/dummy.raw,id=drive-scsi-disk,... \ -device scsi-hd,drive=drive-scsi-disk,... [0.354734] scsi0 : Virtio SCSI HBA [0.379504] BUG: unable to handle kernel NULL pointer dereference at 0020 [0.380141] IP: [] __virtscsi_set_affinity+0x4f/0x120 [0.380141] PGD 0 [0.380141] Oops: [#1] SMP [0.380141] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.0+ #5 [0.380141] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007 [0.380141] task: 88003c9f ti: 88003c9f8000 task.ti: 88003c9f8000 [0.380141] RIP: 0010:[] [] __virtscsi_set_affinity+0x4f/0x120 [0.380141] RSP: :88003c9f9c08 EFLAGS: 00010256 [0.380141] RAX: RBX: 88003c3a9d40 RCX: 1070 [0.380141] RDX: 0002 RSI: RDI: [0.380141] RBP: 88003c9f9c28 R08: 000136c0 R09: 88003c801c00 [0.380141] R10: 81475229 R11: 0008 R12: [0.380141] R13: 81cc7ca8 R14: 88003cac3d40 R15: 88003cac37a0 [0.380141] FS: () GS:88003e40() knlGS: [0.380141] CS: 0010 DS: ES: CR0: 8005003b [0.380141] CR2: 0020 CR3: 01c0e000 CR4: 06f0 [0.380141] Stack: [0.380141] 88003c3a9d40 88003cac3d80 88003cac3d40 [0.380141] 88003c9f9c48 814742e8 88003c26d000 88003c26d000 [0.380141] 88003c9f9c68 81474321 88003c26d000 88003c3a9d40 [0.380141] Call Trace: [0.380141] [] virtscsi_set_affinity+0x28/0x40 [0.380141] [] virtscsi_remove_vqs+0x21/0x50 [0.380141] [] virtscsi_init+0x91/0x240 [0.380141] [] ? vp_get+0x50/0x70 [0.380141] [] virtscsi_probe+0xf4/0x280 [0.380141] [] virtio_dev_probe+0xe5/0x140 [0.380141] [] driver_probe_device+0x89/0x230 [0.380141] [] __driver_attach+0x9b/0xa0 [0.380141] [] ? driver_probe_device+0x230/0x230 [0.380141] [] ? driver_probe_device+0x230/0x230 [0.380141] [] bus_for_each_dev+0x8c/0xb0 [0.380141] [] driver_attach+0x19/0x20 [0.380141] [] bus_add_driver+0x198/0x220 [0.380141] [] driver_register+0x5f/0xf0 [0.380141] [] ? spi_transport_init+0x79/0x79 [0.380141] [] register_virtio_driver+0x1b/0x30 [0.380141] [] init+0x88/0xd6 [0.380141] [] ? scsi_init_procfs+0x5b/0x5b [0.380141] [] do_one_initcall+0x7f/0x10a [0.380141] [] kernel_init_freeable+0x14a/0x1de [0.380141] [] ? kernel_init_freeable+0x1de/0x1de [0.380141] [] ? rest_init+0x80/0x80 [0.380141] [] kernel_init+0x9/0xf0 [0.380141] [] ret_from_fork+0x7c/0xb0 [0.380141] [] ? rest_init+0x80/0x80 [0.380141] RIP [] __virtscsi_set_affinity+0x4f/0x120 [0.380141] RSP [0.380141] CR2: 0020 [0.380141] ---[ end trace 8074b70c3d5e1d73 ]--- [0.475018] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0009 [0.475018] [0.475068] Kernel Offset: 0x0 from 0x8100 (relocation range: 0x8000-0x9fff) [0.475068] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0009 Signed-off-by: Fam Zheng Acked-by: Paolo Bonzini Cc: sta...@vger.kernel.org --- drivers/scsi/virtio_scsi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 16bfd50..3019267 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -750,8 +750,12 @@ static void __virtscsi_set_affinity(struct virtio_scsi *vscsi, bool affinity) vscsi->affinity_hint_set = true; } else { - for (i = 0; i < vscsi->num_queues; i++) + for (i = 0; i < vscsi->num_queues; i++) { + if (!vscsi->req_vqs[i].vq) { + continue; + } virtqueue_set_affinity(vscsi->req_vqs[i].vq, -1); + } vscsi->affinity_hint_set = false; } -- 1.9.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: Missing USB XHCI and EHCI reset for kexec
On Sun, 13 Apr 2014, Stefani Seibold wrote: > When executing a kexec kernel on a PowerPC board the new started kernel > will not find already enumerated USB devices due a missing reset on the > USB bus. How do you know the problem is caused by a missing reset? Can you post the dmesg log from the kexec-ed kernel, with CONFIG_USB_DEBUG enabled? Alan Stern -- 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] pwm_lpss: Add support for PCI devices
> > MODULE_DESCRIPTION("PWM driver for Intel LPSS"); > >MODULE_AUTHOR("Mika > > Westerberg "); > > MODULE_LICENSE("GPL v2"); > > MODULE_ALIAS("platform:pwm-lpss"); > > Looks a good idea to combine pci and acpi driver together. > Since pci driver is added, here the alias need to be refined. > Others look good. > > Thanks, > -Aubrey Ok. I will change it to MODULE_ALIAS("pci/platform:pwm-lpss"); Thanks, Chiau Ee N�r��yb�X��ǧv�^�){.n�+{zX����ܨ}���Ơz�&j:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a��� 0��h���i
linux-next: Tree for Apr 14
Hi all, This tree still fails (more than usual) the powerpc allyesconfig build. Changes since 20140411: Dropped trees: akpm-current, akpm (too complex conflicts) The powerpc tree still had its build failure. Non-merge commits (relative to Linus' tree): 379 788 files changed, 8145 insertions(+), 9705 deletions(-) I have created today's linux-next tree at git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (patches at http://www.kernel.org/pub/linux/kernel/next/ ). If you are tracking the linux-next tree using git, you should not use "git pull" to do so as that will try to merge the new linux-next release with the old one. You should use "git fetch" as mentioned in the FAQ on the wiki (see below). You can see which trees have been included by looking in the Next/Trees file in the source. There are also quilt-import.log and merge.log files in the Next directory. Between each merge, the tree was built with a ppc64_defconfig for powerpc and an allmodconfig for x86_64 and a multi_v7_defconfig for arm. After the final fixups (if any), it is also built with powerpc allnoconfig (32 and 64 bit), ppc44x_defconfig and allyesconfig (this fails its final link) and i386, sparc, sparc64 and arm defconfig. Below is a summary of the state of the merge. I am currently merging 213 trees (counting Linus' and 28 trees of patches pending for Linus' tree). Stats about the size of the tree over time can be seen at http://neuling.org/linux-next-size.html . Status of my local build tests will be at http://kisskb.ellerman.id.au/linux-next . If maintainers want to give advice about cross compilers/configs that work, we are always open to add more builds. Thanks to Randy Dunlap for doing many randconfig builds. And to Paul Gortmaker for triage and bug fixes. There is a wiki covering stuff to do with linux-next at http://linux.f-seidel.de/linux-next/pmwiki/ . Thanks to Frank Seidel. -- Cheers, Stephen Rothwells...@canb.auug.org.au $ git checkout master $ git reset --hard stable Merging origin/master (c9eaa447e77e Linux 3.15-rc1) Merging fixes/master (b0031f227e47 Merge tag 's2mps11-build' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator) Merging kbuild-current/rc-fixes (38dbfb59d117 Linus 3.14-rc1) Merging arc-current/for-curr (61fb4bfc010b ARC: [nsimosci] Unbork console) Merging arm-current/fixes (c9d347e02776 ARM: 8009/1: dcscb.c: remove call to outer_flush_all()) Merging m68k-current/for-linus (50be9eba831d m68k: Update defconfigs for v3.14-rc1) Merging metag-fixes/fixes (0414855fdc4a Linux 3.14-rc5) Merging powerpc-merge/merge (cc4f265ad9a3 powerpc/powernv Adapt opal-elog and opal-dump to new sysfs_remove_file_self) Merging sparc/master (455c6fdbd219 Linux 3.14) Merging net/master (eda43ce03919 Merge branch 'tunnels') Merging ipsec/master (5596732fa8c1 xfrm: Fix crash with ipv6 IPsec tunnel and NAT.) Merging sound-current/for-linus (a5065eb6da55 ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()) Merging pci-current/for-linus (707d4eefbdb3 Revert "[PATCH] Insert GART region into resource map") Merging wireless/master (5869e795e07d ath9k: fix a scheduling while atomic bug in CSA handling) Merging driver-core.current/driver-core-linus (b33ce4429938 Merge branch 'for-3.15/drivers' of git://git.kernel.dk/linux-block) Merging tty.current/tty-linus (b33ce4429938 Merge branch 'for-3.15/drivers' of git://git.kernel.dk/linux-block) Merging usb.current/usb-linus (b33ce4429938 Merge branch 'for-3.15/drivers' of git://git.kernel.dk/linux-block) Merging staging.current/staging-linus (4ba85265790b Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86) Merging char-misc.current/char-misc-linus (b33ce4429938 Merge branch 'for-3.15/drivers' of git://git.kernel.dk/linux-block) Merging input-current/for-linus (692d96552c9a Merge branch 'next' into for-linus) Merging md-current/for-linus (d47648fcf061 raid5: avoid finding "discard" stripe) Merging crypto-current/master (eb4a5346e777 hwrng: bcm2835 - fix oops when rng h/w is accessed during registration) Merging ide/master (5b40dd30bbfa ide: Fix SC1200 dependencies) Merging dwmw2/master (5950f0803ca9 pcmcia: remove RPX board stuff) Merging devicetree-current/devicetree/merge (1f42e5dd5065 of: Add self test for of_match_node()) Merging rr-fixes/fixes (7122c3e9154b scripts/link-vmlinux.sh: only filter kernel symbols for arm) Merging mfd-fixes/master (73beb63d290f mfd: rtsx_pcr: Disable interrupts before cancelling delayed works) Merging vfio-fixes/for-linus (239a87020b26 Merge branch 'for-joerg/arm-smmu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into for-linus) Merging drm-intel-fixes/for-linux-next-fixes (9db32cb625a5 drm/i915: Undo gtt scratch pte unmapping again) CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_gem_gtt.c Merging asm-generic/mas
[PATCH -next 3.16 03/19] tile: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- arch/tile/kernel/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/tile/kernel/proc.c b/arch/tile/kernel/proc.c index 681100c..6829a95 100644 --- a/arch/tile/kernel/proc.c +++ b/arch/tile/kernel/proc.c @@ -113,7 +113,7 @@ arch_initcall(proc_tile_init); * Support /proc/sys/tile directory */ -static ctl_table unaligned_subtable[] = { +static struct ctl_table unaligned_subtable[] = { { .procname = "enabled", .data = &unaligned_fixup, @@ -138,7 +138,7 @@ static ctl_table unaligned_subtable[] = { {} }; -static ctl_table unaligned_table[] = { +static struct ctl_table unaligned_table[] = { { .procname = "unaligned_fixup", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 01/19] arm: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- arch/arm/kernel/isa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c index 3464859..9d1cf71 100644 --- a/arch/arm/kernel/isa.c +++ b/arch/arm/kernel/isa.c @@ -20,7 +20,7 @@ static unsigned int isa_membase, isa_portbase, isa_portshift; -static ctl_table ctl_isa_vars[4] = { +static struct ctl_table ctl_isa_vars[4] = { { .procname = "membase", .data = &isa_membase, @@ -44,7 +44,7 @@ static ctl_table ctl_isa_vars[4] = { static struct ctl_table_header *isa_sysctl_header; -static ctl_table ctl_isa[2] = { +static struct ctl_table ctl_isa[2] = { { .procname = "isa", .mode = 0555, @@ -52,7 +52,7 @@ static ctl_table ctl_isa[2] = { }, {} }; -static ctl_table ctl_bus[2] = { +static struct ctl_table ctl_bus[2] = { { .procname = "bus", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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] pwm: use PWM_LOOKUP to set the period and polarity
On Thu, Apr 10, 2014 at 09:37:03AM +0200, Alexandre Belloni wrote: > On 10/04/2014 at 08:15:49 +0900, Simon Horman wrote : > > On Wed, Apr 09, 2014 at 08:04:09PM +0200, Alexandre Belloni wrote: > > > Now that the PWM core is able to set the period and polarity based on > > > the lookup table, add those to PWM_LOOKUP to ease their usage. > > > > I would prefer if this change was made in a non-atomic manner. > > > > 1. Add new infrastructure > > 2. Update users individually > > 3. Remove old infrastructure > > > > I agree this would be better but I'm not sure how you can modify a macro > without renaming it or changing it everywhere at once. Like said, I'm > open to creating a new macro. I for one would prefer the new macro approach. -- 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 -next 3.16 06/19] parport: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- drivers/parport/procfs.c | 58 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 92ed045..3b47080 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -31,7 +31,7 @@ #define PARPORT_MIN_SPINTIME_VALUE 1 #define PARPORT_MAX_SPINTIME_VALUE 1000 -static int do_active_device(ctl_table *table, int write, +static int do_active_device(struct ctl_table *table, int write, void __user *result, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; @@ -68,7 +68,7 @@ static int do_active_device(ctl_table *table, int write, } #ifdef CONFIG_PARPORT_1284 -static int do_autoprobe(ctl_table *table, int write, +static int do_autoprobe(struct ctl_table *table, int write, void __user *result, size_t *lenp, loff_t *ppos) { struct parport_device_info *info = table->extra2; @@ -110,9 +110,9 @@ static int do_autoprobe(ctl_table *table, int write, } #endif /* IEEE1284.3 support. */ -static int do_hardware_base_addr (ctl_table *table, int write, - void __user *result, - size_t *lenp, loff_t *ppos) +static int do_hardware_base_addr(struct ctl_table *table, int write, +void __user *result, +size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; char buffer[20]; @@ -138,9 +138,9 @@ static int do_hardware_base_addr (ctl_table *table, int write, return copy_to_user(result, buffer, len) ? -EFAULT : 0; } -static int do_hardware_irq (ctl_table *table, int write, - void __user *result, - size_t *lenp, loff_t *ppos) +static int do_hardware_irq(struct ctl_table *table, int write, + void __user *result, + size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; char buffer[20]; @@ -166,9 +166,9 @@ static int do_hardware_irq (ctl_table *table, int write, return copy_to_user(result, buffer, len) ? -EFAULT : 0; } -static int do_hardware_dma (ctl_table *table, int write, - void __user *result, - size_t *lenp, loff_t *ppos) +static int do_hardware_dma(struct ctl_table *table, int write, + void __user *result, + size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; char buffer[20]; @@ -194,9 +194,9 @@ static int do_hardware_dma (ctl_table *table, int write, return copy_to_user(result, buffer, len) ? -EFAULT : 0; } -static int do_hardware_modes (ctl_table *table, int write, - void __user *result, - size_t *lenp, loff_t *ppos) +static int do_hardware_modes(struct ctl_table *table, int write, +void __user *result, +size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; char buffer[40]; @@ -255,11 +255,11 @@ PARPORT_MAX_SPINTIME_VALUE; struct parport_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table vars[12]; - ctl_table device_dir[2]; - ctl_table port_dir[2]; - ctl_table parport_dir[2]; - ctl_table dev_dir[2]; + struct ctl_table vars[12]; + struct ctl_table device_dir[2]; + struct ctl_table port_dir[2]; + struct ctl_table parport_dir[2]; + struct ctl_table dev_dir[2]; }; static const struct parport_sysctl_table parport_sysctl_template = { @@ -369,12 +369,12 @@ static const struct parport_sysctl_table parport_sysctl_template = { struct parport_device_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table vars[2]; - ctl_table device_dir[2]; - ctl_table devices_root_dir[2]; - ctl_table port_dir[2]; - ctl_table parport_dir[2]; - ctl_table dev_dir[2]; + struct ctl_table vars[2]; + struct ctl_table device_dir[2]; + struct ctl_table devices_root_dir[2]; + struct ctl_table port_dir[2]; + struct ctl_table parport_dir[2]; + struct ctl_table dev_dir[2]; }; static const struct parport_device_sysctl_table @@ -422,10 +422,10 @@ parport_device_sysctl_template = { struct parport_default_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table vars[3]; -ctl_table default_dir[2]; - ctl_table parport_dir[2]; - ctl_table dev_dir[2]; + struct ctl_table vars[3]; + struct ctl_table default_dir[2]; + struct ctl_table parport_dir[2]; +
[PATCH -next 3.16 02/19] ia64: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- arch/ia64/kernel/crash.c | 4 ++-- arch/ia64/kernel/perfmon.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index b942f40..2955f35 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c @@ -237,7 +237,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) } #ifdef CONFIG_SYSCTL -static ctl_table kdump_ctl_table[] = { +static struct ctl_table kdump_ctl_table[] = { { .procname = "kdump_on_init", .data = &kdump_on_init, @@ -255,7 +255,7 @@ static ctl_table kdump_ctl_table[] = { { } }; -static ctl_table sys_table[] = { +static struct ctl_table sys_table[] = { { .procname = "kernel", .mode = 0555, diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index d841c4b..5845ffe 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -521,7 +521,7 @@ static pmu_config_t *pmu_conf; pfm_sysctl_t pfm_sysctl; EXPORT_SYMBOL(pfm_sysctl); -static ctl_table pfm_ctl_table[]={ +static struct ctl_table pfm_ctl_table[] = { { .procname = "debug", .data = &pfm_sysctl.debug, @@ -552,7 +552,7 @@ static ctl_table pfm_ctl_table[]={ }, {} }; -static ctl_table pfm_sysctl_dir[] = { +static struct ctl_table pfm_sysctl_dir[] = { { .procname = "perfmon", .mode = 0555, @@ -560,7 +560,7 @@ static ctl_table pfm_sysctl_dir[] = { }, {} }; -static ctl_table pfm_sysctl_root[] = { +static struct ctl_table pfm_sysctl_root[] = { { .procname = "kernel", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 04/19] cdrom: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- drivers/cdrom/cdrom.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 8a3aff7..d49a76f 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -3465,7 +3465,7 @@ static int cdrom_print_info(const char *header, int val, char *info, return 0; } -static int cdrom_sysctl_info(ctl_table *ctl, int write, +static int cdrom_sysctl_info(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int pos; @@ -3578,7 +3578,7 @@ static void cdrom_update_settings(void) mutex_unlock(&cdrom_mutex); } -static int cdrom_sysctl_handler(ctl_table *ctl, int write, +static int cdrom_sysctl_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int ret; @@ -3604,7 +3604,7 @@ static int cdrom_sysctl_handler(ctl_table *ctl, int write, } /* Place files in /proc/sys/dev/cdrom */ -static ctl_table cdrom_table[] = { +static struct ctl_table cdrom_table[] = { { .procname = "info", .data = &cdrom_sysctl_settings.info, @@ -3650,7 +3650,7 @@ static ctl_table cdrom_table[] = { { } }; -static ctl_table cdrom_cdrom_table[] = { +static struct ctl_table cdrom_cdrom_table[] = { { .procname = "cdrom", .maxlen = 0, @@ -3661,7 +3661,7 @@ static ctl_table cdrom_cdrom_table[] = { }; /* Make sure that /proc/sys/dev is there */ -static ctl_table cdrom_root_table[] = { +static struct ctl_table cdrom_root_table[] = { { .procname = "dev", .maxlen = 0, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 08/19] coda: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/coda/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index af56ad5..34218a8 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c @@ -14,7 +14,7 @@ #ifdef CONFIG_SYSCTL static struct ctl_table_header *fs_table_header; -static ctl_table coda_table[] = { +static struct ctl_table coda_table[] = { { .procname = "timeout", .data = &coda_timeout, @@ -39,7 +39,7 @@ static ctl_table coda_table[] = { {} }; -static ctl_table fs_table[] = { +static struct ctl_table fs_table[] = { { .procname = "coda", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 05/19] random: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- drivers/char/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 6b75713..c71dfb6 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1578,10 +1578,10 @@ static int proc_do_uuid(struct ctl_table *table, int write, /* * Return entropy available scaled to integral bits */ -static int proc_do_entropy(ctl_table *table, int write, +static int proc_do_entropy(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - ctl_table fake_table; + struct ctl_table fake_table; int entropy_count; entropy_count = *(int *)table->data >> ENTROPY_SHIFT; -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 07/19] scsi: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- drivers/scsi/scsi_sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c index 2b6b93f..546f162 100644 --- a/drivers/scsi/scsi_sysctl.c +++ b/drivers/scsi/scsi_sysctl.c @@ -12,7 +12,7 @@ #include "scsi_priv.h" -static ctl_table scsi_table[] = { +static struct ctl_table scsi_table[] = { { .procname = "logging_level", .data = &scsi_logging_level, .maxlen = sizeof(scsi_logging_level), @@ -21,14 +21,14 @@ static ctl_table scsi_table[] = { { } }; -static ctl_table scsi_dir_table[] = { +static struct ctl_table scsi_dir_table[] = { { .procname = "scsi", .mode = 0555, .child= scsi_table }, { } }; -static ctl_table scsi_root_table[] = { +static struct ctl_table scsi_root_table[] = { { .procname = "dev", .mode = 0555, .child= scsi_dir_table }, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 09/19] fscache: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/fscache/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fscache/main.c b/fs/fscache/main.c index 7c27907..5b2c174 100644 --- a/fs/fscache/main.c +++ b/fs/fscache/main.c @@ -67,7 +67,7 @@ static int fscache_max_active_sysctl(struct ctl_table *table, int write, return ret; } -ctl_table fscache_sysctls[] = { +struct ctl_table fscache_sysctls[] = { { .procname = "object_max_active", .data = &fscache_object_max_active, @@ -87,7 +87,7 @@ ctl_table fscache_sysctls[] = { {} }; -ctl_table fscache_sysctls_root[] = { +struct ctl_table fscache_sysctls_root[] = { { .procname = "fscache", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 10/19] lockd: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/lockd/svc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 6bf06a0..de051cb1 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -436,7 +436,7 @@ EXPORT_SYMBOL_GPL(lockd_down); * Sysctl parameters (same as module parameters, different interface). */ -static ctl_table nlm_sysctls[] = { +static struct ctl_table nlm_sysctls[] = { { .procname = "nlm_grace_period", .data = &nlm_grace_period, @@ -490,7 +490,7 @@ static ctl_table nlm_sysctls[] = { { } }; -static ctl_table nlm_sysctl_dir[] = { +static struct ctl_table nlm_sysctl_dir[] = { { .procname = "nfs", .mode = 0555, @@ -499,7 +499,7 @@ static ctl_table nlm_sysctl_dir[] = { { } }; -static ctl_table nlm_sysctl_root[] = { +static struct ctl_table nlm_sysctl_root[] = { { .procname = "fs", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 12/19] inotify: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/notify/inotify/inotify_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 78a2ca3..cc423a3 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -57,7 +57,7 @@ static struct kmem_cache *inotify_inode_mark_cachep __read_mostly; static int zero; -ctl_table inotify_table[] = { +struct ctl_table inotify_table[] = { { .procname = "max_user_instances", .data = &inotify_max_user_instances, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 13/19] ntfs: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/ntfs/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/sysctl.c b/fs/ntfs/sysctl.c index 79a8918..a3e6626 100644 --- a/fs/ntfs/sysctl.c +++ b/fs/ntfs/sysctl.c @@ -34,7 +34,7 @@ #include "debug.h" /* Definition of the ntfs sysctl. */ -static ctl_table ntfs_sysctls[] = { +static struct ctl_table ntfs_sysctls[] = { { .procname = "ntfs-debug", .data = &debug_msgs, /* Data pointer and size. */ @@ -46,7 +46,7 @@ static ctl_table ntfs_sysctls[] = { }; /* Define the parent directory /proc/sys/fs. */ -static ctl_table sysctls_root[] = { +static struct ctl_table sysctls_root[] = { { .procname = "fs", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 11/19] nfs: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/nfs/nfs4sysctl.c | 6 +++--- fs/nfs/sysctl.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/nfs/nfs4sysctl.c b/fs/nfs/nfs4sysctl.c index 2628d92..b6ebe7e 100644 --- a/fs/nfs/nfs4sysctl.c +++ b/fs/nfs/nfs4sysctl.c @@ -16,7 +16,7 @@ static const int nfs_set_port_min = 0; static const int nfs_set_port_max = 65535; static struct ctl_table_header *nfs4_callback_sysctl_table; -static ctl_table nfs4_cb_sysctls[] = { +static struct ctl_table nfs4_cb_sysctls[] = { { .procname = "nfs_callback_tcpport", .data = &nfs_callback_set_tcpport, @@ -36,7 +36,7 @@ static ctl_table nfs4_cb_sysctls[] = { { } }; -static ctl_table nfs4_cb_sysctl_dir[] = { +static struct ctl_table nfs4_cb_sysctl_dir[] = { { .procname = "nfs", .mode = 0555, @@ -45,7 +45,7 @@ static ctl_table nfs4_cb_sysctl_dir[] = { { } }; -static ctl_table nfs4_cb_sysctl_root[] = { +static struct ctl_table nfs4_cb_sysctl_root[] = { { .procname = "fs", .mode = 0555, diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c index 6b3f253..bb6ed81 100644 --- a/fs/nfs/sysctl.c +++ b/fs/nfs/sysctl.c @@ -13,7 +13,7 @@ static struct ctl_table_header *nfs_callback_sysctl_table; -static ctl_table nfs_cb_sysctls[] = { +static struct ctl_table nfs_cb_sysctls[] = { { .procname = "nfs_mountpoint_timeout", .data = &nfs_mountpoint_expiry_timeout, @@ -31,7 +31,7 @@ static ctl_table nfs_cb_sysctls[] = { { } }; -static ctl_table nfs_cb_sysctl_dir[] = { +static struct ctl_table nfs_cb_sysctl_dir[] = { { .procname = "nfs", .mode = 0555, @@ -40,7 +40,7 @@ static ctl_table nfs_cb_sysctl_dir[] = { { } }; -static ctl_table nfs_cb_sysctl_root[] = { +static struct ctl_table nfs_cb_sysctl_root[] = { { .procname = "fs", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 0/7] f2fs: some fix and cleanup about flush_merge
On 04/14/2014 09:44 AM, Jaegeuk Kim wrote: > Hi Gu, > > I just started to review the patches and merge them individually though. > Since I've been internally doing in my local tree, so that should be no > problem. I'll roll back to the latest point. OK, and please pay some attention to the flush cmds merging operation when doing tests, it seems that some of the outstanding flush cmds(in the issue_list) will be ignored when new cmd added. I'll review and test it more. > Anyway, thank you for your work. :) Regards, Gu > > 2014-04-14 (월), 09:18 +0800, Gu Zheng: >> Hi All, >> There seems to be a mistake in "[PATCH 2/7]f2fs: remove the unuseful >> "issue_tail" list", >> and the whole patchset needs to be reworked. So please ignore this one. >> Sorry for the noise. >> >> Regards, >> Gu >> On 04/11/2014 05:49 PM, Gu Zheng wrote: >> >>> Gu Zheng (7): >>> f2fs: put the bio when issue_flush completed >>> f2fs: remove the unuseful "issue_tail" list >>> f2fs: use __GFP_ZERO to avoid appending set-NULL >>> f2fs: enable flush_merge only in f2fs is not read-only >>> f2fs: add the flush_merge handle in the remount flow >>> f2fs: introduce struct flush_cmd_control to wrap the flush_merge >>> fields >>> f2fs: introduce help function {create,destroy}_flush_cmd_control >>> >>> fs/f2fs/f2fs.h| 17 ++--- >>> fs/f2fs/segment.c | 102 >>> +++- >>> fs/f2fs/super.c | 32 ++-- >>> 3 files changed, 107 insertions(+), 44 deletions(-) >>> >> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- 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 -next 3.16 17/19] sysctl: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- kernel/sysctl.c | 2 +- kernel/utsname_sysctl.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 74f5b58..bdabf93 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -195,7 +195,7 @@ static int proc_dostring_coredump(struct ctl_table *table, int write, /* Note: sysrq code uses it's own private copy */ static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE; -static int sysrq_sysctl_handler(ctl_table *table, int write, +static int sysrq_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 4f69f9a..09af144 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -17,7 +17,7 @@ #ifdef CONFIG_PROC_SYSCTL -static void *get_uts(ctl_table *table, int write) +static void *get_uts(struct ctl_table *table, int write) { char *which = table->data; struct uts_namespace *uts_ns; @@ -32,7 +32,7 @@ static void *get_uts(ctl_table *table, int write) return which; } -static void put_uts(ctl_table *table, int write, void *which) +static void put_uts(struct ctl_table *table, int write, void *which) { if (!write) up_read(&uts_sem); @@ -44,7 +44,7 @@ static void put_uts(ctl_table *table, int write, void *which) * Special case of dostring for the UTS structure. This has locks * to observe. Should this be in kernel/sys.c */ -static int proc_do_uts_string(ctl_table *table, int write, +static int proc_do_uts_string(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table uts_table; -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 15/19] key: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- include/linux/key.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/key.h b/include/linux/key.h index 80d6774..3ae45f0 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -332,7 +332,7 @@ do { \ } while (0) #ifdef CONFIG_SYSCTL -extern ctl_table key_sysctls[]; +extern struct ctl_table key_sysctls[]; #endif /* * the userspace interface -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 16/19] ipc: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- ipc/ipc_sysctl.c | 14 +++--- ipc/mq_sysctl.c | 12 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 998d31b..c3f0326 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -18,7 +18,7 @@ #include #include "util.h" -static void *get_ipc(ctl_table *table) +static void *get_ipc(struct ctl_table *table) { char *which = table->data; struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns; @@ -27,7 +27,7 @@ static void *get_ipc(ctl_table *table) } #ifdef CONFIG_PROC_SYSCTL -static int proc_ipc_dointvec(ctl_table *table, int write, +static int proc_ipc_dointvec(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; @@ -38,7 +38,7 @@ static int proc_ipc_dointvec(ctl_table *table, int write, return proc_dointvec(&ipc_table, write, buffer, lenp, ppos); } -static int proc_ipc_dointvec_minmax(ctl_table *table, int write, +static int proc_ipc_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; @@ -49,7 +49,7 @@ static int proc_ipc_dointvec_minmax(ctl_table *table, int write, return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos); } -static int proc_ipc_dointvec_minmax_orphans(ctl_table *table, int write, +static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ipc_namespace *ns = current->nsproxy->ipc_ns; @@ -62,7 +62,7 @@ static int proc_ipc_dointvec_minmax_orphans(ctl_table *table, int write, return err; } -static int proc_ipc_callback_dointvec_minmax(ctl_table *table, int write, +static int proc_ipc_callback_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; @@ -85,7 +85,7 @@ static int proc_ipc_callback_dointvec_minmax(ctl_table *table, int write, return rc; } -static int proc_ipc_doulongvec_minmax(ctl_table *table, int write, +static int proc_ipc_doulongvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; @@ -119,7 +119,7 @@ static void ipc_auto_callback(int val) } } -static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, +static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c index 5bb8bfe..68d4e95 100644 --- a/ipc/mq_sysctl.c +++ b/ipc/mq_sysctl.c @@ -14,7 +14,7 @@ #include #ifdef CONFIG_PROC_SYSCTL -static void *get_mq(ctl_table *table) +static void *get_mq(struct ctl_table *table) { char *which = table->data; struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns; @@ -22,7 +22,7 @@ static void *get_mq(ctl_table *table) return which; } -static int proc_mq_dointvec(ctl_table *table, int write, +static int proc_mq_dointvec(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table mq_table; @@ -32,7 +32,7 @@ static int proc_mq_dointvec(ctl_table *table, int write, return proc_dointvec(&mq_table, write, buffer, lenp, ppos); } -static int proc_mq_dointvec_minmax(ctl_table *table, int write, +static int proc_mq_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table mq_table; @@ -53,7 +53,7 @@ static int msg_max_limit_max = HARD_MSGMAX; static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; static int msg_maxsize_limit_max = HARD_MSGSIZEMAX; -static ctl_table mq_sysctls[] = { +static struct ctl_table mq_sysctls[] = { { .procname = "queues_max", .data = &init_ipc_ns.mq_queues_max, @@ -100,7 +100,7 @@ static ctl_table mq_sysctls[] = { {} }; -static ctl_table mq_sysctl_dir[] = { +static struct ctl_table mq_sysctl_dir[] = { { .procname = "mqueue", .mode = 0555, @@ -109,7 +109,7 @@ static ctl_table mq_sysctl_dir[] = { {} }; -static ctl_table mq_sysctl_root[] = { +static struct ctl_table mq_sysctl_root[] = { { .procname = "fs", .mode = 0555, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 19/19] security: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- security/keys/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/sysctl.c b/security/keys/sysctl.c index 8c0af08..b68faa1 100644 --- a/security/keys/sysctl.c +++ b/security/keys/sysctl.c @@ -15,7 +15,7 @@ static const int zero, one = 1, max = INT_MAX; -ctl_table key_sysctls[] = { +struct ctl_table key_sysctls[] = { { .procname = "maxkeys", .data = &key_quota_maxkeys, -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 18/19] mm: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- mm/page-writeback.c | 2 +- mm/page_alloc.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ef41349..023cf08 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1682,7 +1682,7 @@ void throttle_vm_writeout(gfp_t gfp_mask) /* * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs */ -int dirty_writeback_centisecs_handler(ctl_table *table, int write, +int dirty_writeback_centisecs_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { proc_dointvec(table, write, buffer, length, ppos); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5dba293..0128d50 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3351,7 +3351,7 @@ early_param("numa_zonelist_order", setup_numa_zonelist_order); /* * sysctl handler for numa_zonelist_order */ -int numa_zonelist_order_handler(ctl_table *table, int write, +int numa_zonelist_order_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { @@ -5774,7 +5774,7 @@ module_init(init_per_zone_wmark_min) * that we can call two helper functions whenever min_free_kbytes * changes. */ -int min_free_kbytes_sysctl_handler(ctl_table *table, int write, +int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { int rc; @@ -5791,7 +5791,7 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write, } #ifdef CONFIG_NUMA -int sysctl_min_unmapped_ratio_sysctl_handler(ctl_table *table, int write, +int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { struct zone *zone; @@ -5807,7 +5807,7 @@ int sysctl_min_unmapped_ratio_sysctl_handler(ctl_table *table, int write, return 0; } -int sysctl_min_slab_ratio_sysctl_handler(ctl_table *table, int write, +int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { struct zone *zone; @@ -5833,7 +5833,7 @@ int sysctl_min_slab_ratio_sysctl_handler(ctl_table *table, int write, * minimum watermarks. The lowmem reserve ratio can only make sense * if in function of the boot time zone sizes. */ -int lowmem_reserve_ratio_sysctl_handler(ctl_table *table, int write, +int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { proc_dointvec_minmax(table, write, buffer, length, ppos); @@ -5846,7 +5846,7 @@ int lowmem_reserve_ratio_sysctl_handler(ctl_table *table, int write, * cpu. It is the fraction of total pages in each zone that a hot per cpu * pagelist can have before it gets flushed back to buddy allocator. */ -int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, +int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { struct zone *zone; -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 14/19] fs: Convert use of typedef ctl_table to struct ctl_table
This typedef is unnecessary and should just be removed. Signed-off-by: Joe Perches --- fs/dcache.c | 2 +- fs/drop_caches.c | 2 +- fs/eventpoll.c | 2 +- fs/file_table.c | 4 ++-- fs/inode.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 0407ed4..f9a5b3a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -150,7 +150,7 @@ static long get_nr_dentry_unused(void) return sum < 0 ? 0 : sum; } -int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, +int proc_nr_dentry(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { dentry_stat.nr_dentry = get_nr_dentry(); diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 9280202..1de7294 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -50,7 +50,7 @@ static void drop_slab(void) } while (nr_objects > 10); } -int drop_caches_sysctl_handler(ctl_table *table, int write, +int drop_caches_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { int ret; diff --git a/fs/eventpoll.c b/fs/eventpoll.c index af90312..b73e062 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -293,7 +293,7 @@ static LIST_HEAD(tfile_check_list); static long zero; static long long_max = LONG_MAX; -ctl_table epoll_table[] = { +struct ctl_table epoll_table[] = { { .procname = "max_user_watches", .data = &max_user_watches, diff --git a/fs/file_table.c b/fs/file_table.c index 01071c4..b19a86f 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -77,14 +77,14 @@ EXPORT_SYMBOL_GPL(get_max_files); * Handle nr_files sysctl */ #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) -int proc_nr_files(ctl_table *table, int write, +int proc_nr_files(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { files_stat.nr_files = get_nr_files(); return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); } #else -int proc_nr_files(ctl_table *table, int write, +int proc_nr_files(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; diff --git a/fs/inode.c b/fs/inode.c index f96d2a6..2feb9b6 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -105,7 +105,7 @@ long get_nr_dirty_inodes(void) * Handle nr_inode sysctl */ #ifdef CONFIG_SYSCTL -int proc_nr_inodes(ctl_table *table, int write, +int proc_nr_inodes(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { inodes_stat.nr_inodes = get_nr_inodes(); -- 1.8.1.2.459.gbcd45b4.dirty -- 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 -next 3.16 00/19] treewide: Convert typedef ctl_table
Most all of these have been converted in the past, these are the stragglers. Original submission: https://lkml.org/lkml/2013/6/13/650 trivial was cc'd previously, \ Joe Perches (19): arm: Convert use of typedef ctl_table to struct ctl_table ia64: Convert use of typedef ctl_table to struct ctl_table tile: Convert use of typedef ctl_table to struct ctl_table cdrom: Convert use of typedef ctl_table to struct ctl_table random: Convert use of typedef ctl_table to struct ctl_table parport: Convert use of typedef ctl_table to struct ctl_table scsi: Convert use of typedef ctl_table to struct ctl_table coda: Convert use of typedef ctl_table to struct ctl_table fscache: Convert use of typedef ctl_table to struct ctl_table lockd: Convert use of typedef ctl_table to struct ctl_table nfs: Convert use of typedef ctl_table to struct ctl_table inotify: Convert use of typedef ctl_table to struct ctl_table ntfs: Convert use of typedef ctl_table to struct ctl_table fs: Convert use of typedef ctl_table to struct ctl_table key: Convert use of typedef ctl_table to struct ctl_table ipc: Convert use of typedef ctl_table to struct ctl_table sysctl: Convert use of typedef ctl_table to struct ctl_table mm: Convert use of typedef ctl_table to struct ctl_table security: Convert use of typedef ctl_table to struct ctl_table arch/arm/kernel/isa.c| 6 ++--- arch/ia64/kernel/crash.c | 4 +-- arch/ia64/kernel/perfmon.c | 6 ++--- arch/tile/kernel/proc.c | 4 +-- drivers/cdrom/cdrom.c| 10 +++ drivers/char/random.c| 4 +-- drivers/parport/procfs.c | 58 drivers/scsi/scsi_sysctl.c | 6 ++--- fs/coda/sysctl.c | 4 +-- fs/dcache.c | 2 +- fs/drop_caches.c | 2 +- fs/eventpoll.c | 2 +- fs/file_table.c | 4 +-- fs/fscache/main.c| 4 +-- fs/inode.c | 2 +- fs/lockd/svc.c | 6 ++--- fs/nfs/nfs4sysctl.c | 6 ++--- fs/nfs/sysctl.c | 6 ++--- fs/notify/inotify/inotify_user.c | 2 +- fs/ntfs/sysctl.c | 4 +-- include/linux/key.h | 2 +- ipc/ipc_sysctl.c | 14 +- ipc/mq_sysctl.c | 12 - kernel/sysctl.c | 2 +- kernel/utsname_sysctl.c | 6 ++--- mm/page-writeback.c | 2 +- mm/page_alloc.c | 12 - security/keys/sysctl.c | 2 +- 28 files changed, 97 insertions(+), 97 deletions(-) -- 1.8.1.2.459.gbcd45b4.dirty -- 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 2/6] IIO: core: Introduce read_raw_multi
On 04/12/2014 09:52 AM, Jonathan Cameron wrote: On 09/04/14 01:56, Srinivas Pandruvada wrote: This callback is introduced to overcome some limitations of existing read_raw callback. The functionality of both existing read_raw and read_raw_multi is similar, both are used to request values from the device. The current read_raw callback allows only two return values. The new read_raw_multi allows returning multiple values. Instead of passing just address of val and val2, it passes length and pointer to values. Depending on the type and length of passed buffer, iio client drivers can return multiple values. Signed-off-by: Srinivas Pandruvada Hi Srinivas. This has come together pretty much how I thought it would. Very nice. Only comment inline is that I'd prefer we took care now with possiblity of really long sets of values so that we don't get bitten by it sometime in the future. I was thinking of using snprintf, but buf had no length passed. If we assume PAGE_SIZE as max length then I can do what you suggested below, Thanks, Srinivas If you want to drop the reference to 0 having special meaning in the comment as well, thats fine by me. Jonathan --- drivers/iio/iio_core.h | 2 +- drivers/iio/industrialio-core.c | 65 ++-- drivers/iio/industrialio-event.c | 6 ++-- drivers/iio/inkern.c | 16 -- include/linux/iio/iio.h | 17 +++ include/linux/iio/types.h| 1 + 6 files changed, 80 insertions(+), 27 deletions(-) diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h index f6db6af..30327ad 100644 --- a/drivers/iio/iio_core.h +++ b/drivers/iio/iio_core.h @@ -35,7 +35,7 @@ int __iio_add_chan_devattr(const char *postfix, struct list_head *attr_list); void iio_free_chan_devattr_list(struct list_head *attr_list); -ssize_t iio_format_value(char *buf, unsigned int type, int val, int val2); +ssize_t iio_format_value(char *buf, unsigned int type, int size, int *val); /* Event interface flags */ #define IIO_BUSY_BIT_POS 1 diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index ede16aec..3bd565c 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -373,41 +373,53 @@ EXPORT_SYMBOL_GPL(iio_enum_write); * @buf: The buffer to which the formated value gets written * @type: One of the IIO_VAL_... constants. This decides how the val and val2 *parameters are formatted. - * @val: First part of the value, exact meaning depends on the type parameter. - * @val2: Second part of the value, exact meaning depends on the type parameter. + * @vals: pointer to the values, exact meaning depends on the type parameter. */ -ssize_t iio_format_value(char *buf, unsigned int type, int val, int val2) +ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) { unsigned long long tmp; bool scale_db = false; switch (type) { case IIO_VAL_INT: -return sprintf(buf, "%d\n", val); +return sprintf(buf, "%d\n", vals[0]); case IIO_VAL_INT_PLUS_MICRO_DB: scale_db = true; case IIO_VAL_INT_PLUS_MICRO: -if (val2 < 0) -return sprintf(buf, "-%ld.%06u%s\n", abs(val), -val2, +if (vals[1] < 0) +return sprintf(buf, "-%ld.%06u%s\n", abs(vals[0]), +-vals[1], scale_db ? " dB" : ""); else -return sprintf(buf, "%d.%06u%s\n", val, val2, +return sprintf(buf, "%d.%06u%s\n", vals[0], vals[1], scale_db ? " dB" : ""); case IIO_VAL_INT_PLUS_NANO: -if (val2 < 0) -return sprintf(buf, "-%ld.%09u\n", abs(val), -val2); +if (vals[1] < 0) +return sprintf(buf, "-%ld.%09u\n", abs(vals[0]), +-vals[1]); else -return sprintf(buf, "%d.%09u\n", val, val2); +return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); case IIO_VAL_FRACTIONAL: -tmp = div_s64((s64)val * 10LL, val2); -val2 = do_div(tmp, 10LL); -val = tmp; -return sprintf(buf, "%d.%09u\n", val, val2); +tmp = div_s64((s64)vals[0] * 10LL, vals[1]); +vals[1] = do_div(tmp, 10LL); +vals[0] = tmp; +return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); case IIO_VAL_FRACTIONAL_LOG2: -tmp = (s64)val * 10LL >> val2; -val2 = do_div(tmp, 10LL); -val = tmp; -return sprintf(buf, "%d.%09u\n", val, val2); +tmp = (s64)vals[0] * 10LL >> vals[1]; +vals[1] = do_div(tmp, 10LL); +vals[0] = tmp; +return sprintf(buf, "%d.%09u\n", vals[0], vals[1]); +case IIO_VAL_INT_MULTIPLE: +{ +int i; +int len = 0; + +for (i = 0; i < size; ++i) +len += sprintf(&buf[len], "%d ", vals[i]); +
Re: [Patch v3 5/6] iio: hid-sensors: Added device rotation support
On 04/12/2014 10:21 AM, Jonathan Cameron wrote: On 09/04/14 01:56, Srinivas Pandruvada wrote: Added usage id processing for device rotation. This uses IIO interfaces for triggered buffer to present data to user mode.This uses HID sensor framework for registering callback events from the sensor hub. Data is exported to user space in the form of quaternion rotation format. Signed-off-by: Srinivas Pandruvada Very nice. Happy to take this the moment we have a go ahead on the devm_kmemdup and perhaps those minor tweaks I asked for in the multi value handling patch. Actually, may seem a random question, but what the heck are the scale units you can read for the quaternion? Firstly it's an integer, so would only make the value bigger, and secondly we are dealing with a quaternion, which is inherently scale free (when used for rotation anyway). I suppose these units might be meant to transform to a unit quaternion (though this can be easily established form the quaternion itself). Good point. For quaternion there is no scale exported in channel spec. I have in switch case, which was left over, I will remove it. The offset field mostly will be 0, but as you pointed out below they are unit exponent. Looking quickly at the other HID drivers, I am a little confused as to what is going on in general. Could you talk me through this stuff? I have a vague recollection we went through this before, but can't recall the result of those discussions. At first glance, it looks like scale is being used to indicate the base units (via magic numbers) and offset to contain exponents to be applied also as magic numbers. Neither of these is anywhere near our ABI which is going to cause issues for any 'standard' userspace library.. We had this discussion long time back. Initially introduced separate attributes for units ans scale but suggestion was to use offset and scale. Currently these drivers are used only by Android kernel, which has corresponding user space to interpret. But now since after Win8, they became available in many devices. I have received questions on this from user space developers now, so I have to either document them or make complaint to others. I am working on it. I have many units to convert to standard format. I will submit a change for this. Thanks, Srinivas Thanks. Jonathan --- drivers/iio/orientation/Kconfig | 12 + drivers/iio/orientation/Makefile | 1 + drivers/iio/orientation/hid-sensor-rotation.c | 359 ++ include/linux/hid-sensor-ids.h| 1 + 4 files changed, 373 insertions(+) create mode 100644 drivers/iio/orientation/hid-sensor-rotation.c diff --git a/drivers/iio/orientation/Kconfig b/drivers/iio/orientation/Kconfig index 58c62c8..e3aa1e5 100644 --- a/drivers/iio/orientation/Kconfig +++ b/drivers/iio/orientation/Kconfig @@ -16,4 +16,16 @@ config HID_SENSOR_INCLINOMETER_3D Say yes here to build support for the HID SENSOR Inclinometer 3D. +config HID_SENSOR_DEVICE_ROTATION +depends on HID_SENSOR_HUB +select IIO_BUFFER +select IIO_TRIGGERED_BUFFER +select HID_SENSOR_IIO_COMMON +select HID_SENSOR_IIO_TRIGGER +tristate "HID Device Rotation" +help + Say yes here to build support for the HID SENSOR + device rotation. The output of a device rotation sensor + is presented using quaternion format. + endmenu diff --git a/drivers/iio/orientation/Makefile b/drivers/iio/orientation/Makefile index 2c97572..4734dab 100644 --- a/drivers/iio/orientation/Makefile +++ b/drivers/iio/orientation/Makefile @@ -4,3 +4,4 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_HID_SENSOR_INCLINOMETER_3D) += hid-sensor-incl-3d.o +obj-$(CONFIG_HID_SENSOR_DEVICE_ROTATION) += hid-sensor-rotation.o diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c new file mode 100644 index 000..5c7d558 --- /dev/null +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -0,0 +1,359 @@ +/* + * HID Sensors Driver + * Copyright (c) 2014, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../common/hid-sensors/hid-sensor-trigger.h" + +struct dev_rot_state { +struct hid_sensor_hub_callbacks callbacks; +struct hid_sensor_common common_attributes; +struct hid_sensor_hub_attribute_info quaternion; +
[PATCHv2] pinctrl: exynos: Add driver data for Exynos3250
From: Tomasz Figa This patch adds driver data (bank list and EINT layout) for Exynos3250 to pinctrl-exynos driver. Exynos3250 includes 158 multi-functional input/output ports. There are 23 general port groups. Changes from v1: - Add signed-off of sender - Post only separated patch for pinctrl from following patchset(v1) : https://lkml.org/lkml/2014/4/10/286 Cc: Thomas Abraham Cc: Linus Walleij Cc: Kukjin Kim Signed-off-by: Tomasz Figa Signed-off-by: Chanwoo Choi Acked-by: Kyungmin Park --- drivers/pinctrl/pinctrl-exynos.c | 67 +++ drivers/pinctrl/pinctrl-samsung.c | 2 ++ drivers/pinctrl/pinctrl-samsung.h | 1 + 3 files changed, 70 insertions(+) diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index 07c8130..9609c23 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c @@ -718,6 +718,73 @@ struct samsung_pin_ctrl s5pv210_pin_ctrl[] = { }, }; +/* pin banks of exynos3250 pin-controller 0 */ +static struct samsung_pin_bank exynos3250_pin_banks0[] = { + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), + EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), + EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), + EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c), + EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10), + EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14), + EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18), +}; + +/* pin banks of exynos3250 pin-controller 1 */ +static struct samsung_pin_bank exynos3250_pin_banks1[] = { + EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"), + EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"), + EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"), + EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08), + EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c), + EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10), + EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpl0", 0x18), + EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24), + EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28), + EXYNOS_PIN_BANK_EINTG(5, 0x2a0, "gpm2", 0x2c), + EXYNOS_PIN_BANK_EINTG(8, 0x2c0, "gpm3", 0x30), + EXYNOS_PIN_BANK_EINTG(8, 0x2e0, "gpm4", 0x34), + EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00), + EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04), + EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08), + EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c), +}; + +/* + * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes + * two gpio/pin-mux/pinconfig controllers. + */ +struct samsung_pin_ctrl exynos3250_pin_ctrl[] = { + { + /* pin-controller instance 0 data */ + .pin_banks = exynos3250_pin_banks0, + .nr_banks = ARRAY_SIZE(exynos3250_pin_banks0), + .geint_con = EXYNOS_GPIO_ECON_OFFSET, + .geint_mask = EXYNOS_GPIO_EMASK_OFFSET, + .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, + .svc= EXYNOS_SVC_OFFSET, + .eint_gpio_init = exynos_eint_gpio_init, + .suspend= exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, + .label = "exynos3250-gpio-ctrl0", + }, { + /* pin-controller instance 1 data */ + .pin_banks = exynos3250_pin_banks1, + .nr_banks = ARRAY_SIZE(exynos3250_pin_banks1), + .geint_con = EXYNOS_GPIO_ECON_OFFSET, + .geint_mask = EXYNOS_GPIO_EMASK_OFFSET, + .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, + .weint_con = EXYNOS_WKUP_ECON_OFFSET, + .weint_mask = EXYNOS_WKUP_EMASK_OFFSET, + .weint_pend = EXYNOS_WKUP_EPEND_OFFSET, + .svc= EXYNOS_SVC_OFFSET, + .eint_gpio_init = exynos_eint_gpio_init, + .eint_wkup_init = exynos_eint_wkup_init, + .suspend= exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, + .label = "exynos3250-gpio-ctrl1", + }, +}; + /* pin banks of exynos4210 pin-controller 0 */ static struct samsung_pin_bank exynos4210_pin_banks0[] = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 0324d4c..3e61d0f 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -1114,6 +1114,8 @@ static struct syscore_ops samsung_pinctrl_syscore_ops = { static const struct of_device_id samsung_pinctrl_dt_match[] = { #ifdef CONFIG_PINCTRL_EXYNOS + { .compatible = "samsung,exynos3250-pinctrl", + .data = (void *)exynos3250_pin_ctrl }, { .compatible = "samsung,exynos4210-pinctrl", .data = (void *)exynos4210_pin_ctrl }, { .compatible = "samsung,exynos4x12-pinctr
Re: [PATCH 0/7] f2fs: some fix and cleanup about flush_merge
Hi Gu, I just started to review the patches and merge them individually though. Since I've been internally doing in my local tree, so that should be no problem. I'll roll back to the latest point. Anyway, thank you for your work. :) 2014-04-14 (월), 09:18 +0800, Gu Zheng: > Hi All, > There seems to be a mistake in "[PATCH 2/7]f2fs: remove the unuseful > "issue_tail" list", > and the whole patchset needs to be reworked. So please ignore this one. > Sorry for the noise. > > Regards, > Gu > On 04/11/2014 05:49 PM, Gu Zheng wrote: > > > Gu Zheng (7): > > f2fs: put the bio when issue_flush completed > > f2fs: remove the unuseful "issue_tail" list > > f2fs: use __GFP_ZERO to avoid appending set-NULL > > f2fs: enable flush_merge only in f2fs is not read-only > > f2fs: add the flush_merge handle in the remount flow > > f2fs: introduce struct flush_cmd_control to wrap the flush_merge > > fields > > f2fs: introduce help function {create,destroy}_flush_cmd_control > > > > fs/f2fs/f2fs.h| 17 ++--- > > fs/f2fs/segment.c | 102 > > +++- > > fs/f2fs/super.c | 32 ++-- > > 3 files changed, 107 insertions(+), 44 deletions(-) > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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/
[PATCH v2] ARM: perf: save/restore pmu registers in pm notifier
From: Sudeep KarkadaNagesha This adds core support for saving and restoring CPU PMU registers for suspend/resume support i.e. deeper C-states in cpuidle terms. This patch adds support only to ARMv7 PMU registers save/restore. It needs to be extended to xscale and ARMv6 if needed. [Neil] We found that DS-5 not work on our CA7 based SoCs. After debuging, found PMU registers were lost because of core power down. Then i found Sudeep had a patch to fix it about two years ago but not in the mainline, just port it. Signed-off-by: Sudeep KarkadaNagesha Signed-off-by: Neil Zhang --- arch/arm/include/asm/pmu.h | 11 + arch/arm/kernel/perf_event_cpu.c | 29 ++- arch/arm/kernel/perf_event_v7.c | 47 ++ 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index ae1919b..f37f048 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h @@ -62,6 +62,15 @@ struct pmu_hw_events { raw_spinlock_t pmu_lock; }; +struct cpupmu_regs { + u32 pmc; + u32 pmcntenset; + u32 pmuseren; + u32 pmintenset; + u32 pmxevttype[8]; + u32 pmxevtcnt[8]; +}; + struct arm_pmu { struct pmu pmu; cpumask_t active_irqs; @@ -83,6 +92,8 @@ struct arm_pmu { int (*request_irq)(struct arm_pmu *, irq_handler_t handler); void(*free_irq)(struct arm_pmu *); int (*map_event)(struct perf_event *event); + void(*save_regs)(struct arm_pmu *, struct cpupmu_regs *); + void(*restore_regs)(struct arm_pmu *, struct cpupmu_regs *); int num_events; atomic_tactive_events; struct mutexreserve_mutex; diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index 51798d7..7f1c756 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c @@ -19,6 +19,7 @@ #define pr_fmt(fmt) "CPU PMU: " fmt #include +#include #include #include #include @@ -39,6 +40,7 @@ static DEFINE_PER_CPU(struct arm_pmu *, percpu_pmu); static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events); static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask); static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events); +static DEFINE_PER_CPU(struct cpupmu_regs, cpu_pmu_regs); /* * Despite the names, these two functions are CPU-specific and are used @@ -217,6 +219,23 @@ static struct notifier_block cpu_pmu_hotplug_notifier = { .notifier_call = cpu_pmu_notify, }; +static int cpu_pmu_pm_notify(struct notifier_block *b, + unsigned long action, void *hcpu) +{ + struct cpupmu_regs *pmuregs = this_cpu_ptr(&cpu_pmu_regs); + + if (action == CPU_PM_ENTER && cpu_pmu->save_regs) + cpu_pmu->save_regs(cpu_pmu, pmuregs); + else if (action == CPU_PM_EXIT && cpu_pmu->restore_regs) + cpu_pmu->restore_regs(cpu_pmu, pmuregs); + + return NOTIFY_OK; +} + +static struct notifier_block cpu_pmu_pm_notifier = { + .notifier_call = cpu_pmu_pm_notify, +}; + /* * PMU platform driver and devicetree bindings. */ @@ -349,9 +368,17 @@ static int __init register_pmu_driver(void) if (err) return err; + err = cpu_pm_register_notifier(&cpu_pmu_pm_notifier); + if (err) { + unregister_cpu_notifier(&cpu_pmu_hotplug_notifier); + return err; + } + err = platform_driver_register(&cpu_pmu_driver); - if (err) + if (err) { + cpu_pm_unregister_notifier(&cpu_pmu_pm_notifier); unregister_cpu_notifier(&cpu_pmu_hotplug_notifier); + } return err; } diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index f4ef398..29ae8f1 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c @@ -1237,6 +1237,51 @@ static void armv7_pmnc_dump_regs(struct arm_pmu *cpu_pmu) } #endif +static void armv7pmu_save_regs(struct arm_pmu *cpu_pmu, + struct cpupmu_regs *regs) +{ + unsigned int cnt; + asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (regs->pmc)); + if (!(regs->pmc & ARMV7_PMNC_E)) + return; + + asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (regs->pmcntenset)); + asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r" (regs->pmuseren)); + asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (regs->pmintenset)); + asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (regs->pmxevtcnt[0])); + for (cnt = ARMV7_IDX_COUNTER0; + cnt <= ARMV7_IDX_COUNTER_LAST(cpu_pmu); cnt++) { + armv7_pmnc_select_counter(cnt); + asm volatile("mrc p15, 0, %0, c9, c13
Re: [PATCH v2] tuntap: add flow control to support back pressure
From: Steven Galgano Date: Sun, 13 Apr 2014 21:30:27 -0400 > Added optional per queue flow control support using IFF_FLOW_CONTROL. When > the IFF_FLOW_CONTROL TUNSETIFF flag is specified it will set a per queue flag > to indicate that the queue should be stopped using netif_tx_stop_queue(), > rather than discarding frames once full. After reading a frame from the > respective stopped queue, a netif_tx_wake_queue() is issued to signal > resource availability. > > The per queue TUN_FLOW_CONTROL flag is stored in struct tun_file. This > provides the flexibility to enable flow control on all, none or some queues > when using IFF_MULTI_QUEUE. When not using IFF_MULTI_QUEUE, IFF_FLOW_CONTROL > will apply to the single queue. No changes were made to the default drop > frame policy. > > This change adds support for back pressure use cases. > > Reported-by: Brian Adamson > Tested-by: Joseph Giovatto > Signed-off-by: Steven Galgano Please format your commit messages to ~80 columns of text. It won't be automatically formatted by GIT and in fact it looks ugly with all the wrapping in text based tools. -- 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/1] kernel/rcu/tree.c: remove duplicate extern definition
Signed-off-by: Pranith Kumar --- kernel/rcu/tree.c |6 -- 1 file changed, 6 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 0c47e30..67e850a 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -947,12 +947,6 @@ static void print_other_cpu_stall(struct rcu_state *rsp) force_quiescent_state(rsp); /* Kick them all. */ } -/* - * This function really isn't for public consumption, but RCU is special in - * that context switches can allow the state machine to make progress. - */ -extern void resched_cpu(int cpu); - static void print_cpu_stall(struct rcu_state *rsp) { int cpu; -- 1.7.9.5 -- Pranith -- 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] tuntap: add flow control to support back pressure
Added optional per queue flow control support using IFF_FLOW_CONTROL. When the IFF_FLOW_CONTROL TUNSETIFF flag is specified it will set a per queue flag to indicate that the queue should be stopped using netif_tx_stop_queue(), rather than discarding frames once full. After reading a frame from the respective stopped queue, a netif_tx_wake_queue() is issued to signal resource availability. The per queue TUN_FLOW_CONTROL flag is stored in struct tun_file. This provides the flexibility to enable flow control on all, none or some queues when using IFF_MULTI_QUEUE. When not using IFF_MULTI_QUEUE, IFF_FLOW_CONTROL will apply to the single queue. No changes were made to the default drop frame policy. This change adds support for back pressure use cases. Reported-by: Brian Adamson Tested-by: Joseph Giovatto Signed-off-by: Steven Galgano --- Previous version of patch did not respect individual queues when applying flow control using netif_tx_stop_all_queues()/netif_tx_wake_all_queues(). drivers/net/tun.c | 32 include/uapi/linux/if_tun.h | 2 ++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index ee328ba..3d09f5a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -137,7 +137,7 @@ struct tun_file { struct tun_struct __rcu *tun; struct net *net; struct fasync_struct *fasync; - /* only used for fasnyc */ + /* used for fasnyc and flow control */ unsigned int flags; union { u16 queue_index; @@ -783,8 +783,19 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) * number of queues. */ if (skb_queue_len(&tfile->socket.sk->sk_receive_queue) * numqueues - >= dev->tx_queue_len) - goto drop; + >= dev->tx_queue_len) { + if (tfile->flags & TUN_FLOW_CONTROL) { + /* Resources unavailable stop queue */ + netif_tx_stop_queue(netdev_get_tx_queue(dev, txq)); + + /* We won't see all dropped packets individually, so +* over run error is more appropriate. +*/ + dev->stats.tx_fifo_errors++; + } else { + goto drop; + } + } if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) goto drop; @@ -1333,6 +1344,7 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, DECLARE_WAITQUEUE(wait, current); struct sk_buff *skb; ssize_t ret = 0; + struct netdev_queue *ntxq; tun_debug(KERN_INFO, tun, "tun_do_read\n"); @@ -1362,6 +1374,12 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, continue; } + ntxq = netdev_get_tx_queue(tun->dev, tfile->queue_index); + + if (tfile->flags & TUN_FLOW_CONTROL && + netif_tx_queue_stopped(ntxq)) + netif_tx_wake_queue(ntxq); + ret = tun_put_user(tun, tfile, skb, iv, len); kfree_skb(skb); break; @@ -1732,6 +1750,11 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) else tun->flags &= ~TUN_TAP_MQ; + if (ifr->ifr_flags & IFF_FLOW_CONTROL) + tfile->flags |= TUN_FLOW_CONTROL; + else + tfile->flags &= ~TUN_FLOW_CONTROL; + /* Make sure persistent devices do not get stuck in * xoff state. */ @@ -1900,7 +1923,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, * This is needed because we never checked for invalid flags on * TUNSETIFF. */ return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE | - IFF_VNET_HDR | IFF_MULTI_QUEUE, + IFF_VNET_HDR | IFF_MULTI_QUEUE | + IFF_FLOW_CONTROL, (unsigned int __user*)argp); } else if (cmd == TUNSETQUEUE) return tun_set_queue(file, &ifr); diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index e9502dd..bcf2790 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h @@ -36,6 +36,7 @@ #define TUN_PERSIST0x0100 #define TUN_VNET_HDR 0x0200 #define TUN_TAP_MQ 0x0400 +#define TUN_FLOW_CONTROL 0x0800 /* Ioctl defines */ #define TUNSETNOCSUM _IOW('T', 200, int) @@ -70,6 +71,7 @@ #define IFF_MULTI_QUEUE 0x0100 #define IFF_ATTACH_QUEUE 0x0200 #define IFF_DETACH_QUEUE 0x0400 +#define IFF_FLOW_CONTROL 0x0010 /* read-only flag */ #define IFF_PERSIST0x0800 #define IFF_NOFILTER 0x1000 -- To unsubscribe from this list: send the lin
Re: [PATCH 1/7] f2fs: put the bio when issue_flush completed
Hi Gu, Merged. thank you. :) 2014-04-11 (금), 17:49 +0800, Gu Zheng: > Put the bio when the flush cmd issued, it also can fix the following > kmemleak: > unreferenced object 0x8800270c73c0 (size 200): > comm "f2fs_flush-7:0", pid 27161, jiffies 4312127988 (age 988.503s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 40 07 81 19 01 88 ff ff @... > 01 00 00 00 00 00 00 f0 11 14 00 00 00 00 00 00 > backtrace: > [] kmemleak_alloc+0x72/0x96 > [] slab_post_alloc_hook+0x28/0x2a > [] kmem_cache_alloc+0xec/0x157 > [] mempool_alloc_slab+0x15/0x17 > [] mempool_alloc+0x71/0x138 > [] bio_alloc_bioset+0x93/0x18c > [] issue_flush_thread+0x8d/0x145 [f2fs] > [] kthread+0xba/0xc2 > [] ret_from_fork+0x7c/0xb0 > [] 0x > > Signed-off-by: Gu Zheng > --- > fs/f2fs/segment.c |1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 085f548..524b7ed 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -226,6 +226,7 @@ repeat: > next = cmd->next; > complete(&cmd->wait); > } > + bio_put(bio); > sm_i->dispatch_list = NULL; > } > -- 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] ARM: perf: save/restore pmu registers in pm notifier
Stephen, > -Original Message- > From: Stephen Boyd [mailto:sb...@codeaurora.org] > Sent: 2014年4月12日 2:32 > To: Neil Zhang > Cc: will.dea...@arm.com; li...@arm.linux.org.uk; Sudeep KarkadaNagesha; > linux-kernel@vger.kernel.org; linux-arm-ker...@lists.infradead.org > Subject: Re: [PATCH] ARM: perf: save/restore pmu registers in pm notifier > > On 04/11/14 04:01, Neil Zhang wrote: > > @@ -217,6 +219,24 @@ static struct notifier_block > cpu_pmu_hotplug_notifier = { > > .notifier_call = cpu_pmu_notify, > > }; > > > > +static int cpu_pmu_pm_notify(struct notifier_block *b, > > + unsigned long action, void *hcpu) { > > + int cpu = smp_processor_id(); > > + struct cpupmu_regs *pmuregs = &per_cpu(cpu_pmu_regs, cpu); > > this_cpu_ptr(&cpu_pmu_regs)? Thanks for the suggestion, I will update it. > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation Best Regards, Neil Zhang
Re: [GIT PULL] KEYS: Make perm request flags available to security modules
On Tue, 1 Apr 2014, James Morris wrote: > On Mon, 31 Mar 2014, David Howells wrote: > > > James Morris wrote: > > > > > > Can you pull this pair of patches please? They move the flags that are > > > > used to request specific permissions to a more public header file so > > > > that > > > > they can then be used by Smack (and other security modules). > > > > > > These should be going via my tree. > > > > Okay, if you could pull them then. I thought Linus wanted keyrings stuff to > > go separately. > > I don't recall that. > > I'll pull them after the merge window. > Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next -- 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] tuntap: add flow control to support back pressure
On 04/13/2014 10:14 AM, Michael S. Tsirkin wrote: > > Steven, Brian, > > thanks for reporting this issue. > Please see my comments below. > > On Fri, Apr 11, 2014 at 12:41:42PM -0400, Brian Adamson wrote: >> To weigh in on the desire to have support (at least as an optional behavior) >> for the legacy flow control behavior, there are many existing uses of it. >> Many these are related to experimental purposes where the tuntap driver can >> be used (with a little user space code) as a surrogate for a network >> interface type that may not even yet exist. And in some cases these >> experimental purposes have had utility for actual deployment (e.g. disaster >> relief wireless networks where the TAP device has provided some >> intermediate assistance for routing or other protocols, even an underwater >> acoustic sensor network proposed for reef monitoring, etc where a TAP device >> provides a network interface and the sound card is used as a modem on an >> embedded system). Some of these networks have low data rates or packet loss >> and delays that make TCP (which provides flow control as part of its usual >> reliable transport for more typical networking purpose) not an ideal >> protocol to use and so UDP or other alterna tives or used. To keep this short, I'll list a few use cases here I know (and was involved with the implementation of some) with some links (where I know them): >> >> 1) CORE network emulation tool (http://code.google.com/p/coreemu/) >> >> 2) EMANE network emulation tool (https://github.com/adjacentlink/emane) >> >> (likely other network emulation tools exist that have used tuntap as >> surrogates for real physical interfaces and expect the same backpressure to >> sockets and queues that physical interfaces provide) >> >> 3) I don't have a link to it but I implemented an experimental IP interface/ >> MAC protocol called SLIDE (serial-link internet daemon) that implemented a >> user-space CSMA MAC protocol where an underwater acoustic modem was >> connected to the serial port and TAP was used to present a virtual network >> interface to the IP stack. Because of the low data rates involved, the back >> pressure flow control to application sockets (and protocol daemons and >> qdiscs applied) was important. >> >> 4) User space implementation of Simplified Multicast Forwarding (SMF) of >> RFC 6621 has a "device" option that establishes TAP interfaces to perform >> distributed "backpressure" based flow control (and potentially routing) for >> MANET wireless networks. (http://www.nrl.navy.mil/itd/ncs/products/smf) >> >> There are probably some more, among the more esoteric wireless and other >> special networking communities, where host (or routing/gateway/proxy >> non-host), e.g. special embedded system devices based on Linux such as >> sensors, etc) have a first hop network attachment that is _not_ the typical >> Ethernet or something and may be using tuntap along with a sort of >> user-space "driver" to present an IP interface to the network stack. some of >> this stuff, especially embedded systems, tend to lag behind with respect to >> kernel versions and this behavior change in Linux may be yet undiscovered so >> far even though the change was put in a couple years ago. >> >> Several of these are implemented across multiple platforms, and, for >> example, BSD-based systems tuntap provides the same flow control behavior. >> Even if it was never formally documented, I think this behavior was fairly >> well known (at least for these sorts of experimental purposes) and used. I >> understand the concern that a single bad behaving flow can possibly block >> the flow of others unless traffic control queuing disciplines (as done for >> other network interfaces). For the purposes of which I'm aware, I think >> having this behavior as _optional_ is probably OK … If accepted, and >> something is implemented here, it may be a good opportunity to have it >> documented (and the pros and cons of its use) for the more general Linux >> community. > > Yes, a UDP socket with sufficiently deep qdisc and tun queues > would previously get slowed down so it matches the speed of > the interface. > > But IIUC this was not really designed to be a flow control measure, > so depending on what else is in the qdisc you could easily get > into a setup where it behaves exactly as it does now. > For example, have several UDP sockets send data out a single > interface. > > Another problem is that this depends on userspace to be > well-behaved and consume packets in a timely manner: > a misbehaving userspace operating a tun device can cause other > tun devices and/or sockets to get blocked forever and prevent them > from communicating with all destinations (not just the misbehaving one) > as their wmem limit is exhausted. > > It should be possible to reproduce with an old kernel and your userspace > drivers, too - just stop the daemon temporarily. > I realize that
Re: [PATCH 0/7] f2fs: some fix and cleanup about flush_merge
Hi All, There seems to be a mistake in "[PATCH 2/7]f2fs: remove the unuseful "issue_tail" list", and the whole patchset needs to be reworked. So please ignore this one. Sorry for the noise. Regards, Gu On 04/11/2014 05:49 PM, Gu Zheng wrote: > Gu Zheng (7): > f2fs: put the bio when issue_flush completed > f2fs: remove the unuseful "issue_tail" list > f2fs: use __GFP_ZERO to avoid appending set-NULL > f2fs: enable flush_merge only in f2fs is not read-only > f2fs: add the flush_merge handle in the remount flow > f2fs: introduce struct flush_cmd_control to wrap the flush_merge > fields > f2fs: introduce help function {create,destroy}_flush_cmd_control > > fs/f2fs/f2fs.h| 17 ++--- > fs/f2fs/segment.c | 102 +++- > fs/f2fs/super.c | 32 ++-- > 3 files changed, 107 insertions(+), 44 deletions(-) > -- 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] pinctrl: pinctrl-imx: Print the mux_mode field in hex format
On Sun, Apr 13, 2014 at 12:09:05PM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > With debug enabled we get better readability dumps of the mux_mode register > if > we use hexadecimal format instead: > > imx6sl-pinctrl 20e.iomuxc: MX6SL_PAD_FEC_REF_CLK: 0x10 0x0001b0a8 > > Signed-off-by: Fabio Estevam Acked-by: Shawn Guo -- 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/7] f2fs: remove the unuseful "issue_tail" list
Hi All, There seems to be a mistake in this patch, please ignore it. I'll send a reworked one later. Regards, Gu On 04/11/2014 05:49 PM, Gu Zheng wrote: > With the issue_list and dispatch_list, we can handle flush_merge > already, so remove the useless "issue_tail" list. > > Signed-off-by: Gu Zheng > --- > fs/f2fs/f2fs.h|1 - > fs/f2fs/segment.c |5 ++--- > 2 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 2ecac83..90109fa 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -358,7 +358,6 @@ struct f2fs_sm_info { > struct flush_cmd *issue_list; /* list for command issue */ > struct flush_cmd *dispatch_list;/* list for command dispatch */ > spinlock_t issue_lock; /* for issue list lock */ > - struct flush_cmd *issue_tail; /* list tail of issue list */ > }; > > /* > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 524b7ed..8a6fe2a 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -209,7 +209,7 @@ repeat: > spin_lock(&sm_i->issue_lock); > if (sm_i->issue_list) { > sm_i->dispatch_list = sm_i->issue_list; > - sm_i->issue_list = sm_i->issue_tail = NULL; > + sm_i->issue_list = NULL; > } > spin_unlock(&sm_i->issue_lock); > > @@ -250,10 +250,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi) > > spin_lock(&sm_i->issue_lock); > if (sm_i->issue_list) > - sm_i->issue_tail->next = cmd; > + sm_i->issue_list->next = cmd; > else > sm_i->issue_list = cmd; > - sm_i->issue_tail = cmd; > spin_unlock(&sm_i->issue_lock); > > if (!sm_i->dispatch_list) -- 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/
test mail
I sent a patch earlier which does not appear here. Just wondering why! -- Pranith -- 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] workqueue: fix double unlock bug
mutex_unlock() and put_pwq_unlocked() do not need to be called when alloc_unbound_pwq() is failed. Signed-off-by: Daeseok Youn --- kernel/workqueue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 0ee63af..e6e9f6a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4100,7 +4100,7 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, if (!pwq) { pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n", wq->name); - goto out_unlock; + return; } /* -- 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: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
Hi Jonathan, On 04/12/2014 04:49 PM, Jonathan Cameron wrote: > > > On April 11, 2014 11:45:42 PM GMT+01:00, "최찬우" wrote: >> Hi Bartlomiej, >> >> On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz >> wrote: >>> >>> Hi, >>> >>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote: This patch control special clock for ADC in Exynos series's FSYS >> block. >>> >>> s/control/controls/ >> >> I'll fix it. >> >>> If special clock of ADC is registerd on clock list of common clk >> framework, Exynos ADC drvier have to control this clock. >>> >>> s/drvier/driver/ >> >> I'll fix it. >> >>> Exynos3250/Exynos4/Exynos5 has 'adc' clock as following: - 'adc' clock: bus clock for ADC Exynos3250 has additional 'sclk_tsadc' clock as following: - 'sclk_tsadc' clock: special clock for ADC which provide clock to >> internal ADC Exynos 4210/4212/4412 and Exynos5250/5420 has not included >> 'sclk_tsadc' clock in FSYS_BLK. But, Exynos3250 based on Cortex-A7 has only included >> 'sclk_tsadc' clock in FSYS_BLK. Cc: Jonathan Cameron Cc: Kukjin Kim Cc: Naveen Krishna Chatradhi Cc: linux-...@vger.kernel.org Signed-off-by: Chanwoo Choi Signed-off-by: Kyungmin Park --- drivers/iio/adc/exynos_adc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/iio/adc/exynos_adc.c >> b/drivers/iio/adc/exynos_adc.c index d25b262..4cd1975 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -88,6 +88,7 @@ struct exynos_adc { void __iomem*regs; void __iomem*enable_reg; struct clk *clk; + struct clk *sclk; unsigned intirq; struct regulator*vdd; @@ -308,6 +309,13 @@ static int exynos_adc_probe(struct >> platform_device *pdev) goto err_irq; } + info->sclk = devm_clk_get(&pdev->dev, "sclk_tsadc"); + if (IS_ERR(info->sclk)) { + dev_warn(&pdev->dev, "failed getting sclk clock, err = >> %ld\n", + >> PTR_ERR(info->sclk)); + info->sclk = NULL; + } + info->vdd = devm_regulator_get(&pdev->dev, "vdd"); if (IS_ERR(info->vdd)) { dev_err(&pdev->dev, "failed getting regulator, err = >> %ld\n", @@ -341,6 +349,7 @@ static int exynos_adc_probe(struct >> platform_device *pdev) goto err_iio_dev; clk_prepare_enable(info->clk); + clk_prepare_enable(info->sclk); exynos_adc_hw_init(info); @@ -357,6 +366,7 @@ err_of_populate: exynos_adc_remove_devices); regulator_disable(info->vdd); clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->sclk); >>> >>> Please disable clocks in the reverse of order in which they were >> enabled. >> >> Is it necessary? I don't think that. > It is probably not a bug but it is more obviously correct in the reverse > order so that is how it should be done! OK, I'll fix it on next posting(v2). Thanks. Best Regards, Chanwoo Choi -- 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] Docs: Fix elisp code so tabbing more than once works
On Sun, 2014-04-13 at 19:23 -0500, Greg Donald wrote: > The example elisp code breaks tabbing more than once on the same line. > Aligning > equal signs in a struct becomes problematic. Fix it. [] > diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle [] > +(global-set-key (kbd "TAB") 'self-insert-command) This prevents easy indentation alignment via the tab key. Try using "ctrl-q tab" instead. -- 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: Linux 3.15-rc1 out, merge window closed
Hi all, On Mon, 14 Apr 2014 09:18:18 +1000 Stephen Rothwell wrote: > > The merge window is closed, so this would be a good moment for everyone > to tidy up their linux-next included trees/branches (i.e. reset to > v3.15-rc1) before continuing on. For most, this will be a simple fast > forward ... And, of course, let me know about any trees that are no longer needed. -- Cheers, Stephen Rothwells...@canb.auug.org.au pgp5NBHV3TT5c.pgp Description: PGP signature
Re: X86: kexec issues with i915 in 3.14
On Sun, 2014-04-13 at 22:01 +0200, Stefani Seibold wrote: > Rebooting my kernel vanilla kernel 3.14 will fail with tons of kernel > log messages: > > [0.262754] IOMMU: Setting identity map for device :00:1a.0 > [0x7c45f000 - 0x7c46bfff] > [0.262780] IOMMU: Setting identity map for device :00:14.0 > [0x7c45f000 - 0x7c46bfff] > [0.262798] IOMMU: Prepare 0-16MiB unity mapping for LPC > [0.262807] IOMMU: Setting identity map for device :00:1f.0 [0x0 - > 0xff] > [0.262948] PCI-DMA: Intel(R) Virtualization Technology for Directed I/O > [0.262948] dmar: DRHD: handling fault status reg 3 > [0.262951] dmar: DMAR:[DMA Write] Request device [00:02.0] fault addr > e000 > DMAR:[fault reason 05] PTE Write access is not set I'm inferring from the subject line that you mean kexec, not "rebooting"? It looks like a peripheral device is being left active and doing DMA by the previous kernel, rather than being shut down. So as soon as the new kernel resets the IOMMU mappings, that peripheral device is causing faults. We really ought to rate-limit the faults and isolate the offending device before there are 21,000 of them. As discussed elsewhere recently, we could do with a way to tell the PCI layer that it offended us but I suppose we could at *least* stop the IOMMU from reporting faults for it. Is this new behaviour? I'm not sure why this should have changed... -- David WoodhouseOpen Source Technology Centre david.woodho...@intel.com Intel Corporation smime.p7s Description: S/MIME cryptographic signature
[PATCH v6] fs: FAT: Add support for DOS 1.x formatted volumes
Add structure for parsed BPB information, struct fat_bios_param_block, and move all of the deserialization and validation logic from fat_fill_super() into fat_read_bpb(). Add a 'dos1xfloppy' mount option to infer DOS 2.x BIOS Parameter Block defaults from block device geometry for ancient floppies and floppy images, as a fall-back from the default BPB parsing logic. When fat_read_bpb() finds an invalid FAT filesystem and dos1xfloppy is set, fall back to fat_read_static_bpb(). fat_read_static_bpb() validates that the entire BPB is zero, and that the floppy has a DOS-style 8086 code bootstrapping header. Then it fills in default BPB values from media size and a table.[0] Media size is assumed to be static for archaic FAT volumes. See also: [1]. Fixes kernel.org bug #42617. [0]: https://en.wikipedia.org/wiki/File_Allocation_Table#Exceptions [1]: http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html Signed-off-by: Conrad Meyer --- Changes since v5: * Leave the bulk of sbi-> filling logic to the aptly named fat_fill_super() * Create separate structure for deserialized BPB values * fat_read_bpb() deserializes BPB from raw fat_boot_sector and performs validations * fat_read_static_bpb() validates raw fat_boot_sector as dos1x and fills in BPB values from table Thanks, Conrad --- fs/fat/fat.h | 28 - fs/fat/inode.c | 316 +++-- 2 files changed, 267 insertions(+), 77 deletions(-) diff --git a/fs/fat/fat.h b/fs/fat/fat.h index 7270bdb..bcb0d67 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h @@ -52,7 +52,8 @@ struct fat_mount_options { usefree:1,/* Use free_clusters for FAT32 */ tz_set:1, /* Filesystem timestamps' offset set */ rodir:1, /* allow ATTR_RO for directory */ -discard:1;/* Issue discard requests on deletions */ +discard:1,/* Issue discard requests on deletions */ +dos1xfloppy:1;/* Assume default BPB for DOS 1.x floppies */ }; #define FAT_HASH_BITS 8 @@ -139,6 +140,31 @@ struct fat_slot_info { struct buffer_head *bh; }; +/* + * A deserialized copy of the on-disk structure laid out in struct + * fat_boot_sector. + */ +struct fat_bios_param_block { + u16 fat_sector_size; + u8 fat_sec_per_clus; + u16 fat_reserved; + u8 fat_fats; + u16 fat_dir_entries; + u16 fat_sectors; + u16 fat_fat_length; + u32 fat_total_sect; + + u8 fat16_state; + u32 fat16_vol_id; + + u32 fat32_length; + u32 fat32_root_cluster; + u16 fat32_info_sector; + u8 fat32_state; + u32 fat32_vol_id; + +}; + static inline struct msdos_sb_info *MSDOS_SB(struct super_block *sb) { return sb->s_fs_info; diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 992e8cb..7727136 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -35,9 +35,47 @@ #define CONFIG_FAT_DEFAULT_IOCHARSET "" #endif +#define KB_IN_SECTORS 2 + static int fat_default_codepage = CONFIG_FAT_DEFAULT_CODEPAGE; static char fat_default_iocharset[] = CONFIG_FAT_DEFAULT_IOCHARSET; +static struct fat_floppy_defaults { + unsigned nr_sectors; + unsigned sec_per_clus; + unsigned dir_entries; + unsigned media; + unsigned fat_length; +} floppy_defaults[] = { +{ + .nr_sectors = 160 * KB_IN_SECTORS, + .sec_per_clus = 1, + .dir_entries = 64, + .media = 0xFE, + .fat_length = 1, +}, +{ + .nr_sectors = 180 * KB_IN_SECTORS, + .sec_per_clus = 1, + .dir_entries = 64, + .media = 0xFC, + .fat_length = 2, +}, +{ + .nr_sectors = 320 * KB_IN_SECTORS, + .sec_per_clus = 2, + .dir_entries = 112, + .media = 0xFF, + .fat_length = 1, +}, +{ + .nr_sectors = 360 * KB_IN_SECTORS, + .sec_per_clus = 2, + .dir_entries = 112, + .media = 0xFD, + .fat_length = 2, +}, +}; static int fat_add_cluster(struct inode *inode) { @@ -945,7 +983,7 @@ enum { Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, Opt_obsolete, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont, Opt_err_panic, Opt_err_ro, Opt_discard, Opt_nfs, Opt_time_offset, - Opt_nfs_stale_rw, Opt_nfs_nostale_ro, Opt_err, + Opt_nfs_stale_rw, Opt_nfs_nostale_ro, Opt_err, Opt_dos1xfloppy, }; static const match_table_t fat_tokens = { @@ -978,6 +1016,7 @@ static const match_table_t fat_tokens = { {Opt_nfs_stale_rw, "nfs"}, {Opt_nfs_stale_rw, "nfs=stale_rw"}, {Opt_nfs_nostale_ro, "nfs=nostale_ro"}, + {Opt_dos1xfloppy, "dos1xfloppy"}, {Opt_obsolete, "conv=binary"}, {Opt_obsolete, "conv=text"}, {Opt_obsolete, "conv=auto"}, @@ -1180,6 +1219,9 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
[PATCH 2/2] sh-pfc: r8a7791: Add Audio pin support
From: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Kuninori Morimoto --- v1 -> v2 - To Linus Walleij, Cc Linux kernel drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 61 ++ 1 file changed, 61 insertions(+) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c index aef5d7f..19571c1 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c @@ -1680,6 +1680,53 @@ static const struct sh_pfc_pin pinmux_pins[] = { PINMUX_GPIO_GP_ALL(), }; +/* - Audio Clock */ +static const unsigned int audio_clk_a_pins[] = { + /* CLK */ + RCAR_GP_PIN(2, 28), +}; + +static const unsigned int audio_clk_a_mux[] = { + AUDIO_CLKA_MARK, +}; + +static const unsigned int audio_clk_b_pins[] = { + /* CLK */ + RCAR_GP_PIN(2, 29), +}; + +static const unsigned int audio_clk_b_mux[] = { + AUDIO_CLKB_MARK, +}; + +static const unsigned int audio_clk_b_b_pins[] = { + /* CLK */ + RCAR_GP_PIN(7, 20), +}; + +static const unsigned int audio_clk_b_b_mux[] = { + AUDIO_CLKB_B_MARK, +}; + +static const unsigned int audio_clk_c_pins[] = { + /* CLK */ + RCAR_GP_PIN(2, 30), +}; + +static const unsigned int audio_clk_c_mux[] = { + AUDIO_CLKC_MARK, +}; + +static const unsigned int audio_clkout_pins[] = { + /* CLK */ + RCAR_GP_PIN(2, 31), +}; + +static const unsigned int audio_clkout_mux[] = { + AUDIO_CLKOUT_MARK, +}; + + /* - DU - */ static const unsigned int du_rgb666_pins[] = { /* R[7:2], G[7:2], B[7:2] */ @@ -3804,6 +3851,11 @@ static const unsigned int vin2_clk_mux[] = { }; static const struct sh_pfc_pin_group pinmux_groups[] = { + SH_PFC_PIN_GROUP(audio_clk_a), + SH_PFC_PIN_GROUP(audio_clk_b), + SH_PFC_PIN_GROUP(audio_clk_b_b), + SH_PFC_PIN_GROUP(audio_clk_c), + SH_PFC_PIN_GROUP(audio_clkout), SH_PFC_PIN_GROUP(du_rgb666), SH_PFC_PIN_GROUP(du_rgb888), SH_PFC_PIN_GROUP(du_clk_out_0), @@ -4080,6 +4132,14 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { SH_PFC_PIN_GROUP(vin2_clk), }; +static const char * const audio_clk_groups[] = { + "audio_clk_a", + "audio_clk_b", + "audio_clk_b_b", + "audio_clk_c", + "audio_clkout", +}; + static const char * const du_groups[] = { "du_rgb666", "du_rgb888", @@ -4465,6 +4525,7 @@ static const char * const vin2_groups[] = { }; static const struct sh_pfc_function pinmux_functions[] = { + SH_PFC_FUNCTION(audio_clk), SH_PFC_FUNCTION(du), SH_PFC_FUNCTION(du0), SH_PFC_FUNCTION(du1), -- 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: [PATCH 0/2 v2]: sh-pfc: r8a7791: Add sound pin support
Hi Linus Walleij Cc Simon, Laurent, Geert, Magnus These are r8a7791 sound pin support patches I added To Linus Walleij, Cc linux kernel on V2 patches. Kuninori Morimoto (2): sh-pfc: r8a7791: Add SSI pin support sh-pfc: r8a7791: Add Audio pin support drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 375 ++ 1 file changed, 375 insertions(+) -- 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/2 v2] sh-pfc: r8a7791: Add SSI pin support
From: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Kuninori Morimoto --- v1 -> v2 - To Linus Walleij, Cc Linux kernel drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 314 ++ 1 file changed, 314 insertions(+) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c index 5186d70..aef5d7f 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c @@ -3246,6 +3246,260 @@ static const unsigned int sdhi2_wp_pins[] = { static const unsigned int sdhi2_wp_mux[] = { SD2_WP_MARK, }; + +/* - SSI */ +static const unsigned int ssi0_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 2), +}; + +static const unsigned int ssi0_data_mux[] = { + SSI_SDATA0_MARK, +}; + +static const unsigned int ssi0_data_b_pins[] = { + /* SDATA */ + RCAR_GP_PIN(3, 4), +}; + +static const unsigned int ssi0_data_b_mux[] = { + SSI_SDATA0_B_MARK, +}; + +static const unsigned int ssi0129_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 0), RCAR_GP_PIN(2, 1), +}; + +static const unsigned int ssi0129_ctrl_mux[] = { + SSI_SCK0129_MARK, SSI_WS0129_MARK, +}; + +static const unsigned int ssi0129_ctrl_b_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3), +}; + +static const unsigned int ssi0129_ctrl_b_mux[] = { + SSI_SCK0129_B_MARK, SSI_WS0129_B_MARK, +}; + +static const unsigned int ssi1_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 5), +}; + +static const unsigned int ssi1_data_mux[] = { + SSI_SDATA1_MARK, +}; + +static const unsigned int ssi1_data_b_pins[] = { + /* SDATA */ + RCAR_GP_PIN(3, 7), +}; + +static const unsigned int ssi1_data_b_mux[] = { + SSI_SDATA1_B_MARK, +}; + +static const unsigned int ssi1_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 4), +}; + +static const unsigned int ssi1_ctrl_mux[] = { + SSI_SCK1_MARK, SSI_WS1_MARK, +}; + +static const unsigned int ssi1_ctrl_b_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6), +}; + +static const unsigned int ssi1_ctrl_b_mux[] = { + SSI_SCK1_B_MARK, SSI_WS1_B_MARK, +}; + +static const unsigned int ssi2_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 8), +}; + +static const unsigned int ssi2_data_mux[] = { + SSI_SDATA2_MARK, +}; + +static const unsigned int ssi2_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7), +}; + +static const unsigned int ssi2_ctrl_mux[] = { + SSI_SCK2_MARK, SSI_WS2_MARK, +}; + +static const unsigned int ssi3_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 11), +}; + +static const unsigned int ssi3_data_mux[] = { + SSI_SDATA3_MARK, +}; + +static const unsigned int ssi34_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 10), +}; + +static const unsigned int ssi34_ctrl_mux[] = { + SSI_SCK34_MARK, SSI_WS34_MARK, +}; + +static const unsigned int ssi4_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 14), +}; + +static const unsigned int ssi4_data_mux[] = { + SSI_SDATA4_MARK, +}; + +static const unsigned int ssi4_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13), +}; + +static const unsigned int ssi4_ctrl_mux[] = { + SSI_SCK4_MARK, SSI_WS4_MARK, +}; + +static const unsigned int ssi5_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 17), +}; + +static const unsigned int ssi5_data_mux[] = { + SSI_SDATA5_MARK, +}; + +static const unsigned int ssi5_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16), +}; + +static const unsigned int ssi5_ctrl_mux[] = { + SSI_SCK5_MARK, SSI_WS5_MARK, +}; + +static const unsigned int ssi6_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 20), +}; + +static const unsigned int ssi6_data_mux[] = { + SSI_SDATA6_MARK, +}; + +static const unsigned int ssi6_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 18), RCAR_GP_PIN(2, 19), +}; + +static const unsigned int ssi6_ctrl_mux[] = { + SSI_SCK6_MARK, SSI_WS6_MARK, +}; + +static const unsigned int ssi7_data_pins[] = { + /* SDATA */ + RCAR_GP_PIN(2, 23), +}; + +static const unsigned int ssi7_data_mux[] = { + SSI_SDATA7_MARK, +}; + +static const unsigned int ssi7_data_b_pins[] = { + /* SDATA */ + RCAR_GP_PIN(3, 12), +}; + +static const unsigned int ssi7_data_b_mux[] = { + SSI_SDATA7_B_MARK, +}; + +static const unsigned int ssi78_ctrl_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(2, 21), RCAR_GP_PIN(2, 22), +}; + +static const unsigned int ssi78_ctrl_mux[] = { + SSI_SCK78_MARK, SSI_WS78_MARK, +}; + +static const unsigned int ssi78_ctrl_b_pins[] = { + /* SCK, WS */ + RCAR_GP_PIN(3, 10), RCAR
[PATCH] Docs: Fix elisp code so tabbing more than once works
The example elisp code breaks tabbing more than once on the same line. Aligning equal signs in a struct becomes problematic. Fix it. Signed-off-by: Greg Donald --- Documentation/CodingStyle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 7fe0546..287d22f 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle @@ -512,6 +512,8 @@ values. To do the latter, you can stick the following in your .emacs file: (setq indent-tabs-mode t) (c-set-style "linux-tabs-only") +(global-set-key (kbd "TAB") 'self-insert-command) + This will make emacs go better with the kernel coding style for C files below ~/src/linux-trees. -- 1.8.3.2 -- Greg Donald signature.asc Description: Digital signature
Re: [PATCH v3 0/7] Page I/O
On Sun, Apr 13, 2014 at 06:59:49PM -0400, Matthew Wilcox wrote: > Hi Andrew, > > Now that 3.15-rc1 is out, could you queue these patches for 3.16 please? > Patches 1-3 & 7 are, IMO, worthwhile cleanups / bug fixes, regardless > of the rest of the patch set. > > If this patch series gets in, I'll take care of including the NVMe > driver piece. It'll be a bit more tricky than the proof of concept that > I've been flashing around because we have to make sure that the device > responds better to page sized I/Os than accumulating larger I/Os. > > It's indisputably a win for brd and for other NVM technology devices > that are accessed synchronously rather than through DMA. FYI, It would be good for zram, too. I support this patchset. >-- 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 2/6] shm: add sealing API
Hi On Sat, Apr 12, 2014 at 12:07 AM, Andy Lutomirski wrote: > I bet this is missing from lots of places. For example, I can't find > any write_access stuff in the rdma code. > > I suspect that the VM_DENYWRITE code is just generally racy. So what does S_IMMUTABLE do to prevent such races? I somehow suspect it's broken in that regard, too. I really dislike pinning pages like this, but if people want to keep it I guess I have to scan all shmem-inode pages before changing seals. Thanks 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: [PATCH v5] fs: FAT: Add support for DOS 1.x formatted volumes
On Mon, 14 Apr 2014 07:14:51 +0900 OGAWA Hirofumi wrote: > Conrad Meyer writes: > > > + sbi->sec_per_clus = fdefaults->sec_per_clus; > > + sbi->cluster_size = sb->s_blocksize * > > sbi->sec_per_clus; > > + sbi->cluster_bits = ffs(sbi->cluster_size) - 1; > > + sbi->fats = 2; > > + sbi->fat_start = 1; > > + sbi->fat_length = fdefaults->fat_length; > > + > > + sbi->dir_per_block = sb->s_blocksize / > > sizeof(struct msdos_dir_entry); > > + sbi->dir_per_block_bits = > > ffs(sbi->dir_per_block) - 1; > > + sbi->dir_start = sbi->fat_start + sbi->fats * > > sbi->fat_length; > > + sbi->dir_entries = fdefaults->dir_entries; > > + > > + rootdir_sectors = sbi->dir_entries > > + * sizeof(struct msdos_dir_entry) / > > sb->s_blocksize; > > + sbi->data_start = sbi->dir_start + > > rootdir_sectors; > > + total_sectors = fdefaults->nr_sectors; > > + total_clusters = (total_sectors - > > sbi->data_start) / sbi->sec_per_clus; > > + sbi->fat_bits = (total_clusters > MAX_FAT12) ? > > 16 : 12; + > > + /* some OSes set FAT_STATE_DIRTY and clean it on > > unmount. */ > > + sbi->dirty = b->fat16.state & FAT_STATE_DIRTY; > > + > > + /* check that FAT table does not overflow */ > > + fat_clusters = calc_fat_clusters(sb); > > + total_clusters = min(total_clusters, > > fat_clusters - FAT_START_ENT); > > Ah, you meant this duplicated one. > > Let's use structure like fat_boot_sector (but more cpu > friendly) on stack or something, instead of modify bh > (BPB). Modifying bh in bdev is visible via /dev/foo, this > is why I want to avoid to modify. > > With this, we can share almost all codes on both of > read_bpb() and static_bpb(), and avoids to modify bdev > buffer? And those 2 helpers only has small chunk of code, > and provide the required parameters? > > Thanks. Hi, I think I understand the idea, sounds good to me. Working to clean up now. Thanks again, Conrad -- 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/
Crypto Fixes for 3.15
Hi Linus: This push fixes a potential boot crash on bcm2835 due to the recent change that now causes hardware RNGs to be accessed on registration. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git or master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git Matt Porter (1): hwrng: bcm2835 - fix oops when rng h/w is accessed during registration drivers/char/hw_random/bcm2835-rng.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- 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 5/5] hugetlb: add support for gigantic page allocation at runtime
(2014/04/11 2:58), Luiz Capitulino wrote: > HugeTLB is limited to allocating hugepages whose size are less than > MAX_ORDER order. This is so because HugeTLB allocates hugepages via > the buddy allocator. Gigantic pages (that is, pages whose size is > greater than MAX_ORDER order) have to be allocated at boottime. > > However, boottime allocation has at least two serious problems. First, > it doesn't support NUMA and second, gigantic pages allocated at > boottime can't be freed. > > This commit solves both issues by adding support for allocating gigantic > pages during runtime. It works just like regular sized hugepages, > meaning that the interface in sysfs is the same, it supports NUMA, > and gigantic pages can be freed. > > For example, on x86_64 gigantic pages are 1GB big. To allocate two 1G > gigantic pages on node 1, one can do: > > # echo 2 > \ > /sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages > > And to free them all: > > # echo 0 > \ > /sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages > > The one problem with gigantic page allocation at runtime is that it > can't be serviced by the buddy allocator. To overcome that problem, this > commit scans all zones from a node looking for a large enough contiguous > region. When one is found, it's allocated by using CMA, that is, we call > alloc_contig_range() to do the actual allocation. For example, on x86_64 > we scan all zones looking for a 1GB contiguous region. When one is found, > it's allocated by alloc_contig_range(). > > One expected issue with that approach is that such gigantic contiguous > regions tend to vanish as runtime goes by. The best way to avoid this for > now is to make gigantic page allocations very early during system boot, say > from a init script. Other possible optimization include using compaction, > which is supported by CMA but is not explicitly used by this commit. > > It's also important to note the following: > > 1. Gigantic pages allocated at boottime by the hugepages= command-line > option can be freed at runtime just fine > > 2. This commit adds support for gigantic pages only to x86_64. The > reason is that I don't have access to nor experience with other archs. > The code is arch indepedent though, so it should be simple to add > support to different archs > > 3. I didn't add support for hugepage overcommit, that is allocating > a gigantic page on demand when > /proc/sys/vm/nr_overcommit_hugepages > 0. The reason is that I don't > think it's reasonable to do the hard and long work required for > allocating a gigantic page at fault time. But it should be simple > to add this if wanted > > Signed-off-by: Luiz Capitulino > --- Reviewed-by: Yasuaki Ishimatsu Thanks, Yasuaki Ishimatsu > mm/hugetlb.c | 167 > +++ > 1 file changed, 156 insertions(+), 11 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 6f1ca74..161dc39 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -680,11 +680,150 @@ static int hstate_next_node_to_free(struct hstate *h, > nodemask_t *nodes_allowed) > ((node = hstate_next_node_to_free(hs, mask)) || 1); \ > nr_nodes--) > > +#if defined(CONFIG_CMA) && defined(CONFIG_X86_64) > +static void destroy_compound_gigantic_page(struct page *page, > + unsigned long order) > +{ > + int i; > + int nr_pages = 1 << order; > + struct page *p = page + 1; > + > + for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { > + __ClearPageTail(p); > + set_page_refcounted(p); > + p->first_page = NULL; > + } > + > + set_compound_order(page, 0); > + __ClearPageHead(page); > +} > + > +static void free_gigantic_page(struct page *page, unsigned order) > +{ > + free_contig_range(page_to_pfn(page), 1 << order); > +} > + > +static int __alloc_gigantic_page(unsigned long start_pfn, > + unsigned long nr_pages) > +{ > + unsigned long end_pfn = start_pfn + nr_pages; > + return alloc_contig_range(start_pfn, end_pfn, MIGRATE_MOVABLE); > +} > + > +static bool pfn_range_valid_gigantic(unsigned long start_pfn, > + unsigned long nr_pages) > +{ > + unsigned long i, end_pfn = start_pfn + nr_pages; > + struct page *page; > + > + for (i = start_pfn; i < end_pfn; i++) { > + if (!pfn_valid(i)) > + return false; > + > + page = pfn_to_page(i); > + > + if (PageReserved(page)) > + return false; > + > + if (page_count(page) > 0) > + return false; > + > + if (PageHuge(page)) > + return false; > + } > + > + return true; > +} > + > +static bool zone_spans_last_pfn(const struct zone *zone, > +
Re: Linux 3.15-rc1 out, merge window closed
The merge window is closed, so this would be a good moment for everyone to tidy up their linux-next included trees/branches (i.e. reset to v3.15-rc1) before continuing on. For most, this will be a simple fast forward ... -- Cheers, Stephen Rothwells...@canb.auug.org.au pgp_TWsVuWNUU.pgp Description: PGP signature
Re: [PATCH] ipc,shm: increase default size for shmmax
On Sun, 2014-04-13 at 20:05 +0200, Manfred Spraul wrote: > Hi Andrew, > > On 04/02/2014 12:08 AM, Andrew Morton wrote: > > Well, I'm assuming 64GB==infinity. It *was* infinity in the RHEL5 > > timeframe, but infinity has since become larger so pickanumber. > > I think infinity is the right solution: > The only common case where infinity is wrong would be Android - and > Android disables sysv shm entirely. > > There are two patches: > http://marc.info/?l=linux-kernel&m=139730332306185&q=raw If you apply this one, please include the below, which updates a missing definition for SHMALL. diff --git a/include/uapi/linux/shm.h b/include/uapi/linux/shm.h index d9497b7..0774ec4 100644 --- a/include/uapi/linux/shm.h +++ b/include/uapi/linux/shm.h @@ -9,14 +9,14 @@ /* * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can - * be increased by sysctl + * be decreased by sysctl. */ #define SHMMAX ULONG_MAX/* max shared seg size (bytes) */ #define SHMMIN 1/* min shared seg size (bytes) */ #define SHMMNI 4096 /* max num of segs system wide */ #ifndef __KERNEL__ -#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) +#define SHMALL ULONG_MAX #endif #define SHMSEG SHMMNI /* max shared segs per process */ > http://marc.info/?l=linux-kernel&m=139727299800644&q=raw > > Could you apply one of them? > I wrote the first one, thus I'm biased which one is better. > > -- > Manfred -- 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/
Linux 3.15-rc1 out, merge window closed
It's been two weeks since 3.14 was released, and -rc1 of 3.15 is now tagged and pushed out, and the patches and tar-balls are going through the compressors on kernel.org as I write this. Which means that the merge window is closed, and people should send me fixes only. And quite frankly, it's about time. This release doesn't really have a lot of odd things going on, but it's *big*. Sure, we've had releases with more files and lines changed (3.7-rc1 and 3.11-rc1 in particular), but those tended to have something particular going on (3.7-rc1 saw the largely automated UAPI header file disintegration, and 3.11 saw the bug staging lustre merge). In comparison to those large releases, 3.15-rc1 is just big in general. No single big thing, but just lots and lots of commits. Sure, it has a few big new staging drivers (rtl8723au in particular), but even when big, those aren't nearly the bulk of things. There's just a lot going on In fact, we have the biggest number of commits in recent history (maybe ever), at just over 12000 non-merge commits (and about 800 merges). And it really is all over the map. The bulk is driver changes, at about three quarters of the actual patch. Staging shows up pretty prominently, but it's really all over the driver map, with networking, sound, media, gpu, block drivers..) But there's tons of non-driver stuff too. Outside of the driver subdirectories, architecture updates account for about half the changes (with ARM leading the way, largely due to device-tree descriptors, but there's mips, x86, powerpc, s390, blackfin..). And the rest is pretty varied too, with core networking, documentation, kernel, mm, tools etc. So while drivers and architecture updates are the bulk of it, we really do have a lot of core changes too. Anyway, even more than usual, the -rc1 is much too big to include a shortlog of all commits. But the shortlog of merges I've done might give at least some overview of all the changes. As usual, the people credited in the mergelog are the maintainers I pull from, not the developers that wrote the code. You can see that in the full git logs. Anyway, because -rc1 is already pretty darn big, I do *not* want to hear about "sorry this missed the window, can I still sneak in". Fixes only. The only exception to that is a couple of pending things that came in during the merge window, but were explicitly delayed. So we do have a fbdev file movement pending (I'll do the file movement after -rc1 just to make things easier to see in the history and not mix up movement with development). And there was one namespaces/mounting pull request that I didn't pull, but that might still make it in after some more commentary/work. That will *probably* be delayed 3.16, but we'll see how much TLC that thing needs.. Linus --- Al Viro (1): vfs updates Alex Williamson (1): VFIO updates Andrew Morton (3): first patch-bomb second patch-bomb a few more patches Arnd Bergmann (8): ARM SoC non-critical bug fixes ARM SoC cleanups ARM SoC specific changes ARM SoC board changes ARM SoC device tree changes ARM SoC driver changes ARM SoC sh driver change ARM SoC late cleanups Artem Bityutskiy (1): ubifs updates Behan Webster (1): llvm patches Ben Herrenschmidt (3): main powerpc updates powerpc non-virtualized cpuidle more powerpc updates Ben LaHaise (1): aio ctx->ring_pages migration serialization fix Bjorn Helgaas (1): PCI changes Boaz Harrosh (1): exofs updates Borislav Petkov (1): EDAC updates Brian Norris (1): MTD updates Bruce Fields (1): nfsd updates Bryan Wu (1): LED updates Catalin Marinas (2): ARM64 updates second set of arm64 updates Chris Ball (1): MMC updates Chris Mason (2): btrfs changes second set of btrfs updates Chris Metcalf (1): arch/tile updates Dan Williams (1): async SCSI resume support Dave Airlie (1): drm updates Dave Chinner (1): xfs update David Miller (3): networking updates more networking updates yet more networking updates David Teigland (1): dlm updates David Vrabel (2): Xen features and fixes Xen build fix Dmitry Torokhov (1): input updates Eric Paris (1): audit updates Eric Van Hensbergen (1): 9p changes Geert Uytterhoeven (1): m68k updates Grant Likely (1): devicetree changes Greg KH (6): char/misc driver patches driver core and sysfs updates staging driver updates tty/serial driver update USB patches more staging patches Greg Ungerer (1): m68k fixes Guenter Roeck (2): hwmon updates second round of hwmon updates Hans-Christian Egtvedt (1): AVR32 updates Heiko Carstens (1): s390 compat wrapper rework Herbert Xu (1): crypto updates Ingo Molnar (21): core locking updates RCU updates hweight type fix perf changes scheduler changes x86 acpi numa fix x86 apic changes x86 build change x86 cleanups x86 cpu handling changes x86 debug cleanup x86 EFI changes x86 hashing changes x86 hype
[PATCH v3 6/7] brd: Add support for rw_page
Signed-off-by: Matthew Wilcox --- drivers/block/brd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index e73b85c..807d3d5 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -360,6 +360,15 @@ out: bio_endio(bio, err); } +static int brd_rw_page(struct block_device *bdev, sector_t sector, + struct page *page, int rw) +{ + struct brd_device *brd = bdev->bd_disk->private_data; + int err = brd_do_bvec(brd, page, PAGE_CACHE_SIZE, 0, rw, sector); + page_endio(page, rw & WRITE, err); + return err; +} + #ifdef CONFIG_BLK_DEV_XIP static int brd_direct_access(struct block_device *bdev, sector_t sector, void **kaddr, unsigned long *pfn) @@ -419,6 +428,7 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode, static const struct block_device_operations brd_fops = { .owner =THIS_MODULE, + .rw_page = brd_rw_page, .ioctl =brd_ioctl, #ifdef CONFIG_BLK_DEV_XIP .direct_access =brd_direct_access, -- 1.9.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/
[PATCH v3 3/7] Factor page_endio() out of mpage_end_io()
page_endio() takes care of updating all the appropriate page flags once I/O has finished to a page. Switch to using mapping_set_error() instead of setting AS_EIO directly; this will handle thin-provisioned devices correctly. Signed-off-by: Matthew Wilcox --- fs/mpage.c | 18 +- include/linux/pagemap.h | 2 ++ mm/filemap.c| 25 + 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 4cc9c5d..10da0da 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -48,23 +48,7 @@ static void mpage_end_io(struct bio *bio, int err) bio_for_each_segment_all(bv, bio, i) { struct page *page = bv->bv_page; - - if (bio_data_dir(bio) == READ) { - if (!err) { - SetPageUptodate(page); - } else { - ClearPageUptodate(page); - SetPageError(page); - } - unlock_page(page); - } else { /* bio_data_dir(bio) == WRITE */ - if (err) { - SetPageError(page); - if (page->mapping) - set_bit(AS_EIO, &page->mapping->flags); - } - end_page_writeback(page); - } + page_endio(page, bio_data_dir(bio), err); } bio_put(bio); diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 45598f1..718214c 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -425,6 +425,8 @@ static inline void wait_on_page_writeback(struct page *page) extern void end_page_writeback(struct page *page); void wait_for_stable_page(struct page *page); +void page_endio(struct page *page, int rw, int err); + /* * Add an arbitrary waiter to a page's wait queue */ diff --git a/mm/filemap.c b/mm/filemap.c index a82fbe4..ee6a3ce 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -762,6 +762,31 @@ void end_page_writeback(struct page *page) } EXPORT_SYMBOL(end_page_writeback); +/* + * After completing I/O on a page, call this routine to update the page + * flags appropriately + */ +void page_endio(struct page *page, int rw, int err) +{ + if (rw == READ) { + if (!err) { + SetPageUptodate(page); + } else { + ClearPageUptodate(page); + SetPageError(page); + } + unlock_page(page); + } else { /* rw == WRITE */ + if (err) { + SetPageError(page); + if (page->mapping) + mapping_set_error(page->mapping, err); + } + end_page_writeback(page); + } +} +EXPORT_SYMBOL_GPL(page_endio); + /** * __lock_page - get a lock on the page, assuming we need to sleep to get it * @page: the page to lock -- 1.9.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/