public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Du, ChangbinX" <changbinx.du@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"balbi@ti.com" <balbi@ti.com>,
	"sarah.a.sharp@linuxfoundation.org" 
	<sarah.a.sharp@linuxfoundation.org>, "Wu, Hao" <hao.wu@intel.com>,
	"Tang, Jianqiang" <jianqiang.tang@intel.com>,
	"Zhuang, Jin Can" <jin.can.zhuang@intel.com>,
	"Huang, Xiaochao" <xiaochao.huang@intel.com>
Subject: Re: About TRB_TO_EP_INDEX() macro using
Date: Mon, 5 Aug 2013 16:34:45 +0800	[thread overview]
Message-ID: <20130805083445.GA15885@kroah.com> (raw)
In-Reply-To: <0C18FE92A7765D4EB9EE5D38D86A563A019660C8@SHSMSX103.ccr.corp.intel.com>

On Mon, Aug 05, 2013 at 08:07:25AM +0000, Du, ChangbinX wrote:
> Recently when I check xHCI code, find that some functions try to get EP index 
> from a Command Completion Event TRB via TRB_TO_EP_INDEX() macro.
> 
> This is totally wrong. The macro definition is:
> 
> 	#define TRB_TO_EP_INDEX(p)		((((p) & (0x1f << 16)) >> 16) - 1)
> 
> TRB_TO_EP_INDEX only applies to Transfer Event TRB. But for Command 
> Completion Event TRB, there is no Endpoint ID field. So, we cannot directly 
> get EP index from these TRBs, but we can find it by the TRB Pointer.
> 
> Here list two functions for you to check:
> 	handle_stopped_endpoint()
> 	handle_reset_ep_completion()

Care to send a patch showing how you would change this if it is
incorrect?

thanks,

greg k-h

  reply	other threads:[~2013-08-05  8:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05  8:07 About TRB_TO_EP_INDEX() macro using Du, ChangbinX
2013-08-05  8:34 ` gregkh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-06  8:59 Du, ChangbinX
2013-08-06  9:06 ` 'gregkh@linuxfoundation.org'

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=20130805083445.GA15885@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@ti.com \
    --cc=changbinx.du@intel.com \
    --cc=hao.wu@intel.com \
    --cc=jianqiang.tang@intel.com \
    --cc=jin.can.zhuang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linuxfoundation.org \
    --cc=xiaochao.huang@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