All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Badhri Jagan Sridharan <badhri@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v4] usb: typec: tcpm: Migrate workqueue to RT priority for processing events
Date: Thu, 30 Jul 2020 09:05:13 -0700	[thread overview]
Message-ID: <33bec771-7255-517f-fb5f-9c4e7320837d@roeck-us.net> (raw)
In-Reply-To: <20200730123431.GO883641@kuha.fi.intel.com>

On 7/30/20 5:34 AM, Heikki Krogerus wrote:
> Hi,
> 
> One more nitpick below...
> 
> On Thu, Jul 30, 2020 at 12:25:31AM -0700, Badhri Jagan Sridharan wrote:
>> @@ -4786,10 +4807,28 @@ static int devm_tcpm_psy_register(struct tcpm_port *port)
>>  	return PTR_ERR_OR_ZERO(port->psy);
>>  }
>>  
>> +static enum hrtimer_restart state_machine_timer_handler(struct hrtimer *timer)
>> +{
>> +	struct tcpm_port *port = container_of(timer, struct tcpm_port, state_machine_timer);
>> +
>> +	kthread_queue_work(port->wq, &port->state_machine);
>> +	return HRTIMER_NORESTART;
>> +}
>> +
>> +static enum hrtimer_restart vdm_state_machine_timer_handler(struct hrtimer *timer)
>> +{
>> +	struct tcpm_port *port = container_of(timer, struct tcpm_port, vdm_state_machine_timer);
>> +
>> +	kthread_queue_work(port->wq, &port->vdm_state_machine);
>> +	return HRTIMER_NORESTART;
>> +}
>> +
>>  struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
>>  {
>>  	struct tcpm_port *port;
>>  	int err;
>> +	/* Priority just lower than default irq thread priority */
>> +	struct sched_param param = {.sched_priority = (MAX_USER_RT_PRIO / 2) + 1,};
> 
> Move that outside the function and constify it:
> 

Good catch. With this change applied:

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

>         static const struct sched_param param {
>                 .shed_priority = (MAX_USER_RT_PRIO / 2) + 1,

Caution: s/shed/sched/

>         };
> 
>>  	if (!dev || !tcpc ||
>>  	    !tcpc->get_vbus || !tcpc->set_cc || !tcpc->get_cc ||
> 
> thanks,
> 


  reply	other threads:[~2020-07-30 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  7:25 [PATCH v4] usb: typec: tcpm: Migrate workqueue to RT priority for processing events Badhri Jagan Sridharan
2020-07-30 12:34 ` Heikki Krogerus
2020-07-30 16:05   ` Guenter Roeck [this message]
2020-07-31  6:59     ` Badhri Jagan Sridharan

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=33bec771-7255-517f-fb5f-9c4e7320837d@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.