lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Jul 2020 09:05:13 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Badhri Jagan Sridharan <badhri@...gle.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hans de Goede <hdegoede@...hat.com>
Subject: Re: [PATCH v4] usb: typec: tcpm: Migrate workqueue to RT priority for
 processing events

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@...ck-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,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ