Tony Lindgren [Wed, 2 Aug 2006 10:02:05 +0000 (13:02 +0300)]
ARM: OMAP: Remove non-static declaration of clocks
"clocks" should be static. It is currenly needed only for
CONFIG_OMAP_RESET_CLOCKS. A follow-up patch will fix
CONFIG_OMAP_RESET_CLOCKS while keeping clocks static.
Imre Deak [Wed, 19 Jul 2006 12:29:39 +0000 (15:29 +0300)]
ARM: OMAP2: Dynamic allocator for GPMC memory space
Add support for assigning memory regions dynamically to peripherals
attached to GPMC interface. Platform specific code should now call
gpmc_cs_request to get a free GPMC memory region instead of using
a fixed address.
Make the H4 and Apollon platform initialization use the new API.
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Imre Deak [Thu, 6 Jul 2006 16:23:09 +0000 (19:23 +0300)]
ARM: OMAP: timer32k: fix tick count calculation when reprogramming
Reprogramming takes places before putting the CPU into idle mode if
the dynamic tick option is enabled. The timer is then set to expire
at the next pending timer event. Because some time has already passed
since the last reported jiffy we have to wait less than the time
specified in jiffies.
Also make sure we don't set a load value of 0 whose outcome is
unspecified according to the TRM.
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Input: ads7846: leave Vref on during differential measurements optionally
On some LCDs leaving the Vref on provides much better readings.
Signed-off-by: Jarkko Oikarinen <jarkko.oikarinen@nokia.com> Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Some LCDs like the LS041Y3 require a customized filtering
logic for reliable readings, so make the filtering function
replacable through platform specific hooks.
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Use hrtimer instead of the normal timer, since it provides better
sampling resolution. This will:
- avoid a problem where we have a 1 jiffy poll period and dynamic tick on
- utilize high resolution HW clocks when they are added to the hrtimer
framework
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Imre Deak [Wed, 12 Jul 2006 11:18:57 +0000 (14:18 +0300)]
ARM: OMAP: DISPC: DMA underflow for high graphics bandwith
DISPC DMA can, in certain conditions, underflow which will trigger an error
condition and halt the graphics pipeline. The only way to recover from
this would be to reset the related HW modules, which would abort the
current transfer and cause unwanted visual side-effects. The problem
arises mainly when enabling multiple planes with higher resolutions.
The arbitration priority of the DISPC DMA cannot be raised higher, thus -
so far - the only workaround is to keep the DMA FIFO full as much as
possible to minimize the risk of it being totally drained. The patch does
this for external LCD controllers connected to RFBI, where the new FIFO
setting doesn't degrade power consumption significantly.
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Samuel Ortiz [Thu, 13 Jul 2006 12:24:25 +0000 (15:24 +0300)]
IDLETIMER: We shouldn't sleep in the timer routine
Currently, IDLETIMER timer routine calls kobject_uevent, which might sleep.
Since we are in interrupt context, we now schedule a work when the timer
expires. This calls sysfs_notify() for notifying userspace.
Signed-off-by: Samuel Ortiz <samuel.ortiz@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Samuel Ortiz [Thu, 13 Jul 2006 10:04:06 +0000 (13:04 +0300)]
IDLETIMER: New xt_target prototype
In ipt_IDLETIMER.c, we are using an old prototype for xt_target hooks. We need
to pass one additional argument, a pointer to xt_target.
We also need to specify the targetsize value, otherwise registration fails.
Signed-off-by: Samuel Ortiz <samuel.ortiz@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
WARNING: drivers/pcmcia/omap_cf.o - Section mismatch:
reference to .init.text: from .data between '' (at offset
0x80) and 'omap_cf_ops'
WARNING: sound/arm/omap/snd-omap-alsa-aic23.o - Section
mismatch: reference to .init.text: from .data between ''
(at offset 0x68) and 'aic23_hw_constraints_rates'
Signed-off-by: Dirk Behme <dirk.behme_at_gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Imre Deak [Mon, 26 Jun 2006 15:48:47 +0000 (18:48 +0300)]
ARM: OMAP: omapfb: update LCD drivers
- replace custom debugging stuff with the default kernel one
- pass a pointer to the LCD object instance to member functions
- rename lcd_lph8923 to the more generic lcd_mipid
- use SPI_MODE_1 instead of SPI_MODE_0 in lcd_mipid
- add ESD spike recovery support to lcd_mipid
Signed-off-by: Imre Deak <ext-imre.deak@nokia.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Imre Deak [Mon, 26 Jun 2006 12:52:36 +0000 (15:52 +0300)]
ARM: OMAP: omapfb platform file changes
- OMAP ATAG changes:
FBMEM - support for per plane memory configurations
LCD - add data_lines, reset GPIO line params
- FB memory configuration:
Support for per-plane memory configurations with FB location
either in SRAM or SDRAM.
- DMA consistent memory size:
Make the ARM DMA consistent memory size overridable. The default
is 2MB, but for larger frame buffers we may need more. Kconfig
option is added in the next patch.
Signed-off-by: Imre Deak <ext-imre.deak@nokia.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Timo Teras [Mon, 19 Jun 2006 16:37:21 +0000 (19:37 +0300)]
ARM: OMAP: Update dmtimers
- Initialize timer outside of spinlock to reduce the time the spinlock is held
- Do clk_get to the source clocks during initialization to avoid sleeping later
- New function to set counter register
Signed-off-by: Timo Teras <timo.teras@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Arnd Bergmann [Thu, 15 Jun 2006 11:15:44 +0000 (21:15 +1000)]
[PATCH] powerpc: Fix 64k pages on non-partitioned machines
The page size encoding passed to tlbie is incorrect for new-style
large pages. This fixes it. This doesn't affect anything on older
machines because mmu_psize_defs[psize].penc (the page size encoding)
is 0 for 4k and 16M pages (the two are distinguished by a separate "is
a large page" bit).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Oleg Nesterov [Thu, 15 Jun 2006 16:12:02 +0000 (20:12 +0400)]
[PATCH] arm_timer: remove a racy and obsolete PF_EXITING check
arm_timer() checks PF_EXITING to prevent BUG_ON(->exit_state)
in run_posix_cpu_timers().
However, for some reason it does so only for CPUCLOCK_PERTHREAD
case (which is imho wrong).
Also, this check is not reliable, PF_EXITING could be set on
another cpu without any locks/barriers just after the check,
so it can't prevent from attaching the timer to the exiting
task.
Oleg Nesterov [Thu, 15 Jun 2006 16:11:43 +0000 (20:11 +0400)]
[PATCH] run_posix_cpu_timers: remove a bogus BUG_ON()
do_exit() clears ->it_##clock##_expires, but nothing prevents
another cpu to attach the timer to exiting process after that.
arm_timer() tries to protect against this race, but the check
is racy.
After exit_notify() does 'write_unlock_irq(&tasklist_lock)' and
before do_exit() calls 'schedule() local timer interrupt can find
tsk->exit_state != 0. If that state was EXIT_DEAD (or another cpu
does sys_wait4) interrupted task has ->signal == NULL.
At this moment exiting task has no pending cpu timers, they were
cleanuped in __exit_signal()->posix_cpu_timers_exit{,_group}(),
so we can just return from irq.
Oleg Nesterov [Thu, 15 Jun 2006 16:11:15 +0000 (20:11 +0400)]
[PATCH] check_process_timers: fix possible lockup
If the local timer interrupt happens just after do_exit() sets PF_EXITING
(and before it clears ->it_xxx_expires) run_posix_cpu_timers() will call
check_process_timers() with tasklist_lock + ->siglock held and
check_process_timers:
t = tsk;
do {
....
do {
t = next_thread(t);
} while (unlikely(t->flags & PF_EXITING));
} while (t != tsk);
the outer loop will never stop.
Actually, the window is bigger. Another process can attach the timer
after ->it_xxx_expires was cleared (see the next commit) and the 'if
(PF_EXITING)' check in arm_timer() is racy (see the one after that).
A couple of fixes that should prevent crashes when using netconsole and
suspend/resume. First, netconsole poll routine shouldn't run unless the
device is up; second, the NAPI poll should be disabled during suspend.
This is only an issue on sky2, because it has to have one NAPI poll
routine for both ports on dual port boards. Normal drivers use
netif_rx_schedule_prep and that checks for netif_running.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jens Axboe [Fri, 16 Jun 2006 11:02:29 +0000 (13:02 +0200)]
[PATCH] Fix missing ret assignment in __bio_map_user() error path
If get_user_pages() returns less pages than what we asked for, we jump
to out_unmap which will return ERR_PTR(ret). But ret can contain a
positive number just smaller than local_nr_pages, so be sure to set it
to -EFAULT always.
Problem found and diagnosed by Damien Le Moal <damien@sdl.hitachi.co.jp>
Jens Axboe [Fri, 16 Jun 2006 05:46:37 +0000 (07:46 +0200)]
[PATCH] fix cdrom open
Some time ago the cdrom open routine was changed so that we call the
driver's open routine before checking to see if it is read only. However,
if we discovered that a read write open was not possible and the open
flags required a writable open, we just returned -EROFS without calling
the driver's release routine. This seems to work for most cdrom drivers,
but breaks the Powerpc iSeries virtual cdrom rather badly.
This just inserts the release call in the error path to balance the call
to "->open()" done by "open_for_data()".
Juha Yrjola [Wed, 14 Jun 2006 20:25:53 +0000 (23:25 +0300)]
OMAP: Clean up MMC driver, part 1
- Move register definitions away from the header file
- Change OMAP_MMC_{READ,WRITE} macros to use the host pointer
- Replace base with virt_base and phys_base
- Implement OMAP2420 initialization workaround
- General code cleanups
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Jens Axboe [Wed, 14 Jun 2006 17:11:57 +0000 (19:11 +0200)]
[PATCH] cfq-iosched: fix crash in do_div()
We don't clear the seek stat values in cfq_alloc_io_context(), and if
->seek_mean is unlucky enough to be set to -36 by chance, the first
invocation of cfq_update_io_seektime() will oops with a divide by zero
in do_div().
Just memset the entire cic instead of filling invididual values
independently.
Samuel Ortiz [Wed, 14 Jun 2006 11:58:12 +0000 (14:58 +0300)]
OMAP: camera code cleanups and compilation fixes
- Fixed the Makefile: camera_core should be compiled only for OMAP1, and in
conjunction with omap16xxcam.c.
- Fixed the sensor->init() calls and prototype in camera_core.c and
sensor_ov9640.c.
- Ported the code to the new videobuf code.
- Renamed camera_sensor to omap_camera_sensor since this is an OMAP-specific
structure.
Signed-off-by: Samuel Ortiz <samuel.ortiz@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
[PATCH] sky2: stop/start hardware idle timer on suspend/resume
The resume bug was caused not by an early interrupt but because the idle
timeout was not being stopped on suspend. Also disable hardware IRQ's
on suspend. Will need to revisit this with hotplug?
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The set power state function is cleaner if it doesn't return anything.
The only caller that could fail is in suspend() and it can check the argument
there.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Randy Dunlap [Mon, 12 Jun 2006 22:13:40 +0000 (15:13 -0700)]
[PATCH] alpha: generic hweight build fix
From: Randy Dunlap <rdunlap@xenotime.net>
According to include/asm-alpha/bitops.h, only ALPHA_EV67 has hardware
hweight support, so ALPHA_EV6 needs to use GENERIC_HWEIGHT.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Ernst Herzberg <earny@net4u.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Sergey Vlasov [Mon, 12 Jun 2006 20:53:23 +0000 (21:53 +0100)]
[PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir()
shmem_rmdir() must undo the increment of i_nlink done in
shmem_get_inode() for directories, otherwise at least
IN_DELETE_SELF inotify event generation is broken.
Robin H. Johnson [Mon, 12 Jun 2006 20:50:25 +0000 (21:50 +0100)]
[PATCH] tmpfs: time granularity fix for [acm]time going backwards
I noticed a strange behavior in a tmpfs file system the other day, while
building packages - occasionally, and seemingly at random, make decided to
rebuild a target. However, only on tmpfs.
A file would be created, and if checked, it had a sub-second timestamp.
However, after an utimes related call where sub-seconds should be set, they
were zeroed instead. In the case that a file was created, and utimes(...,NULL)
was used on it in the same second, the timestamp on the file moved backwards.
After some digging, I found that this was being caused by tmpfs not having a
time granularity set, thus inheriting the default 1 second granularity.
Hugh adds: yes, we missed tmpfs when the s_time_gran mods went into 2.6.11.
Unfortunately, the granularity of CURRENT_TIME, often used in filesystems,
does not match the default granularity set by alloc_super. A few more such
discrepancies have been found, but this is the most important to fix now.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Acked-by: Andi Kleen <ak@suse.de> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds [Mon, 12 Jun 2006 19:53:27 +0000 (12:53 -0700)]
[sky2] Fix sky2 network driver suspend/resume
This fixes two independent problems: it would not save the PCI state on
suspend (and thus try to resume a nonexistent state on resume), and
while shut off, if an interrupt happened on the same shared irq, the irq
handler would react very badly to the interrupt status being an invalid
all-ones state.
Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Imre Deak [Fri, 9 Jun 2006 15:17:50 +0000 (18:17 +0300)]
ARM: OMAP: omap_uwire: wait for tx complete before starting the next one
The TDR register shouldn't be written when the CSRB flag is set. The fix
solves the problem where one SPI transfer includes multiple 8 or 16 bit
tx elements and the current transfer can be corrupted by accessing the
TDR too early.
Signed-off-by: Imre Deak <imre.deak@nokia.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
A read / write cycle is defined by tw0 + tw1. It was wrongly assumed that
the 1 cycle long CS active edge to read / write active edge is part of
each cycle, thus we ended up with too low tw1 value -> too short cycle
time.
Signed-off-by: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>