diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-19 22:34:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-19 22:34:56 -0500 |
commit | 8386cda3f9faadcdcf0205ab6b84b03ce4ee1f6f (patch) | |
tree | 8f7be8e77f9915bc0a276f1263674ad8448415ee | |
parent | 83bdd240eeb388a611b2bdbed9afdb3192966cec (diff) | |
parent | 242cc0547f3bcecc0b02ca6f3e9512760185727e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
sfc: SFE4002/SFN4112F: Widen temperature and voltage tolerances
sfc: Fix sign of efx_mcdi_poll_reboot() error in efx_mcdi_poll()
net-sysfs: Use rtnl_trylock in wireless sysfs methods.
net: Fix sysctl restarts...
-rw-r--r-- | drivers/net/sfc/falcon_boards.c | 45 | ||||
-rw-r--r-- | drivers/net/sfc/mcdi.c | 2 | ||||
-rw-r--r-- | net/core/net-sysfs.c | 3 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 7 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 16 |
5 files changed, 50 insertions, 23 deletions
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c index bf0b96af5334..5712fddd72f2 100644 --- a/drivers/net/sfc/falcon_boards.c +++ b/drivers/net/sfc/falcon_boards.c | |||
@@ -29,6 +29,15 @@ | |||
29 | #define FALCON_BOARD_SFN4111T 0x51 | 29 | #define FALCON_BOARD_SFN4111T 0x51 |
30 | #define FALCON_BOARD_SFN4112F 0x52 | 30 | #define FALCON_BOARD_SFN4112F 0x52 |
31 | 31 | ||
32 | /* Board temperature is about 15°C above ambient when air flow is | ||
33 | * limited. */ | ||
34 | #define FALCON_BOARD_TEMP_BIAS 15 | ||
35 | |||
36 | /* SFC4000 datasheet says: 'The maximum permitted junction temperature | ||
37 | * is 125°C; the thermal design of the environment for the SFC4000 | ||
38 | * should aim to keep this well below 100°C.' */ | ||
39 | #define FALCON_JUNC_TEMP_MAX 90 | ||
40 | |||
32 | /***************************************************************************** | 41 | /***************************************************************************** |
33 | * Support for LM87 sensor chip used on several boards | 42 | * Support for LM87 sensor chip used on several boards |
34 | */ | 43 | */ |
@@ -548,16 +557,16 @@ fail_hwmon: | |||
548 | static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */ | 557 | static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */ |
549 | 558 | ||
550 | static const u8 sfe4002_lm87_regs[] = { | 559 | static const u8 sfe4002_lm87_regs[] = { |
551 | LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ | 560 | LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */ |
552 | LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ | 561 | LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */ |
553 | LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ | 562 | LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */ |
554 | LM87_IN_LIMITS(3, 0xb0, 0xc9), /* 5V: 4.6-5.2V */ | 563 | LM87_IN_LIMITS(3, 0xac, 0xd4), /* 5V: 5.0V +/- 10% */ |
555 | LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ | 564 | LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */ |
556 | LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ | 565 | LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */ |
557 | LM87_AIN_LIMITS(0, 0xa0, 0xb2), /* AIN1: 1.66V +/- 5% */ | 566 | LM87_AIN_LIMITS(0, 0x98, 0xbb), /* AIN1: 1.66V +/- 10% */ |
558 | LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ | 567 | LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */ |
559 | LM87_TEMP_INT_LIMITS(10, 60), /* board */ | 568 | LM87_TEMP_INT_LIMITS(0, 80 + FALCON_BOARD_TEMP_BIAS), |
560 | LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ | 569 | LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX), |
561 | 0 | 570 | 0 |
562 | }; | 571 | }; |
563 | 572 | ||
@@ -619,14 +628,14 @@ static int sfe4002_init(struct efx_nic *efx) | |||
619 | static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ | 628 | static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ |
620 | 629 | ||
621 | static const u8 sfn4112f_lm87_regs[] = { | 630 | static const u8 sfn4112f_lm87_regs[] = { |
622 | LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ | 631 | LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */ |
623 | LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ | 632 | LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */ |
624 | LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ | 633 | LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */ |
625 | LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ | 634 | LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */ |
626 | LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ | 635 | LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */ |
627 | LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ | 636 | LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */ |
628 | LM87_TEMP_INT_LIMITS(10, 60), /* board */ | 637 | LM87_TEMP_INT_LIMITS(0, 60 + FALCON_BOARD_TEMP_BIAS), |
629 | LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ | 638 | LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX), |
630 | 0 | 639 | 0 |
631 | }; | 640 | }; |
632 | 641 | ||
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 9f035b9f0350..f66b3da6ddff 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
@@ -127,7 +127,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) | |||
127 | efx_dword_t reg; | 127 | efx_dword_t reg; |
128 | 128 | ||
129 | /* Check for a reboot atomically with respect to efx_mcdi_copyout() */ | 129 | /* Check for a reboot atomically with respect to efx_mcdi_copyout() */ |
130 | rc = efx_mcdi_poll_reboot(efx); | 130 | rc = -efx_mcdi_poll_reboot(efx); |
131 | if (rc) | 131 | if (rc) |
132 | goto out; | 132 | goto out; |
133 | 133 | ||
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index fbc1c7472c5e..099c753c4213 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -410,7 +410,8 @@ static ssize_t wireless_show(struct device *d, char *buf, | |||
410 | const struct iw_statistics *iw; | 410 | const struct iw_statistics *iw; |
411 | ssize_t ret = -EINVAL; | 411 | ssize_t ret = -EINVAL; |
412 | 412 | ||
413 | rtnl_lock(); | 413 | if (!rtnl_trylock()) |
414 | return restart_syscall(); | ||
414 | if (dev_isalive(dev)) { | 415 | if (dev_isalive(dev)) { |
415 | iw = get_wireless_stats(dev); | 416 | iw = get_wireless_stats(dev); |
416 | if (iw) | 417 | if (iw) |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 040c4f05b653..26dec2be9615 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1317,14 +1317,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, | |||
1317 | { | 1317 | { |
1318 | int *valp = ctl->data; | 1318 | int *valp = ctl->data; |
1319 | int val = *valp; | 1319 | int val = *valp; |
1320 | loff_t pos = *ppos; | ||
1320 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 1321 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
1321 | 1322 | ||
1322 | if (write && *valp != val) { | 1323 | if (write && *valp != val) { |
1323 | struct net *net = ctl->extra2; | 1324 | struct net *net = ctl->extra2; |
1324 | 1325 | ||
1325 | if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { | 1326 | if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { |
1326 | if (!rtnl_trylock()) | 1327 | if (!rtnl_trylock()) { |
1328 | /* Restore the original values before restarting */ | ||
1329 | *valp = val; | ||
1330 | *ppos = pos; | ||
1327 | return restart_syscall(); | 1331 | return restart_syscall(); |
1332 | } | ||
1328 | if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { | 1333 | if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { |
1329 | inet_forward_change(net); | 1334 | inet_forward_change(net); |
1330 | } else if (*valp) { | 1335 | } else if (*valp) { |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index de7a194a64ab..143791da062c 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -502,8 +502,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) | |||
502 | if (p == &net->ipv6.devconf_dflt->forwarding) | 502 | if (p == &net->ipv6.devconf_dflt->forwarding) |
503 | return 0; | 503 | return 0; |
504 | 504 | ||
505 | if (!rtnl_trylock()) | 505 | if (!rtnl_trylock()) { |
506 | /* Restore the original values before restarting */ | ||
507 | *p = old; | ||
506 | return restart_syscall(); | 508 | return restart_syscall(); |
509 | } | ||
507 | 510 | ||
508 | if (p == &net->ipv6.devconf_all->forwarding) { | 511 | if (p == &net->ipv6.devconf_all->forwarding) { |
509 | __s32 newf = net->ipv6.devconf_all->forwarding; | 512 | __s32 newf = net->ipv6.devconf_all->forwarding; |
@@ -4028,12 +4031,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, | |||
4028 | { | 4031 | { |
4029 | int *valp = ctl->data; | 4032 | int *valp = ctl->data; |
4030 | int val = *valp; | 4033 | int val = *valp; |
4034 | loff_t pos = *ppos; | ||
4031 | int ret; | 4035 | int ret; |
4032 | 4036 | ||
4033 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 4037 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
4034 | 4038 | ||
4035 | if (write) | 4039 | if (write) |
4036 | ret = addrconf_fixup_forwarding(ctl, valp, val); | 4040 | ret = addrconf_fixup_forwarding(ctl, valp, val); |
4041 | if (ret) | ||
4042 | *ppos = pos; | ||
4037 | return ret; | 4043 | return ret; |
4038 | } | 4044 | } |
4039 | 4045 | ||
@@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old) | |||
4075 | if (p == &net->ipv6.devconf_dflt->disable_ipv6) | 4081 | if (p == &net->ipv6.devconf_dflt->disable_ipv6) |
4076 | return 0; | 4082 | return 0; |
4077 | 4083 | ||
4078 | if (!rtnl_trylock()) | 4084 | if (!rtnl_trylock()) { |
4085 | /* Restore the original values before restarting */ | ||
4086 | *p = old; | ||
4079 | return restart_syscall(); | 4087 | return restart_syscall(); |
4088 | } | ||
4080 | 4089 | ||
4081 | if (p == &net->ipv6.devconf_all->disable_ipv6) { | 4090 | if (p == &net->ipv6.devconf_all->disable_ipv6) { |
4082 | __s32 newf = net->ipv6.devconf_all->disable_ipv6; | 4091 | __s32 newf = net->ipv6.devconf_all->disable_ipv6; |
@@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write, | |||
4095 | { | 4104 | { |
4096 | int *valp = ctl->data; | 4105 | int *valp = ctl->data; |
4097 | int val = *valp; | 4106 | int val = *valp; |
4107 | loff_t pos = *ppos; | ||
4098 | int ret; | 4108 | int ret; |
4099 | 4109 | ||
4100 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 4110 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
4101 | 4111 | ||
4102 | if (write) | 4112 | if (write) |
4103 | ret = addrconf_disable_ipv6(ctl, valp, val); | 4113 | ret = addrconf_disable_ipv6(ctl, valp, val); |
4114 | if (ret) | ||
4115 | *ppos = pos; | ||
4104 | return ret; | 4116 | return ret; |
4105 | } | 4117 | } |
4106 | 4118 | ||