From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755878AbcKVOUC (ORCPT ); Tue, 22 Nov 2016 09:20:02 -0500 Received: from mail-qk0-f178.google.com ([209.85.220.178]:36264 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755592AbcKVOT7 (ORCPT ); Tue, 22 Nov 2016 09:19:59 -0500 MIME-Version: 1.0 In-Reply-To: <43bd46ae-cf13-a5c2-6483-ba759cdc9b3c@lechnology.com> References: <20161114144103.12120-4-ahaslam@baylibre.com> <26d7b4c1-a7ef-7250-eb6a-270182d279ea@lechnology.com> <43bd46ae-cf13-a5c2-6483-ba759cdc9b3c@lechnology.com> From: Axel Haslam Date: Tue, 22 Nov 2016 15:18:26 +0100 Message-ID: Subject: Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS To: David Lechner Cc: Greg KH , Alan Stern , Kevin Hilman , kishon@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2016 at 5:29 PM, David Lechner wrote: > On 11/21/2016 04:22 AM, Axel Haslam wrote: >> >> Hi David, >> >> Thanks for the review, >> > > You're welcome. > >>>> >>>> @@ -160,15 +212,41 @@ static void ohci_da8xx_ocic_handler(struct >>>> da8xx_ohci_root_hub *hub, >>>> hub->set_power(port, 0); >>>> } >>>> >>>> +static int ohci_da8xx_regulator_event(struct notifier_block *nb, >>>> + unsigned long event, void *data) >>>> +{ >>>> + struct da8xx_ohci_hcd *da8xx_ohci = >>>> + container_of(nb, struct da8xx_ohci_hcd, >>>> nb); >>>> + struct device *dev = da8xx_ohci->hcd->self.controller; >>>> + >>>> + if (event & REGULATOR_EVENT_OVER_CURRENT) { >>>> + dev_warn(dev, "over current event\n"); >>> >>> >>> >>> Won't this result in duplicate overcurrent warnings in the kernel log? It >>> seems like in previous version of this patch series, we would get an >>> overcurrent error from the core usb driver. >> >> >> you mean in the regulator driver? i did not make changes to core usb. >> but, no, i did not add a print in the fixed regulator driver itself. >> Since >> the regulator is a separate driver, and could be implemented with or >> without >> a trace, i think its better to leave this print. It shows that the usb >> driver >> has well received the notification. >> > > No, I mean in drivers/usb/core/hub.c. There is > > if (status & USB_PORT_STAT_OVERCURRENT) > dev_err(&port_dev->dev, "over-current condition\n"); > > and > > if (status & HUB_STATUS_OVERCURRENT) > dev_err(hub_dev, "over-current condition\n"); > > In ohci_da8xx_hub_control(), we are setting RH_PS_POCI and RH_PS_OCIC, so > these messages will be printed via the core hub driver. We don't need to > print another message from the same event. > > Hi David I did a couple of tests, and i don't get those prints do you get them?. What i understand is that they happen when we get a hub event that is reporting the over current. Which is what the root hub of the davinci system does not have, and why we use gpios instead). Regards, Axel. >