Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3881851pxu; Tue, 20 Oct 2020 03:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjHOvV9C0dm1Uzrh+2+F46njrQjmns6fKyg4SJyQuJsn8rJHleTXNFOc+JdWS6Qf/mdkJE X-Received: by 2002:a17:906:1150:: with SMTP id i16mr2296385eja.82.1603188180860; Tue, 20 Oct 2020 03:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603188180; cv=none; d=google.com; s=arc-20160816; b=DolkYjtH6gazY9aTzPnL7I1+IiAV1xynnd0SrEVl3vc4ZMekyYcN6sbCfIi4h8HvP/ rYQnfbknoc9NfVB7R3BfL2NoXfKTwy2sMpmwL7ptU9hWEG3lElZv4uUuzqvAYDboZLCE RptqZFrsEPqhjFfBZjg3gs8Uxq6RSBbM/GTcCZNE8V9qs4BFL7Gs41ZTy6ExE8MK28lA S3OAdR1VEA6+QC0NS98xrNtBy1t2U7t4pnX/Jlwo6Hz6wrV/Hz44fBd7I1zDgFqxsqD3 O5vGPi4PmTmfZJxHQaGrswtA3WHMkRnZpABSk/CRBE1cUuHziO3hnjXX1p6Pvnzi00Ts Bmww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=IyHsTupE9fuRCreVd/5Khl5usGRzJYicWfZVGY98Tjk=; b=GHHnj9f+vTTL7zlZMfa6cJQU6h2pZv8CSYdO+zPQ17mk6/tnizSQFIDH3HNEL/ISXd EvVnNAJHafjrU+jl2OfFK+qXSKGGVxbbIoAUG/cF4afQP8qPAI2606ewgGfOi43WlXRm 8IHFj9s5UdIcCtUQN6QPE3mPcTphlU1cfClSQFaC9ucVx3tS3EPJ19iRPumU1ElSvPBT 4LXqYS6M4Duaq8cW2XpBZ9a6ltxGLCApYVo8tNo4LAgK3gstb6tSBl2D6Uk5S6pmPus0 /wj/anhpXkSLM8qt99Z+CnCUEg/XyaIMxLKNyeqnymei5jAy4mXCfJFFlugUZBWXIl31 M0Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=o88PlNkV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs10si823190edb.190.2020.10.20.03.02.38; Tue, 20 Oct 2020 03:03:00 -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=@suse.com header.s=susede1 header.b=o88PlNkV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387393AbgJTHmI (ORCPT + 99 others); Tue, 20 Oct 2020 03:42:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:35684 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731568AbgJTHmI (ORCPT ); Tue, 20 Oct 2020 03:42:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603179726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IyHsTupE9fuRCreVd/5Khl5usGRzJYicWfZVGY98Tjk=; b=o88PlNkVACqAvIX4H5PqG/DTmKfZqGqoXRwIJizXfHw8wI1qJGLezu0+0hNa0tQV/TiFBj HLI9fye+zlRG5VDv7wrokipiFK/zb4Gf3j7Caf4jKrTMzfYglJaGtXwsYizmkOd091BNaY u3UbVvQuDv0THJu8SzSxBe8n/rYNTtU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9F0A6AE09; Tue, 20 Oct 2020 07:42:06 +0000 (UTC) Message-ID: <09636f3b8dbd3838ba7a568f611a0323e85c4404.camel@suse.com> Subject: Re: [PATCH] usb: cdc-acm: fix cooldown mechanism From: Oliver Neukum To: Jerome Brunet , Greg Kroah-Hartman Cc: Kevin Hilman , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Pascal Vizeli Date: Tue, 20 Oct 2020 09:41:34 +0200 In-Reply-To: <20201019170702.150534-1-jbrunet@baylibre.com> References: <20201019170702.150534-1-jbrunet@baylibre.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, den 19.10.2020, 19:07 +0200 schrieb Jerome Brunet: > Commit a4e7279cd1d1 ("cdc-acm: introduce a cool down") is causing > regression if there is some USB error, such as -EPROTO. > > This has been reported on some samples of the Odroid-N2 using the Combee II > Zibgee USB dongle. > > > struct acm *acm = container_of(work, struct acm, work) > > is incorrect in case of a delayed work and causes warnings, usually from > the workqueue: > > > WARNING: CPU: 0 PID: 0 at kernel/workqueue.c:1474 __queue_work+0x480/0x528. > > When this happens, USB eventually stops working completely after a while. > Also the ACM_ERROR_DELAY bit is never set, so the cooldown mechanism > previously introduced cannot be triggered and acm_submit_read_urb() is > never called. > > This changes makes the cdc-acm driver use a single delayed work, fixing the > pointer arithmetic in acm_softint() and set the ACM_ERROR_DELAY when the > cooldown mechanism appear to be needed. > > Fixes: a4e7279cd1d1 ("cdc-acm: introduce a cool down") > Reported-by: Pascal Vizeli > Cc: Oliver Neukum > Signed-off-by: Jerome Brunet Acked-by: Oliver Neukum