pandora-kernel.git
15 years ago[CIFS] add mount option to send mandatory rather than advisory locks
Steve French [Tue, 2 Dec 2008 17:24:33 +0000 (17:24 +0000)]
[CIFS] add mount option to send mandatory rather than advisory locks

Some applications/subsystems require mandatory byte range locks
(as is used for Windows/DOS/OS2 etc). Sending advisory (posix style)
byte range lock requests (instead of mandatory byte range locks) can
lead to problems for these applications (which expect that other
clients be prevented from writing to portions of the file which
they have locked and are updating).  This mount option allows
mounting cifs with the new mount option "forcemand" (or
"forcemandatorylock") in order to have the cifs client use mandatory
byte range locks (ie SMB/CIFS/Windows/NTFS style locks) rather than
posix byte range lock requests, even if the server would support
posix byte range lock requests.  This has no effect if the server
does not support the CIFS Unix Extensions (since posix style locks
require support for the CIFS Unix Extensions), but for mounts
to Samba servers this can be helpful for Wine and applications
that require mandatory byte range locks.

Acked-by: Jeff Layton <jlayton@redhat.com>
CC: Alexander Bokovoy <ab@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: make ipv6_connect take a TCP_Server_Info arg
Jeff Layton [Mon, 1 Dec 2008 23:42:33 +0000 (18:42 -0500)]
cifs: make ipv6_connect take a TCP_Server_Info arg

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: make ipv4_connect take a TCP_Server_Info arg
Jeff Layton [Mon, 1 Dec 2008 23:42:15 +0000 (18:42 -0500)]
cifs: make ipv4_connect take a TCP_Server_Info arg

In order to unify the smb_send routines, we need to reorganize the
routines that connect the sockets. Have ipv4_connect take a
TCP_Server_Info pointer and get the necessary fields from that.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: don't declare smb_vol info on the stack
Jeff Layton [Mon, 1 Dec 2008 23:41:49 +0000 (18:41 -0500)]
cifs: don't declare smb_vol info on the stack

struct smb_vol is fairly large, it's probably best to kzalloc it...

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: move allocation of new TCP_Server_Info into separate function
Jeff Layton [Mon, 1 Dec 2008 23:41:46 +0000 (18:41 -0500)]
cifs: move allocation of new TCP_Server_Info into separate function

Clean up cifs_mount a bit by moving the code that creates new TCP
sessions into a separate function. Have that function search for an
existing socket and then create a new one if one isn't found.

Also reorganize the initializion of TCP_Server_Info a bit to prepare
for cleanup of the socket connection code.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: account for IPv6 in ses->serverName and clean up netbios name handling
Jeff Layton [Mon, 1 Dec 2008 20:23:50 +0000 (15:23 -0500)]
cifs: account for IPv6 in ses->serverName and clean up netbios name handling

The current code for setting the session serverName is IPv4-specific.
Allow it to be an IPv6 address as well. Use NIP* macros to set the
format.

This also entails increasing the length of the serverName field, so
declare a new macro for RFC1001 name length and use it in the
appropriate places.

Finally, drop the unicode_server_Name field from TCP_Server_Info since
it's not used. We can add it back later if needed, but for now it just
wastes memory.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: make dnotify thread experimental code
Jeff Layton [Mon, 1 Dec 2008 20:23:50 +0000 (15:23 -0500)]
cifs: make dnotify thread experimental code

Now that tasks sleeping in wait_for_response will time out on their own,
we're not reliant on the dnotify thread to do this. Mark it as
experimental code for now.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: convert tcpSem to a mutex
Jeff Layton [Mon, 1 Dec 2008 12:09:36 +0000 (07:09 -0500)]
cifs: convert tcpSem to a mutex

Mutexes are preferred for single-holder semaphores...

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: take module reference when starting cifsd
Jeff Layton [Mon, 1 Dec 2008 12:09:35 +0000 (07:09 -0500)]
cifs: take module reference when starting cifsd

cifsd can outlive the last cifs mount. We need to hold a module
reference until it exits to prevent someone from unplugging
the module until we're ready.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: display addr and prefixpath options in /proc/mounts
Jeff Layton [Mon, 1 Dec 2008 12:09:35 +0000 (07:09 -0500)]
cifs: display addr and prefixpath options in /proc/mounts

Have cifs_show_options display the addr and prefixpath options in
/proc/mounts. Reduce struct dereferencing by adding some local
variables.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: remove unused SMB session pointer from struct mid_q_entry
Jeff Layton [Mon, 1 Dec 2008 12:09:34 +0000 (07:09 -0500)]
cifs: remove unused SMB session pointer from struct mid_q_entry

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agomlx4_en: Remove pauses module parameters.
Yevgeny Petrilin [Fri, 26 Dec 2008 02:20:13 +0000 (18:20 -0800)]
mlx4_en: Remove pauses module parameters.

They are controlled through Ethtool interface.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed Interrupt moderation module parameters
Yevgeny Petrilin [Fri, 26 Dec 2008 02:19:47 +0000 (18:19 -0800)]
mlx4_en: Removed Interrupt moderation module parameters

They are controlled through Ethtool interface, no need to have two
ways to modify them.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed redundant cq->armed flag
Yevgeny Petrilin [Fri, 26 Dec 2008 02:14:04 +0000 (18:14 -0800)]
mlx4_en: Removed redundant cq->armed flag

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Removed TX locking when polling TX cq
Yevgeny Petrilin [Fri, 26 Dec 2008 02:13:45 +0000 (18:13 -0800)]
mlx4_en: Removed TX locking when polling TX cq

There is no need to synchronize the polling with the transmit
function. The only place to synchronize is when we process
the cq from the transmit function. Also removed spin_lock_irq,
and using spin_trylock, if somebody else is already processing the cq,
no need to wait for it to finish.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Memory leak on completion queue free
Yevgeny Petrilin [Fri, 26 Dec 2008 02:13:20 +0000 (18:13 -0800)]
mlx4_en: Memory leak on completion queue free

If port is being destroyed without being activated before,
CQ resources are not freed.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'for-david' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
David S. Miller [Fri, 26 Dec 2008 02:10:12 +0000 (18:10 -0800)]
Merge branch 'for-david' of git://git./linux/kernel/git/chris/linux-2.6

15 years agomyri10ge: update driver version to 1.4.4-1.395
Brice Goglin [Fri, 26 Dec 2008 02:09:16 +0000 (18:09 -0800)]
myri10ge: update driver version to 1.4.4-1.395

Update myri10ge driver version to 1.4.4-1.395.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update firmware headers to 1.4.37
Brice Goglin [Fri, 26 Dec 2008 02:08:59 +0000 (18:08 -0800)]
myri10ge: update firmware headers to 1.4.37

Update myri10ge firmware headers to 1.4.37:
* Make each member of the error/cmd enum an initialized one, so there
  is a convenient numerical reference to look for reverse conversion.
* Add new MXGEFW_CMD_RELAX_RXBUFFER_ALIGNMENT command.
* Add new "features" field to mcp_header.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoforcedeth: don't poll NV event 36
Johannes Berg [Fri, 26 Dec 2008 02:07:50 +0000 (18:07 -0800)]
forcedeth: don't poll NV event 36

Polling doesn't seem to be necessary on my hardware, at
least I haven't seen any bad effects testing it a while.
Remove the polling so the CPU doesn't have to wake up a
hundred times per second.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/appletalk: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:04:51 +0000 (18:04 -0800)]
net/appletalk: Remove redundant test

atif is tested for being NULL twice, with the same effect in each case.  I
have kept the second test, as it seems to fit well with the comment above it.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/wan: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:44 +0000 (18:03 -0800)]
drivers/net/wan: Remove redundant test

arg is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:28 +0000 (18:03 -0800)]
drivers/net: Remove redundant test

In each case, ap is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/ehea: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:03:09 +0000 (18:03 -0800)]
drivers/net/ehea: Remove redundant test

In each case, vpage is checked not to be NULL just after it is initialized
at the beginning of each loop iteration.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/au1000_eth.c: Remove redundant test
Julia Lawall [Fri, 26 Dec 2008 02:02:49 +0000 (18:02 -0800)]
drivers/net/au1000_eth.c: Remove redundant test

phydev is checked to be not NULL a few lines above.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: ql_adapter_down() typo
Roel Kluin [Fri, 26 Dec 2008 01:23:50 +0000 (17:23 -0800)]
qlge: ql_adapter_down() typo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetlink: fix (theoretical) overrun in message iteration
Vegard Nossum [Fri, 26 Dec 2008 01:21:17 +0000 (17:21 -0800)]
netlink: fix (theoretical) overrun in message iteration

See commit 1045b03e07d85f3545118510a587035536030c1c ("netlink: fix
overrun in attribute iteration") for a detailed explanation of why
this patch is necessary.

In short, nlmsg_next() can make "remaining" go negative, and the
remaining >= sizeof(...) comparison will promote "remaining" to an
unsigned type, which means that the expression will evaluate to
true for negative numbers, even though it was not intended.

I put "theoretical" in the title because I have no evidence that
this can actually happen, but I suspect that a crafted netlink
packet can trigger some badness.

Note that the last test, which seemingly has the exact same
problem (also true for nla_ok()), is perfectly OK, since we
already know that remaining is positive.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: Always set urgent pointer if it's beyond snd_nxt
Herbert Xu [Fri, 26 Dec 2008 01:12:58 +0000 (17:12 -0800)]
tcp: Always set urgent pointer if it's beyond snd_nxt

Our TCP stack does not set the urgent flag if the urgent pointer
does not fit in 16 bits, i.e., if it is more than 64K from the
sequence number of a packet.

This behaviour is different from the BSDs, and clearly contradicts
the purpose of urgent mode, which is to send the notification
(though not necessarily the associated data) as soon as possible.
Our current behaviour may in fact delay the urgent notification
indefinitely if the receiver window does not open up.

Simply matching BSD however may break legacy applications which
incorrectly rely on the out-of-band delivery of urgent data, and
conversely the in-band delivery of non-urgent data.

Alexey Kuznetsov suggested a safe solution of following BSD only
if the urgent pointer itself has not yet been transmitted.  This
way we guarantee that when the remote end sees the packet with
non-urgent data marked as urgent due to wrap-around we would have
advanced the urgent pointer beyond, either to the actual urgent
data or to an as-yet untransmitted packet.

The only potential downside is that applications on the remote
end may see multiple SIGURG notifications.  However, this would
occur anyway with other TCP stacks.  More importantly, the outcome
of such a duplicate notification is likely to be harmless since
the signal itself does not carry any information other than the
fact that we're in urgent mode.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Add validity check for SCTP_PARTIAL_DELIVERY_POINT socket option
Wei Yongjun [Fri, 26 Dec 2008 00:59:03 +0000 (16:59 -0800)]
sctp: Add validity check for SCTP_PARTIAL_DELIVERY_POINT socket option

The latest ietf socket extensions API draft said:

  8.1.21.  Set or Get the SCTP Partial Delivery Point

    Note also that the call will fail if the user attempts to set
    this value larger than the socket receive buffer size.

This patch add this validity check for SCTP_PARTIAL_DELIVERY_POINT
socket option.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Avoid memory overflow while FWD-TSN chunk is received with bad stream ID
Wei Yongjun [Fri, 26 Dec 2008 00:58:11 +0000 (16:58 -0800)]
sctp: Avoid memory overflow while FWD-TSN chunk is received with bad stream ID

If FWD-TSN chunk is received with bad stream ID, the sctp will not do the
validity check, this may cause memory overflow when overwrite the TSN of
the stream ID.

The FORWARD-TSN chunk is like this:

FORWARD-TSN chunk
  Type                       = 192
  Flags                      = 0
  Length                     = 172
  NewTSN                     = 99
  Stream                     = 10000
  StreamSequence             = 0xFFFF

This patch fix this problem by discard the chunk if stream ID is not
less than MIS.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Implement socket option SCTP_GET_ASSOC_NUMBER
Wei Yongjun [Fri, 26 Dec 2008 00:57:24 +0000 (16:57 -0800)]
sctp: Implement socket option SCTP_GET_ASSOC_NUMBER

Implement socket option SCTP_GET_ASSOC_NUMBER of the latest ietf socket
extensions API draft.

  8.2.5.  Get the Current Number of Associations (SCTP_GET_ASSOC_NUMBER)

   This option gets the current number of associations that are attached
   to a one-to-many style socket.  The option value is an uint32_t.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Fix a typo in socket.c
Wei Yongjun [Fri, 26 Dec 2008 00:56:45 +0000 (16:56 -0800)]
sctp: Fix a typo in socket.c

Just fix a typo in socket.c.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Bring SCTP_MAXSEG socket option into ietf API extension compliance
Wei Yongjun [Fri, 26 Dec 2008 00:54:58 +0000 (16:54 -0800)]
sctp: Bring SCTP_MAXSEG socket option into ietf API extension compliance

Brings maxseg socket option set/get into line with the latest ietf socket
extensions API draft, while maintaining backwards compatibility.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: PHYLIB mdio fixes #2
Krzysztof Halasa [Fri, 26 Dec 2008 00:50:41 +0000 (16:50 -0800)]
net: PHYLIB mdio fixes #2

The PHYLIB mdio code has more problems in error paths:
- mdiobus_release can be called before bus->state is set to
  MDIOBUS_REGISTERED
- mdiobus_scan allocates resources which need to be freed
- the comment is wrong, the resistors used are actually pull-ups.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: fix convertion to net_device_ops
Eric Dumazet [Fri, 26 Dec 2008 00:45:19 +0000 (16:45 -0800)]
vlan: fix convertion to net_device_ops

commit 656299f706e52e0409733d704c2761f1b12d6954
(vlan: convert to net_device_ops) added a net_device_ops
with a NULL ndo_start_xmit field.

This gives a crash in dev_hard_start_xmit()

Fix it using two net_device_ops structures, one for hwaccel vlan,
one for non hwaccel vlan.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: fix platform resource call during module unload
Steve Glendinning [Fri, 26 Dec 2008 00:44:01 +0000 (16:44 -0800)]
smsc911x: fix platform resource call during module unload

This patch fixes a typo, the platform_get_resource calls in
smsc911x_drv_remove are supposed to look the same as those in
smsc911x_drv_probe.

Reported and fixed by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: don't clobber driver_data
Steve Glendinning [Fri, 26 Dec 2008 00:43:34 +0000 (16:43 -0800)]
smsc911x: don't clobber driver_data

smsc911x uses driver_data to store our net_device, don't overwrite this
with the mii_bus.

Reported and fixed by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: igmp: make /proc/net/{igmp,mcfilter} per netns
Alexey Dobriyan [Fri, 26 Dec 2008 00:42:51 +0000 (16:42 -0800)]
netns: igmp: make /proc/net/{igmp,mcfilter} per netns

This patch makes the followinf proc entries per-netns:
/proc/net/igmp
/proc/net/mcfilter

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: igmp: allow IPPROTO_IGMP sockets in netns
Alexey Dobriyan [Fri, 26 Dec 2008 00:42:23 +0000 (16:42 -0800)]
netns: igmp: allow IPPROTO_IGMP sockets in netns

Looks like everything is already ready.

Required for ebtables(8) for one thing.

Also, required for ipmr per-netns (coming soon). (Benjamin)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: make smsc911x_ethtool_ops constant
Steve Glendinning [Fri, 26 Dec 2008 00:41:09 +0000 (16:41 -0800)]
smsc911x: make smsc911x_ethtool_ops constant

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: convert driver to use net_device_ops
Steve Glendinning [Fri, 26 Dec 2008 00:40:47 +0000 (16:40 -0800)]
smsc911x: convert driver to use net_device_ops

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: fix BUG if module is removed while interface is up
Steve Glendinning [Fri, 26 Dec 2008 00:40:19 +0000 (16:40 -0800)]
smsc911x: fix BUG if module is removed while interface is up

If the module is removed while its interface is up, smsc911x_stop is not
called until after smsc911x_drv_remove has disposed of phy_dev.  This
patch changes the stop method to handle this situation.

This is a different problem to the one reported by dfoley@telus.net.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'sched/urgent'; commit 'v2.6.28' into sched/core
Ingo Molnar [Thu, 25 Dec 2008 12:42:23 +0000 (13:42 +0100)]
Merge branch 'sched/urgent'; commit 'v2.6.28' into sched/core

15 years ago[S390] provide documentation for hvc_iucv kernel parameter.
Hendrik Brueckner [Thu, 25 Dec 2008 12:39:55 +0000 (13:39 +0100)]
[S390] provide documentation for hvc_iucv kernel parameter.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert ctcm printks to dev_xxx and pr_xxx macros.
Peter Tiedemann [Thu, 25 Dec 2008 12:39:54 +0000 (13:39 +0100)]
[S390] convert ctcm printks to dev_xxx and pr_xxx macros.

Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert zfcp printks to pr_xxx macros.
Christof Schmitt [Thu, 25 Dec 2008 12:39:53 +0000 (13:39 +0100)]
[S390] convert zfcp printks to pr_xxx macros.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert vmlogrdr printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:52 +0000 (13:39 +0100)]
[S390] convert vmlogrdr printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert zfcp dumper printks to pr_xxx macros.
Michael Holzheu [Thu, 25 Dec 2008 12:39:51 +0000 (13:39 +0100)]
[S390] convert zfcp dumper printks to pr_xxx macros.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert cpu related printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:50 +0000 (13:39 +0100)]
[S390] convert cpu related printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert qeth printks to dev_xxx and pr_xxx macros.
Frank Blaschka [Thu, 25 Dec 2008 12:39:49 +0000 (13:39 +0100)]
[S390] convert qeth printks to dev_xxx and pr_xxx macros.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert sclp printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:48 +0000 (13:39 +0100)]
[S390] convert sclp printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert iucv printks to dev_xxx and pr_xxx macros.
Ursula Braun [Thu, 25 Dec 2008 12:39:47 +0000 (13:39 +0100)]
[S390] convert iucv printks to dev_xxx and pr_xxx macros.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert ap_bus printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:46 +0000 (13:39 +0100)]
[S390] convert ap_bus printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert dcssblk and extmem printks messages to pr_xxx macros.
Hongjie Yang [Thu, 25 Dec 2008 12:39:45 +0000 (13:39 +0100)]
[S390] convert dcssblk and extmem printks messages to pr_xxx macros.

Signed-off-by: Hongjie Yang <hongjie@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert monwriter printks to pr_xxx macros.
Melissa Howland [Thu, 25 Dec 2008 12:39:44 +0000 (13:39 +0100)]
[S390] convert monwriter printks to pr_xxx macros.

Signed-off-by: Melissa Howland <melissah@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert s390 debug feature printks to pr_xxx macros.
Michael Holzheu [Thu, 25 Dec 2008 12:39:43 +0000 (13:39 +0100)]
[S390] convert s390 debug feature printks to pr_xxx macros.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert monreader printks to pr_xxx macros.
Gerald Schaefer [Thu, 25 Dec 2008 12:39:42 +0000 (13:39 +0100)]
[S390] convert monreader printks to pr_xxx macros.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert appldata printks to pr_xxx macros.
Gerald Schaefer [Thu, 25 Dec 2008 12:39:41 +0000 (13:39 +0100)]
[S390] convert appldata printks to pr_xxx macros.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert setup printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:40 +0000 (13:39 +0100)]
[S390] convert setup printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert hypfs printks to pr_xxx macros.
Michael Holzheu [Thu, 25 Dec 2008 12:39:39 +0000 (13:39 +0100)]
[S390] convert hypfs printks to pr_xxx macros.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert time printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:38 +0000 (13:39 +0100)]
[S390] convert time printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert cpacf printks to pr_xxx macros.
Jan Glauber [Thu, 25 Dec 2008 12:39:37 +0000 (13:39 +0100)]
[S390] convert cpacf printks to pr_xxx macros.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert cio printks to pr_xxx macros.
Michael Ernst [Thu, 25 Dec 2008 12:39:36 +0000 (13:39 +0100)]
[S390] convert cio printks to pr_xxx macros.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert vmur printks to pr_xxx macros.
Frank Munzert [Thu, 25 Dec 2008 12:39:35 +0000 (13:39 +0100)]
[S390] convert vmur printks to pr_xxx macros.

Signed-off-by: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert cpcmd printks to pr_xxx macros.
Christian Borntraeger [Thu, 25 Dec 2008 12:39:34 +0000 (13:39 +0100)]
[S390] convert cpcmd printks to pr_xxx macros.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert lcs printks to dev_xxx and pr_xxx macros.
Klaus-D. Wacker [Thu, 25 Dec 2008 12:39:33 +0000 (13:39 +0100)]
[S390] convert lcs printks to dev_xxx and pr_xxx macros.

Signed-off-by: Klaus-D. Wacker <kdwacker@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert vmcp printks to pr_xxx macros.
Christian Borntraeger [Thu, 25 Dec 2008 12:39:32 +0000 (13:39 +0100)]
[S390] convert vmcp printks to pr_xxx macros.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] convert xpram printks to pr_xxx macros.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:31 +0000 (13:39 +0100)]
[S390] convert xpram printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] s390: Remove redundant test
Julia Lawall [Thu, 25 Dec 2008 12:39:30 +0000 (13:39 +0100)]
[S390] s390: Remove redundant test

The loop above the modified code only terminates when rc is a valid pointer.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] s390/setup: set default preferred console device "ttyS"
Hendrik Brueckner [Thu, 25 Dec 2008 12:39:29 +0000 (13:39 +0100)]
[S390] s390/setup: set default preferred console device "ttyS"

This patch sets the default console device for s390.

The console= kernel parameter can be still used to switch the preferred
console to some other device. In that case, console messages are also
printed on the default console device (ttyS0).

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] drivers/s390/crypto: Move dereference to after IS_ERR test
Julia Lawall [Thu, 25 Dec 2008 12:39:28 +0000 (13:39 +0100)]
[S390] drivers/s390/crypto: Move dereference to after IS_ERR test

If reply is ERR_PTR(...), then it should not be dereferenced, so I have
moved the dereference from the declaration to after the IS_ERR test.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@match exists@
expression x, E;
identifier fld;
position p1,p2;
@@

(
x = E;
|
x = E
|
x@p1->fld
... when != x = E
IS_ERR(x@p2)
... when any
)

@other_match exists@
expression match.x, E1, E2;
position match.p1,match.p2;
@@

x = E1
... when != x = E2
    when != x@p1
x@p2

@ script:python depends on !other_match@
p1 << match.p1;
p2 << match.p2;
@@

print "* file %s dereference %s test %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] panic_stack leak in smp_alloc_lowcore
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:27 +0000 (13:39 +0100)]
[S390] panic_stack leak in smp_alloc_lowcore

Fix freeing of the panic_stack if the allocation of async_stack failed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] clear_table inline assembly contraints
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:26 +0000 (13:39 +0100)]
[S390] clear_table inline assembly contraints

Tell the compile that the clear_table inline assembly writes to the
memory referenced by *s.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] Remove config options.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:25 +0000 (13:39 +0100)]
[S390] Remove config options.

On s390 we always want to run with precise cputime accounting.
Remove the config options VIRT_TIMER and VIRT_CPU_ACCOUNTING.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cpu topology: remove dead code
Heiko Carstens [Thu, 25 Dec 2008 12:39:24 +0000 (13:39 +0100)]
[S390] cpu topology: remove dead code

Interrupts haven't been implemented. So remove the dead code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cpu topology: introduce kernel parameter
Heiko Carstens [Thu, 25 Dec 2008 12:39:23 +0000 (13:39 +0100)]
[S390] cpu topology: introduce kernel parameter

Introduce a topology=[on|off] kernel parameter which allows to switch
cpu topology on/off. Default will be off, since it looks like that for
some workloards this doesn't behave very well (on s390).

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] add new machine types to setup_hwcaps.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:22 +0000 (13:39 +0100)]
[S390] add new machine types to setup_hwcaps.

Add the machine types for z9-bc, z10-ec and z10-bc to the elf_platform
detection in setup_hwcaps.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] Remove initial kernel stack backchain initialization.
Heiko Carstens [Thu, 25 Dec 2008 12:39:21 +0000 (13:39 +0100)]
[S390] Remove initial kernel stack backchain initialization.

Early init code clears the backchain of the initial kernel stack frame.
This is not necessary since it is pre initialized with zeros. Plus it
was broken on 64 bit since it cleared only four of eight bytes.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] s390: use the new byteorder headers
Harvey Harrison [Thu, 25 Dec 2008 12:39:20 +0000 (13:39 +0100)]
[S390] s390: use the new byteorder headers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] Add processor type march=z10 and a processor type safety check.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:19 +0000 (13:39 +0100)]
[S390] Add processor type march=z10 and a processor type safety check.

This patch adds the code generation option for IBM System z10 and
adds a check in head[31,64].S to prevents the execution of a kernel
compiled for a new processor type on an old machine.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] sclp vt220: fix compile warning
Heiko Carstens [Thu, 25 Dec 2008 12:39:18 +0000 (13:39 +0100)]
[S390] sclp vt220: fix compile warning

get rid of this one:

  CC      drivers/s390/char/sclp_vt220.o
drivers/s390/char/sclp_vt220.c:588: warning: '__sclp_vt220_flush_buffer' defined but not used

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] remove warnings with functions ending in BUG
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:17 +0000 (13:39 +0100)]
[S390] remove warnings with functions ending in BUG

Functions which end in a BUG() statement and skip the return statement
cause compile warnings on s390, e.g.:

mm/bootmem.c: In function 'mark_bootmem':
mm/bootmem.c:321: warning: control reaches end of non-void function

To avoid the warning add an endless loop to the BUG() macro.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] mark disabled_wait as noreturn function
Heiko Carstens [Thu, 25 Dec 2008 12:39:16 +0000 (13:39 +0100)]
[S390] mark disabled_wait as noreturn function

disabled_wait() won't return, so add an __attribute__((noreturn)).
This will remove a false positive finding which our internal code
checker reports.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: use pim to check for multipath.
Sebastian Ott [Thu, 25 Dec 2008 12:39:15 +0000 (13:39 +0100)]
[S390] cio: use pim to check for multipath.

To check if multipath is available we count the bits set in lpm,
which could change over time (via configure [on|off] of a path).

The following patch uses the pim (which is persistent) for this
decision.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: commit all pmcw changes.
Sebastian Ott [Thu, 25 Dec 2008 12:39:14 +0000 (13:39 +0100)]
[S390] cio: commit all pmcw changes.

Sometimes we change the pmcw configuration but don't call msch
to transmit these changes to the channel subsystem.

The patch fixes this by calling cio_commit_config in such cases.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: introduce cio_commit_config
Sebastian Ott [Thu, 25 Dec 2008 12:39:13 +0000 (13:39 +0100)]
[S390] cio: introduce cio_commit_config

To change the configuration of a subchannel we alter the modifiable
bits of the subchannel's schib field and issue a modify subchannel.
There can be the case that not all changes were applied -or worse-
quietly overwritten by the hardware. With the next store subchannel
we obtain the current state of the hardware but lose our target
configuration.

With this patch we introduce a subchannel_config structure which
contains the target subchannel configuration. Additionally the msch
wrapper cio_modify is replaced with cio_commit_config which
copies the desired changes to a temporary schib. msch is then
called with the temporary schib. This schib is only written back
to the subchannel if all changes were applied.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: introduce cio_update_schib
Sebastian Ott [Thu, 25 Dec 2008 12:39:12 +0000 (13:39 +0100)]
[S390] cio: introduce cio_update_schib

There is the chance that we get condition code 0 for a stsch but
the resulting schib is not vaild. In the current code there are
2 cases:
* we do a check for validity of the schib after stsch, but at this
  time we have already stored the invaild schib in the subchannel
  structure. This may lead to problems.
* we don't do a check for validity, which is not that good either.

The patch addresses both issues by introducing the stsch wrapper
cio_update_schib which performs stsch on a local schib. This schib
is only written back to the subchannel if it's valid.

side note: For some functions (chp_events) the return codes are
different now (-ENXIO vs -ENODEV) but this shouldn't do harm
since the caller doesn't check for _specific_ errors.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Use device_is_registered().
Cornelia Huck [Thu, 25 Dec 2008 12:39:11 +0000 (13:39 +0100)]
[S390] cio: Use device_is_registered().

Check if a ccw device is registered via device_is_registered()
and not via the old kludge of checking the membership in driver
core internal klists.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Dont call ->release directly.
Cornelia Huck [Thu, 25 Dec 2008 12:39:10 +0000 (13:39 +0100)]
[S390] cio: Dont call ->release directly.

Just put the cdev's reference count to give up our reference.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Dont fail probe for I/O subchannels.
Cornelia Huck [Thu, 25 Dec 2008 12:39:09 +0000 (13:39 +0100)]
[S390] cio: Dont fail probe for I/O subchannels.

If we fail the probe for an I/O subchannel, we won't be able
to unregister it again since there are no sch_event()
callbacks for unbound subchannels. Just succeed the probe in
any case and schedule unregistering the subchannel.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Only register ccw_device for registered subchannel.
Cornelia Huck [Thu, 25 Dec 2008 12:39:08 +0000 (13:39 +0100)]
[S390] cio: Only register ccw_device for registered subchannel.

There is a race between io_subchannel_register() and
io_subchannel_sch_event() which may cause a subchannel to be
unregistered because it is no longer operational before
io_subchannel_register() had run. We need to check whether the
subchannel is still registered before the ccw device can be
registered and just bail out if it is not.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Fix I/O subchannel refcounting.
Cornelia Huck [Thu, 25 Dec 2008 12:39:07 +0000 (13:39 +0100)]
[S390] cio: Fix I/O subchannel refcounting.

Subchannel refcounting was incorrect in some places, especially
a refcount was missing when ccw_device_call_sch_unregister()
was called and the refcount was not correctly switched after
moving devices.

Fix this by establishing the following rules:
- The ccw_device obtains a reference on its parent subchannel
  when dev.parent is set and gives it up in its release
  function. This is needed because we need a parent reference
  for correct refcounting even before the ccw device is (if at
  all) registered.
- When calling device_move(), obtain a reference on the new
  subchannel before moving the ccw device and give up the
  reference on the old parent after moving. This brings the
  refcount in line with the first rule.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Fix reference counting for online/offline.
Cornelia Huck [Thu, 25 Dec 2008 12:39:06 +0000 (13:39 +0100)]
[S390] cio: Fix reference counting for online/offline.

The current code attempts to get an extra reference count
for online devices by doing a get_device() in ccw_device_online()
and a put_device() in ccw_device_done(). However, this
- incorrectly obtains an extra reference for disconnected
  devices becoming available again (since they are already
  online)
- needs special checks for css_init_done in order to handle
  the console device
- is not obvious and
- may incorretly drop a reference count in ccw_device_done() if
  that function is called after path verification for a device
  that just became not operational.

So let's just get the reference in ccw_device_set_online() and
drop it in ccw_device_set_offline(). (Unfortunately, we still
need the special case in io_subchannel_probe().)

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: Put referernce on correct device after moving.
Cornelia Huck [Thu, 25 Dec 2008 12:39:05 +0000 (13:39 +0100)]
[S390] cio: Put referernce on correct device after moving.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: fix ccwgroup online vs. ungroup race condition
Peter Oberparleiter [Thu, 25 Dec 2008 12:39:04 +0000 (13:39 +0100)]
[S390] cio: fix ccwgroup online vs. ungroup race condition

Ensure atomicity of ungroup operation to prevent concurrent ungroup
and online processing which may lead to use-after-release situations.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: move irritating comment.
Sebastian Ott [Thu, 25 Dec 2008 12:39:03 +0000 (13:39 +0100)]
[S390] cio: move irritating comment.

Due to former patches a comment and device id initialization were
split from the addressed function call in io_subchannel_probe.

Move it back to where it belongs.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: update sac values
Peter Oberparleiter [Thu, 25 Dec 2008 12:39:02 +0000 (13:39 +0100)]
[S390] cio: update sac values

Values for the sac field have changed - update code accordingly.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] cio: get rid of compile warning
Heiko Carstens [Thu, 25 Dec 2008 12:39:01 +0000 (13:39 +0100)]
[S390] cio: get rid of compile warning

Move cio_tpi() to the rest of the CONFIG_CCW_CONSOLE functions to
get rid of this one:

drivers/s390/cio/cio.c:115: warning: 'cio_tpi' defined but not used

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] remove ptrace warning on 31 bit.
Martin Schwidefsky [Thu, 25 Dec 2008 12:39:00 +0000 (13:39 +0100)]
[S390] remove ptrace warning on 31 bit.

A kernel compile on 31 bit gives the following warnings in ptrace.c:

arch/s390/kernel/ptrace.c: In function 'peek_user':
arch/s390/kernel/ptrace.c:207: warning: unused variable 'dummy'
arch/s390/kernel/ptrace.c: In function 'poke_user':
arch/s390/kernel/ptrace.c:315: warning: unused variable 'dummy'

Getting rid of the dummy variables removes the warnings.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 years ago[S390] __page_to_pfn warnings
Martin Schwidefsky [Thu, 25 Dec 2008 12:38:59 +0000 (13:38 +0100)]
[S390] __page_to_pfn warnings

For CONFIG_SPARSEMEM_VMEMMAP=y on s390 I get warnings like

init/main.c: In function 'start_kernel':
init/main.c:641: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'int'

The warning can be suppressed with a cast to unsigned long in the
CONFIG_SPARSEMEM_VMEMMAP=y version of __page_to_pfn.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>