public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	Alexander Usyskin <alexander.usyskin@intel.com>
Subject: Re: [char-misc-next 3/3] mei: add WPT second mei interface
Date: Tue, 27 May 2014 14:22:07 -0700	[thread overview]
Message-ID: <20140527212207.GB26089@kroah.com> (raw)
In-Reply-To: <1399969321-6512-4-git-send-email-tomas.winkler@intel.com>

On Tue, May 13, 2014 at 11:22:01AM +0300, Tomas Winkler wrote:
> From: Alexander Usyskin <alexander.usyskin@intel.com>
> 
> Add WPT second mei interface.
> In order for correct device numbering we add mei device interface id
> to to mei_cfg structure
> 
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
>  drivers/misc/mei/hw-me-regs.h | 1 +
>  drivers/misc/mei/hw-me.c      | 5 +++++
>  drivers/misc/mei/hw-me.h      | 1 +
>  drivers/misc/mei/main.c       | 2 +-
>  drivers/misc/mei/mei_dev.h    | 2 ++
>  drivers/misc/mei/pci-me.c     | 1 +
>  6 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
> index a7856c0..c5feafd 100644
> --- a/drivers/misc/mei/hw-me-regs.h
> +++ b/drivers/misc/mei/hw-me-regs.h
> @@ -115,6 +115,7 @@
>  #define MEI_DEV_ID_LPT_HR     0x8CBA  /* Lynx Point H Refresh */
>  
>  #define MEI_DEV_ID_WPT_LP     0x9CBA  /* Wildcat Point LP */
> +#define MEI_DEV_ID_WPT_LP_2   0x9CBB  /* Wildcat Point LP 2 */
>  
>  /* Host Firmware Status Registers in PCI Config Space */
>  #define PCI_CFG_HFS_1         0x40
> diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
> index 6a2d272..9066bb1 100644
> --- a/drivers/misc/mei/hw-me.c
> +++ b/drivers/misc/mei/hw-me.c
> @@ -844,6 +844,11 @@ const struct mei_cfg mei_me_pch_cfg = {
>  	MEI_CFG_PCH_HFS,
>  };
>  
> +/* PCH devices MEI 2 interface */
> +const struct mei_cfg mei_me_pch_2_cfg = {
> +	MEI_CFG_PCH_HFS,
> +	.mei_id = 1

That's going to be a recipe for disaster.  Have the MEI core allocate
the id numbers as things are registered, don't have the individual
drivers create their id.

> +};
>  
>  /* PCH Cougar Point and Patsburg with quirk for Node Manager exclusion */
>  const struct mei_cfg mei_me_pch_cpt_pbg_cfg = {
> diff --git a/drivers/misc/mei/hw-me.h b/drivers/misc/mei/hw-me.h
> index 12b0f4b..6fb841f 100644
> --- a/drivers/misc/mei/hw-me.h
> +++ b/drivers/misc/mei/hw-me.h
> @@ -41,6 +41,7 @@ struct mei_me_hw {
>  extern const struct mei_cfg mei_me_legacy_cfg;
>  extern const struct mei_cfg mei_me_ich_cfg;
>  extern const struct mei_cfg mei_me_pch_cfg;
> +extern const struct mei_cfg mei_me_pch_2_cfg;
>  extern const struct mei_cfg mei_me_pch_cpt_pbg_cfg;
>  extern const struct mei_cfg mei_me_lpt_cfg;
>  
> diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
> index c58e059..cf4ed5a 100644
> --- a/drivers/misc/mei/main.c
> +++ b/drivers/misc/mei/main.c
> @@ -667,7 +667,7 @@ int mei_register(struct mei_device *dev)
>  {
>  
>  	int ret, devno;
> -	int id = 0; /* FIXME: retrieve interface version*/
> +	int id = dev->cfg->mei_id;

Why can't you do this in patch 01 of this series?


>  
>  	/* Fill in the data structures */
>  	devno = MKDEV(MAJOR(mei_devt), id);
> diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
> index a418565..a521783 100644
> --- a/drivers/misc/mei/mei_dev.h
> +++ b/drivers/misc/mei/mei_dev.h
> @@ -384,10 +384,12 @@ enum mei_pg_state {
>   *
>   * @fw_status - FW status
>   * @quirk_probe - device exclusion quirk
> + * @mei_id - id of mei device
>   */
>  struct mei_cfg {
>  	const struct mei_fw_status fw_status;
>  	bool (*quirk_probe)(struct pci_dev *pdev);
> +	int mei_id;

This should be part of the device, not the configuration, for the reason
specified above.

thanks,

greg k-h

  reply	other threads:[~2014-05-27 21:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  8:21 [char-misc-next 0/3] mei support more devices Tomas Winkler
2014-05-13  8:21 ` [char-misc-next 1/3] mei: move from misc to char device Tomas Winkler
2014-05-27 21:20   ` Greg KH
2014-05-13  8:22 ` [char-misc-next 2/3] mei: sysfs: add Documentation mei class attributes Tomas Winkler
2014-05-13  8:22 ` [char-misc-next 3/3] mei: add WPT second mei interface Tomas Winkler
2014-05-27 21:22   ` Greg KH [this message]
2014-05-27 21:42     ` Winkler, Tomas
2014-05-27 22:06       ` Greg KH
2014-05-27 23:47         ` Winkler, Tomas
2014-05-28  0:35           ` Greg KH

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=20140527212207.GB26089@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.usyskin@intel.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@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