24 Oct, 2013
9 commits
-
Several architectures open code effectively the same code block for
finding and mapping PCI irqs. This patch consolidates it down to a
single function.Signed-off-by: Grant Likely
Acked-by: Michal Simek
Cc: Russell King
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt -
Replace some instances of of_irq_map_one()/irq_create_of_mapping() and
of_irq_to_resource() by the simpler equivalent irq_of_parse_and_map().Signed-off-by: Thierry Reding
Acked-by: Rob Herring
[grant.likely: resolved conflicts with core code renames]
Signed-off-by: Grant Likely -
The of_irq_to_resource() helper that is used to implement of_irq_count()
tries to resolve interrupts and in fact creates a mapping for resolved
interrupts. That's pretty heavy lifting for something that claims to
just return the number of interrupts requested by a given device node.Instead, use the more lightweight of_irq_map_one(), which, despite the
name, doesn't create an actual mapping. Perhaps a better name would be
of_irq_translate_one().Signed-off-by: Thierry Reding
Acked-by: Rob Herring
[grant.likely: fixup s/of_irq_map_one/of_irq_parse_one/]
Signed-off-by: Grant Likely -
This patch extends the DT selftest code with some test cases for the
interrupt parsing functions.Signed-off-by: Grant Likely
-
It is sometimes useful for debug to get the contents of an
of_phandle_args structure out into the kernel log.Signed-off-by: Grant Likely
-
All the users of of_irq_parse_raw pass in a raw interrupt specifier from
the device tree and expect it to be returned (possibly modified) in an
of_phandle_args structure. However, the primary function of
of_irq_parse_raw() is to check for translations due to the presence of
one or more interrupt-map properties. The actual placing of the data
into an of_phandle_args structure is trivial. If it is refactored to
accept an of_phandle_args structure directly, then it becomes possible
to consume of_phandle_args from other sources. This is important for an
upcoming patch that allows a device to be connected to more than one
interrupt parent. It also simplifies the code a bit.The biggest complication with this patch is that the old version works
on the interrupt specifiers in __be32 form, but the of_phandle_args
structure is intended to carry it in the cpu-native version. A bit of
churn was required to make this work. In the end it results in tighter
code, so the churn is worth it.Signed-off-by: Grant Likely
Acked-by: Tony Lindgren
Cc: Benjamin Herrenschmidt -
All the callers of irq_create_of_mapping() pass the contents of a struct
of_phandle_args structure to the function. Since all the callers already
have an of_phandle_args pointer, why not pass it directly to
irq_create_of_mapping()?Signed-off-by: Grant Likely
Acked-by: Michal Simek
Acked-by: Tony Lindgren
Cc: Thomas Gleixner
Cc: Russell King
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt -
struct of_irq and struct of_phandle_args are exactly the same structure.
This patch makes the kernel use of_phandle_args everywhere. This in
itself isn't a big deal, but it makes some follow-on patches simpler.Signed-off-by: Grant Likely
Acked-by: Michal Simek
Acked-by: Tony Lindgren
Cc: Russell King
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt -
The OF irq handling code has been overloading the term 'map' to refer to
both parsing the data in the device tree and mapping it to the internal
linux irq system. This is probably because the device tree does have the
concept of an 'interrupt-map' function for translating interrupt
references from one node to another, but 'map' is still confusing when
the primary purpose of some of the functions are to parse the DT data.This patch renames all the of_irq_map_* functions to of_irq_parse_*
which makes it clear that there is a difference between the parsing
phase and the mapping phase. Kernel code can make use of just the
parsing or just the mapping support as needed by the subsystem.The patch was generated mechanically with a handful of sed commands.
Signed-off-by: Grant Likely
Acked-by: Michal Simek
Acked-by: Tony Lindgren
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt
16 Oct, 2013
4 commits
-
Some drivers might rely on availability of trigger flags in IRQ
resource, for example to configure the hardware for particular interrupt
type. However current code creating IRQ resources from data in device
tree does not configure trigger flags in resulting resources.This patch tries to solve the problem, based on the fact that
irq_of_parse_and_map() configures the trigger based on DT interrupt
specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
and we can get correct trigger flags by calling irqd_get_trigger_type()
after mapping the interrupt.Signed-off-by: Tomasz Figa
[grant.likely: Merged the two assignments to r->flags]
Signed-off-by: Grant Likely -
Several locations in the of_address and of_irq code dereference the
full_name parameter from a device_node pointer without checking if the
pointer is valid. This patch switches to use of_node_full_name() which
always checks the pointer.Signed-off-by: Grant Likely
-
The size of each hwid in a cpu nodes 'reg' property is defined by the
parents #address-cells property in the normal way. The cpu parsing code
has a bug where it will overrun the end of the property if
address-cells is greater than one. This commit fixes the problem by
adjusting the array size by the number of address cells. It also makes
sure address-cells isn't zero for that would cause an infinite loop.v2: bail if #address-cells is zero instead of forcing to
OF_ROOT_NODE_ADDR_CELLS_DEFAULT. Forcing it will cause the reg
property to be parsed incorrectly.Signed-off-by: Grant Likely
Cc: Rob Herring
Cc: Benjamin Herrenschmidt -
Use for_each_node_by_type() to iterate all cpu nodes in the
system.Provide and overridable function arch_find_n_match_cpu_physical_id,
which sees if the given device node matches 'cpu' and if so sets
'*thread' when non-NULL to the cpu thread number within the core.The default implementation behaves the same as the existing code.
Add a sparc64 implementation.
Signed-off-by: David S. Miller
Tested-by: Sudeep KarkadaNagesha
Signed-off-by: Grant Likely
14 Oct, 2013
11 commits
-
Not all DT platforms have all the cpus collected under a /cpus node.
That just happens to be a details of FDT, ePAPR and PowerPC platforms.
Sparc does something different, but unfortunately the current code
complains with a warning if /cpus isn't there. This became a problem
with commit f86e4718, "driver/core cpu: initialize of_node in cpu's
device structure", which caused the function to get called for all
architectures.This commit is a temporary fix to fail silently if the cpus node isn't
present. A proper fix will come later to allow arch code to provide a
custom mechanism for decoding the CPU hwid if the 'reg' property isn't
appropriate.Signed-off-by: Grant Likely
Cc: David Miller
Cc: Sudeep KarkadaNagesha
Cc: Rob Herring -
Pull watchdog fixes from Wim Van Sebroeck:
"This will fix a deadlock on the ts72xx_wdt driver, fix bitmasks in the
kempld_wdt driver and fix a section mismatch in the sunxi_wdt driver"* git://www.linux-watchdog.org/linux-watchdog:
watchdog: sunxi: Fix section mismatch
watchdog: kempld_wdt: Fix bit mask definition
watchdog: ts72xx_wdt: locking bug in ioctl -
This driver has a section mismatch, for probe and remove functions,
leading to the following warning during the compilation.WARNING: drivers/watchdog/built-in.o(.data+0x24): Section mismatch in
reference from the variable sunxi_wdt_driver to the function
.init.text:sunxi_wdt_probe()
The variable sunxi_wdt_driver references
the function __init sunxi_wdt_probe()Signed-off-by: Maxime Ripard
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck -
STAGE_CFG bits are defined as [5:4] bits. However, '(((x) & 0x30) << 4)'
handles [9:8] bits. Thus, it should be fixed in order to handle
[5:4] bits.Signed-off-by: Jingoo Han
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck -
Calling the WDIOC_GETSTATUS & WDIOC_GETBOOTSTATUS and twice will cause a
interruptible deadlock.Signed-off-by: Dan Carpenter
Reviewed-by: Guenter Roeck
Signed-off-by: Wim Van Sebroeck -
Pull ARM SoC fixes from Olof Johansson:
"A small batch of fixes this week, mostly OMAP related. Nothing stands
out as particularly controversial.Also a fix for a 3.12-rc1 timer regression for Exynos platforms,
including the Chromebooks"* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: exynos: dts: Update 5250 arch timer node with clock frequency
ARM: OMAP2: RX-51: Add missing max_current to rx51_lp5523_led_config
ARM: mach-omap2: board-generic: fix undefined symbol
ARM: dts: Fix pinctrl mask for omap3
ARM: OMAP3: Fix hardware detection for omap3630 when booted with device tree
ARM: OMAP2: gpmc-onenand: fix sync mode setup with DT -
Without the "clock-frequency" property in arch timer node, could able
to see the below crash dump.[] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14)
[] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0)
[] (dump_stack+0x7c/0xb0) from [] (Ldiv0_64+0x8/0x18)
[] (Ldiv0_64+0x8/0x18) from [] (clockevents_config.part.2+0x1c/0x74)
[] (clockevents_config.part.2+0x1c/0x74) from [] (clockevents_config_and_register+0x20/0x2c)
[] (clockevents_config_and_register+0x20/0x2c) from [] (arch_timer_setup+0xa8/0x134)
[] (arch_timer_setup+0xa8/0x134) from [] (arch_timer_init+0x1f4/0x24c)
[] (arch_timer_init+0x1f4/0x24c) from [] (clocksource_of_init+0x34/0x58)
[] (clocksource_of_init+0x34/0x58) from [] (time_init+0x20/0x2c)
[] (time_init+0x20/0x2c) from [] (start_kernel+0x1e0/0x39c)THis is because the Exynos u-boot, for example on the Chromebooks, doesn't set
up the CNTFRQ register as expected by arch_timer. Instead, we have to specify
the frequency in the device tree like this.Signed-off-by: Yuvaraj Kumar C D
[olof: Changed subject, added comment, elaborated on commit message]
Signed-off-by: Olof Johansson -
…kernel/git/tmlind/linux-omap into fixes
From Tony Lindgren:
Few fixes for omap3 related hangs and errors that people have
noticed now that people are actually using the device tree
based booting for omap3.Also one regression fix for timer compile for dra7xx when
omap5 is not selected, and a LED regression fix for n900.* tag 'fixes-against-v3.12-rc3-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2: RX-51: Add missing max_current to rx51_lp5523_led_config
ARM: mach-omap2: board-generic: fix undefined symbol
ARM: dts: Fix pinctrl mask for omap3
ARM: OMAP3: Fix hardware detection for omap3630 when booted with device tree
ARM: OMAP2: gpmc-onenand: fix sync mode setup with DTSigned-off-by: Olof Johansson <olof@lixom.net>
-
Pull parisc fixes from Helge Deller:
"This patchset includes a bugfix to prevent a kernel crash when memory
in page zero is accessed by the kernel itself, e.g. via
probe_kernel_read().Furthermore we now export flush_cache_page() which is needed
(indirectly) by the lustre filesystem. The other patches remove
unused functions and optimizes the page fault handler to only evaluate
variables if needed, which again protects against possible kernel
crashes"* 'parisc-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: let probe_kernel_read() capture access to page zero
parisc: optimize variable initialization in do_page_fault
parisc: fix interruption handler to respect pagefault_disable()
parisc: mark parisc_terminate() noreturn and cold.
parisc: remove unused syscall_ipi() function.
parisc: kill SMP single function call interrupt
parisc: Export flush_cache_page() (needed by lustre) -
Pull slave-dmaengine fixes from Vinod Koul:
"Another week, time to send another fixes request taking time out of
extended weekend for the festivities in this part of the world.We have two fixes from Sergei for rcar driver and one fixing memory
leak of edma driver by Geyslan"* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
dma: edma.c: remove edma_desc leakage
rcar-hpbdma: add parameter to set_slave() method
rcar-hpbdma: remove shdma_free_irq() calls
13 Oct, 2013
16 commits
-
Signed-off-by: Helge Deller
-
The attached change defers the initialization of the variables tsk, mm
and flags until they are needed. As a result, the code won't crash if a
kernel probe is done with a corrupt context and the code will be better
optimized.Signed-off-by: John David Anglin
Signed-off-by: Helge Deller -
Running an "echo t > /proc/sysrq-trigger" crashes the parisc kernel. The
problem is, that in print_worker_info() we try to read the workqueue info via
the probe_kernel_read() functions which use pagefault_disable() to avoid
crashes like this:
probe_kernel_read(&pwq, &worker->current_pwq, sizeof(pwq));
probe_kernel_read(&wq, &pwq->wq, sizeof(wq));
probe_kernel_read(name, wq->name, sizeof(name) - 1);The problem here is, that the first probe_kernel_read(&pwq) might return zero
in pwq and as such the following probe_kernel_reads() try to access contents of
the page zero which is read protected and generate a kernel segfault.With this patch we fix the interruption handler to call parisc_terminate()
directly only if pagefault_disable() was not called (in which case
preempt_count()==0). Otherwise we hand over to the pagefault handler which
will try to look up the faulting address in the fixup tables.Signed-off-by: Helge Deller
Cc: # v3.0+
Signed-off-by: John David Anglin
Signed-off-by: Helge Deller -
Signed-off-by: Helge Deller
-
Signed-off-by: Helge Deller
-
Commit 9a46ad6d6df3b54 "smp: make smp_call_function_many() use logic
similar to smp_call_function_single()" has unified the way to handle
single and multiple cross-CPU function calls. Now only one interrupt
is needed for architecture specific code to support generic SMP function
call interfaces, so kill the redundant single function call interrupt.Signed-off-by: Jiang Liu
Cc: Jiang Liu
Signed-off-by: Helge Deller -
ERROR: "flush_cache_page" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined!
Signed-off-by: Geert Uytterhoeven
Signed-off-by: Helge Deller -
Olga reported that file descriptors opened with O_PATH do not work with
fstatfs(), found during further development of ksh93's thread support.There is no reason to not allow O_PATH file descriptors here (fstatfs is
very much a path operation), so use "fdget_raw()". See commit
55815f70147d ("vfs: make O_PATH file descriptors usable for 'fstat()'")
for a very similar issue reported for fstat() by the same team.Reported-and-tested-by: ольга крыжановская
Acked-by: Al Viro
Cc: stable@kernel.org # O_PATH introduced in 3.0+
Signed-off-by: Linus Torvalds -
Pull ext4 bugfixes from Ted Ts'o:
"A bug fix and performance regression fix for ext4"* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix memory leak in xattr
ext4: fix performance regression in writeback of random writes -
Pull btrfs fixes from Chris Mason:
"We've got more bug fixes in my for-linus branch:One of these fixes another corner of the compression oops from last
time. Miao nailed down some problems with concurrent snapshot
deletion and drive balancing.I kept out one of his patches for more testing, but these are all
stable"* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix oops caused by the space balance and dead roots
Btrfs: insert orphan roots into fs radix tree
Btrfs: limit delalloc pages outside of find_delalloc_range
Btrfs: use right root when checking for hash collision -
Pull sound fixes from Takashi Iwai:
"All stable fixes except for a trivial headset mic fixup: the removal
of bogus frame checks in snd-usb-usx2y driver that have regressed in
the recent kernel versions, the HD-audio HDMI channel map fix, and a
few HD-audio device-specific fixes"* tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Sony VAIO Pro 13 (haswell) now has a working headset jack
ALSA: hda - Add a headset mic model for ALC269 and friends
ALSA: hda - Fix microphone for Sony VAIO Pro 13 (Haswell model)
ALSA: hda - Add fixup for ASUS N56VZ
ALSA: hda - hdmi: Fix channel map switch not taking effect
ALSA: hda - Fix mono speakers and headset mic on Dell Vostro 5470
ALSA: snd-usb-usx2y: remove bogus frame checks -
Pull i2c fixes from Wolfram Sang:
"We had various reports of problems with deferred probing in the I2C
subsystem, so this pull requst is a little bigger than usual.Most issues should be addressed now so devices will be found
correctly. A few ususal driver bugfixes are in here, too"* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: i2c-mux-pinctrl: use deferred probe when adapter not found
i2c: i2c-arb-gpio-challenge: use deferred probe when adapter not found
i2c: i2c-mux-gpio: use deferred probing
i2c: i2c-mux-gpio: don't ignore of_get_named_gpio errors
i2c: omap: Clear ARDY bit twice
i2c: Not all adapters have a parent
i2c: i2c-stu300: replace platform_driver_probe to support deferred probing
i2c: i2c-mxs: replace platform_driver_probe to support deferred probing
i2c: i2c-imx: replace platform_driver_probe to support deferred probing
i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing -
If we take the 2nd retry path in ext4_expand_extra_isize_ea, we
potentionally return from the function without having freed these
allocations. If we don't do the return, we over-write the previous
allocation pointers, so we leak either way.Spotted with Coverity.
[ Fixed by tytso to set is and bs to NULL after freeing these
pointers, in case in the retry loop we later end up triggering an
error causing a jump to cleanup, at which point we could have a double
free bug. -- Ted ]Signed-off-by: Dave Jones
Signed-off-by: "Theodore Ts'o"
Reviewed-by: Eric Sandeen
Cc: stable@vger.kernel.org -
Pull gcc "asm goto" miscompilation workaround from Ingo Molnar:
"This is the fix for the GCC miscompilation discussed in the following
lkml thread:[x86] BUG: unable to handle kernel paging request at 00740060
The bug in GCC has been fixed by Jakub and the fix will be part of the
GCC 4.8.2 release expected to be released next week - so the quirk's
version test checks for miscompilation bug -
Pull x86 fixes from Ingo Molnar:
"A build fix and a reboot quirk"* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/reboot: Add reboot quirk for Dell Latitude E5410
x86, build, pci: Fix PCI_MSI build on !SMP -
Pull ARC fix from Vineet Gupta:
"Fix for broken gdb 'jump'"* tag 'arc-fixes-for-3.12-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
ARC: Ignore ptrace SETREGSET request for synthetic register "stop_pc"