Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170Ab3HEIHb (ORCPT ); Mon, 5 Aug 2013 04:07:31 -0400 Received: from mga02.intel.com ([134.134.136.20]:57486 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754889Ab3HEIH2 convert rfc822-to-8bit (ORCPT ); Mon, 5 Aug 2013 04:07:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,816,1367996400"; d="scan'208";a="376243090" From: "Du, ChangbinX" To: "gregkh@linuxfoundation.org" CC: "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "balbi@ti.com" , "sarah.a.sharp@linuxfoundation.org" , "Wu, Hao" , "Tang, Jianqiang" , "Zhuang, Jin Can" , "Huang, Xiaochao" Subject: About TRB_TO_EP_INDEX() macro using Thread-Topic: About TRB_TO_EP_INDEX() macro using Thread-Index: Ac6RstFtOlwuIZkPS2GOcAkgTF+4sQ== Date: Mon, 5 Aug 2013 08:07:25 +0000 Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A019660C8@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 849 Lines: 24 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() Regards & Thanks! Changbin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/