aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-12writeback: avoid unnecessary calculation of bdi dirty thresholdsWu Fengguang4-41/+44
Split get_dirty_limits() into global_dirty_limits()+bdi_dirty_limit(), so that the latter can be avoided when under global dirty background threshold (which is the normal state for most systems). Signed-off-by: Wu Fengguang <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12writeback: balance_dirty_pages(): reduce calls to global_page_stateWu Fengguang1-62/+33
Reducing the number of times balance_dirty_pages calls global_page_state reduces the cache references and so improves write performance on a variety of workloads. 'perf stats' of simple fio write tests shows the reduction in cache access. Where the test is fio 'write,mmap,600Mb,pre_read' on AMD AthlonX2 with 3Gb memory (dirty_threshold approx 600 Mb) running each test 10 times, dropping the fasted & slowest values then taking the average & standard deviation average (s.d.) in millions (10^6) 2.6.31-rc8 648.6 (14.6) +patch 620.1 (16.5) Achieving this reduction is by dropping clip_bdi_dirty_limit as it rereads the counters to apply the dirty_threshold and moving this check up into balance_dirty_pages where it has already read the counters. Also by rearrange the for loop to only contain one copy of the limit tests allows the pdflush test after the loop to use the local copies of the counters rather than rereading them. In the common case with no throttling it now calls global_page_state 5 fewer times and bdi_stat 2 fewer. Fengguang: This patch slightly changes behavior by replacing clip_bdi_dirty_limit() with the explicit check (nr_reclaimable + nr_writeback >= dirty_thresh) to avoid exceeding the dirty limit. Since the bdi dirty limit is mostly accurate we don't need to do routinely clip. A simple dirty limit check would be enough. The check is necessary because, in principle we should throttle everything calling balance_dirty_pages() when we're over the total limit, as said by Peter. We now set and clear dirty_exceeded not only based on bdi dirty limits, but also on the global dirty limit. The global limit check is added in place of clip_bdi_dirty_limit() for safety and not intended as a behavior change. The bdi limits should be tight enough to keep all dirty pages under the global limit at most time; occasional small exceeding should be OK though. The change makes the logic more obvious: the global limit is the ultimate goal and shall be always imposed. We may now start background writeback work based on outdated conditions. That's safe because the bdi flush thread will (and have to) double check the states. It reduces overall overheads because the test based on old states still have good chance to be right. [[email protected]] fix uninitialized dirty_exceeded Signed-off-by: Richard Kennedy <[email protected]> Signed-off-by: Wu Fengguang <[email protected]> Cc: Jan Kara <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12parisc: fix wrong page aligned size calculation in ioremapping codeFlorian Zumbiehl1-1/+1
parisc __ioremap(): fix off-by-one error in page alignment of allocation size for sizes where size%PAGE_SIZE==1. Signed-off-by: Florian Zumbiehl <[email protected]> Cc: Kyle McMartin <[email protected]> Acked-by: Helge Deller <[email protected]> Tested-by: Helge Deller <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12score: fix dereference of NULL pointer in local_flush_tlb_page()Roel Kluin1-1/+1
Don't dereference vma if it's NULL. Signed-off-by: Roel Kluin <[email protected]> Cc: Chen Liqin <[email protected]> Cc: Lennox Wu <[email protected]> Cc: Arnd Bergmann <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12pc8736x_gpio: depends on X86_32Randy Dunlap1-1/+1
Fix kconfig dependency warning for PC8736x_GPIO by restricting it to X86_32. warning: (SCx200_GPIO && SCx200 || PC8736x_GPIO && X86) selects NSC_GPIO which has unmet direct dependencies (X86_32) NSC_GPIO is X86_32 only. The other driver (SCx200_GPIO) that selects NSC_GPIO is X86_32 only (indirectly, since SCx200 depends on X86_32), so limit this driver also. Signed-off-by: Randy Dunlap <[email protected]> Cc: Jordan Crouse <[email protected]> Cc: Jim Cromie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12mm: fix fatal kernel-doc errorRandy Dunlap1-1/+1
Fix a fatal kernel-doc error due to a #define coming between a function's kernel-doc notation and the function signature. (kernel-doc cannot handle this) Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12acpi: fix bogus preemption logicThomas Gleixner2-3/+8
The ACPI_PREEMPTION_POINT() logic was introduced in commit 8bd108d (ACPICA: add preemption point after each opcode parse). The follow up commits abe1dfab6, 138d15692, c084ca70 tried to fix the preemption logic back and forth, but nobody noticed that the usage of in_atomic_preempt_off() in that context is wrong. The check which guards the call of cond_resched() is: if (!in_atomic_preempt_off() && !irqs_disabled()) in_atomic_preempt_off() is not intended for general use as the comment above the macro definition clearly says: * Check whether we were atomic before we did preempt_disable(): * (used by the scheduler, *after* releasing the kernel lock) On a CONFIG_PREEMPT=n kernel the usage of in_atomic_preempt_off() works by accident, but with CONFIG_PREEMPT=y it's just broken. The whole purpose of the ACPI_PREEMPTION_POINT() is to reduce the latency on a CONFIG_PREEMPT=n kernel, so make ACPI_PREEMPTION_POINT() depend on CONFIG_PREEMPT=n and remove the in_atomic_preempt_off() check. Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16210 [[email protected]: fix build] Signed-off-by: Thomas Gleixner <[email protected]> Cc: Len Brown <[email protected]> Cc: Francois Valenduc <[email protected]> Cc: Lin Ming <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12kernel/kfifo.c: add handling of chained scatterlistsStefani Seibold1-7/+6
The current kfifo scatterlist implementation will not work with chained scatterlists. It assumes that struct scatterlist arrays are allocated contiguously, which is not the case when chained scatterlists (struct sg_table) are in use. Signed-off-by: Stefani Seibold <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-08-12x86, asm: Use a lower case name for the end macro in atomic64_386_32.SLuca Barbieri1-18/+20
Use a lowercase name for the end macro, which somehow fixes a binutils 2.16 problem. Signed-off-by: Luca Barbieri <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
2010-08-12CRIS: Define io_remap_pfn_range as remap_pfn_rangeJesper Nilsson1-0/+3
CRIS don't need any special mapping for io, but didn't define this, meaning that all uses of io_remap_pfn_range lead to compile errors. This fixes a compile error introduced in CRIS when drivers/mtd/mtdchar.c mmap handling was changed in commit dd02b67d5e9e7896891fa27eb5db65f55a290998 Signed-off-by: Jesper Nilsson <[email protected]>
2010-08-12mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix incorrect kfree(i2c) in wm831x-core i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix incorrect kfree(i2c) in tps6507x i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add TPS6586x driverMike Rapoport4-0/+437
Add mfd core driver for TPS6586x PMICs family. The driver provides I/O access for the sub-device drivers and performs regstration of the sub-devices based on the platform requirements. In addition it implements GPIOlib interface for the chip GPIOs. TODO: - add interrupt support - add platform data for PWM, backlight leds and charger Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Use macros instead of some constant magic numbers for menelausJarkko Nikula1-21/+54
This patch is originally done by Carlos Eduardo Aguiar. Original fix is commit 3305829b2816072b9c8ed01374b205ae4de74027 in git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git Author modified the fix for mainline version of menelaus. Signed-off-by: Jarkko Nikula <[email protected]> Cc: Carlos Eduardo Aguiar <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix menelaus mmc slot 2 misconfigurationJarkko Nikula1-2/+2
We are modifying register value instead of return value. This fix is originally done by Carlos Eduardo Aguiar. Original fix is commit bb4e91722e29efe31587d2cc664b6def645aecd9 in git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git Author modified the fix for mainline version of menelaus. Signed-off-by: Jarkko Nikula <[email protected]> Cc: Carlos Eduardo Aguiar <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Missing slab.h includesDavid Miller1-0/+1
Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix wrong wm8350-core kfree in error pathAxel Lin1-2/+4
This patch includes below fixes: 1. fix wm8350_create_cache error path make sure wm8350->reg_cache is freed in error path. 2. fix wm8350_device_init error path no need to kfree(wm8350->reg_cache) in the case of goto out. Signed-off-by: Axel Lin <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix wm8994_device_init() return valueAxel Lin1-1/+3
wm8994_device_init() will return 0 in the case of kzalloc fail in current implementation. This patch fixes the return value. Signed-off-by: Axel Lin <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Avoid calling platform_device_put() twice in ucb1400 probe error pathAxel Lin1-1/+1
In the case of goto err2, what we want is to call platform_device_del() instead of platform_device_unregister(). Otherwise, we call platform_device_put() twice. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Annotate tc6387xb probe/remove routines with __devinit/__devexitAxel Lin1-3/+3
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix tc6387xb resource reclaimAxel Lin1-3/+7
This patch includes below fixes: 1. add a missing iounmap in tc6387xb_probe() error path 2. fix resource reclaim in tc6387xb_remove() Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix wrong goto labels for tc6393xb error handlingAxel Lin1-2/+2
This patch corrects the error handling path. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Get rid of now unused mc13783 private headerUwe Kleine-König2-221/+23
This adds all remaining definitions that are used by the core driver to the .c file. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12hwmon: Don't access struct mc13783 directly from mc13783-adcUwe Kleine-König1-4/+13
There is a shiny new mc13783 API function that can be used instead. While at it refactor the code a bit to reduce code duplication a bit. This removes the last user of <linux/mfd/mc13783-private.h> and so this include file can go away. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: New mc13783 function exposing flagsUwe Kleine-König2-0/+8
This is needed for the mc13783-adc driver to decide if a touch screen is connected. If so some channels are not available as generic hwmon inputs. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Check jz4740-adc kmalloc() resultAxel Lin1-0/+4
If kmalloc() fails exit with -ENOMEM. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix jz4740-adc resource reclaim in probe error pathAxel Lin1-1/+7
If mfd_add_devices() fail, we need to relese allocated resources. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add WM8321 supportMark Brown1-0/+14
The WM8321 is a PMIC for low power, high performance applications. From a software point of view the device is identical to the WM8320, all the differences between the two devices are visible only in hardware. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add stmpe auto sleep featureSundar R Iyer3-0/+81
Some STMPE devices support entering sleep mode automatically on a specified timeout of inactivity on the I2C bus with the host system. Acked-by: Linus Walleij <[email protected]> Acked-by: Rabin Vincent <[email protected]> Signed-off-by: Sundar R Iyer <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12touchscreen: Fix sign bugKulikov Vasiliy1-1/+1
platform_get_irq_byname() can return negative results, it is not seen to unsigned ts_irq. Make it signed. Signed-off-by: Kulikov Vasiliy <[email protected]> Acked-By: Luotao Fu <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add support for TWL6030 PWMHemanth V3-0/+173
TWL6030 supports PWM (Pulse Width Modulator) which is used to control charging LED. PWM allows for controlling brightness. This patch implements the APIs required by leds-pwm driver. Signed-off-by: Hemanth V <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add additional WM8994 GPIO functionsMark Brown1-0/+4
Later revisions of the WM8994 add some more GPIO functions, define them in the header file. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add JZ4740 ADC driverLars-Peter Clausen4-0/+425
This patch adds a MFD driver for the JZ4740 ADC unit. The driver is used to demultiplex IRQs and synchronize access to shared registers between the battery, hwmon and (future) touchscreen driver. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12gpiolib: Implement set_debounce for WM831x GPIOsMark Brown1-0/+32
The debounce times are approximate, they can be selected using the two input functions. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12input: STMPE touch controller supportLuotao Fu3-0/+408
This one adds a driver for STMPE touchscreen controllers. This driver depends on the stmpexxx mfd core driver. Signed-off-by: Luotao Fu <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12input: Add STMPE keypad driverRabin Vincent3-0/+397
Add an input driver for the keypad on STMPE I/O expanders. This driver uses the common support provided by the STMPE MFD driver. Acked-by: Dmitry Torokhov <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12gpio: Add STMPE GPIO driverRabin Vincent3-0/+407
Add support for the GPIOs on STMPE I/O Expanders. [[email protected]: fix set direction input] [[email protected]: set GPIO alternate function while requesting] Acked-by: Luotao Fu <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Add STMPE I/O Expander supportRabin Vincent5-0/+1312
Add support for the STMPE family of I/O Expanders from STMicroelectronics. These devices include upto 24 gpios and a varying selection of blocks, including PWM, keypad, and touchscreen controllers. This patch adds the MFD core. [[email protected]: fix stmpe811 enable hook] [[email protected]: add touchscreen platform data] Acked-by: Luotao Fu <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Properly free t7l66xb clk32k clock sourceAxel Lin1-1/+2
This patch includes below fixes to properly free clk32k clock source: 1. remove a redundant clk_put in t7l66xb_probe error path 2. add missing clk_disable(t7l66xb->clk32k) and clk_put(t7l66xb->clk32k) to properly free the clock source. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: More verbose MFD Kconfig entrySamuel Ortiz1-1/+10
For people to be able to intellingibly decide if they want to enable MFD drivers or not, we have to give them a much better description of what they are.
2010-08-12mfd: Staticise ab3550 register access functionsMark Brown1-11/+12
These are now exported via an ops table rather than referenced directly and so should be staticised. Signed-off-by: Mark Brown <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix davinci memory leakJulia Lawall1-2/+4
Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: properly handle platform_device_add_resources fail in mfd_add_deviceAxel Lin1-1/+3
platform_device_add_resources may fail, thus add error checking for it. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: kzalloc doesn't return ERR_PTRJulia Lawall1-1/+1
Use !x rather than IS_ERR(x) to test the result of kzalloc. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,E; @@ x = \(kmalloc\|kzalloc\|kcalloc\)(...) ... when != x = E - IS_ERR(x) + !x // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: AB8500 mask off irrelevant bits from the SPI messageLinus Walleij1-1/+6
The registers on the AB8500 are only 8 bits wide, so the content of the remaining bits is undefined. Let's mask off the undefined stuff when returning a register in an SPI read. Acked-by: Rabin Vincent <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix 88pm860x uninitialized variable and clean upDan Carpenter1-40/+32
The original code had a compile warning: drivers/mfd/88pm860x-core.c:431: warning: ‘ret’ may be used uninitialized in this function It seems like the warning is valid if either pdata or pdata->touch is NULL. This patch checks pdata and pdata->touch at the beginning of the function. That means everything can be pulled in one indent level. Now all the statements fit within the 80 character limit. Also at that point the "use_gpadc" variable isn't needed and removing it simplifies the logic. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix memory leak in ab3100_otp_probeAxel Lin1-8/+8
In current implementation, there is a memory leak if ab3100_otp_read fail. And in the case of ab3100_otp_init_debugfs fail, it does not properly remove sysfs entries. This patch properly handle above failure cases. Signed-off-by: Axel Lin <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Fix led resource in 88pm860xHaojian Zhuang1-6/+6
Fix typo error in LED resource of 88pm860x. Signed-off-by: Haojian Zhuang <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2010-08-12mfd: Enable onkey on max8925Haojian Zhuang1-0/+27
Enable onkey feature in max8925 driver. Signed-off-by: Haojian Zhuang <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>