提交 8386cda3 编写于 作者: L Linus Torvalds

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...
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
#define FALCON_BOARD_SFN4111T 0x51 #define FALCON_BOARD_SFN4111T 0x51
#define FALCON_BOARD_SFN4112F 0x52 #define FALCON_BOARD_SFN4112F 0x52
/* Board temperature is about 15°C above ambient when air flow is
* limited. */
#define FALCON_BOARD_TEMP_BIAS 15
/* SFC4000 datasheet says: 'The maximum permitted junction temperature
* is 125°C; the thermal design of the environment for the SFC4000
* should aim to keep this well below 100°C.' */
#define FALCON_JUNC_TEMP_MAX 90
/***************************************************************************** /*****************************************************************************
* Support for LM87 sensor chip used on several boards * Support for LM87 sensor chip used on several boards
*/ */
...@@ -548,16 +557,16 @@ static int sfn4111t_init(struct efx_nic *efx) ...@@ -548,16 +557,16 @@ static int sfn4111t_init(struct efx_nic *efx)
static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */ static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */
static const u8 sfe4002_lm87_regs[] = { static const u8 sfe4002_lm87_regs[] = {
LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */
LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */
LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */
LM87_IN_LIMITS(3, 0xb0, 0xc9), /* 5V: 4.6-5.2V */ LM87_IN_LIMITS(3, 0xac, 0xd4), /* 5V: 5.0V +/- 10% */
LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */
LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */
LM87_AIN_LIMITS(0, 0xa0, 0xb2), /* AIN1: 1.66V +/- 5% */ LM87_AIN_LIMITS(0, 0x98, 0xbb), /* AIN1: 1.66V +/- 10% */
LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */
LM87_TEMP_INT_LIMITS(10, 60), /* board */ LM87_TEMP_INT_LIMITS(0, 80 + FALCON_BOARD_TEMP_BIAS),
LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX),
0 0
}; };
...@@ -619,14 +628,14 @@ static int sfe4002_init(struct efx_nic *efx) ...@@ -619,14 +628,14 @@ static int sfe4002_init(struct efx_nic *efx)
static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */
static const u8 sfn4112f_lm87_regs[] = { static const u8 sfn4112f_lm87_regs[] = {
LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */
LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */
LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */
LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */
LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */
LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */
LM87_TEMP_INT_LIMITS(10, 60), /* board */ LM87_TEMP_INT_LIMITS(0, 60 + FALCON_BOARD_TEMP_BIAS),
LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX),
0 0
}; };
......
...@@ -127,7 +127,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) ...@@ -127,7 +127,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
efx_dword_t reg; efx_dword_t reg;
/* Check for a reboot atomically with respect to efx_mcdi_copyout() */ /* Check for a reboot atomically with respect to efx_mcdi_copyout() */
rc = efx_mcdi_poll_reboot(efx); rc = -efx_mcdi_poll_reboot(efx);
if (rc) if (rc)
goto out; goto out;
......
...@@ -410,7 +410,8 @@ static ssize_t wireless_show(struct device *d, char *buf, ...@@ -410,7 +410,8 @@ static ssize_t wireless_show(struct device *d, char *buf,
const struct iw_statistics *iw; const struct iw_statistics *iw;
ssize_t ret = -EINVAL; ssize_t ret = -EINVAL;
rtnl_lock(); if (!rtnl_trylock())
return restart_syscall();
if (dev_isalive(dev)) { if (dev_isalive(dev)) {
iw = get_wireless_stats(dev); iw = get_wireless_stats(dev);
if (iw) if (iw)
......
...@@ -1317,14 +1317,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, ...@@ -1317,14 +1317,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; int val = *valp;
loff_t pos = *ppos;
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
if (write && *valp != val) { if (write && *valp != val) {
struct net *net = ctl->extra2; struct net *net = ctl->extra2;
if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) {
if (!rtnl_trylock()) if (!rtnl_trylock()) {
/* Restore the original values before restarting */
*valp = val;
*ppos = pos;
return restart_syscall(); return restart_syscall();
}
if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
inet_forward_change(net); inet_forward_change(net);
} else if (*valp) { } else if (*valp) {
......
...@@ -502,8 +502,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) ...@@ -502,8 +502,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
if (p == &net->ipv6.devconf_dflt->forwarding) if (p == &net->ipv6.devconf_dflt->forwarding)
return 0; return 0;
if (!rtnl_trylock()) if (!rtnl_trylock()) {
/* Restore the original values before restarting */
*p = old;
return restart_syscall(); return restart_syscall();
}
if (p == &net->ipv6.devconf_all->forwarding) { if (p == &net->ipv6.devconf_all->forwarding) {
__s32 newf = net->ipv6.devconf_all->forwarding; __s32 newf = net->ipv6.devconf_all->forwarding;
...@@ -4028,12 +4031,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, ...@@ -4028,12 +4031,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; int val = *valp;
loff_t pos = *ppos;
int ret; int ret;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos); ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
if (write) if (write)
ret = addrconf_fixup_forwarding(ctl, valp, val); ret = addrconf_fixup_forwarding(ctl, valp, val);
if (ret)
*ppos = pos;
return ret; return ret;
} }
...@@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old) ...@@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old)
if (p == &net->ipv6.devconf_dflt->disable_ipv6) if (p == &net->ipv6.devconf_dflt->disable_ipv6)
return 0; return 0;
if (!rtnl_trylock()) if (!rtnl_trylock()) {
/* Restore the original values before restarting */
*p = old;
return restart_syscall(); return restart_syscall();
}
if (p == &net->ipv6.devconf_all->disable_ipv6) { if (p == &net->ipv6.devconf_all->disable_ipv6) {
__s32 newf = net->ipv6.devconf_all->disable_ipv6; __s32 newf = net->ipv6.devconf_all->disable_ipv6;
...@@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write, ...@@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write,
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; int val = *valp;
loff_t pos = *ppos;
int ret; int ret;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos); ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
if (write) if (write)
ret = addrconf_disable_ipv6(ctl, valp, val); ret = addrconf_disable_ipv6(ctl, valp, val);
if (ret)
*ppos = pos;
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册