Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1949452ybt; Mon, 15 Jun 2020 13:49:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV8Pb9tH66PsxrFPskpNGQAOFo2SYQsJfD3Nt+A8ZPe1TBdld8DhEHeDe5XzEvABuByGyO X-Received: by 2002:a17:90a:a616:: with SMTP id c22mr1019063pjq.14.1592254190229; Mon, 15 Jun 2020 13:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592254190; cv=none; d=google.com; s=arc-20160816; b=qsJqfrLm7pqruo9lGO+1r1WaASm0XFn2aadlLogW816JbWhqAAX89lXq5aSNimNMsD F6++rQ8VxNfJSCDehKS+ltC4ZFEM+J8FsdKJUuo8InkHqzqmdNb5w1m1Ba1V5rCuWscY xap8aNti83km69JBnlK/IKdPya6qzEP3Fakkxi5oMDzFQ8LdZRcMRK7sqO0if2xZwUVq CEh/JeangHBjMJtbRnTSfDz6sTWbHHsVw/rgqIklBI6eoER+WPNkJUjjFcK6NA/sB+2q UTDYWo5UGB88Rp4HMxlkyNGNP1M8frd5hV0+mbFxClwvWyHzYNrY5jTJr7xlwh5/Pmrh xxuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6NB11slt87BU+4xj4RQk4kGC454YPuIt0Wk8mlOD8qk=; b=K1cClk5xUt1tRbeRqxRi0bAhYixDRhSa7OJqyhFDzQ2DhWRKmz32pTef54R9oVdWfQ gUJU/zzZWjK26zEkaeMX9s6FpGmhc/eEQ2KoJA4CkToGER4LkgePaVygQwbceuhE7w/l 5Gr55PFJMRSwyEji5aJRaCg2yRHAw4j/2uvKEYCKECU5aYm5bPNjOjkkuNCCe5o/BQFB NXSY6ZAbnOvf403u7iCX7Vj4mIcu/Kdc7jlAG8GkenjJaLF9vGEQuG2z6PF0ZewrWYNc aA4M88eeKhm6rBjr9uy2Cku7yq5KleMm+v1kOlfgjRrCh7pfDiIaeb7WN6gpXeV+5KLV jl1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=XyChLv1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si7909326pld.171.2020.06.15.13.49.04; Mon, 15 Jun 2020 13:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=XyChLv1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgFOUpu (ORCPT + 99 others); Mon, 15 Jun 2020 16:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729692AbgFOUpt (ORCPT ); Mon, 15 Jun 2020 16:45:49 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D533C061A0E for ; Mon, 15 Jun 2020 13:45:49 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id g18so13773190qtu.13 for ; Mon, 15 Jun 2020 13:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6NB11slt87BU+4xj4RQk4kGC454YPuIt0Wk8mlOD8qk=; b=XyChLv1QYsXD5ZuVVF4fG9lmqfNx/h8JnfCH2w2aLZmyMfg9fW63/yqx3dTabIZAL9 Q3EN4/VBshdINKbNRUouJBzlsurFl6ppvkSQPivADTlfTNbZ2dBdRYCooQtDBi91uBX3 fCDFeTuxjseCMpFGuxlKN+UO1Wpkv27H3zh6k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6NB11slt87BU+4xj4RQk4kGC454YPuIt0Wk8mlOD8qk=; b=NoP6OPqFGEVt/7M8c6SroCvXBwDM3acYXTeSi2CUkJax0L6pxeCSXqEmL1F5n3oSlu uKMMWH/EByrXLAFAL9egYWMcIuEAN4txJdWLn7BcBcANUO5T5HneSVZ1hj+xjMFNOCLU bTyvjwhh28GYwhZ1Jc180mfTfo3Xff6aJ1yc4MW22GBVW4G2PTiQGiwHNUK/1CrhNJva aN/A4cAmaQkJXpuZKZblGxF9pvrxaGew2otLe3s3FBBSF66iziVN+9792xPd5LwPmeI+ c1s5zOzQ1vvcpy69hNtYG+0JQ2Ofu2Kln6msJEqfT0IypHSC3yMRsigFgaKBvmuO4uRA tVJQ== X-Gm-Message-State: AOAM5309mulypZ2XE5AAkSQxPihJMmGENR3FQUsLEje6ewKdWB7AzXVZ RaUrW3hasHmgAlFK81oOtQJTg365BkaTCUi17kvYKw== X-Received: by 2002:ac8:43ce:: with SMTP id w14mr17451952qtn.80.1592253948476; Mon, 15 Jun 2020 13:45:48 -0700 (PDT) MIME-Version: 1.0 References: <20200615190119.382589-1-drc@linux.vnet.ibm.com> In-Reply-To: <20200615190119.382589-1-drc@linux.vnet.ibm.com> From: Michael Chan Date: Mon, 15 Jun 2020 13:45:36 -0700 Message-ID: Subject: Re: [PATCH] tg3: driver sleeps indefinitely when EEH errors exceed eeh_max_freezes To: David Christensen Cc: Netdev , Siva Reddy Kallam , Prashant Sreedharan , Michael Chan , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 12:01 PM David Christensen wrote: > > The driver function tg3_io_error_detected() calls napi_disable twice, > without an intervening napi_enable, when the number of EEH errors exceeds > eeh_max_freezes, resulting in an indefinite sleep while holding rtnl_lock. > > The function is called once with the PCI state pci_channel_io_frozen and > then called again with the state pci_channel_io_perm_failure when the > number of EEH failures in an hour exceeds eeh_max_freezes. > > Protecting the calls to napi_enable/napi_disable with a new state > variable prevents the long sleep. This works, but I think a simpler fix is to check tp->pcierr_recovery in tg3_io_error_detected() and skip most of the tg3 calls (including the one that disables NAPI) if the flag is true.