V4L/DVB (5818): CinergyT2: fix flush_workqueue() vs work->func() deadlock
Spotted and tested by Thomas Sattler <tsattler@gmx.de>.
cinergyT2.c does cancel_delayed_work() + flush_scheduled_work() while
holding cinergyt2->sem. This leads to deadlock because work->func()
needs the same mutex to complete. Another bug is that this code in fact
can't reliably stop the re-arming delayed_work.
Convert this code to use cancel_rearming_delayed_work() and move it
out of ->sem. Another mutex, ->wq_sem, was added to protect against the
concurrent open/resume.
This patch is a horrible hack to fix the lockup which happens in practice.
As Dmitry Torokhov pointed out this driver has other problems and needs
further changes.
Jelle Foks [Mon, 21 May 2007 17:56:17 +0000 (14:56 -0300)]
V4L/DVB (5816): Cx88-blackbird: fix vidioc_g_tuner never ending list of tuners
v4l-info and other programs would loop indefinitely while querying the
tuners for cx88-blackbird cards.
The cause was that vidioc_g_tuner didn't return an error value for
qctrl->id != 0, making the application think there is a never ending
list of tuners...
This patch adds the same index check as done in vidioc_g_tuner() in
cx88-video.
V4L/DVB (5808): Bttv: fix v4l1 breaking the driver
If one uses a V4L *one* application, such as vlc or mplayer's v4l driver, as
the first user after the driver is loaded, the driver wedges itself and will
never capture properly. Even if one uses a V4L2 application later, it still
won't work.
If one uses a V4L *two* application first, such as tvtime or mplayer's v4l2
driver, then the driver will be ok. One can then run a V4L1 application, and
it will work.
It turns out the problem is with norm changing and the crop support that was
added in 2.6.21. The driver defaults to PAL, and keeps the last norm it was
set too across opens. If one changes the norm via V4L1, the cropping
parameters are not reset like they should be, and they'll remain broken across
device opens.
This patch removes the direct setting of btv->tvnorm in the V4L1 ioctl
VIDIOCSCHAN handler. The norm is set via the existing call to set_input(),
which calls set_tvnorm(), which will reset the cropping values now that it is
able to detect the norm change.
host->irq and host->irq2 should be set before ata_host_register() for
IRQ reporting to work. Move up host->irq assignment in
ata_host_activate() and add it to ata_pci_init_one() native path and
pata_cs5520.
The port info printing in ata_host_register() doesn't fit all the
different controllers. It should probably be moved out to LLDs with
some helpers in the future.
Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6:
Blackfin arch: remove zero-sized include/asm-blackfin/macros.h
Blackfin arch: update board defconfig files
Blackfin arch: Fix up remaining printks with proper log levels
Blackfin arch: Add proper -mcpu option according to the cpu and silicon revision configuration
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
3c589_cs: fix local_bh_enable warning
RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon module unload
drivers/net/ns83820.c: fix a check-after-use
net/usb/cdc_ether minor sparse cleanup
RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers
RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctly
dm9601: Return 0 from bind() on success
Update MAINTAINERS for USB network devices
usbnet: Zero padding byte if there is tail room in skb
dm9601: HW header size shouldn't be included in packet length
starfire list alpha as 64 bit arch
myri10ge: SET_NETDEV_DEV()
gianfar: Fix typo bug introduced by move to udp_hdr()
[PATCH] libertas: remove private ioctls
[PATCH] libertas: fix WPA associations by handling ENABLE_RSN correctly
[PATCH] libertas: kill wlan_scan_process_results
[PATCH] libertas: style fixes
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
firewire: add Kconfig help on building both stacks
firewire: fix async reception on big endian machines
Ralph Campbell [Fri, 29 Jun 2007 18:37:56 +0000 (11:37 -0700)]
IPoIB/cm: Partial error clean up unmaps wrong address
If a page can't be allocated for the frag list of a skb, the code to
unmap the partially allocated list is off by one. For exaple, if
'frags' equals one, i == 0, and the alloc_page() fails, then the old
loop would have unmapped mapping[1] which is uninitialized. The same
would happen if the call to ib_dma_map_page() failed.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Acked-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This file accidentally got truncated instead of deleted in commit df30b11.
Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl> Cc: Robert P. J. Day <rpjday@mindspring.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Jesper Juhl <jesper.juhl@gmail.com> Cc: Alex Riesen <raa.lkml@gmail.com> Cc: Robin Getz <robin.getz@analog.com> Acked-by: Bryan Wu <bryan.wu@analog.com>
Patrick McHardy [Mon, 2 Jul 2007 14:08:28 +0000 (16:08 +0200)]
3c589_cs: fix local_bh_enable warning
Russell King wrote:
> Having upgraded from 2.6.16 to 2.6.22-rc6, I'm now seeing the following.
>
> Looks like netfilter is calling local_bh_enable() with IRQs disabled,
> which would appear to be illegal. Thankfully, this is a warn-once
> warning.
>
> WARNING: at /home/rmk/git/linux-2.6-rmk/kernel/softirq.c:138 local_bh_enable()
> [...]
> [<c01447fc>] (nf_conntrack_destroy+0x0/0x2c) from [<c012c05c>] (__kfree_skb+0xd0/0x100)
> [<c012bf8c>] (__kfree_skb+0x0/0x100) from [<c012c0d8>] (kfree_skb+0x4c/0x50)
> r5:c12a3800 r4:00000300
> [<c012c08c>] (kfree_skb+0x0/0x50) from [<bf03cbb0>] (el3_start_xmit+0xb8/0xd0 [3c589_cs])
> [<bf03caf8>] (el3_start_xmit+0x0/0xd0 [3c589_cs]) from [<c01324dc>] (dev_hard_start_xmit+0x1a8/0x244)
> r7:c12a3800 r6:c1a9aa00 r5:c1a9aa00 r4:c12a3800
> [<c0132334>] (dev_hard_start_xmit+0x0/0x244) from [<c013fcc0>] (__qdisc_run+0xb0/0x198)
Thats a bug in the 3c589_cs driver. Patch attached.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Uwe Koziolek [Thu, 14 Jun 2007 21:40:43 +0000 (23:40 +0200)]
libata: PATA-mode fixes for sis_sata
Changed PATA handler for PATA-ports used by sata_sis.
This patch was originally submitted by Jeff Garzik.
Added PCI-ID 1180 for SiS966 Controller in pata_sis.
The 1180 mode is fully compatible to other SiS PATA-controller.
The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible
to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis.
1183 is not working if simply added to pata_sis.
This handling fixes issues with SiS968.
Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Robert Hancock [Fri, 29 Jun 2007 00:52:24 +0000 (18:52 -0600)]
sata_nv: allow changing queue depth
The sata_nv driver was missing the change_queue_depth hook in the SCSI host
template which the other NCQ-capable libata drivers had. This made it impossible
to change the queue depth by user request. Add this in.
Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Tejun Heo [Fri, 29 Jun 2007 02:33:08 +0000 (11:33 +0900)]
sata_inic162x: disable LBA48 devices
sata_inic162x can't do LBA48 properly yet and is likely to corrupt
data on drives larger than LBA28 limit. Disable LBA48 devices during
device configuration.
Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Albert Lee [Tue, 26 Jun 2007 05:43:15 +0000 (13:43 +0800)]
libata: pata_pdc2027x PLL input clock fix
Recently the PLL input clock of pata_pdc2027x is sometimes detected
higer than expected (e.g. 20.027 MHz compared to 16.714 MHz).
It seems sometimes the mdelay() function is not as precise as it
used to be. Per Alan's advice, HT or power management might affect
the precision of mdelay().
This patch calls gettimeofday() to mesure the time elapsed and
calculate the PLL input clock accordingly.
Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Randy Dunlap [Mon, 11 Jun 2007 18:59:34 +0000 (11:59 -0700)]
scsi disk help file is not complete
On Mon, 11 Jun 2007 20:28:16 +0200 api wrote:
> Good day,
> When doing make menuconfig one comes across CONFIG_BLK_DEV_SD.
> The help file states that this is for scsi disks.NO MENTION IS MADE THAT
> IT IS NEEDE FOR SATA DISKS AS WELL!
> Would have saved me a lot of time if the help was up to date.
> I hope this can be changed so others can make a kernel for sata systems
> quicker.
From: Randy Dunlap <randy.dunlap@oracle.com>
Add help info for BLK_DEV_SD referring to its use in
SATA or PATA driver configurations.
Add help text for "ATA" indicating that it probably needs
some SCSI config symbols enabled in order to be useful.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon module unload
Resending patch 3/3 only.
These changes allow driver close routine to be called during module unload,
to clean-up buffers and other software resources, flush queues etc. Also,
hardware is reset to pristine state.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers
This patch updates the various access routines to access different
control and status settings present in different register locations.
This will fix problems related to working of different ports in
multi Port card.
Signed-off by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off by: Milan Bag <mbag@netxen.com>
RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctly
NetXen driver uses PCI function 0 to provide the functionality of MSI.
The patch makes driver check the bus master bit for function 0 and
enable it after the card initialization.
Signed-off-by: Dhananjay Phadke<dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Peter Korsgaard [Wed, 27 Jun 2007 19:18:18 +0000 (21:18 +0200)]
Update MAINTAINERS for USB network devices
>>>>> "Greg" == Greg KH <greg@kroah.com> writes:
Greg> Yeah, this is the cdc_acm driver that is still in the USB drivers/
Greg> directory tree as it is a USB class driver that shows up as a tty device
Greg> to userspace. It should not be moved to the networking list unless no
Greg> one minds that I never see any queries about it :)
Ok, here's an updated patch:
Questions regarding the USB network drivers should now go to netdev.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Peter Korsgaard [Wed, 27 Jun 2007 06:48:15 +0000 (08:48 +0200)]
usbnet: Zero padding byte if there is tail room in skb
Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero
padding byte if there is tail room in skb.
Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Commit 52ade9b3b97fd3bea42842a056fe0786c28d0555 changed the suspend code
ordering to execute pm_ops->prepare() after the device model per-device
.suspend() calls in order to fix some ACPI-related issues. Unfortunately, it
broke the at91 platform which assumed that pm_ops->prepare() would be called
before suspending devices.
at91 used pm_ops->prepare() to get notified of the target system sleep state,
so that it could use this information while suspending devices. However, with
the current suspend code ordering pm_ops->prepare() is called too late for
this purpose. Thus, at91 needs an additional method in 'struct pm_ops' that
will be used for notifying the platform of the target system sleep state.
Moreover, in the future such a method will also be needed by ACPI.
This patch adds the .set_target() method to 'struct pm_ops' and makes the
suspend code call it, if implemented, before executing the device model
per-device .suspend() calls. It also modifies the at91 code to use
pm_ops->set_target() instead of pm_ops->prepare().
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Pavel Machek <pavel@ucw.cz> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Len Brown <lenb@kernel.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
smsc-ircc2: bypass PNP detection until we get the quirks worked out
Don't use PNP detection by default yet. We have some PNP and BIOS issues
to work out first.
Sample problem on a Toshiba Portege 4000: the SMCf010 device is handed off
disabled. We assign I/O ports originally assigned to the SMCf010 to a
PCMCIA device instead. We enable the SMCf010, configuring it to use
disjoint ports, but _SRS doesn't work correctly, so the device doesn't
work.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Andrey Borzenkov <arvidjaar@mail.ru> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton [Sun, 1 Jul 2007 19:06:48 +0000 (12:06 -0700)]
i386: mtrr crash fix
Commit 3ebad5905609476a4ff1151a66b21d9794009961 ("[PATCH] x86: Save and
restore the fixed-range MTRRs of the BSP when suspending") added mtrr
operations without verifying that the CPU has MTRRs. Crashes transmeta
CPUs.
Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: <linux@horizon.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Maxime Austruy [Sun, 1 Jul 2007 19:06:38 +0000 (12:06 -0700)]
asus_acpi: fix oops on non-asus machines
If asus_acpi_init doesn't find any device it knows about, it mistakenly
returns a "success" error code even though it cleans up after itself. Later
when trying to rmmod asus_acpi, the module_exit routine would try to clean up
one more time and we would end up calling
acpi_bus_unregister_driver(&asus_hotk_driver) twice. This patch addresses
this first problem by returning -ENODEV when no appropriate device is found.
Then there was also another bug with the code handling the return value of
backlight_device_register. If this function ever failed, the driver would
cleanup by calling the module_exit routine from module_init, but it would
still return "success". So any attempt to rmmod this module would result in
asus_acpi_exit being called twice but it's not ready to handle it (I haven't
hit this bug, just found it by code inspection). This patch fixes that by
inserting a return -ENODEV; at the end of this error handling path.
Signed-off-by: Maxime Austruy <maxime@tralhalla.org> Cc: Len Brown <lenb@kernel.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
frv: fix fallout from "remove sched.h from mm.h" patch
/home/rpjday/AMD/k/topics/0_hi/hi1.c:15: error: dereferencing pointer to incomplete type
/home/rpjday/AMD/k/topics/0_hi/hi1.c:16: error: dereferencing pointer to incomplete type
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The blink driver wakes up every jiffies which wastes power unnecessarily.
Using a notifier gives same effect. Also add ability to unload module.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
[ We should really just delete the whole thing. The blink driver is
broken in many other ways too -Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commit 9215da33209b861b01c51382254b178a3fe92a30 "fixed" the MTRR range
check to not allow any MTRR's under the 1MB mark (since that's where the
fixed MTRR's are active).
However, that was totally bogus, since it's normal (and almost required)
to have a large variable MTRR that starts at 0, and covers some large
percentage of the whole RAM, and then using the fixed MTRR's to override
that large MTRR to handle the special ISA hole in the 640k-1M region.
The old check was bogus too (checking that no variable MTRR is used that
is entirely under the 1MB range), but at least it wasn't actively
detrimental, because no sane situation would ever trigger such MTRR
usage in the first place.
That said, the whole notion of not allowing variable MTRR's in the low
1MB is just stupid, so rather than revert the commit, this just removes
the whole sad and unnecessary check entirely.
Cc: Jan Beulich <jbeulich@novell.com> Cc: Andi Kleen <ak@suse.de> Cc: Andrew Morton <akpm@linux-foundation.org> Tested-by: Luca Palermo <darkmage@sabayonlinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 30 Jun 2007 04:30:18 +0000 (21:30 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Add linux/pagemap.h to asm/tlb.h
[SPARC64]: Need to set state to IDLE during sun4v IRQ enable.
[SPARC64]: Fix VIRQ enabling.
[SPARC64]: Add irqs to mdesc_node.
Will Schmidt [Fri, 29 Jun 2007 20:49:50 +0000 (15:49 -0500)]
Fix VDSO gettimeofday() when called with NULL struct timeval.
The vdso64 portion of patch 74609f4536f2b8fd6a48381bbbe3cd37da20a527 for
fixing problems with NULL gettimeofday input mistakenly checks for a
null tz field twice, when it should be checking for null tz once, and
null tv once; by way of a r10/r11 typo.
Any application calling gettimeofday(&tv,NULL) will "fail".
This corrects that typo, and makes my G5 happy.
Tested on G5.
Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com> Cc: Tony Breeds <tony@bakeyournoodle.com> Forwarded-by: Ben Herrenschmidt <benh@kernel.crashing.org>
[ Ben says: "I checked the 32 bits part of the change is correct. You
can probably blame me for originally writing the 2 versions with
inversed usage of r10 and r11, thus confusing Tony :-)"
Stefan Richter [Mon, 25 Jun 2007 20:18:40 +0000 (22:18 +0200)]
firewire: add Kconfig help on building both stacks
Alas that won't work so good, because nobody reads help texts.
I thought about adding some crude multiple choice selection (build the
old stack, build the new stack, build both stacks). It's possible, but
it would introduce awkward dummy config variables.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Randy Dunlap [Fri, 29 Jun 2007 05:40:23 +0000 (22:40 -0700)]
[IRDA]: fix printk format
Fix printk format warning:
drivers/net/irda/irport.c:512: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Kumar Gala [Fri, 29 Jun 2007 05:12:04 +0000 (00:12 -0500)]
gianfar: Fix typo bug introduced by move to udp_hdr()
In commit 4bedb45203eab92a87b4c863fe2d0cded633427f both the udp and tcp
cases where changed to use udp_hdr() instead of leaving the tcp case
alone and fixing with tcp_hdr().
This ended up causing random behavior with TCP connections because
of looking for tcp_hdr()->check in the wrong place.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Jarek Poplawski [Fri, 29 Jun 2007 05:11:47 +0000 (22:11 -0700)]
[NETPOLL] netconsole: fix soft lockup when removing module
#1
Until kernel ver. 2.6.21 (including) cancel_rearming_delayed_work()
required a work function should always (unconditionally) rearm with
delay > 0 - otherwise it would endlessly loop. This patch replaces
this function with cancel_delayed_work(). Later kernel versions don't
require this, so here it's only for uniformity.
#2
After deleting a timer in cancel_[rearming_]delayed_work() there could
stay a last skb queued in npinfo->txq causing a memory leak after
kfree(npinfo).
Initial patch & testing by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Fri, 29 Jun 2007 04:25:31 +0000 (21:25 -0700)]
[SPARC64]: Add linux/pagemap.h to asm/tlb.h
As seen on sparc64-allnoconfig:
CC arch/sparc64/mm/tlb.o
In file included from arch/sparc64/mm/tlb.c:19:
include/asm/tlb.h: In function 'tlb_flush_mmu':
include/asm/tlb.h:60: warning: implicit declaration of function 'release_pages'
include/asm/tlb.h: In function 'tlb_remove_page':
include/asm/tlb.h:92: warning: implicit declaration of function 'page_cache_release'
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
David Woodhouse [Wed, 27 Jun 2007 21:10:09 +0000 (14:10 -0700)]
Introduce fixed sys_sync_file_range2() syscall, implement on PowerPC and ARM
Not all the world is an i386. Many architectures need 64-bit arguments to be
aligned in suitable pairs of registers, and the original
sys_sync_file_range(int, loff_t, loff_t, int) was therefore wasting an
argument register for padding after the first integer. Since we don't
normally have more than 6 arguments for system calls, that left no room for
the final argument on some architectures.
Fix this by introducing sys_sync_file_range2(int, int, loff_t, loff_t) which
all fits nicely. In fact, ARM already had that, but called it
sys_arm_sync_file_range. Move it to fs/sync.c and rename it, then implement
the needed compatibility routine. And stop the missing syscall check from
bitching about the absence of sys_sync_file_range() if we've implemented
sys_sync_file_range2() instead.
Tested on PPC32 and with 32-bit and 64-bit userspace on PPC64.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jay Lubomirski [Wed, 27 Jun 2007 21:10:09 +0000 (14:10 -0700)]
serial: clear proper MPSC interrupt cause bits
The interrupt clearing code in mpsc_sdma_intr_ack() mistakenly clears the
interrupt for both controllers instead of just the one its supposed to.
This can result in the other controller appearing to hang because its
interrupt was effectively lost.
So, don't clear the interrupt cause bits for both MPSC controllers when
clearing the interrupt for one of them. Just clear the one that is
supposed to be cleared.
Signed-off-by: Jay Lubomirski <jaylubo@motorola.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Davide Libenzi [Wed, 27 Jun 2007 21:09:59 +0000 (14:09 -0700)]
avoid spurious POLLIN returns in signalfd
The new code in kernel/signal.c does not allow fetching private signals
from another task. This patch avoid spurious POLLIN returns from a
signalfd poll(2) operation.
Jeff Mahoney [Wed, 27 Jun 2007 21:09:58 +0000 (14:09 -0700)]
saa7134: fix thread shutdown handling
This patch changes the test for the thread pid from >= 0 to > 0.
When the saa8134 driver initialization fails after a certain point, it goes
through the complete shutdown process for the driver. Part of shutting it
down includes tearing down the thread for tv audio.
The test for tearing down the thread tests for >= 0. Since the dev
structure is kzalloc'd, the test will always be true if we haven't tried to
start the thread yet. We end up waiting on pid 0 to complete, which will
never happen, so we lock up.
This bug was observed in Novell Bugzilla 284718, when request_irq() failed.
Signed-off-by: Jeff Mahoney <jeffm@suse.com> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Wed, 27 Jun 2007 21:09:56 +0000 (14:09 -0700)]
IOATDMA: fix section mismatches
Rename struct pci_driver data so that false section mismatch warnings won't
be produced.
Sam, ISTM that depending on variable names is the weakest & worst part of
modpost section checking. Should __init_refok work here? I got build
errors when I tried to use it, probably because the struct pci_driver probe
and remove methods are not marked "__init_refok".
WARNING: drivers/dma/ioatdma.o(.data+0x10): Section mismatch: reference to .init.text: (between 'ioat_pci_drv' and 'ioat_pci_tbl')
WARNING: drivers/dma/ioatdma.o(.data+0x14): Section mismatch: reference to .exit.text: (between 'ioat_pci_drv' and 'ioat_pci_tbl')
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Chris Leech <christopher.leech@intel.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If one has a dependency chain (tristate)FOO depends on (bool)BAR depends on
(tristate)BAZ, build problems will result. If BAZ=m, then BAR can be set
y, which allows FOO=y. It's possible to have FOO=y && BAZ=m, which
wouldn't be allowed if FOO depended directly on BAZ. In effect, the bool
promotes the tristate from m to y.
This ends up causing a problem with several menuconfigs that look like:
menuconfig BAR
bool
depends on BAZ [tristate]
if BAR
config FOO
tristate
endif
The solution used here is to add the dependencies of BAR to the if
statement, so that items in the if block will gain a direct
non-bool-promoted dependency on BAZ. This is how it would work if a menu
was used instead of an if block.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Jeff Garzik <jeff@garzik.org> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Dickins [Wed, 27 Jun 2007 21:09:53 +0000 (14:09 -0700)]
mm: kill validate_anon_vma to avoid mapcount BUG
validate_anon_vma gave a useful check on the integrity of the anon_vma list
when Andrea was developing obj rmap; but it was not enabled in SLES9
itself, nor in mainline, until Nick changed commented-out RMAP_DEBUG to
configurable CONFIG_DEBUG_VM in 2.6.17. Now Petr Vandrovec reports that
its BUG_ON(mapcount > 100000) can easily crash a CONFIG_DEBUG_VM=y system.
That limit was just an arbitrary number to protect against an infinite
loop. We could raise it to something enormous (depending on sizeof struct
vma and size of memory?); but I rather think validate_anon_vma has outlived
its usefulness, and is better just removed - which gives a magnificent
performance boost to anything like Petr's test program ;)
Of course, a very long anon_vma list is bad news for preemption latency,
and I believe there has been one recent report of such: let's not forget
that, but validate_anon_vma only makes it worse not better.
Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Petr Vandrovec <petr@vmware.com> Acked-by: Nick Piggin <npiggin@suse.de> Cc: Andrea Arcangeli <andrea@suse.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bjorn Helgaas [Wed, 27 Jun 2007 21:09:52 +0000 (14:09 -0700)]
PNP SMCf010 quirk: auto-config device if BIOS left it broken
Some HP firmware leaves the SMCf010 IRDA device incompletely configured, or
reports the wrong resources in _CRS. As a workaround, when we find such a
device, try to auto-configure the device.
This ignores the _CRS data, picks a config from _PRS, and runs _SRS to
configure the device. This makes smsc-ircc2 work correctly with PNP
resources (with no preconfiguration!) on all the machines I tested.
I think Windows does something like this by default for all devices,
so we should consider doing the same thing in Linux.
This patch addresses part of the 2.6.22 regression:
"no irda0 interface (2.6.21 was OK), smsc does not find chip"
It fixes smsc-ircc2 PNP device detection on HP nc6000, nc6220, nw8000,
nw8240, and possibly other machines.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: "Linus Walleij (LD/EAB)" <linus.walleij@ericsson.com> Cc: Andrey Borzenkov <arvidjaar@mail.ru> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bjorn Helgaas [Wed, 27 Jun 2007 21:09:50 +0000 (14:09 -0700)]
smsc-ircc2: skip preconfiguration for PNP devices
If we rely on the device resources from PNPBIOS, we also have to rely on
the BIOS to configure any bridges on the way to the device.
Using the PNPBIOS resources but changing the configuration of a bridge
behind the back of the firmware is likely to make things inconsistent.
This patch addresses part of the 2.6.22 regression:
"no irda0 interface (2.6.21 was OK), smsc does not find chip"
It fixes smsc-ircc2 PNP device detection on HP nx5000 laptops.
Other laptops, including HP nc6000, HP nc8000, HP nw8000, and Toshiba
Portege 4000, still need PNP quirks to make this work.
With "smsc-ircc2.nopnp", we do the legacy device probe, including manual
bridge preconfiguration, as before.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Samuel Ortiz <samuel@sortiz.org> Acked-by: "Linus Walleij (LD/EAB)" <linus.walleij@ericsson.com> Cc: Andrey Borzenkov <arvidjaar@mail.ru> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Wed, 27 Jun 2007 21:09:49 +0000 (14:09 -0700)]
mtrr/cyrix: fix sections
main.c::mtrr_add() or mtrr_del() [exported]
calls main.c::mtrr_add_page() or mtrr_del_page() or mtrr_restore() [resume]
calls main.c::set_mtrr()
calls main.c::ipi_handler()
calls main.c::mtrr_if->set_all() == which can be cyrix_set_all
WARNING: arch/i386/kernel/built-in.o(.text+0x8657): Section mismatch: reference to .init.data: (between 'cyrix_set_all' and 'centaur_get_free_region')
WARNING: arch/i386/kernel/built-in.o(.text+0x866b): Section mismatch: reference to .init.data: (between 'cyrix_set_all' and 'centaur_get_free_region')
WARNING: arch/i386/kernel/built-in.o(.text+0x867e): Section mismatch: reference to .init.data: (between 'cyrix_set_all' and 'centaur_get_free_region')
WARNING: arch/i386/kernel/built-in.o(.text+0x8684): Section mismatch: reference to .init.data: (between 'cyrix_set_all' and 'centaur_get_free_region')
WARNING: arch/i386/kernel/built-in.o(.text+0x868a): Section mismatch: reference to .init.data: (between 'cyrix_set_all' and 'centaur_get_free_region')
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Halcrow [Wed, 27 Jun 2007 21:09:45 +0000 (14:09 -0700)]
zero out last page for llseek/write
When one llseek's past the end of the file and then writes, every page past
the previous end of the file should be cleared. Trevor found that the code,
as is, does not assure that the very last page is always cleared. This patch
takes care of that.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Halcrow [Wed, 27 Jun 2007 21:09:44 +0000 (14:09 -0700)]
eCryptfs: initialize crypt_stat in setattr
Recent changes in eCryptfs have made it possible to get to ecryptfs_setattr()
with an uninitialized crypt_stat struct. This results in a wide and colorful
variety of unpleasantries. This patch properly initializes the crypt_stat
structure in ecryptfs_setattr() when it is necessary to do so.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Halcrow [Wed, 27 Jun 2007 21:09:44 +0000 (14:09 -0700)]
eCryptfs: fix write zeros behavior
This patch fixes the processes involved in wiping regions of the data during
truncate and write events, fixing a kernel hang in 2.6.22-rc4 while assuring
that zero values are written out to the appropriate locations during events in
which the i_size will change.
The range passed to ecryptfs_truncate() from ecryptfs_prepare_write() includes
the page that is the object of ecryptfs_prepare_write(). This leads to a
kernel hang as read_cache_page() is executed on the same page in the
ecryptfs_truncate() execution path. This patch remedies this by limiting the
range passed to ecryptfs_truncate() so as to exclude the page that is the
object of ecryptfs_prepare_write(); it also adds code to
ecryptfs_prepare_write() to zero out the region of its own page when writing
past the i_size position. This patch also modifies ecryptfs_truncate() so
that when a file is truncated to a smaller size, eCryptfs will zero out the
contents of the new last page from the new size through to the end of the last
page.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Kumar Gala [Thu, 28 Jun 2007 18:26:06 +0000 (13:26 -0500)]
phy: Fix phy_id for Vitesse 824x PHY
The phy_id specified for the Vitesse 824x PHY would never match because
it was expecting bits to be set that would be masked by the phy_id_mask.
Fix the phy_id so it will match properly, and changed the mdio_bus_match
to mask both the driver and devices phy_id with the mask so we dont have
this issue in the future.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Dan Williams [Mon, 18 Jun 2007 16:01:12 +0000 (12:01 -0400)]
[PATCH] libertas: fix WPA associations by handling ENABLE_RSN correctly
Don't clobber the firmware's internal state machine by setting
ENABLE_RSN more than once during the 4-way handshake. Check what
the ENABLE_RSN status is and only set if it should be changed.
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Linus Torvalds [Wed, 27 Jun 2007 17:04:02 +0000 (10:04 -0700)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] Make SN2 PCI code use ioremap rather than manually mangle the address
[IA64] Force error to surface in nofault code
[IA64] change sh_change_coherence oemcall to use nolock
[IA64] remove duplicate header include line
[IA64] Correct unwind validation code
[IA64] is_power_of_2-ia64/mm/hugetlbpage.c
If sky2 device poll routine is called from netpoll_send_skb, it would
deadlock. The netpoll_send_skb held the netif_tx_lock, and the poll
routine could acquire it to clean up skb's. Other drivers might use
same locking model.
The driver is correct, netpoll should not introduce more locking
problems than it causes already. So change the code to drop lock
before calling poll handler.
Signed-off-by: Stephen Hemminger <shemminger@linux.foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>