]> pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years ago[POWERPC] mpc5200: add gpiolib support for mpc5200
s.hauer@pengutronix.de [Fri, 25 Apr 2008 10:56:04 +0000 (20:56 +1000)]
[POWERPC] mpc5200: add gpiolib support for mpc5200

This patch adds gpiolib support for mpc5200 SOCs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
17 years ago[POWERPC] mpc5200: add interrupt type function
Sascha Hauer [Tue, 15 Apr 2008 15:29:54 +0000 (01:29 +1000)]
[POWERPC] mpc5200: add interrupt type function

Add a set_type function for external (GPIO) interrupts.

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
17 years ago[POWERPC] mpc5200: Fix unterminated of_device_id table
Grant Likely [Tue, 29 Apr 2008 12:40:37 +0000 (06:40 -0600)]
[POWERPC] mpc5200: Fix unterminated of_device_id table

If CONFIG_PPC_MPC5121 is not set, then the of_device_id table for the
mpc5200 serial driver will not get terminated with a NULL entry.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
17 years agoblock: Skip I/O merges when disabled
Alan D. Brunelle [Tue, 29 Apr 2008 12:44:19 +0000 (14:44 +0200)]
block: Skip I/O merges when disabled

The block I/O + elevator + I/O scheduler code spend a lot of time trying
to merge I/Os -- rightfully so under "normal" circumstances. However,
if one were to know that the incoming I/O stream was /very/ random in
nature, the cycles are wasted.

This patch adds a per-request_queue tunable that (when set) disables
merge attempts (beyond the simple one-hit cache check), thus freeing up
a non-trivial amount of CPU cycles.

Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: add large command support
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:39 +0000 (09:54 +0200)]
block: add large command support

This patch changes rq->cmd from the static array to a pointer to
support large commands.

We rarely handle large commands. So for optimization, a struct request
still has a static array for a command. rq_init sets rq->cmd pointer
to the static array.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: replace sizeof(rq->cmd) with BLK_MAX_CDB
FUJITA Tomonori [Tue, 29 Apr 2008 12:37:52 +0000 (14:37 +0200)]
block: replace sizeof(rq->cmd) with BLK_MAX_CDB

This is a preparation for changing rq->cmd from the static array to a
pointer.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoide: use blk_rq_init() to initialize the request
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:38 +0000 (09:54 +0200)]
ide: use blk_rq_init() to initialize the request

This converts ide to use blk_rq_init to initialize the request.

This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: use blk_rq_init() to initialize the request
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:37 +0000 (09:54 +0200)]
block: use blk_rq_init() to initialize the request

Any path needs to call it to initialize the request.

This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: rename and export rq_init()
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:36 +0000 (09:54 +0200)]
block: rename and export rq_init()

This rename rq_init() blk_rq_init() and export it. Any path that hands
the request to the block layer needs to call it to initialize the
request.

This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: no need to initialize rq->cmd with blk_get_request
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:36 +0000 (09:54 +0200)]
block: no need to initialize rq->cmd with blk_get_request

blk_get_request initializes rq->cmd (rq_init does) so the users don't
need to do that.

The purpose of this patch is to remove sizeof(rq->cmd) and &rq->cmd,
as a preparation for large command support, which changes rq->cmd from
the static array to a pointer. sizeof(rq->cmd) will not make sense and
&rq->cmd won't work.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: no need to initialize rq->cmd in prepare_flush_fn hook
FUJITA Tomonori [Tue, 29 Apr 2008 07:54:35 +0000 (09:54 +0200)]
block: no need to initialize rq->cmd in prepare_flush_fn hook

The block layer initializes rq->cmd (queue_flush calls rq_init) so
prepare_flush_fn hooks don't need to do that.

The purpose of this patch is to remove sizeof(rq->cmd), as a
preparation for large command support, which changes rq->cmd from the
static array to a pointer. sizeof(rq->cmd) will not make sense.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline
Adrian Bunk [Tue, 29 Apr 2008 07:49:06 +0000 (09:49 +0200)]
block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline

This patch fixes the following build error with UML and gcc 4.3:

<--  snip  -->

...
  CC      block/blk-barrier.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c: In function ‘blk_do_ordered’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:252: sorry, unimplemented: called from here
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:253: sorry, unimplemented: called from here
make[2]: *** [block/blk-barrier.o] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock/elevator.c:elv_rq_merge_ok() mustn't be inline
Adrian Bunk [Tue, 29 Apr 2008 07:49:05 +0000 (09:49 +0200)]
block/elevator.c:elv_rq_merge_ok() mustn't be inline

This patch fixes the following build error with UML and gcc 4.3:

<--  snip  -->

...
  CC      block/elevator.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/elevator.c: In function ‘elv_merge’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/elevator.c:73: sorry, unimplemented: inlining failed in call to ‘elv_rq_merge_ok’: function body not available
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/elevator.c:103: sorry, unimplemented: called from here
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/elevator.c:73: sorry, unimplemented: inlining failed in call to ‘elv_rq_merge_ok’: function body not available
/home/bunk/linux/kernel-2.6/git/linux-2.6/block/elevator.c:495: sorry, unimplemented: called from here
make[2]: *** [block/elevator.o] Error 1
make[1]: *** [block] Error 2

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: make queue flags non-atomic
Nick Piggin [Tue, 29 Apr 2008 12:48:33 +0000 (14:48 +0200)]
block: make queue flags non-atomic

We can save some atomic ops in the IO path, if we clearly define
the rules of how to modify the queue flags.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agox86: fix PCI MSI breaks when booting with nosmp
Jesse Barnes [Mon, 21 Apr 2008 21:14:44 +0000 (14:14 -0700)]
x86: fix PCI MSI breaks when booting with nosmp

set up sane APIC state even in the nosmp case.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: vget_cycles() __always_inline
Hugh Dickins [Sat, 26 Apr 2008 23:39:36 +0000 (00:39 +0100)]
x86: vget_cycles() __always_inline

Mark vget_cycles() as __always_inline, so gcc is never tempted to make
the vsyscall vread_tsc() dive into kernel text, with resulting SIGSEGV.

This was a self-inflicted wound: I've not seen that happen with unhacked
sources; but for debug reasons I'd changed my x86/Makefile to compile
no-unit-at-a-time, and that in conjunction with OPTIMIZE_INLINING=y
ended up with vget_cycles() in kernel text.  Perhaps it can happen
in other ways: safer to use __always_inline.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: add more boot protocol documentation
Ian Campbell [Sun, 27 Apr 2008 11:21:11 +0000 (12:21 +0100)]
x86: add more boot protocol documentation

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agobootprotocol: cleanup
Ingo Molnar [Sat, 26 Apr 2008 21:14:36 +0000 (23:14 +0200)]
bootprotocol: cleanup

Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: fix warning in "x86: clean up vSMP detection"
Alexander van Heukelum [Wed, 16 Apr 2008 16:45:35 +0000 (18:45 +0200)]
x86: fix warning in "x86: clean up vSMP detection"

The function detect_vsmp_box is a void function in the PCI case.
Change the !PCI stub to void too.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
17 years agox86: !x & y typo in mtrr code
Harvey Harrison [Sun, 27 Apr 2008 04:00:17 +0000 (21:00 -0700)]
x86: !x & y typo in mtrr code

As written, this can never be true.

Spotted by the Sparse checker.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agoatm: ambassador: vcc_sf semaphore to mutex
Daniel Walker [Tue, 29 Apr 2008 10:39:29 +0000 (03:39 -0700)]
atm: ambassador: vcc_sf semaphore to mutex

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoMAINTAINERS: The socketcan-core list is subscribers-only.
Pavel Emelyanov [Tue, 29 Apr 2008 10:37:41 +0000 (03:37 -0700)]
MAINTAINERS: The socketcan-core list is subscribers-only.

When I posted a copy_to_user fixes, the list daemon refused to accept
the Cc: <this-list>, because I was not a subscriber.

I found, that other lists with such a feature are marked respectively
in the MAINTAINERS file.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonetfilter: nf_conntrack: padding breaks conntrack hash on ARM
Philip Craig [Tue, 29 Apr 2008 10:35:10 +0000 (03:35 -0700)]
netfilter: nf_conntrack: padding breaks conntrack hash on ARM

commit 0794935e "[NETFILTER]: nf_conntrack: optimize hash_conntrack()"
results in ARM platforms hashing uninitialised padding.  This padding
doesn't exist on other architectures.

Fix this by replacing NF_CT_TUPLE_U_BLANK() with memset() to ensure
everything is initialised.  There were only 4 bytes that
NF_CT_TUPLE_U_BLANK() wasn't clearing anyway (or 12 bytes on ARM).

Signed-off-by: Philip Craig <philipc@snapgear.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoipv4: Update MTU to all related cache entries in ip_rt_frag_needed()
Timo Teras [Tue, 29 Apr 2008 10:32:25 +0000 (03:32 -0700)]
ipv4: Update MTU to all related cache entries in ip_rt_frag_needed()

Add struct net_device parameter to ip_rt_frag_needed() and update MTU to
cache entries where ifindex is specified. This is similar to what is
already done in ip_rt_redirect().

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agosch_sfq: use del_timer_sync() in sfq_destroy()
Jarek Poplawski [Tue, 29 Apr 2008 10:29:03 +0000 (03:29 -0700)]
sch_sfq: use del_timer_sync() in sfq_destroy()

Let's delete timer reliably in sfq_destroy().

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonet: Add compat support for getsockopt (MCAST_MSFILTER)
David L Stevens [Tue, 29 Apr 2008 10:23:22 +0000 (03:23 -0700)]
net: Add compat support for getsockopt (MCAST_MSFILTER)

This patch adds support for getsockopt for MCAST_MSFILTER for
both IPv4 and IPv6. It depends on the previous setsockopt patch,
and uses the same method.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonet: Several cleanups for the setsockopt compat support.
David L Stevens [Tue, 29 Apr 2008 10:23:00 +0000 (03:23 -0700)]
net: Several cleanups for the setsockopt compat support.

1) added missing "__user" for kgsr and kgf pointers
2) verify read for only GROUP_FILTER_SIZE(0). The group_filter
        structure definition (via RFC) includes space for one source
        in the source list array, but that source need not be present.
        So, sizeof(group_filter) > GROUP_FILTER_SIZE(0). Fixed
        the user read-check for minimum length to use the smaller size.
3) remove unneeded "&" for gf_slist addresses

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoipvs: fix oops in backup for fwmark conn templates
Julian Anastasov [Tue, 29 Apr 2008 10:21:23 +0000 (03:21 -0700)]
ipvs: fix oops in backup for fwmark conn templates

Fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=10556
where conn templates with protocol=IPPROTO_IP can oops backup box.

        Result from ip_vs_proto_get() should be checked because
protocol value can be invalid or unsupported in backup. But
for valid message we should not fail for templates which use
IPPROTO_IP. Also, add checks to validate message limits and
connection state. Show state NONE for templates using IPPROTO_IP.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agosparc64: remove duplicated include
Huang Weiyi [Tue, 29 Apr 2008 10:19:38 +0000 (03:19 -0700)]
sparc64: remove duplicated include

Remove dulicated include file <asm/timer.h> in arch/sparc64/kernel/smp.c.

Signed-off-by: Huang Weiyi <hwy@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agobridge: kernel panic when unloading bridge module
Bodo Stroesser [Tue, 29 Apr 2008 10:18:13 +0000 (03:18 -0700)]
bridge: kernel panic when unloading bridge module

There is a race condition when unloading bridge and netfilter.

The problem happens if __fake_rtable is in use by a skb
coming in, while someone starts to unload bridge.ko.
br_netfilter_fini() is called at the beginning of unload
in br_deinit() while skbs still are being forwarded and
transferred to local ip stack. Thus there is a possibility
of the __fake_rtable pointer not being removed in a skb that
goes up to ip stack. This results in a kernel panic, as
ip_rcv() calls the input-function of __fake_rtable, which
is NULL.

Moving the call of br_netfilter_fini() to the end of
br_deinit() solves the problem.

Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agobridge: fix error handling in br_add_if()
Volodymyr G Lukiianyk [Tue, 29 Apr 2008 10:17:42 +0000 (03:17 -0700)]
bridge: fix error handling in br_add_if()

When device is added to bridge its refcnt is incremented (in new_nbp()), but if
error occurs during further br_add_if() operations this counter is not
decremented back. Fix it by adding dev_put() call in the error path.

Signed-off-by: Volodymyr G Lukiianyk <volodymyrgl@gmail.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonetfilter: {nfnetlink,ip,ip6}_queue: fix skb_over_panic when enlarging packets
Arnaud Ebalard [Tue, 29 Apr 2008 10:16:34 +0000 (03:16 -0700)]
netfilter: {nfnetlink,ip,ip6}_queue: fix skb_over_panic when enlarging packets

While reinjecting *bigger* modified versions of IPv6 packets using
libnetfilter_queue, things work fine on a 2.6.24 kernel (2.6.22 too)
but I get the following on recents kernels (2.6.25, trace below is
against today's net-2.6 git tree):

skb_over_panic: text:c04fddb0 len:696 put:632 head:f7592c00 data:f7592c00 tail:0xf7592eb8 end:0xf7592e80 dev:eth0
------------[ cut here ]------------
invalid opcode: 0000 [#1] PREEMPT
Process sendd (pid: 3657, ti=f6014000 task=f77c31d0 task.ti=f6014000)
Stack: c071e638 c04fddb0 000002b8 00000278 f7592c00 f7592c00 f7592eb8 f7592e80
       f763c000 f6bc5200 f7592c40 f6015c34 c04cdbfc f6bc5200 00000278 f6015c60
       c04fddb0 00000020 f72a10c0 f751b420 00000001 0000000a 000002b8 c065582c
Call Trace:
 [<c04fddb0>] ? nfqnl_recv_verdict+0x1c0/0x2e0
 [<c04cdbfc>] ? skb_put+0x3c/0x40
 [<c04fddb0>] ? nfqnl_recv_verdict+0x1c0/0x2e0
 [<c04fd115>] ? nfnetlink_rcv_msg+0xf5/0x160
 [<c04fd03e>] ? nfnetlink_rcv_msg+0x1e/0x160
 [<c04fd020>] ? nfnetlink_rcv_msg+0x0/0x160
 [<c04f8ed7>] ? netlink_rcv_skb+0x77/0xa0
 [<c04fcefc>] ? nfnetlink_rcv+0x1c/0x30
 [<c04f8c73>] ? netlink_unicast+0x243/0x2b0
 [<c04cfaba>] ? memcpy_fromiovec+0x4a/0x70
 [<c04f9406>] ? netlink_sendmsg+0x1c6/0x270
 [<c04c8244>] ? sock_sendmsg+0xc4/0xf0
 [<c011970d>] ? set_next_entity+0x1d/0x50
 [<c0133a80>] ? autoremove_wake_function+0x0/0x40
 [<c0118f9e>] ? __wake_up_common+0x3e/0x70
 [<c0342fbf>] ? n_tty_receive_buf+0x34f/0x1280
 [<c011d308>] ? __wake_up+0x68/0x70
 [<c02cea47>] ? copy_from_user+0x37/0x70
 [<c04cfd7c>] ? verify_iovec+0x2c/0x90
 [<c04c837a>] ? sys_sendmsg+0x10a/0x230
 [<c011967a>] ? __dequeue_entity+0x2a/0xa0
 [<c011970d>] ? set_next_entity+0x1d/0x50
 [<c0345397>] ? pty_write+0x47/0x60
 [<c033d59b>] ? tty_default_put_char+0x1b/0x20
 [<c011d2e9>] ? __wake_up+0x49/0x70
 [<c033df99>] ? tty_ldisc_deref+0x39/0x90
 [<c033ff20>] ? tty_write+0x1a0/0x1b0
 [<c04c93af>] ? sys_socketcall+0x7f/0x260
 [<c0102ff9>] ? sysenter_past_esp+0x6a/0x91
 [<c05f0000>] ? snd_intel8x0m_probe+0x270/0x6e0
 =======================
Code: 00 00 89 5c 24 14 8b 98 9c 00 00 00 89 54 24 0c 89 5c 24 10 8b 40 50 89 4c 24 04 c7 04 24 38 e6 71 c0 89 44 24 08 e8 c4 46 c5 ff <0f> 0b eb fe 55 89 e5 56 89 d6 53 89 c3 83 ec 0c 8b 40 50 39 d0
EIP: [<c04ccdfc>] skb_over_panic+0x5c/0x60 SS:ESP 0068:f6015bf8

Looking at the code, I ended up in nfq_mangle() function (called by
nfqnl_recv_verdict()) which performs a call to skb_copy_expand() due to
the increased size of data passed to the function. AFAICT, it should ask
for 'diff' instead of 'diff - skb_tailroom(e->skb)'. Because the
resulting sk_buff has not enough space to support the skb_put(skb, diff)
call a few lines later, this results in the call to skb_over_panic().

The patch below asks for allocation of a copy with enough space for
mangled packet and the same amount of headroom as old sk_buff. While
looking at how the regression appeared (e2b58a67), I noticed the same
pattern in ipq_mangle_ipv6() and ipq_mangle_ipv4(). The patch corrects
those locations too.

Tested with bigger reinjected IPv6 packets (nfqnl_mangle() path), things
are ok (2.6.25 and today's net-2.6 git tree).

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonetfilter: x_tables: fix net namespace leak when reading /proc/net/xxx_tables_names
Pavel Emelyanov [Tue, 29 Apr 2008 10:15:35 +0000 (03:15 -0700)]
netfilter: x_tables: fix net namespace leak when reading /proc/net/xxx_tables_names

The seq_open_net() call should be accompanied with seq_release_net() one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agonetfilter: xt_TCPOPTSTRIP: signed tcphoff for ipv6_skip_exthdr() retval
Roel Kluin [Tue, 29 Apr 2008 10:15:10 +0000 (03:15 -0700)]
netfilter: xt_TCPOPTSTRIP: signed tcphoff for ipv6_skip_exthdr() retval

if tcphoff remains unsigned, a negative ipv6_skip_exthdr() return value will
go unnoticed,

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agotcp: Limit cwnd growth when deferring for GSO
John Heffner [Tue, 29 Apr 2008 10:13:52 +0000 (03:13 -0700)]
tcp: Limit cwnd growth when deferring for GSO

This fixes inappropriately large cwnd growth on sender-limited flows
when GSO is enabled, limiting cwnd growth to 64k.

Signed-off-by: John Heffner <johnwheffner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agotcp: Allow send-limited cwnd to grow up to max_burst when gso disabled
John Heffner [Tue, 29 Apr 2008 10:13:02 +0000 (03:13 -0700)]
tcp: Allow send-limited cwnd to grow up to max_burst when gso disabled

This changes the logic in tcp_is_cwnd_limited() so that cwnd may grow
up to tcp_max_burst() even when sk_can_gso() is false, or when
sysctl_tcp_tso_win_divisor != 0.

Signed-off-by: John Heffner <johnwheffner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit
Zhang Wei [Fri, 18 Apr 2008 20:33:48 +0000 (13:33 -0700)]
[RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit

Change RapidIO doorbell source and target ID field to 16-bit for
support large system size, which max rio devid is 65535.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add RapidIO connection info print out and re-training for broken connections
Zhang Wei [Fri, 18 Apr 2008 20:33:44 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO connection info print out and re-training for broken connections

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641
Zhang Wei [Fri, 18 Apr 2008 20:33:44 +0000 (13:33 -0700)]
[RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table
Zhang Wei [Fri, 18 Apr 2008 20:33:43 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add RapidIO node into MPC8641HPCN dts file
Zhang Wei [Fri, 18 Apr 2008 20:33:42 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO node into MPC8641HPCN dts file

This adds properties describing the RapidIO controller to the
device-tree source for the MPC8641HPCN board.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Auto-probe the RapidIO system size
Zhang Wei [Fri, 18 Apr 2008 20:33:42 +0000 (13:33 -0700)]
[RAPIDIO] Auto-probe the RapidIO system size

The RapidIO system size will auto probe in RIO setup.  The route table
and rionet_active in rionet.c are changed to be allocated dynamically
according to the size of the system.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add OF-tree support to RapidIO controller driver
Zhang Wei [Fri, 18 Apr 2008 20:33:41 +0000 (13:33 -0700)]
[RAPIDIO] Add OF-tree support to RapidIO controller driver

This initializes the RapidIO controller driver using addresses and
interrupt numbers obtained from the firmware device tree, rather than
using hardcoded constants.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add RapidIO multi mport support
Zhang Wei [Fri, 18 Apr 2008 20:33:41 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO multi mport support

The original RapidIO driver suppose there is only one mpc85xx RIO controller
in system.  So, some data structures are defined as mpc85xx_rio global, such
as 'regs_win', 'dbell_ring', 'msg_tx_ring'.  Now, I changed them to mport's
private members.  And you can define multi RIO OF-nodes in dts file for multi
RapidIO controller in one processor, such as PCI/PCI-Ex host controllers in
Freescale's silicon.  And the mport operation function declaration should be
changed to know which RapidIO controller is target.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc
Zhang Wei [Fri, 18 Apr 2008 20:33:40 +0000 (13:33 -0700)]
[RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Add RapidIO option to kernel configuration
Zhang Wei [Fri, 18 Apr 2008 20:33:39 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO option to kernel configuration

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[RAPIDIO] Change RIO function mpc85xx_ to fsl_
Zhang Wei [Fri, 18 Apr 2008 20:33:38 +0000 (13:33 -0700)]
[RAPIDIO] Change RIO function mpc85xx_ to fsl_

The driver is suitable for the Freescale MPC8641 processor as well as
85xx processors, so this changes the mpc85xx prefix to fsl.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agosparc: Add kgdb support.
David S. Miller [Tue, 29 Apr 2008 09:38:50 +0000 (02:38 -0700)]
sparc: Add kgdb support.

Current limitations:

1) On SMP single stepping has some fundamental issues,
   shared with other sw single-step architectures such
   as mips and arm.

2) On 32-bit sparc we don't support SMP kgdb yet.  That
   requires some reworking of the IPI mechanisms and
   infrastructure on that platform.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agokgdbts: Sparc needs sstep emulation.
David S. Miller [Tue, 29 Apr 2008 08:36:14 +0000 (01:36 -0700)]
kgdbts: Sparc needs sstep emulation.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agosparc32: Kill smp_message_pass() and related code.
David S. Miller [Tue, 29 Apr 2008 08:14:10 +0000 (01:14 -0700)]
sparc32: Kill smp_message_pass() and related code.

Completely unused, and it just makes the SMP message
passing code on 32-bit sparc look more complex than
it is.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoblock: add dma alignment and padding support to blk_rq_map_kern
FUJITA Tomonori [Fri, 25 Apr 2008 10:47:50 +0000 (12:47 +0200)]
block: add dma alignment and padding support to blk_rq_map_kern

This patch adds bio_copy_kern similar to
bio_copy_user. blk_rq_map_kern uses bio_copy_kern instead of
bio_map_kern if necessary.

bio_copy_kern uses temporary pages and the bi_end_io callback frees
these pages. bio_copy_kern saves the original kernel buffer at
bio->bi_private it doesn't use something like struct bio_map_data to
store the information about the caller.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agounexport blk_max_pfn
Adrian Bunk [Fri, 25 Apr 2008 10:46:58 +0000 (12:46 +0200)]
unexport blk_max_pfn

blk_max_pfn can now be unexported.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agops3disk: Remove superfluous cast
Geert Uytterhoeven [Fri, 25 Apr 2008 10:46:20 +0000 (12:46 +0200)]
ps3disk: Remove superfluous cast

As ps3disk is a ppc64-only driver, sector_t equals to unsigned long, and the
cast is not needed.

Reuse in another (possibly 32-bit) driver is protected by the safety net called
`compiler warning' (with the cast, it may silently truncate to 32-bit).
If sector_t ever changes, we will get a compiler warning as well (with the
cast, we won't).

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoblock: make rq_init() do a full memset()
FUJITA Tomonori [Fri, 25 Apr 2008 10:26:28 +0000 (12:26 +0200)]
block: make rq_init() do a full memset()

This requires moving rq_init() from get_request() to blk_alloc_request().
The upside is that we can now require an rq_init() from any path that
wishes to hand the request to the block layer.

rq_init() will be exported for the code that uses struct request
without blk_get_request.

This is a preparation for large command support, which needs to
initialize struct request in a proper way (that is, just doing a
memset() will not work).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agorelay: fix splice problem
Tom Zanussi [Thu, 24 Apr 2008 10:52:20 +0000 (12:52 +0200)]
relay: fix splice problem

Splice isn't always incrementing the ppos correctly, which broke
relay splice.

Signed-off-by: Tom Zanussi <zanussi@comcast.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17 years agoACPICA: always disable GPE when requested
Damián Viano [Tue, 29 Apr 2008 07:32:25 +0000 (03:32 -0400)]
ACPICA: always disable GPE when requested

acpi_ev_disable_gpe() has an optimization where it doesn't disable
a GPE that it "doesn't have to".  Unfortunately, it can get tricked
by AML that scribbles on register state behind its back.  So when asked
to disable a GPE, simply do it -- a redundant register write
in the common case is a fair price to pay to be bomb-proof
for the rare cases.

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

Signed-off-by: Damián Viano <des@debian.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPBIOS: remove include/linux/pnpbios.h
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:42 +0000 (16:34 -0600)]
PNPBIOS: remove include/linux/pnpbios.h

The contents of include/linux/pnpbios.h are used only inside the PNPBIOS
backend, so this file doesn't need to be visible outside PNP.

This patch moves the contents into an existing PNPBIOS-specific file,
drivers/pnp/pnpbios/pnpbios.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoISAPNP: remove unused pnp_dev->regs field
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:41 +0000 (16:34 -0600)]
ISAPNP: remove unused pnp_dev->regs field

The "regs" field in struct pnp_dev is set but never read, so remove it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make interfaces private to the PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:40 +0000 (16:34 -0600)]
PNP: make interfaces private to the PNP core

The interfaces for registering protocols, devices, cards,
and resource options should only be used inside the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: move _CRS/_PRS warnings closer to the action
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:39 +0000 (16:34 -0600)]
PNPACPI: move _CRS/_PRS warnings closer to the action

Move warnings about _CRS and _PRS problems to the place where we
actually make the ACPI calls.  Then we don't have to pass around
acpi_status values any more than necessary.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoISAPNP: fold isapnp_read_resources() back into isapnp_get_resources()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:38 +0000 (16:34 -0600)]
ISAPNP: fold isapnp_read_resources() back into isapnp_get_resources()

isapnp_get_resources() does very little besides call
isapnp_read_resources(), so just fold them back together.

Based on a patch by Rene Herman <rene.herman@gmail.com>

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make generic pnp_add_mem_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:37 +0000 (16:34 -0600)]
PNP: make generic pnp_add_mem_resource()

Add a pnp_add_mem_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make generic pnp_add_io_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:36 +0000 (16:34 -0600)]
PNP: make generic pnp_add_io_resource()

Add a pnp_add_io_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make generic pnp_add_dma_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:35 +0000 (16:34 -0600)]
PNP: make generic pnp_add_dma_resource()

Add a pnp_add_dma_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make generic pnp_add_irq_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:34 +0000 (16:34 -0600)]
PNP: make generic pnp_add_irq_resource()

Add a pnp_add_irq_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add pnp_new_resource() to find a new unset pnp_resource
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:33 +0000 (16:34 -0600)]
PNP: add pnp_new_resource() to find a new unset pnp_resource

This encapsulates the code to locate a new pnp_resource of the
desired type.  Currently this uses the pnp_resource_table, but
it will soon change to find a resource in a linked list.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add pnp_resource index for ISAPNP
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:32 +0000 (16:34 -0600)]
PNP: add pnp_resource index for ISAPNP

Save the ISAPNP config register index in the struct pnp_resource.

We need this because it is important to write ISAPNP configuration
back to the same registers we read it from.  For example, if we
read valid regions from memory descriptors 0, 1, and 3, we'd
better write them back to the same registers, without compressing
them to descriptors 0, 1, and 2.

This was previously guaranteed by using the index into the
pnp_resource_table array as the ISAPNP config register index.
However, I am removing those fixed-size arrays, so we need to
save the ISAPNP register index elsewhere.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add pnp_get_pnp_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:31 +0000 (16:34 -0600)]
PNP: add pnp_get_pnp_resource()

In some places, we need to get the struct pnp_resource, not just
the struct resource, because ISAPNP needs to store the register
index in the pnp_resource.

I don't like pnp_get_pnp_resource() and hope that it is temporary,
but we need it for a little while.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add struct pnp_resource
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:30 +0000 (16:34 -0600)]
PNP: add struct pnp_resource

This patch adds a "struct pnp_resource".  This currently
contains only a struct resource, but we will soon need
additional PNP-specific information.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove pnp_resource_table references from resource decoders
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:29 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table references from resource decoders

This removes a few more references to the pnp_resource_table.
No functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: make pnp_resource_table private to PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:28 +0000 (16:34 -0600)]
PNP: make pnp_resource_table private to PNP core

There are no remaining references to the PNP_MAX_* constants or
the pnp_resource_table structure outside of the PNP core.  Make
them private to the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agortc: dont reference pnp_resource_table directly
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:27 +0000 (16:34 -0600)]
rtc: dont reference pnp_resource_table directly

pnp_resource_table is going away soon, so use the more
generic public interfaces instead.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove PNP_MAX_* uses
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:26 +0000 (16:34 -0600)]
PNP: remove PNP_MAX_* uses

Remove some PNP_MAX_* uses.  The pnp_resource_table isn't
dynamic yet, but with pnp_get_resource(), we can start moving
away from the table size constants.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:25 +0000 (16:34 -0600)]
PNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table from the
pnp_assign_resources() path and the /sys user interface path.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: convert encoders to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:24 +0000 (16:34 -0600)]
PNP: convert encoders to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.  This
path is used when telling a device what resources it should use.

This doesn't convert ISAPNP because ISA needs to know the config
register index in addition to the resource itself.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: convert resource checks to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:23 +0000 (16:34 -0600)]
PNP: convert resource checks to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: pass resources, not indexes, to pnp_check_port(), et al
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:22 +0000 (16:34 -0600)]
PNP: pass resources, not indexes, to pnp_check_port(), et al

The caller already has the struct resource pointer, so no need for
pnp_check_port(), pnp_check_mem(), etc., to look it up again.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: check for conflicts with all resources, not just earlier ones
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:21 +0000 (16:34 -0600)]
PNP: check for conflicts with all resources, not just earlier ones

This patch removes a use of "idx" in pnp_check_port() and similar
functions, in preparation for replacing idx with a pointer to the
resource itself.

I split this out because it changes the behavior slightly: we used
to check for conflicts only with earlier resources, e.g., we checked
resource 2 against resources 0 and 1 but not against 3, 4, etc.  Now
we will check against all resources except 2.

Since resources are assigned in ascending order, the old behavior
was probably safe, but I don't like to depend on that ordering.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: reduce redundancy in pnp_set_current_resources()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:20 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_set_current_resources()

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: reduce redundancy in pnp_check_port() and others
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:19 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_check_port() and others

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: reduce redundancy in pnp_assign_port() and others
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:18 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_assign_port() and others

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: use conventional "i" for loop indices
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:17 +0000 (16:34 -0600)]
PNP: use conventional "i" for loop indices

Cosmetic only: just use "i" instead of "tmp".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: convert resource accessors to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:16 +0000 (16:34 -0600)]
PNP: convert resource accessors to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove pnp_mem_flags() as an lvalue
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:15 +0000 (16:34 -0600)]
PNP: remove pnp_mem_flags() as an lvalue

A future change will change pnp_mem_flags() from a "#define that
simplifies to an lvalue" to "an inline function that returns the
flags value."

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add pnp_get_resource() interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:14 +0000 (16:34 -0600)]
PNP: add pnp_get_resource() interface

This adds a pnp_get_resource() that works the same way as
platform_get_resource().  This will enable us to consolidate
many pnp_resource_table references in one place, which will
make it easier to make the table dynamic.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: factor pnp_init_resource_table() and pnp_clean_resource_table()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:13 +0000 (16:34 -0600)]
PNP: factor pnp_init_resource_table() and pnp_clean_resource_table()

Move the common part of pnp_init_resource_table() and
pnp_clean_resource_table() into a new pnp_init_resource().
This reduces a little code duplication and will be
useful later to initialize an individual resource.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: use dev_printk when possible
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:12 +0000 (16:34 -0600)]
PNP: use dev_printk when possible

Use dev_printk() when possible for more informative error messages.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove unused interfaces using pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:11 +0000 (16:34 -0600)]
PNP: remove unused interfaces using pnp_resource_table

Rene Herman <rene.herman@gmail.com> recently removed the only in-tree
driver uses of:

    pnp_init_resource_table()
    pnp_manual_config_dev()
    pnp_resource_change()

in this change:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=109c53f840e551d6e99ecfd8b0131a968332c89f

These are no longer used in the PNP core either, so we can just remove
them completely.

It's possible that there are out-of-tree drivers that use these
interfaces.  They should be changed to either (1) use PNP quirks
to work around broken hardware or firmware, or (2) use the sysfs
interfaces to control resource usage from userspace.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove pnp_resource_table from internal pnp_clean_resource_table interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:10 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table from internal pnp_clean_resource_table interface

This changes pnp_clean_resource_table() to take a pnp_dev pointer
rather than a pnp_resource_table pointer.  This reduces the visibility
of pnp_resource_table and removes an opportunity for error in the
caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add pnp_init_resources(struct pnp_dev *) interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:09 +0000 (16:34 -0600)]
PNP: add pnp_init_resources(struct pnp_dev *) interface

Add pnp_init_resources(struct pnp_dev *) to replace
pnp_init_resource_table(), which takes a pointer to the
pnp_resource_table itself.  Passing only the pnp_dev * reduces
the possibility for error in the caller and removes the
pnp_resource_table implementation detail from the interface.

Even though pnp_init_resource_table() is exported, I did not
export pnp_init_resources() because it is used only by the PNP
core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add debug when assigning PNP resources
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:08 +0000 (16:34 -0600)]
PNP: add debug when assigning PNP resources

This patch adds code to dump PNP resources before and after
assigning resources and before writing them to the device.

This is enabled by CONFIG_PNP_DEBUG=y.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add debug output to encoders
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:07 +0000 (16:34 -0600)]
PNP: add debug output to encoders

Add debug output to encoders (enabled by CONFIG_PNP_DEBUG).  This
uses dev_printk, so I had to add pnp_dev arguments at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove more pnp_resource_table arguments
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:06 +0000 (16:34 -0600)]
PNP: remove more pnp_resource_table arguments

Stop passing around struct pnp_resource_table pointers.  In most cases,
the caller doesn't need to know how the resources are stored inside
the struct pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: remove pnp_resource_table from internal get/set interfaces
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:05 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table from internal get/set interfaces

When we call protocol->get() and protocol->set() methods, we currently
supply pointers to both the pnp_dev and the pnp_resource_table even
though the pnp_resource_table should always be the one associated with
the pnp_dev.

This removes the pnp_resource_table arguments to make it clear that
these methods only operate on the specified pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNP: add debug output to option registration
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:04 +0000 (16:34 -0600)]
PNP: add debug output to option registration

Add debug output to resource option registration functions (enabled
by CONFIG_PNP_DEBUG).  This uses dev_printk, so I had to add pnp_dev
arguments at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: pass pnp_dev instead of acpi_handle
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:03 +0000 (16:34 -0600)]
PNPACPI: pass pnp_dev instead of acpi_handle

Pass the pnp_dev pointer when possible instead of the acpi_handle.
This allows better error messages and reduces the chance of error
in the caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: extend irq_flags() to set IORESOURCE_IRQ_SHAREABLE when appropriate
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:02 +0000 (16:34 -0600)]
PNPACPI: extend irq_flags() to set IORESOURCE_IRQ_SHAREABLE when appropriate

This simplifies IRQ resource parsing slightly by computing all the
IORESOURCE_IRQ_* flags at the same time.

This also keeps track of shareability information when parsing options
from _PRS.  Previously we ignored shareability in _PRS.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:01 +0000 (16:34 -0600)]
PNPACPI: hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource()

Hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource() into its
caller.  This makes pnpacpi_parse_allocated_dmaresource() more similar
to pnpbios_parse_allocated_dmaresource().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: use temporaries to reduce repetition
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:00 +0000 (16:34 -0600)]
PNPACPI: use temporaries to reduce repetition

No functional change, just fewer words and fewer chances for
transcription errors.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPNPACPI: pnpacpi_encode_ext_irq() wrongly set "irq" instead of "extended_irq"
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:59 +0000 (16:33 -0600)]
PNPACPI: pnpacpi_encode_ext_irq() wrongly set "irq" instead of "extended_irq"

pnpacpi_encode_ext_irq() should set resource->data.extended_irq, not
resource->data.irq.

This has been wrong since at least 2.6.12.  I haven't seen any bug
reports, but it's clearly incorrect.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>