Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2362620rwr; Fri, 21 Apr 2023 07:58:17 -0700 (PDT) X-Google-Smtp-Source: AKy350YlEOoUTNnTgocVKbF03n4dxhvoyCYMKaB7uhBIk9e4OVXZEM2TEJvGT5o+3Nf4+47HaazG X-Received: by 2002:a05:6a20:728a:b0:f1:c0a1:8035 with SMTP id o10-20020a056a20728a00b000f1c0a18035mr7785834pzk.0.1682089096789; Fri, 21 Apr 2023 07:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682089096; cv=none; d=google.com; s=arc-20160816; b=ZlWFh1tpOv8M8mMeGOY+iBudMSuguO6TQL2l/BqEBdY2Db4YZ+/ZKfmEMCvTFJYcZ0 f2PMGamy96QRpNEuNQ2aeH+yUBwRPUNl9vj8Wegg4lIJ0r1Ofhw8MgyMlfhxEyr5Rwek UXOzY9L03W/I6AYHJiJjh8z+jzmAgLirnppntFvAerbYJH+V1RmM7CCXPRfVELGRwFpm +lKjWBid4bfD5878PaWzHKl87ysunuUzsQJUxVcQ4/Y/BAc6Qn/bZzDK7RQvY7qJPmyg g6u2EfNHPnB/60MaGjZfGmy8D8IEaopz0NOpRxInhc+DFnNzDpus7JxjUjDezBA2Lv2y /tSw== 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:dkim-signature:dkim-signature; bh=FUaHjqwAUBVTmW0O/bwvpnE48ou2UUiRPqDFHCuym3M=; b=oFlzpQS0O2Klg598/mKa9I8vEOgY3PAerNWmDfhqkC7eOBNyv6XRDM4WxpFLq5mo0m brA2hgh+HBsck8kY3TDWb3s+AA2+Tm0JVJ/E7sqYxWnPCUfxdaW4x7dhxiEvX7+HLW8m lAqBZ4lpz8/do7D682NxdQ3TdbWnusLe1w/9V4p8tx6k/W3SWsSx7yUaFgGl4IUHBrvv B5ARvvuFvfuiHPOBhinELFcXxnxAV88Zz3ZzKyuQcqkXjn+EPZTqoDCEEKt/iwWC/tFg Z5lf7/HPzBnB1cLGBoNhhaT8VsV5JXSajiNhujiO8fwEaKCSWr9VJFw0yQ62fW/O0w0m uUPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HVVxQMBS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a12-20020aa7970c000000b0063bba11c4a0si4640766pfg.59.2023.04.21.07.58.05; Fri, 21 Apr 2023 07:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HVVxQMBS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232587AbjDUOoe (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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