qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH v2 6/7] usb/ohci: Implement resume on connection status change
Date: Tue, 28 Feb 2023 16:50:50 +0100	[thread overview]
Message-ID: <4a835d39-bcb4-e147-50e0-5a526d1ae107@linaro.org> (raw)
In-Reply-To: <5281d606-7348-4537-01db-68714969c0e8@eik.bme.hu>

On 28/2/23 15:55, BALATON Zoltan wrote:
> On Tue, 28 Feb 2023, Philippe Mathieu-Daudé wrote:
>> On 20/2/23 19:19, BALATON Zoltan wrote:
>>> If certain bit is set remote wake up should change state from
>>> suspended to resume and generate interrupt. There was a todo comment
>>> for this, implement that by moving existing resume logic to a function
>>> and call that.
>>>
>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> ---
>>>   hw/usb/hcd-ohci.c | 23 +++++++++++++++++------
>>>   1 file changed, 17 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
>>> index bad8db7b1d..88bd42b14a 100644
>>> --- a/hw/usb/hcd-ohci.c
>>> +++ b/hw/usb/hcd-ohci.c
>>> @@ -1410,6 +1410,18 @@ static void ohci_set_hub_status(OHCIState 
>>> *ohci, uint32_t val)
>>>       }
>>>   }
>>>   +/* This is the one state transition the controller can do by 
>>> itself */
>>> +static int ohci_resume(OHCIState *s)
>>
>> Preferably returning bool.
> 
> I can change that on rebase. I just followed other exising functions in 
> this file for consistency which return int (although some use 1 and 
> others use -1 besides 0).

I'll squash that myself.

>>> +{
>>> +    if ((s->ctl & OHCI_CTL_HCFS) == OHCI_USB_SUSPEND) {
>>> +        trace_usb_ohci_remote_wakeup(s->name);
>>> +        s->ctl &= ~OHCI_CTL_HCFS;
>>> +        s->ctl |= OHCI_USB_RESUME;
>>> +        return 1;
>>> +    }
>>> +    return 0;
>>> +}
>>> +
>>>   /*
>>>    * Sets a flag in a port status reg but only set it if the port is 
>>> connected.
>>>    * If not set ConnectStatusChange flag. If flag is enabled return 1.
>>> @@ -1426,7 +1438,10 @@ static int 
>>> ohci_port_set_if_connected(OHCIState *ohci, int i, uint32_t val)
>>>       if (!(ohci->rhport[i].ctrl & OHCI_PORT_CCS)) {
>>>           ohci->rhport[i].ctrl |= OHCI_PORT_CSC;
>>
>> // ConnectStatusChange
>>
>>>           if (ohci->rhstatus & OHCI_RHS_DRWE) {
>>
>> // DeviceRemoteWakeupEnable: ConnectStatusChange is a remote wakeup 
>> event.
> 
> Not clear if you want any change here or the comments are just 
> explanation in this email.

I was just taking notes while reviewing ;) Our OHCI definitions
aren't very verbose.

>>> -            /* TODO: CSC is a wakeup event */
>>> +            /* CSC is a wakeup event */
>>> +            if (ohci_resume(ohci)) {
>>> +                ohci_set_interrupt(ohci, OHCI_INTR_RD);
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> Thanks for the review. You put a lot of work in QEMU and we appreciate 
> very much that you're also doing the job of other maintainers.

No problem. I'm queuing this patch for my next PR (hopefully much
less patches, and before the freeze).



  reply	other threads:[~2023-02-28 15:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 18:15 [PATCH v2 0/7] OHCI changes BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 1/7] usb/ohci: Code style fix comments BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 2/7] usb/ohci: Code style fix white space errors BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 3/7] usb/ohci: Code style fix missing braces and extra parenthesis BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 4/7] usb/ohci: Move a function next to where it is used BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 5/7] usb/ohci: Add trace points for register access BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:15 ` [PATCH v2 6/7] usb/ohci: Implement resume on connection status change BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-28 13:54   ` Philippe Mathieu-Daudé
2023-02-28 14:55     ` Gerd Hoffmann
2023-02-28 14:55     ` BALATON Zoltan
2023-02-28 15:50       ` Philippe Mathieu-Daudé [this message]
2023-02-20 18:15 ` [PATCH v2 7/7] hw/usb/hcd-ohci: Fix typo BALATON Zoltan
2023-02-20 18:19   ` BALATON Zoltan
2023-02-20 18:19 ` [PATCH v2 RESEND 0/7] OHCI changes BALATON Zoltan

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=4a835d39-bcb4-e147-50e0-5a526d1ae107@linaro.org \
    --to=philmd@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).