From patchwork Fri Jul 8 16:44:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 647028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rpDHC3JvHz9s5w for ; Tue, 12 Jul 2016 04:32:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gaikai-com.20150623.gappssmtp.com header.i=@gaikai-com.20150623.gappssmtp.com header.b=HoOQLgDl; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 08CE8880E8; Mon, 11 Jul 2016 18:32:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uhuDDB3Kw5M8; Mon, 11 Jul 2016 18:32:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EE02988051; Mon, 11 Jul 2016 18:32:41 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 905831C2A37 for ; Fri, 8 Jul 2016 16:44:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8A0ECC098C for ; Fri, 8 Jul 2016 16:44:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BIerhjPbyHel for ; Fri, 8 Jul 2016 16:44:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 18AE3C0988 for ; Fri, 8 Jul 2016 16:44:52 +0000 (UTC) Received: by mail-it0-f52.google.com with SMTP id u186so13364401ita.0 for ; Fri, 08 Jul 2016 09:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaikai-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Zb2KNsTixTXRS6srbfk9vVxFQgadnpmiJaoepy9CdeQ=; b=HoOQLgDlyhIfYVOcvYj5oPTc1d0LVNZVxowBUjG/+seSXzsATPw2Rn6FDyxrZohJ8q mWablcLHqOMRA5BMzDZNylAFTy5skla+lJpbMWUJlc4J5LXqTzbmns9Ymqpl8FUojQTc blBSXtIHIPq95BB3KxDcQJBjU2kdp4TynI4kK0fC/F0lqRUoWFl0lrFXmfaPGzD0/sNs x3G7nQ8YCug8omuAtdK6ztKtkwz9weAMS8vTkVBbGyUiMMHy+1oJd0dzrVUmOInIcAbe DcRKtwHXua0uAm4L71mDFUIYUoT58iTSogKYc2jb2nAWHYo5If8ChzF4UykGx+3Amdfy xfQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Zb2KNsTixTXRS6srbfk9vVxFQgadnpmiJaoepy9CdeQ=; b=ZRXIDb2pVHzSUaF7u3Z/sHN84VjJH71WwvQwXwtt7NDaVZUUB6GfIQ4hFGVw8Q+0F9 OG1jPP8/xSuI+rzOuiuEfrzqClivp6OG3usNtaJJ3+KDghvtHc4HB9vpezJM7BNLBk84 o11SspUE44l6NSb9k8fVcJQccIXZi/dCq5XUz/4o+WTSKXpj6QtD2RwrCv/cBJt4Z5FM 94S6IfXLNT6lZRk9V263JR+ResUdGr+Vg2+oNq0iMqemt6y5zh4R39IpmgxmI84WFIQT ecJQ3CCj9BivO/2+Dce/R7FD2RKG32NW/4BcbwDulovV6zgp4ng8EEaQ48s0MNiq+or7 d/MA== X-Gm-Message-State: ALyK8tL5p/u4y2OW/9Br/Zs2HBdLDXJMImGh3k3lnv3zjhJOLHYD0B0w1scOhgZhVTtwnj/uoTyIFfTXhW6JGhr4 X-Received: by 10.36.20.212 with SMTP id 203mr4134297itg.83.1467996291482; Fri, 08 Jul 2016 09:44:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.38.151 with HTTP; Fri, 8 Jul 2016 09:44:49 -0700 (PDT) In-Reply-To: References: <038AE347-E85C-4738-BC91-C8C16AE88620@intel.com> <87618083B2453E4A8714035B62D679925066EACF@FMSMSX105.amr.corp.intel.com> From: Patrick McLean Date: Fri, 8 Jul 2016 09:44:49 -0700 Message-ID: To: zhuyj X-Mailman-Approved-At: Mon, 11 Jul 2016 18:32:40 +0000 Cc: netdev , intel-wired-lan Subject: Re: [Intel-wired-lan] [PATCH] (resend) ixgbe: always initialize setup_fc X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" How about just initializing it when the rest of the struct is initialized? This is what is done for every other model. On Fri, Jul 8, 2016 at 2:47 AM, zhuyj wrote: > Sure. setup_fc should not be null. Emil, your patch can fix it well. > > On Fri, Jul 8, 2016 at 8:18 AM, Tantilov, Emil S > wrote: >> >> >-----Original Message----- >> >From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] >> > On >> >Behalf Of Rustad, Mark D >> >Sent: Wednesday, July 06, 2016 4:01 PM >> >To: Patrick McLean >> >Cc: netdev ; intel-wired-lan > >lan@lists.osuosl.org> >> >Subject: Re: [Intel-wired-lan] [PATCH] (resend) ixgbe: always initialize >> >setup_fc >> > >> >Patrick McLean wrote: >> > >> >> Gmail mangled my first message, sorry about that. Second attempt. >> >> >> >> In ixgbe_init_mac_link_ops_X550em, the code has a special case for >> >> backplane media type, but does not fall through to the default case, >> >> so the setup_fc never gets initialized. This causes a panic when it >> >> later tries to set up the card, and the kernel dereferences the null >> >> pointer. >> >> >> >> This patch lets the the function fall through, which initialized >> >> setup_fc properly. >> > >> >I don't think that this is the right fix. My memory is that fc autoneg is >> >> setup_fc() does not configure FC autoneg and it should always be set. >> >> I posted an alternative patch that simply sets setup_fc at the beginning >> of >> the function. The fall-through in the switch statement is not a good >> solution >> because it won't work in case we need to add another case. >> >> http://patchwork.ozlabs.org/patch/646228/ >> >> Thanks, >> Emil >> > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index 19b75cd..cfc814a 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c @@ -2915,7 +2915,7 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = { .acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X550em, .release_swfw_sync = &ixgbe_release_swfw_sync_X550em, .init_swfw_sync = &ixgbe_init_swfw_sync_X540, - .setup_fc = NULL, /* defined later */ + .setup_fc = ixgbe_setup_fc_x550em, .read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550, .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550, };