linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Badhri Jagan Sridharan <badhri@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	USB <linux-usb@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] usb: typec: tcpm: Migrate workqueue to RT priority for processing events
Date: Thu, 30 Jul 2020 00:28:23 -0700	[thread overview]
Message-ID: <CAPTae5LBfYni0m2+drcXfTtgbZZCzdEWb_r-XtkhhQ-8tP60EQ@mail.gmail.com> (raw)
In-Reply-To: <20200730064356.GA3910237@kroah.com>

Hi Greg,

Yes Guenter's suspicion is right. Mine was conflicting with Han's
following patch:
commit 5f2b8d87bca528616e04344d1fc4032dc5ec0f3d
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Fri Jul 24 19:46:57 2020 +0200

    usb: typec: tcpm: Move mod_delayed_work(&port->vdm_state_machine)
call into tcpm_queue_vdm()

    All callers of tcpm_queue_vdm() immediately follow the tcpm_queue_vdm()
    vdm call with a:

            mod_delayed_work(port->wq, &port->vdm_state_machine, 0);

    Call, fold this into tcpm_queue_vdm() itself.

    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20200724174702.61754-1-hdegoede@redhat.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Fixed merged conflicts and sent out the v4 version of the patch.
Added hdegoede@redhat.com to CC as well.

Thanks,
Badhri

On Wed, Jul 29, 2020 at 11:44 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jul 29, 2020 at 07:24:57PM -0700, Badhri Jagan Sridharan wrote:
> > "tReceiverResponse 15 ms Section 6.6.2
> > The receiver of a Message requiring a response Shall respond
> > within tReceiverResponse in order to ensure that the
> > sender’s SenderResponseTimer does not expire."
> >
> > When the cpu complex is busy running other lower priority
> > work items, TCPM's work queue sometimes does not get scheduled
> > on time to meet the above requirement from the spec.
> > Moving to kthread_work apis to run with real time priority.
> > Just lower than the default threaded irq priority,
> > MAX_USER_RT_PRIO/2 + 1. (Higher number implies lower priority).
> >
> > Further, as observed in 1ff688209e2e, moving to hrtimers to
> > overcome scheduling latency while scheduling the delayed work.
> >
> > TCPM has three work streams:
> > 1. tcpm_state_machine
> > 2. vdm_state_machine
> > 3. event_work
> >
> > tcpm_state_machine and vdm_state_machine both schedule work in
> > future i.e. delayed. Hence each of them have a corresponding
> > hrtimer, tcpm_state_machine_timer & vdm_state_machine_timer.
> >
> > When work is queued right away kthread_queue_work is used.
> > Else, the relevant timer is programmed and made to queue
> > the kthread_work upon timer expiry.
> >
> > kthread_create_worker only creates one kthread worker thread,
> > hence single threadedness of workqueue is retained.
> >
> > Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> > Changes since v1:(Guenter's suggestions)
> > - Remove redundant call to hrtimer_cancel while calling
> >   hrtimer_start.
> >
> > Changes since v2:(Greg KH's suggestions)
> > - Rebase usb-next TOT.
> >   633198cd2945b7 (HEAD -> usb-next-1) usb: typec: tcpm: Migrate workqueue to RT priority for processing events
> >   fa56dd9152ef95 (origin/usb-next) Merge tag 'usb-serial-5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
> >   25252919a1050e xhci: dbgtty: Make some functions static
> >   b0e02550346e67 xhci: dbc: Make function xhci_dbc_ring_alloc() static
> >   ca6377900974c3 Revert "usb: dwc2: override PHY input signals with usb role switch support"
> >   09df709cb5aeb2 Revert "usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15 SoCs"
> >   17a82716587e9d USB: iowarrior: fix up report size handling for some devices
> >   e98ba8cc3f8a89 Merge tag 'usb-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
> >   c97793089b11f7 Merge 5.8-rc7 into usb-next
> >   92ed301919932f (tag: v5.8-rc7, origin/usb-linus, origin/main) Linux 5.8-rc7
> >
>
> Hm, still does not apply.  I think it has something to do with other
> patches that landed before yours, can you rebase again?
>
> thanks,
>
> greg k-h

      reply	other threads:[~2020-07-30  7:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  2:24 [PATCH v3] usb: typec: tcpm: Migrate workqueue to RT priority for processing events Badhri Jagan Sridharan
2020-07-30  6:43 ` Greg Kroah-Hartman
2020-07-30  7:28   ` Badhri Jagan Sridharan [this message]

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=CAPTae5LBfYni0m2+drcXfTtgbZZCzdEWb_r-XtkhhQ-8tP60EQ@mail.gmail.com \
    --to=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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).