Received: by 10.213.65.68 with SMTP id h4csp1102466imn; Wed, 14 Mar 2018 09:39:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELtyBuS+vINsAs+HgzZjgEv0xheoip28yeVrUf7G13tgsuIshf6Amlvz1IMRyEZvt3YnCbzP X-Received: by 2002:a17:902:468:: with SMTP id 95-v6mr4730578ple.360.1521045575209; Wed, 14 Mar 2018 09:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521045575; cv=none; d=google.com; s=arc-20160816; b=wl9Gb+8ANFVaakXbYwmLboowz7p/pDSA2CDf7FvDi2vorm37gLTRuFQ0RzppSkgBvY caoKA8zryPKxlkGNkau2gZ+lg9/yMQzeDnp9kTSDjFvd3IhF3bqsvah0JN3cyZO1t9lm Mnf3yAJ0la7dOOET5N8DlY3+J0+I/AUZa3dNxVP0bscb1uvo1nRY0cGyMh0s8EZSh1OF 2ULNuSK9Z3GLqwVh1AMdFbkl6VHTNDYsGOJZBHjqneSRMfRpZv4UKfMFN4hLOO6ABADW qQVlD1PPb0ppQ/k3lCwAYzDvCRPl970k9es+EvTZSfbJSDp/DRWDmF2MydrDuAenv6fN wKtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=aK9Zurh93YZXdmuMvr1yQ3J7Z+N8x3s7FY9zRI3ViEY=; b=V3yJrpuUOWNf93dBpL9tbyaJu3WLQfFgtjeaw3YO0y1WxzokS2Z2ebcH7GDUeWT2dL ES+q4JejYyPTMvwNyjoRqHghqErPg9j2Qj6wpIXZ8xv+vurGpQHZDzLs141/RFdedO4v k6yPt/1Jb+rYiABYNWEEQ2p8+ZONH4lm4CTS0ChVHOyvu5/DxGu3CVRiEM1UTBNjchO+ paAXRvltw9zgamptdyQX+eYyKHv6MSkQ0v9nqncx8Lll32tZKf7dkg3XM9Vi3MIPOVm6 B+N0By8o0zhrl3q+zypt/9sgnpaZphWQbqm39xcruwAH4lVKYysnLgcSazl6XkrHk6G1 kmoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si2078466pgq.322.2018.03.14.09.39.21; Wed, 14 Mar 2018 09:39:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbeCNQgp (ORCPT + 99 others); Wed, 14 Mar 2018 12:36:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40598 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751353AbeCNQgn (ORCPT ); Wed, 14 Mar 2018 12:36:43 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99DC6406E8A4; Wed, 14 Mar 2018 16:36:42 +0000 (UTC) Received: from jtoppins.rdu.csb (ovpn-124-69.rdu2.redhat.com [10.10.124.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C88AAFD50; Wed, 14 Mar 2018 16:36:42 +0000 (UTC) From: Jonathan Toppins To: netdev@vger.kernel.org Cc: Andy Gospodarek , Siva Reddy Kallam , Prashant Sreedharan , Michael Chan , linux-kernel@vger.kernel.org Subject: [PATCH net] tg3: prevent scheduling while atomic splat Date: Wed, 14 Mar 2018 12:36:25 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Mar 2018 16:36:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Mar 2018 16:36:42 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jtoppins@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index c1841db1b500..f2593978ae75 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -820,7 +820,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us) tg3_ape_unlock(tp, TG3_APE_LOCK_MEM); - usleep_range(10, 20); + udelay(10); timeout_us -= (timeout_us > 10) ? 10 : timeout_us; } -- 2.13.6