Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2104595pxb; Mon, 11 Jan 2021 00:30:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTsk6oSf+LOW6L/9FjjRwgKCGQSg880nDy/Z3S0wAgTyk/iLcKC3ho+IcszjWZMANbveWz X-Received: by 2002:a05:6402:3074:: with SMTP id bs20mr13389727edb.365.1610353821636; Mon, 11 Jan 2021 00:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610353821; cv=none; d=google.com; s=arc-20160816; b=FjvSZvcU8zw9a1cNyK06/2LR8eS45tOctQUIN5f9Qrnqb5eseBo9YPLpk9Fj5kNZdm kp9e2HQnPKHFDn0B8Vz/VV9AZH2ZaJRf7XWBy23qvVkQJu+AxgS7U08/RErIn3fUqHCB rcRYfzwrZHJs7cnuRLwzmwxbtfPgpd7yg/3YhnRmUXJ0Thvq9xFqLvoNSn1aeNKLyR6K ptH67F1uW8Bh9Cw08VW+0HrigmzkXDcoA0MQ47onBrrAIhJFCtaGcQ18JrYpwPBHeNRJ dOgnd1QS1Pj08aQvskgZSIFqXV/E2DfFnBOQ1YGkltfe0XsJcs+fnpsv6qUPP5DUCS+J LpcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=+vaBDW1uw9OiPhpDhlgvScR2NR5Dt5aOLKBJAoiDM/g=; b=AE+LeGf4whs3b0UtRrz/0ijjBEO5cRpt98DJJc7Jy77TQL5QnzEuf3cFpR3Duq0sEZ 7U5rEbJSGKSpSZUzHpWpS2LQ1aDwB172l4BBjv49Y5PKiDVQuwTzF0hUAJldIPh9/uys JoPXz7veCvkAlX/wafC0evx1iWJPWAJmTJyIzTg7S4KtryNpvC+w3lGYIXuVbH58qpmN ytGmFdCUIek2UPwtn0CRkUAB83hZHG2L4b67yePgrU1tIwjPigWg6IjxCirzxBVeqpWx swHqgUBTqqBIQk0SjKTNsjgutwxFg7ymLtyErv9y701caWAhRa0bATCfU0gaX2DW20oi nP6w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si6245484ejb.78.2021.01.11.00.29.58; Mon, 11 Jan 2021 00:30:21 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbhAKI3M (ORCPT + 99 others); Mon, 11 Jan 2021 03:29:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:44316 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727623AbhAKI3L (ORCPT ); Mon, 11 Jan 2021 03:29:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 044A4AD18; Mon, 11 Jan 2021 08:28:30 +0000 (UTC) Date: Mon, 11 Jan 2021 09:28:29 +0100 Message-ID: From: Takashi Iwai To: Davidlohr Bueso Cc: balbi@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH] usb/gadget: f_midi: Replace tasklet with work In-Reply-To: <20210111042855.73289-1-dave@stgolabs.net> References: <20210111042855.73289-1-dave@stgolabs.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Jan 2021 05:28:55 +0100, Davidlohr Bueso wrote: > > Currently a tasklet is used to transmit input substream buffer > data. However, tasklets have long been deprecated as being too > heavy on the system by running in irq context - and this is not > a performance critical path. If a higher priority process wants > to run, it must wait for the tasklet to finish before doing so. > > Deferring work to a workqueue and executing in process context > should be fine considering the callback already does > f_midi_do_transmit() under the transmit_lock and thus changes in > semantics are ok regarding concurrency - tasklets being serialized > against itself. > > Cc: Takashi Iwai > Signed-off-by: Davidlohr Bueso The patch looks good to me. Reviewed-by: Takashi Iwai BTW, now I found that the driver doesn't have the cancel call for tasklet or work at the unbind. Practically seen it's no big problem, but its lack is a bait for syzbot. We may need to just call cancel_work_sync() somewhere, probably at f_midi_drop_out_substreams() or f_midi_disable(), but it can be in another patch. thanks, Takashi