Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526914

Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS

From David Lechner <david@lechnology.com>
Newsgroups linux.kernel
Subject Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS
Date 2016-11-21 18:00 +0100
Message-ID <sG06K-3IM-25@gated-at.bofh.it> (permalink)
References <sDqK6-8gf-19@gated-at.bofh.it> <sFr8Z-5Ec-1@gated-at.bofh.it> <sFU1k-8p7-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/5] USB: ohci-da8xx: Add device tree support Axel Haslam <ahaslam@baylibre.com> - 2016-11-14 15:50 +0100
  [PATCH v5 2/5] USB: ohci: da8xx: Add wrappers for platform callbacks Axel Haslam <ahaslam@baylibre.com> - 2016-11-14 15:50 +0100
  [PATCH v5 1/5] USB: ohci: da8xx: use ohci priv data instead of globals Axel Haslam <ahaslam@baylibre.com> - 2016-11-14 15:50 +0100
    Re: [v5,1/5] USB: ohci: da8xx: use ohci priv data instead of globals David Lechner <david@lechnology.com> - 2016-11-20 04:00 +0100
      Re: [v5,1/5] USB: ohci: da8xx: use ohci priv data instead of globals Axel Haslam <ahaslam@baylibre.com> - 2016-11-21 10:10 +0100
  [PATCH v5 3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS Axel Haslam <ahaslam@baylibre.com> - 2016-11-14 15:50 +0100
    Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS David Lechner <david@lechnology.com> - 2016-11-20 04:40 +0100
    Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS David Lechner <david@lechnology.com> - 2016-11-20 04:40 +0100
      Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS Axel Haslam <ahaslam@baylibre.com> - 2016-11-21 11:30 +0100
        Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS David Lechner <david@lechnology.com> - 2016-11-21 18:00 +0100
          Re: [v5,3/5] USB: ohci: da8xx: Allow a regulator to handle VBUS Axel Haslam <ahaslam@baylibre.com> - 2016-11-22 15:30 +0100

csiph-web