From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60858C77B71 for ; Fri, 21 Apr 2023 14:44:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0BB87E92; Fri, 21 Apr 2023 16:43:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0BB87E92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1682088266; bh=UBAxw1wgUEfSq5zfa2z7rI4bHBi4UnHqC0xE2yapaFM=; h=Date:From:To:Subject:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ODh1R3VWhTrjsk9vwLEhoNU+mJZTOsK1yriG+2FORorYxw7ATBhF0wV7wS5KHSH+p rwkZrmUr8nMYfSziTovxSGzbcyVkS510nUGYylja9CxOf/XnaMkmZq/M0nYTd5piwq qwhYgyV6v1SPemOCdk2M5UwwVNh/xMrIFM/9uV/8= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E316BF80155; Fri, 21 Apr 2023 16:43:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 646D7F80155; Fri, 21 Apr 2023 16:43:01 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DAAD0F800D0 for ; Fri, 21 Apr 2023 16:42:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DAAD0F800D0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=HVVxQMBS; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=n+Yb+bt7 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5097C218F2; Fri, 21 Apr 2023 14:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682088178; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FUaHjqwAUBVTmW0O/bwvpnE48ou2UUiRPqDFHCuym3M=; b=HVVxQMBS7rq9Ji7T7UJvFhFYmPbIht4wZMdNEBF84t8JM5xqU1wTZYMU3Jxcs6iRt+cA1/ ztMystp5eKj+sDEMeScBjHAHV/TgUT9MbIc7ihu6b+hs5K1GX3ha8IrrJWpVcP5C8bSvDQ Oja3UIfXaxczek1c21m9O4jw26EV7iY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682088178; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FUaHjqwAUBVTmW0O/bwvpnE48ou2UUiRPqDFHCuym3M=; b=n+Yb+bt7mR0jXjlxH8/MBdsTegmSosMzwCokv0AmwV8vHfryEZDO4R3+3dU6UxJEiNNRKm aKOCCdpkZoEquiCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 219991390E; Fri, 21 Apr 2023 14:42:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7xoAAfKgQmQpBAAAMHmgww (envelope-from ); Fri, 21 Apr 2023 14:42:58 +0000 Date: Fri, 21 Apr 2023 16:42:57 +0200 Message-ID: <87wn25qosu.wl-tiwai@suse.de> From: Takashi Iwai To: Chris Down Subject: Re: [PATCH] usb-audio: Rate limit usb_set_interface error reporting In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-ID-Hash: OUXEBOLQXMTPWSNYIZV2IUFUS6KLMMRU X-Message-ID-Hash: OUXEBOLQXMTPWSNYIZV2IUFUS6KLMMRU X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Takashi Iwai X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 21 Apr 2023 16:38:41 +0200, Chris Down wrote: > > When an error occurs during USB disconnection sometimes things can go > wrong as endpoint_set_interface may end up being called repeatedly. For > example: > > % dmesg --notime | grep 'usb 3-7.1.4' | sort | uniq -c | head -2 > 3069 usb 3-7.1.4: 1:1: usb_set_interface failed (-19) > 908 usb 3-7.1.4: 1:1: usb_set_interface failed (-71) > > In my case, there sometimes are hundreds of these usb_set_interface > failure messages a second when I disconnect the hub that has my USB > audio device. > > These messages can take a huge amount of the kmsg ringbuffer and don't > provide any extra information over the previous ones, so ratelimit them. > > Signed-off-by: Chris Down This patch itself is safe and good to have, so I'm going to take it as is. But I'm still curious in which code path the problem happens. That is, we should address such unnecessary repeats if possible. Do you have some more data? thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25364C7618E for ; Fri, 21 Apr 2023 14:44:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232770AbjDUOoe (ORCPT ); Fri, 21 Apr 2023 10:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232263AbjDUOoc (ORCPT ); Fri, 21 Apr 2023 10:44:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578094487 for ; Fri, 21 Apr 2023 07:44:02 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5097C218F2; Fri, 21 Apr 2023 14:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682088178; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FUaHjqwAUBVTmW0O/bwvpnE48ou2UUiRPqDFHCuym3M=; b=HVVxQMBS7rq9Ji7T7UJvFhFYmPbIht4wZMdNEBF84t8JM5xqU1wTZYMU3Jxcs6iRt+cA1/ ztMystp5eKj+sDEMeScBjHAHV/TgUT9MbIc7ihu6b+hs5K1GX3ha8IrrJWpVcP5C8bSvDQ Oja3UIfXaxczek1c21m9O4jw26EV7iY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682088178; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FUaHjqwAUBVTmW0O/bwvpnE48ou2UUiRPqDFHCuym3M=; b=n+Yb+bt7mR0jXjlxH8/MBdsTegmSosMzwCokv0AmwV8vHfryEZDO4R3+3dU6UxJEiNNRKm aKOCCdpkZoEquiCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 219991390E; Fri, 21 Apr 2023 14:42:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7xoAAfKgQmQpBAAAMHmgww (envelope-from ); Fri, 21 Apr 2023 14:42:58 +0000 Date: Fri, 21 Apr 2023 16:42:57 +0200 Message-ID: <87wn25qosu.wl-tiwai@suse.de> From: Takashi Iwai To: Chris Down Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai Subject: Re: [PATCH] usb-audio: Rate limit usb_set_interface error reporting In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Apr 2023 16:38:41 +0200, Chris Down wrote: > > When an error occurs during USB disconnection sometimes things can go > wrong as endpoint_set_interface may end up being called repeatedly. For > example: > > % dmesg --notime | grep 'usb 3-7.1.4' | sort | uniq -c | head -2 > 3069 usb 3-7.1.4: 1:1: usb_set_interface failed (-19) > 908 usb 3-7.1.4: 1:1: usb_set_interface failed (-71) > > In my case, there sometimes are hundreds of these usb_set_interface > failure messages a second when I disconnect the hub that has my USB > audio device. > > These messages can take a huge amount of the kmsg ringbuffer and don't > provide any extra information over the previous ones, so ratelimit them. > > Signed-off-by: Chris Down This patch itself is safe and good to have, so I'm going to take it as is. But I'm still curious in which code path the problem happens. That is, we should address such unnecessary repeats if possible. Do you have some more data? thanks, Takashi