Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2998120pxa; Tue, 18 Aug 2020 04:01:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqg7x5Y7WdnuC1nv10XOj25YRZS8gSYGn4bEyyj7+/iNsoaDE9QcIf2som5ednzOxzkGUq X-Received: by 2002:a17:906:4a4e:: with SMTP id a14mr19929262ejv.450.1597748468279; Tue, 18 Aug 2020 04:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597748468; cv=none; d=google.com; s=arc-20160816; b=N830jIzsEiAnwkQe73gvuXwUlrepOk3s8KrTHCL3jwxcDSkGx+o1bK3sXwPIVI8jGX jNc9iqExODYgy3HoMwjucm4MJAKxk6ZAlOPWyDjF2oByUykXgyq6EmMVdEvbbxGZy7Zf +Q8u0NNlo/CHCeCKewTlsiTz5nlNLxJnkiVtbJxY4Trij2XX+p6Nxnm4eg/pS5KHTVNR ba1b99T2wvkAGALqi3sH35FeXmu6lSyYp4cwBERGUIfzfamuBKjUOIBhi7EK1+8qO7xn cY4p/o332Xutetgr4PpD5JszePNCGlpXUJXzJk+WG6PV7BkcvRb/9NUnhqzsI8T9zAsz e8QQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=P2s3joNl67nofmDTI6ZvWYYdMxIOd6TbwsPtx1p5B+s=; b=nRc6d8UUXgoLbwAc2/ZeT/KIM2u3PJhegDhoc0YOISJtLM6utxemxgl00oLdncEr1z WKb9TIE6sYe5iJ9y1CNo6anCIinVTQCbYOv5JCD1JlNg2w83CGVXDN/pIeaj8j+BNvzG lvnZnAHu5yGjeEewcVYrY9UbLReb0oR4LfKWgSlzJG3iR8YErMCGUtmU+UUKbWMGFonI YLEYaXdbBkD6bLRh5vLpo5fPt5wp/KxJZB6ti9kItR7R+xpYZmtL6Q/pieXXvpk29akG AAcuI015oTuAqm8G/TxDX5v0ITRs3idGSBh8BddUuCv48lT3faMtdTng17+m5YSm7ZCq PCJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lIScz0mX; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si13308220edz.228.2020.08.18.04.00.42; Tue, 18 Aug 2020 04:01:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lIScz0mX; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgHRK6C (ORCPT + 99 others); Tue, 18 Aug 2020 06:58:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbgHRK6B (ORCPT ); Tue, 18 Aug 2020 06:58:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4525205CB; Tue, 18 Aug 2020 10:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597748281; bh=J7VxecJmS67J6UNrXJpkf+lwbw4VNoeGDUuCvboivXY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lIScz0mXjK2BB/sVSQNuTDkoLRJqX/tgDNBdkAiLyg626RVbpViuzUPqzL42AoBR4 beAW8jNZiedWuWQbaGxpU4WWNHQaQQFqBNhyHnVrfYCxcS3Yxzs7jrEgv1rdzgNagL 6s/wNJUB329gp4PGLxa/c0fdO+swSA4HNfeucw78= Date: Tue, 18 Aug 2020 12:58:24 +0200 From: Greg Kroah-Hartman To: Badhri Jagan Sridharan Cc: Guenter Roeck , Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Hans de Goede Subject: Re: [PATCH v5] usb: typec: tcpm: Migrate workqueue to RT priority for processing events Message-ID: <20200818105824.GA135059@kroah.com> References: <20200731065830.3744049-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200731065830.3744049-1-badhri@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 11:58:30PM -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 > Reviewed-by: Guenter Roeck > Reviewed-by: Heikki Krogerus > --- With this patch applied I get the following build breakage: ERROR: modpost: "sched_setscheduler" [drivers/usb/typec/tcpm/tcpm.ko] undefined! Please fix up and resend against 5.9-rc1. thanks, greg k-h