From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751571AbeCNR1o (ORCPT ); Wed, 14 Mar 2018 13:27:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56386 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751279AbeCNR1m (ORCPT ); Wed, 14 Mar 2018 13:27:42 -0400 Reply-To: jtoppins@redhat.com Subject: Re: [PATCH net] tg3: prevent scheduling while atomic splat To: Michael Chan Cc: Netdev , Andy Gospodarek , Siva Reddy Kallam , Prashant Sreedharan , Michael Chan , open list References: From: Jonathan Toppins Organization: Red Hat Message-ID: <266eae62-bef2-6c51-415f-cbacc1669e30@redhat.com> Date: Wed, 14 Mar 2018 13:27:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/14/2018 01:22 PM, Michael Chan wrote: > On Wed, Mar 14, 2018 at 9:36 AM, Jonathan Toppins wrote: >> The problem was introduced in commit >> 506b0a395f26 ("[netdrv] tg3: APE heartbeat changes"). The bug occurs >> because tp->lock spinlock is held which is obtained in tg3_start >> by way of tg3_full_lock(), line 11571. The documentation for usleep_range() >> specifically states it cannot be used inside a spinlock. >> >> Fixes: 506b0a395f26 ("[netdrv] tg3: APE heartbeat changes") >> Signed-off-by: Jonathan Toppins >> --- >> >> Notes: >> The thing I need reviewed from Broadcom is if the udelay should be 20 >> instead of 10, due to any timing changes introduced by the offending >> patch. > > Thanks. 10 us is correct. > > As a future improvement, we might want to see if we can release the > spinlock and go back to usleep_range(). The wait time is potentially > up to 20 msec which is quite long. Agreed, glad it is not just me wondering why a lock needs to be held for reads. :-)