All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verkamp, Daniel" <daniel.verkamp@intel.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: "Jiang, Dave" <dave.jiang@intel.com>,
	"jdmason@kudzu.us" <jdmason@kudzu.us>
Subject: ntb: initialize max_mw for Atom before using it
Date: Mon, 15 Jun 2015 16:39:10 +0000	[thread overview]
Message-ID: <1434386296.146175.3.camel@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

Please apply this patch, included in 4.1-rc8, to the stable trees:

  commit ebaad1322d8080a1a8367ec631b345405d9879e2
  ntb: initialize max_mw for Atom before using it

Commit ab760a0 (ntb: Adding split BAR support for Haswell platforms)
caused a regression on Intel Atom systems with ntb hardware (in
particular, Atom S1200); on these systems, the ntb driver dereferences
a null pointer on startup and does not function correctly.

Applies to 4.0.y, 3.19.y, and 3.18.y.

Thanks,
-- Daniel Verkamp

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ntb-initialize-max_mw-for-Atom-before-using-it.patch --]
[-- Type: text/x-patch; name="0001-ntb-initialize-max_mw-for-Atom-before-using-it.patch", Size: 1305 bytes --]

commit ebaad1322d8080a1a8367ec631b345405d9879e2
Author: Daniel Verkamp <daniel.verkamp@intel.com>
Date:   Wed May 13 15:50:04 2015 -0700

    ntb: initialize max_mw for Atom before using it
    
    Commit ab760a0 (ntb: Adding split BAR support for Haswell platforms)
    changed ntb_device's mw from a fixed-size array into a pointer that is
    allocated based on limits.max_mw; however, on Atom platforms, max_mw
    is not initialized until ntb_device_setup(), which happens after the
    allocation.
    
    Fill out max_mw in ntb_atom_detect() to match ntb_xeon_detect(); this
    happens before the use of max_mw in the ndev->mw allocation.
    
    Fixes a null pointer dereference on Atom platforms with ntb hardware.
    
    v2: fix typo (mw_max should be max_mw)
    
    Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
    Acked-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Jon Mason <jdmason@kudzu.us>

diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
index b5c8707..15f9b7c 100644
--- a/drivers/ntb/ntb_hw.c
+++ b/drivers/ntb/ntb_hw.c
@@ -1660,6 +1660,7 @@ static int ntb_atom_detect(struct ntb_device *ndev)
 	u32 ppd;
 
 	ndev->hw_type = BWD_HW;
+	ndev->limits.max_mw = BWD_MAX_MW;
 
 	rc = pci_read_config_dword(ndev->pdev, NTB_PPD_OFFSET, &ppd);
 	if (rc)

             reply	other threads:[~2015-06-15 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 16:39 Verkamp, Daniel [this message]
2015-06-15 17:08 ` [PATCH] ntb: initialize max_mw for Atom before using it Daniel Verkamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434386296.146175.3.camel@intel.com \
    --to=daniel.verkamp@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.