mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2 v3.2] mei: add mei_quirk_probe function
Date: Fri, 12 Dec 2014 05:10:02 +0000	[thread overview]
Message-ID: <1418361002.3599.79.camel@decadent.org.uk> (raw)
In-Reply-To: <1417472994-19699-1-git-send-email-tomas.winkler@intel.com>

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

On Tue, 2014-12-02 at 00:29 +0200, Tomas Winkler wrote:
> commit  9a123f19832702753805afe0e93db26799b91b07 upstream
> 
> The main purpose of this function is to exclude ME devices
> without support for MEI/HECI interface from binding
> 
> Currently affected systems are C600/X79 based servers
> that expose PCI device even though it doesn't supported ME Interface.
> MEI driver accessing such nonfunctional device can corrupt
> the system.
> 
> [Backported to 3.2: files were moved]
> Cc: stable@vger.kernel.org #v3.2
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

I've added these two to the queue, thanks.

Ben.

> ---
>  drivers/staging/mei/main.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/staging/mei/main.c b/drivers/staging/mei/main.c
> index eb05c36f45d4..44ed7a859ecd 100644
> --- a/drivers/staging/mei/main.c
> +++ b/drivers/staging/mei/main.c
> @@ -106,6 +106,27 @@ MODULE_DEVICE_TABLE(pci, mei_pci_tbl);
>  static DEFINE_MUTEX(mei_mutex);
>  
>  /**
> + * mei_quirk_probe - probe for devices that doesn't valid ME interface
> + * @pdev: PCI device structure
> + * @ent: entry into pci_device_table
> + *
> + * returns true if ME Interface is valid, false otherwise
> + */
> +static bool __devinit mei_quirk_probe(struct pci_dev *pdev,
> +				const struct pci_device_id *ent)
> +{
> +	u32 reg;
> +	if (ent->device == MEI_DEV_ID_PBG_1) {
> +		pci_read_config_dword(pdev, 0x48, &reg);
> +		/* make sure that bit 9 is up and bit 10 is down */
> +		if ((reg & 0x600) == 0x200) {
> +			dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n");
> +			return false;
> +		}
> +	}
> +	return true;
> +}
> +/**
>   * mei_probe - Device Initialization Routine
>   *
>   * @pdev: PCI device structure
> @@ -120,6 +141,12 @@ static int __devinit mei_probe(struct pci_dev *pdev,
>  	int err;
>  
>  	mutex_lock(&mei_mutex);
> +
> +	if (!mei_quirk_probe(pdev, ent)) {
> +		err = -ENODEV;
> +		goto end;
> +	}
> +
>  	if (mei_device) {
>  		err = -EEXIST;
>  		goto end;

-- 
Ben Hutchings
Kids!  Bringing about Armageddon can be dangerous.  Do not attempt it in
your own home. - Terry Pratchett and Neil Gaiman, `Good Omens'

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

           reply	other threads:[~2014-12-12  5:10 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1417472994-19699-1-git-send-email-tomas.winkler@intel.com>]

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=1418361002.3599.79.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tomas.winkler@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®