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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 582BFC5B57D for ; Fri, 5 Jul 2019 22:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3192420856 for ; Fri, 5 Jul 2019 22:01:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728251AbfGEWBe (ORCPT ); Fri, 5 Jul 2019 18:01:34 -0400 Received: from gate.crashing.org ([63.228.1.57]:40935 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfGEWBe (ORCPT ); Fri, 5 Jul 2019 18:01:34 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x65M1HGt013708; Fri, 5 Jul 2019 17:01:18 -0500 Message-ID: <15f6a7e8cbe534cbc4f647f6f99cdef80a7b01ad.camel@kernel.crashing.org> Subject: Re: Virtual hub, resets etc... From: Benjamin Herrenschmidt To: Alan Stern Cc: Felipe Balbi , "linux-usb@vger.kernel.org" , Michal Nazarewicz Date: Sat, 06 Jul 2019 08:01:17 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, 2019-07-05 at 10:08 -0400, Alan Stern wrote: > On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > > > > > > As for f_mass_storage, repeatedly attempting to queue an OUT transfer > > > > > is normal behavior. The fact that one attempt gets an error doesn't > > > > > stop the driver from making more attempts; the only thing that would > > > > > stop it is being disabled by a config change, a suspend, a disconnect, > > > > > or an unbind. > > > > > > > > Except it does that in a tight loop and locks up the machine... > > > > > > Well, that wouldn't happen if your UDC accepted the requests, right? > > > > Sure but it would be nice if the mass storage dealt with -ESHUTDOWN > > properly and stopped :-) Or other errors... if the UDC HW for example > > dies for some reason, mass storage will lockup. > > I suppose we could add code to check for this case and handle it, > although I'm not sure what would be the right thing to do. Delay for > one second and try again? Disable the gadget until the host does a > reset? I think just stop it until the next reset yes. > > > Besides, f_mass_storage won't repeatedly try to queue an OUT transfer > > > once it knows that it is suspended. > > > > Not afaik. But I might have missed something. I didn't see any suspend > > callback in f_mass_storage.c... > > Oops, right. Sorry about that; my memory is slowly decaying. I need > to upgrade my brain's RAM... Haha, I wish I didn't have that problem too :) Cheers, Ben.