From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06EBBC43461 for ; Mon, 7 Sep 2020 17:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C609221775 for ; Mon, 7 Sep 2020 17:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599498840; bh=98ZAClSIGU+33a2lTFd4CtKoPGoJ2kE/5cQwoXDxrA0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=dAGXthvyhY4rMlZER3odwMJo/CWeRn/kfURtGRKBMAFlixmGxypDCUYmFyMopWq1K YkeaHD2Ccve7pvmBZn/UE4wVPv1MOQOeQqM6FH4FxPWMYyihmH8a1HZce8hgzXBDjY XSfLB3dcgNBfyP/G2tEO3GU/VRR1TNhU8p5wBTJ8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730685AbgIGRN6 (ORCPT ); Mon, 7 Sep 2020 13:13:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730717AbgIGRNv (ORCPT ); Mon, 7 Sep 2020 13:13:51 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E899F21532; Mon, 7 Sep 2020 17:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599498831; bh=98ZAClSIGU+33a2lTFd4CtKoPGoJ2kE/5cQwoXDxrA0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KNYm7hXy10pS3XT5yMPQGYsMsWOHUsNKPvC8IFgCWw1RR9z8GYGzUH5Zo3kpSy691 1M1ClcKA+4RBGDVwAwEVv6urAO8308tdvNZa3Wt1KMF0iksgcaATtuRiGmdxRo1ypG U88aLP9OS5spgovqGm1KlR197EE7E31xU3HceAbk= Date: Mon, 7 Sep 2020 10:13:49 -0700 From: Jakub Kicinski To: Michael Chan Cc: David Miller , Netdev , Vasundhara Volam Subject: Re: [PATCH net 2/2] bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task() Message-ID: <20200907101349.2c3f8c32@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <1599360937-26197-1-git-send-email-michael.chan@broadcom.com> <1599360937-26197-3-git-send-email-michael.chan@broadcom.com> <20200906122534.54e16e08@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20200906201311.0873ad59@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 6 Sep 2020 20:48:04 -0700 Michael Chan wrote: > On Sun, Sep 6, 2020 at 8:13 PM Jakub Kicinski wrote: > > > > On Sun, 6 Sep 2020 15:07:02 -0700 Michael Chan wrote: > > > On Sun, Sep 6, 2020 at 12:25 PM Jakub Kicinski wrote: > > > > > > > > devlink can itself scheduler a recovery via: > > > > > > > > bnxt_fw_fatal_recover() -> bnxt_fw_reset() > > > > > > > > > > Yes, this is how it is initiated when we call devlink_health_report() > > > to report the error condition. From bnxt_fw_reset(), we use a > > > workqueue because we have to go through many states, requiring > > > sleeping/polling to transition through the states. > > > > > > > no? Maybe don't make the devlink recovery path need to go via a > > > > workqueue? > > > > > > Current implementation is going through a work queue. > > > > What I'm saying is the code looks like this after this patch: > > > > + clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); > > + bnxt_cancel_sp_work(bp); > > + bp->sp_event = 0; > > + > > bnxt_dl_fw_reporters_destroy(bp, true); > > > > It cancels the work, _then_ destroys the reporter. But I think the > > reported can be used to schedule a recovery from command line. So the > > work may get re-scheduled after it has been canceled. > > bnxt_en does not support recovery from the command line. We return > -EOPNOTSUPP when it comes from the command line. > > Recovery has to be triggered from a firmware reported error or a > driver detected error. I see it now, thanks.