Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1894854ybg; Thu, 30 Jul 2020 05:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyll0NlPNITNtqcP0QQEZMsQ2dfVjKzaGcRL4XOoyzxfJX8dSe3ftM+bS+JHsmM4YyzQR9C X-Received: by 2002:a17:906:1414:: with SMTP id p20mr2305468ejc.247.1596112639097; Thu, 30 Jul 2020 05:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596112639; cv=none; d=google.com; s=arc-20160816; b=052jh+CtDUxcrM9iy5H6OLPm+MNFjJxAvNVN7KWYpZJEFMJmWZMS/uAAQPQp7UMdTv lFGIAa5iQxQZ+MsTLF5FIkkkYE/XlAw2B//Hz7ZUlSeld66kQpDSeRbca3RO89lKVil4 r/DKX4+zyS0iUeYn3MOWnQwfXxruOtXoib1Iio9NU1C5HY+YVRccA1ZaZKwbFDTW1iK9 L2DXW6yHaxxqlLGRqxAYi4LFcRkRXRnTfXuhaUZBx3nmDdl9oLAl1v/xNDXrnsOOOPSu QNuiICy1GZB2QO4kqhRyDqwAN2k0+q7VWKw37y8ZxpC6Kx8od4cN+q/FkIHY+fwX3I/u lySA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=xOqAS/LNSykkB72nyKRbljazq09lmQ1t0oD+phlvy9Y=; b=tLdJBcdnBgQ4ATobwP2R6hzlEi0sclkkn1lSi/kVqK/hfzAlH6AsGDtQTkTtvuSg9n Cvx4ctR+5931ccx2Sa18daZZLEXJ/vUXX3/3+zj6PGuHty3qqjMUO9ybDrEcZMMt9ZB5 f8h8zKHuB25Y7ptMdSLvJ6iMZ7ntNAojTv1hqYblflGYLOfaYb8AfzloXa7Ybg5tcaZ9 x2gotoSM9FWsG2oG9d4KfV4Q5Cyt8PK3ENA3qOSRvsNKIVU3wEsU12ELHOZwMj195WR0 W1O1BIRYKqnxPEdL+7CMxvYUayx20927IXk9nZUHtl1fAucgJJppKz7RWHIkoX28SW8E Hy6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg3si3246013ejb.284.2020.07.30.05.36.56; Thu, 30 Jul 2020 05:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbgG3Meq (ORCPT + 99 others); Thu, 30 Jul 2020 08:34:46 -0400 Received: from mga05.intel.com ([192.55.52.43]:45046 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgG3Meq (ORCPT ); Thu, 30 Jul 2020 08:34:46 -0400 IronPort-SDR: mL4D9J+6bRsdSdSGnUN+QkS6EL6EswWZMy2v2XZmr6GmthdMp2cD6EpK0C7Lsbgi8QRnS7yegk LgTr1tbWnW6w== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="236450650" X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="236450650" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 05:34:34 -0700 IronPort-SDR: a+EjjITPA3CAOLnFYI2jZrH9JOxMzQaTQZavapdRJsplFGxSPIQoUNw4Z41gq1h622zDGX5mvH ZQ1K2//pdTPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="394968658" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 30 Jul 2020 05:34:32 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 30 Jul 2020 15:34:31 +0300 Date: Thu, 30 Jul 2020 15:34:31 +0300 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Hans de Goede Subject: Re: [PATCH v4] usb: typec: tcpm: Migrate workqueue to RT priority for processing events Message-ID: <20200730123431.GO883641@kuha.fi.intel.com> References: <20200730072531.3171984-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200730072531.3171984-1-badhri@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: static const struct sched_param param { .shed_priority = (MAX_USER_RT_PRIO / 2) + 1, }; > if (!dev || !tcpc || > !tcpc->get_vbus || !tcpc->set_cc || !tcpc->get_cc || thanks, -- heikki