RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context

2017-08-16 Thread David Laight
From: Greg Edwards
> Sent: 15 August 2017 20:32
> On Mon, Aug 14, 2017 at 10:17:31AM +, David Laight wrote:
> > From: Jeff Kirsher
> >> Sent: 09 August 2017 22:48
> >> From: Greg Edwards 
> >>
> >> This fixes a "scheduling while atomic" splat seen with
> >> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
> >>
> >> Signed-off-by: Greg Edwards 
> >> Tested-by: Aaron Brown 
> >> Signed-off-by: Jeff Kirsher 
> >> ---
> >>  drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c 
> >> b/drivers/net/ethernet/intel/igbvf/vf.c
> >> index 1d3aa9adcaa8..9577ccf4b26a 100644
> >> --- a/drivers/net/ethernet/intel/igbvf/vf.c
> >> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
> >> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
> >>msgbuf[0] = E1000_VF_RESET;
> >>mbx->ops.write_posted(hw, msgbuf, 1);
> >>
> >> -  msleep(10);
> >> +  mdelay(10);
> >
> > Spinning for 10ms seems somewhat sub-optimal
> 
> Jeff,
> 
> Do we even need this delay?  The subsequent read_posted() will poll for
> the PF's mailbox reply for up to 1s.

A 1 second loop?
Who is kidding who that this code is sensible.
If this code is ever executed and has to wait at all other interfaces
are likely to lose packets.

David



Re: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context

2017-08-15 Thread Greg Edwards
On Mon, Aug 14, 2017 at 10:17:31AM +, David Laight wrote:
> From: Jeff Kirsher
>> Sent: 09 August 2017 22:48
>> From: Greg Edwards 
>>
>> This fixes a "scheduling while atomic" splat seen with
>> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
>>
>> Signed-off-by: Greg Edwards 
>> Tested-by: Aaron Brown 
>> Signed-off-by: Jeff Kirsher 
>> ---
>>  drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c 
>> b/drivers/net/ethernet/intel/igbvf/vf.c
>> index 1d3aa9adcaa8..9577ccf4b26a 100644
>> --- a/drivers/net/ethernet/intel/igbvf/vf.c
>> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
>> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
>>  msgbuf[0] = E1000_VF_RESET;
>>  mbx->ops.write_posted(hw, msgbuf, 1);
>>
>> -msleep(10);
>> +mdelay(10);
>
> Spinning for 10ms seems somewhat sub-optimal

Jeff,

Do we even need this delay?  The subsequent read_posted() will poll for
the PF's mailbox reply for up to 1s.

Greg


RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context

2017-08-14 Thread David Laight
From: Jeff Kirsher
> Sent: 09 August 2017 22:48
> From: Greg Edwards 
> 
> This fixes a "scheduling while atomic" splat seen with
> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
> 
> Signed-off-by: Greg Edwards 
> Tested-by: Aaron Brown 
> Signed-off-by: Jeff Kirsher 
> ---
>  drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c 
> b/drivers/net/ethernet/intel/igbvf/vf.c
> index 1d3aa9adcaa8..9577ccf4b26a 100644
> --- a/drivers/net/ethernet/intel/igbvf/vf.c
> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
>   msgbuf[0] = E1000_VF_RESET;
>   mbx->ops.write_posted(hw, msgbuf, 1);
> 
> - msleep(10);
> + mdelay(10);

Spinning for 10ms seems somewhat sub-optimal

David