From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine02.qualcomm.com ([199.106.114.251]:18853 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874Ab0LPIyy (ORCPT ); Thu, 16 Dec 2010 03:54:54 -0500 Message-ID: <4D09D3D5.9040705@codeaurora.org> Date: Thu, 16 Dec 2010 14:24:45 +0530 From: Pavan Kondeti MIME-Version: 1.0 Subject: Re: [RFC 4/5] USB: EHCI: Notify HCD about HNP enabled port suspend References: <1292411654-21382-1-git-send-email-pkondeti@codeaurora.org> <1292411654-21382-5-git-send-email-pkondeti@codeaurora.org> <20101215121909.GQ2997@legolas.emea.dhcp.ti.com> In-Reply-To: <20101215121909.GQ2997@legolas.emea.dhcp.ti.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: balbi@ti.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org On 12/15/2010 5:49 PM, Felipe Balbi wrote: > Hi, > > On Wed, Dec 15, 2010 at 04:44:13PM +0530, Pavankumar Kondeti wrote: >> Introduce start_hnp callback function for HCD to receive notification >>from EHCI core that HNP enabled port is suspended. HCD may initiate >> HNP or notify the same to OTG via otg_start_hnp(). >> >> This patch is inspired by "USB: Hook start_hnp into ohci struct" >> (e8b24450). >> >> Change-Id: I8e258a6fdf42c166ea9cb3a727e4d3d28a8adc72 >> Signed-off-by: Pavankumar Kondeti >> --- >> drivers/usb/host/ehci-hub.c | 11 +++++++++++ >> drivers/usb/host/ehci.h | 2 ++ >> 2 files changed, 13 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c >> index 796ea0c..65bf104 100644 >> --- a/drivers/usb/host/ehci-hub.c >> +++ b/drivers/usb/host/ehci-hub.c >> @@ -1018,6 +1018,17 @@ static int ehci_hub_control ( >> || (temp & PORT_RESET) != 0) >> goto error; >> >> +#ifdef CONFIG_USB_OTG >> + if (hcd->self.otg_port == (wIndex + 1) && >> + hcd->self.b_hnp_enable && >> + ehci->start_hnp) { The pointer is checked here... >> + ehci_writel(ehci, temp | PORT_SUSPEND, >> + status_reg); >> + set_bit(wIndex, &ehci->suspended_ports); >> + ehci->start_hnp(ehci); > > should you check if this pointer is valid before ? > -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.