Commit Graph

74617 Commits

Author SHA1 Message Date
Richard Knutsson
8142294dda [MIPS] Compliment va_start() with va_end().
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:15 +00:00
Thomas Bogendoerfer
5b3af8f19f [MIPS] IP22: Fix broken eeprom access by using __raw_readl/__raw_writel
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:14 +00:00
Thomas Bogendoerfer
68de480372 [MIPS] IP22: Fix broken EISA interrupt setup by switching to generic i8259
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:14 +00:00
Ralf Baechle
cce335ae47 [MIPS] 64-bit Sibyte kernels need DMA32.
Sibyte SOCs only have 32-bit PCI.  Due to the sparse use of the address
space only the first 1GB of memory is mapped at physical addresses
below 1GB.  If a system has more than 1GB of memory 32-bit DMA will
not be able to reach all of it.

For now this patch is good enough to keep Sibyte users happy but it seems
eventually something like swiotlb will be needed for Sibyte.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:14 +00:00
Ralf Baechle
940f6b48a1 [MIPS] Only build r4k clocksource for systems that work ok with it.
In particular as-is it's not suited for multicore and mutiprocessors
systems where there is on guarantee that the counter are synchronized
or running from the same clock at all.  This broke Sibyte and probably
others since the "[MIPS] Handle R4000/R4400 mfc0 from count register."
commit.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:14 +00:00
Ralf Baechle
5aa85c9fc4 [MIPS] Handle R4000/R4400 mfc0 from count register.
The R4000 and R4400 have an errata where if the cp0 count register is read
in the exact moment when it matches the compare register no interrupt will
be generated.

This bug may be triggered if the cp0 count register is being used as
clocksource and the compare interrupt as clockevent.  So a simple
workaround is to avoid using the compare for both facilities on the
affected CPUs.

This is different from the workaround suggested in the old errata documents;
at some opportunity probably the official version should be implemented
and tested.  Another thing to find out is which processor versions
exactly are affected.  I only have errata documents upto R4400 V3.0
available so for the moment the code treats all R4000 and R4400 as broken.

This is potencially a problem for some machines that have no other decent
clocksource available; this workaround will cause them to fall back to
another clocksource, worst case the "jiffies" source.
2007-11-26 17:26:14 +00:00
Ralf Baechle
0f67e90e1c [MIPS] Fix possible hang in LL/SC futex loops.
The LL / SC loops in __futex_atomic_op() have the usual fixups necessary
for memory acccesses to userspace from kernel space installed:

        __asm__ __volatile__(
        "       .set    push                            \n"
        "       .set    noat                            \n"
        "       .set    mips3                           \n"
        "1:     ll      %1, %4  # __futex_atomic_op     \n"
        "       .set    mips0                           \n"
        "       " insn  "                               \n"
        "       .set    mips3                           \n"
        "2:     sc      $1, %2                          \n"
        "       beqz    $1, 1b                          \n"
        __WEAK_LLSC_MB
        "3:                                             \n"
        "       .set    pop                             \n"
        "       .set    mips0                           \n"
        "       .section .fixup,\"ax\"                  \n"
        "4:     li      %0, %6                          \n"
        "       j       2b                              \n"	<-----
        "       .previous                               \n"
        "       .section __ex_table,\"a\"               \n"
        "       "__UA_ADDR "\t1b, 4b                    \n"
        "       "__UA_ADDR "\t2b, 4b                    \n"
        "       .previous                               \n"
        : "=r" (ret), "=&r" (oldval), "=R" (*uaddr)
        : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT)
        : "memory");

The branch at the end of the fixup code, it goes back to the SC
instruction, no matter if the fault was first taken by the LL or SC
instruction resulting in an endless loop which will only terminate if
the address become valid again due to another thread setting up an
accessible mapping and the CPU happens to execute the SC instruction
successfully which due to the preceeding ERET instruction of the fault
handler would only happen if UNPREDICTABLE instruction behaviour of the
SC instruction without a preceeding LL happens to favor that outcome.
But normally processes are nice, pass valid arguments and we were just
getting away with this.

Thanks to Kaz Kylheku <kaz@zeugmasystems.com> for providing the original
report and a test case.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:14 +00:00
Ralf Baechle
07500b0d85 [MIPS] Fix context DSP context / TLS pointer switching bug for new threads.
A new born thread starts execution not in schedule but rather in
ret_from_fork which results in it bypassing the part of the code to
load a new context written in C which are the DSP context and the
userlocal register which Linux uses for the TLS pointer.  Frequently
we were just getting away with this bug for a number of reasons:

 o Real world application scenarios are very unlikely to use clone or fork
   in blocks of DSP code.
 o Linux by default runs the child process right after the fork, so the
   child by luck will find all the right context in the DSP and userlocal
   registers.
 o So far the rdhwr instruction was emulated on all hardware so userlocal
   wasn't getting referenced at all and the emulation wasn't suffering
   from the issue since it gets it's value straight from the thread's
   thread_info.

Fixed by moving the code to load the context from switch_to() to
finish_arch_switch which will be called by newborn and old threads.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:13 +00:00
Ralf Baechle
98ce472181 [MIPS] IP32: More interrupt renumbering fixes.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:13 +00:00
Ralf Baechle
526a677069 [MIPS] time: MIPSsim's plat_time_init doesn't need to be irq safe.
It's running early during the bootup process so interrupts are still off.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:13 +00:00
Ralf Baechle
aea6863944 [MIPS] time: Fix negated condition in cevt-r4k driver.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:13 +00:00
Ralf Baechle
cfb6f26035 [MIPS] Fix pcspeaker build.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-11-26 17:26:13 +00:00
Tejun Heo
e190222d04 libata: bump transfer chunk size if it's odd
None of the drives I have follows what the standard says about
transfer chunk size.  Of the four SATA and six PATA ATAPI devices
tested, four ignore transfer chunk size completely and the ones which
honor it don't behave according to the spec when it's odd.

According to the spec, transfer chunk size can be odd if the amount of
data to transfer equals or is smaller than the chunk size and the
device can indicate the same odd number and transfer the whole thing
at one go with a pad byte appended.  However, in reality, none of the
drives I have does that.  They all indicate and transfer even number
of bytes one byte shorter than the chunk size first; then indicate and
transfer two bytes, which is clearly out of spec.

In addition to unnecessary second PIO data phase, this also creates a
weird problem when combined with SATA controllers which perform PIO
via DMA.  Some of these controllers use actualy number of bytes
received to update DMA pointer so chunks which are sized 4n + 2 makes
DMA pointer off by two bytes.  This causes data corruption and buffer
overruns.

This patch rounds nbytes up to the nearest even number such that ATAPI
devices don't split data transfer for the last odd byte.  This
shouldn't confuse controllers which depend on transfer chunk size as
devices will report the rounded-up number, actually transfer that much
and padding buffer is there to receive them.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-26 11:03:40 -05:00
sonic zhang
dc86f6d418 libata: Return proper ATA INT status in pata_bf54x driver
INT status can be OR.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-26 11:03:40 -05:00
Adrian Bunk
3660019e5f [IPV4]: Remove bogus ifdef mess in arp_process
The #ifdef's in arp_process() were not only a mess, they were also wrong 
in the CONFIG_NET_ETHERNET=n and (CONFIG_NETDEV_1000=y or 
CONFIG_NETDEV_10000=y) cases.

Since they are not required this patch removes them.

Also removed are some #ifdef's around #include's that caused compile 
errors after this change.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2007-11-26 23:17:53 +08:00
Herbert Xu
2d4baff8da [SKBUFF]: Free old skb properly in skb_morph
The skb_morph function only freed the data part of the dst skb, but leaked
the auxiliary data such as the netfilter fields.  This patch fixes this by
moving the relevant parts from __kfree_skb to skb_release_all and calling
it in skb_morph.

It also makes kfree_skbmem static since it's no longer called anywhere else
and it now no longer does skb_release_data.

Thanks to Yasuyuki KOZAKAI for finding this problem and posting a patch for
it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2007-11-26 23:11:19 +08:00
Philipp Zabel
fa7f1518e8 [ARM] 4662/1: Fix PXA serial driver compilation if SERIAL_PXA_CONSOLE is disabled
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:39:12 +00:00
Roel Kluin
1f809226b9 [ARM] PXA ssp: unlock when ssp tries to close an invalid port
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:39:04 +00:00
eric miao
52b2bd7f97 [ARM] 4654/1: pxa: update default MFP register value
1. update default MFPR value to drive strength fast 3mA and edge
   detection logic disabled

2. update impacted MFP_CFG_xxx() macros

Signed-off-by: bridge wu <bridge.wu@marvell.com>
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:38:57 +00:00
eric miao
43b35f104d [ARM] 4653/1: pxa: fix a gpio typo in mfp-pxa320.h
Signed-off-by: bridge wu <bridge.wu@marvell.com>
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:38:55 +00:00
eric miao
8854cb49a2 [ARM] 4652/1: pxa: fix a typo of pxa27x usb host clk definition
CKEN_USBHOST should be used instead of CKEN_USB for usb host

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:38:51 +00:00
eric miao
a892919856 [ARM] 4651/1: pxa: add PXA3xx specific IRQ definitions
add missing IRQ_xxx definitions for PXA3xx

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-11-26 14:38:46 +00:00
Pavel Emelyanov
218ad12f42 [IPV4]: Fix memory leak in inet_hashtables.h when NUMA is on
The inet_ehash_locks_alloc() looks like this:

#ifdef CONFIG_NUMA
	if (size > PAGE_SIZE)
		x = vmalloc(...);
	else
#endif
		x = kmalloc(...);

Unlike it, the inet_ehash_locks_alloc() looks like this:

#ifdef CONFIG_NUMA
	if (size > PAGE_SIZE)
		vfree(x);
	else
#else
		kfree(x);
#endif

The error is obvious - if the NUMA is on and the size
is less than the PAGE_SIZE we leak the pointer (kfree is
inside the #else branch).

Compiler doesn't warn us because after the kfree(x) there's
a "x = NULL" assignment, so here's another (minor?) bug: we 
don't set x to NULL under certain circumstances.

Boring explanation, I know... Patch explains it better.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2007-11-26 20:23:31 +08:00
Herbert Xu
8053fc3de7 [IPSEC]: Temporarily remove locks around copying of non-atomic fields
The change 050f009e16

	[IPSEC]: Lock state when copying non-atomic fields to user-space

caused a regression.

Ingo Molnar reports that it causes a potential dead-lock found by the
lock validator as it tries to take x->lock within xfrm_state_lock while
numerous other sites take the locks in opposite order.

For 2.6.24, the best fix is to simply remove the added locks as that puts
us back in the same state as we've been in for years.  For later kernels
a proper fix would be to reverse the locking order for every xfrm state
user such that if x->lock is taken together with xfrm_state_lock then
it is to be taken within it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2007-11-26 19:07:34 +08:00
Jeff Garzik
1e64166430 [SCSI] NCR5380: Fix bugs and canonicalize irq handler usage
* Always pass the same value to free_irq() that we pass to
  request_irq().  This fixes several bugs.

* Always call NCR5380_intr() with 'irq' and 'dev_id' arguments.

  Note, scsi_falcon_intr() is the only case now where dev_id is not the
  scsi_host.

* Always pass Scsi_Host to request_irq().  For most cases, the drivers
  already did so, and I merely neated the source code line.  In other
  cases, either NULL or a non-sensical value was passed, verified to be
  unused, then changed to be Scsi_Host in anticipation of the future.

In addition to the bugs fixes, this change makes the interface usage
consistent, which in turn enables the possibility of directly
referencing Scsi_Host from all NCR5380_intr() invocations.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2007-11-25 12:19:26 +02:00
Steve French
2b83457bde [CIFS] Fix check after use error in ACL code
Spotted by the coverity scanner.

CC: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2007-11-25 10:01:00 +00:00
Steve French
058250a0d5 Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6 2007-11-25 09:53:27 +00:00
Erez Zilber
a316b79c33 IB/iser: Add missing counter increment in iser_data_buf_aligned_len()
While adding sg chaining support to iSER, a "for" loop was replaced
with a "for_each_sg" loop. The "for" loop included the incrementation
of 2 variables. Only one of them is incremented in the current
"for_each_sg" loop. This caused iSER to think that all data is
unaligned, and all data was copied to aligned buffers.

This patch increments the missing counter inside the "for_each_sg"
loop whenever necessary.

Signed-off-by: Erez Zilber <erezz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-24 13:50:39 -08:00
Joachim Fenkes
3fe2ed344d IB/ehca: Fix static rate regression
Wrong choice of port number caused modify_qp() to fail -- fixed.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-24 13:47:59 -08:00
Jeff Garzik
a31e23e15c dmfe: checkpatch fix (add whitespace)
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-11-23 22:13:19 -05:00
Vitja Makarov
00ff49a91e Blackfin EMAC driver: fix bug - NAT doesn't work with bfin_mac driver
https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=23114&_forum_action=ForumMessageBrowse
Today I was dealing with the same problem, on my custom bf537 board, and bfin_mac driver.
I found that the problem is in setting ip_summed flag of skbuff structure,

Signed-off-by: Vitja Makarov <vitja.makarov@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:02 -05:00
Mike Frysinger
95af9feb49 Blackfin SMC91x Driver: punt CONFIG_BFIN -- we already have CONFIG_BLACKFIN
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:02 -05:00
Maxim Levitsky
65809b5125 NET: dmfe: don't access configuration space in D3 state
Accidently I reversed the order of pci_save_state and
 pci_set_power_state in .suspend()/.resume() callbacks

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Peter Korsgaard
7b31f7ffa9 smc911x: Fix multicast handling
smc911x_set_multicast_list fails to fill out the multicast hash table
correctly; Bit 1 was used rather than bit 5 to decide if the lower or
upper register should be used.

The function is at the same time cleaned up by calling ether_crc rather
than using it's own bit reversal table.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Stephen Hemminger
8b31cfbcd1 sky2: disable rx checksum on Yukon XL
The Marvell Yukon XL chipset appears to have a hardware glitch
where it will repeat the checksum of the last packet. Of course, this is
timing sensitive and only happens sometimes...

More info: http://bugzilla.kernel.org/show_bug.cgi?id=9381

As a workaround just disable hardware checksumming by default on
this chip version. The earlier workaround for PCIX, dual port
was also on Yukon XL so don't need to disable checksumming there.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Thomas Klein
58dd8258fc ehea: Reworked rcv queue handling to log only fatal errors
Prevent driver from brawly logging packet checksum errors.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Thomas Klein
7393b87c9a ehea: Improve tx packets counting
Using own tx_packets counter instead of firmware counters.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Peter Korsgaard
a9b121c4df smc911x: Fix unused variable warning.
The smc911x_local pointer in smc911x_rcv is only used in the SMC_USE_DMA
case. Move it under the #ifdef so GCC doesn't generate a warning in the
non-DMA case.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:01 -05:00
Peter Korsgaard
d0c4581b68 smc911x: Fix undefined CONFIG_ symbol warning
elif defined(CONFIG_*) should be used instead of elif CONFIG_*
so GCC doesn't give warnings about undefined symbols when the config
option is disabled.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:00 -05:00
Jiri Bohac
3defd0ee74 amd8111e: don't call napi_enable if configured w/o NAPI
The amd8111e network driver was broken by
bea3348eef, which makes the driver
call napi_enable() and napi_disable() even if the driver had been
configured without CONFIG_AMD8111E_NAPI, and thus
netif_napi_add() had not been called on initialization.
This triggers a BUG in napi_enable().

This patch fixes the problem. Please apply.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 22:09:00 -05:00
Jeff Garzik
2541d0ca7e pata_ali: trim trailing whitespace (fix checkpatch complaints)
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-11-23 21:08:42 -05:00
Peter Korsgaard
77b6901573 dm9601: Fix printk
A printk in the error handling code of dm9601.c was missing a newline.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 21:02:53 -05:00
Ayaz Abdulla
9e555930bd forcedeth boot delay fix
Fix a long boot delay in the forcedeth driver.  During initialization, the
timeout for the handshake between mgmt unit and driver can be very long.
The patch reduces the timeout by eliminating a extra loop around the
timeout logic.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9308

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Cc: Alex Howells <astinus@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 20:59:59 -05:00
Ayaz Abdulla
490dde8990 forcedeth: new mcp79 pci ids
This patch adds new device ids and features for mcp79 devices into the
forcedeth driver.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-11-23 20:54:01 -05:00
Benjamin Herrenschmidt
61dbcecef5 ibm_newemac: Fix possible lockup on close
It's a bad idea to call flush_scheduled_work from within a
netdev->stop because the linkwatch will occasionally take the
rtnl lock from a workqueue context, and thus that can deadlock.

This reworks things a bit in that area to avoid the problem.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 20:52:09 -05:00
Alan Cox
91e33d3109 pata_isapnp: Polled devices
If a card has no IRQ then pass no interrupt handler but allow polled
usage.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:33:27 -05:00
Alan Cox
22d5c760c8 pata_hpt37x: Fix cable detect bug spotted by Sergei
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:33:27 -05:00
Alan Cox
498222f323 pata_ali: Lots of problems still showing up with small ATAPI DMA
Hopefully there is a better long term solution but for now lets favour
reliability.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:33:27 -05:00
Alan Cox
8f59a13acc pata_ali: Add Mitac 8317 and derivatives
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:33:26 -05:00
Alan Cox
92c52c52e1 libata-core: List more documentation sources for reference
And next time I'll be able to find the ata tape spec easily...

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-23 19:33:26 -05:00