Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1701531ybg; Wed, 29 Jul 2020 23:44:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPD4mjCfDch6LwNdoRDWO3eElfnyJmnezidMNJRUH0xk6uOsx3Yxpr00otej1L/bzAku2E X-Received: by 2002:a05:6402:c85:: with SMTP id cm5mr1266268edb.350.1596091487870; Wed, 29 Jul 2020 23:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596091487; cv=none; d=google.com; s=arc-20160816; b=BdUAc4vDtkPxJkfaaQ23JnTYz6BGan4O2yRJ+U5mkFRzirb4WyT5Wikf6BW8PULVfU VvnxD2Cg5z+JpmOKcJKva/z2wl4DU4QUWS+YhYVf0799jSrzpqhnpNJwojYw9fdKaJUM kaj0NfHrb84bcF60V9xSD0fwhqMxwy9K4WwgPEyrSwu/DXQRBZ+TllbGERaMzuSS25ST wYcKfEfDpB7RmbG2Nv7NeracGb+m/Y+rJOd02GL1HjUUyu4WNhiX6lZRjtmXPah8XKgS CUJYnZoVhIwk+gk0OJ7wyU5XC1ckLmyfsRt3UiOnvmpzbTkhvyt7lcVJ9773b/FnC5Mm g6/Q== 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=QbadMdtae1ApEwewb8j8ZMJDR5M1PXFq80HaPhpzmtE=; b=aG4mgjOEdHTMZv5ZcrumIjST2JztwXjYyj/oRzrb8mdPvmi+Tz6obxnwdjs6qqJ0H7 brbpNtUUFEZjA/KxSl/VuTu6Yfmz4uYzqvSlxz6xaZ8SnP2uuXH1nstD6CgwfQ3PUeSq Xty61mZ1q6nZQqNbGn8q462BaEZKzF7SQfv0rXwAwTDhIxi2fsFG59g7/j6EW9LjEQoe 9zGKz0a74tRVmk6qcbuOkbFXSC1oiU/jWeZT+TE7wiCwxkmrN0cVr0bhJM6DAQNJGtWz A4pu1vfdInWxghkom1IMOfB9qx3UO0kaHs9ntu2pUAglhNsIaQ3zr48X3rz2aM8MgxvH s9sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A1FiKYPa; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si2501558ejr.98.2020.07.29.23.44.25; Wed, 29 Jul 2020 23:44:47 -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=A1FiKYPa; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728802AbgG3GoH (ORCPT + 99 others); Thu, 30 Jul 2020 02:44:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbgG3GoH (ORCPT ); Thu, 30 Jul 2020 02:44:07 -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 E3918206D7; Thu, 30 Jul 2020 06:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596091446; bh=MVEIO7FfojzQztFXL9hSu5cyY0RA3fORSt6UPu4rm/E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A1FiKYPaH2+h9zer3nVVTKIHkZyRLDJ55pAj6CjKudvNPdyLel5Bga4zkaFViIkaD tYYTFcNOoljvUQlJxHVm1X0htfpq+0F2sYd4y2wQuzzEZ7NmX78+j0PY7thuwNc5Yv LLSCs2cm9lxqKt0VhIjQzYkCNLfqLoKhgpZuVuXE= Date: Thu, 30 Jul 2020 08:43:56 +0200 From: Greg Kroah-Hartman To: Badhri Jagan Sridharan Cc: Guenter Roeck , Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] usb: typec: tcpm: Migrate workqueue to RT priority for processing events Message-ID: <20200730064356.GA3910237@kroah.com> References: <20200730022457.3021112-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: <20200730022457.3021112-1-badhri@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Reviewed-by: Guenter Roeck > Reviewed-by: Heikki Krogerus > --- > 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