Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3097819img; Mon, 25 Mar 2019 03:49:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1+E1bbysZKx6PfZFG1vEaJ8z7MS+x7phzTKnIe3gwN2uz4f/+TdzejkzqHod0QNH24bPl X-Received: by 2002:a17:902:8d8b:: with SMTP id v11mr24901470plo.241.1553510968598; Mon, 25 Mar 2019 03:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553510968; cv=none; d=google.com; s=arc-20160816; b=0EhrR2V8ra/yV9EVXTqQU66ESLGPohXkjQpiSYhkkNMss8ZoiWsBVyzS8027tIaG8y p4MZlDOFuS/RlPQ1RC+0fzUmsSeeVeysk0JWAhhBVrwzMBIuTV9f73+JyIrYJdKMg3cV s3BuRXO+/Pqs/CDNeNPs01KQaBKKvFZdjf4DiaZoyQ7NI6gI6DVwp8chaKaVZUo1AKGY XJdDFOBeby8PYgKpUe6cyooEHhDB9oSvdWHfh8mcXxjINa08Q0Y+Tk3KnFQQawldgrym Hfc5p0G7o9Sbp/27yAUpaL+c1vJ0/v+PrqnJnS8B9iMTZD3WuV1WftVp56ZDB3pJO5Xy TtKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=DQsSaaagaIoAyMaWH6+u+hKMF8DGDjVJwPQ4rkI8S0Y=; b=yQoJGpuHRlmYLFAydw00+1j4bQHhEWKdQXFkf6iHhWBOzyxFxSLjuw0lSdUdZLDpha DbzdB4XTOwJ5yUOZXTZAoxR3rty+ccelaPSdbEwYP+RK7TYz/O91nnMhJte1JsNUvhuc 1vRAhK1iCJCE8lIAHsCy9hZopaHG2FMyrwTwZTyp/xKp5M66cyUkHzIcL/qF87r6ohiz 2owxGraIoTfHZKY4pD4KUEQ0qmq5iTxvcUyQmVKyOT3tsHuCU6EEahPQAb3JS8LkkvWj sv0ekc2ok2NKvshUFm/HeS6fh/nsT/fMJbFNWTuMqKn7NguHc1mqSYY3x6jOyr/QAFIo Dz4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si13658241pfe.166.2019.03.25.03.49.13; Mon, 25 Mar 2019 03:49:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730856AbfCYKrB (ORCPT + 99 others); Mon, 25 Mar 2019 06:47:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:34706 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729727AbfCYKrB (ORCPT ); Mon, 25 Mar 2019 06:47:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9605AAF3F; Mon, 25 Mar 2019 10:46:59 +0000 (UTC) Message-ID: <1553510086.2668.2.camel@suse.com> Subject: Re: [PATCH] usb: uas: fix usb subsystem hang after power off hub port From: Oliver Neukum To: Kento.A.Kobayashi@sony.com, gregkh@linuxfoundation.org, stern@rowland.harvard.edu Cc: usb-storage@lists.one-eyed-alien.net, Jacky.Cao@sony.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org Date: Mon, 25 Mar 2019 11:34:46 +0100 In-Reply-To: References: <1552063928.29776.2.camel@suse.com> <1552405047.21557.7.camel@suse.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mo, 2019-03-25 at 10:21 +0000, Kento.A.Kobayashi@sony.com wrote: > Hi, > > > > > And the return value(-ENODEV) will be returned to error handler. > > > > uas_eh_device_reset_handler->usb_reset_device -> usb_reset_and_verify_device (return -ENODEV) Then I wrote that commit message that we think even if we ignore "ENODEV" in post reset to avoid hang issue but the error will also be reported to error handler. > > > > #If ignore an error and the error will not be reported then it is not good. > > > > > > Well, what do we do now? Are you saying that the state model SCSI is using is wrong? > > No, it is not wrong. > > But I think we may want to prevend hang by sleep peocess with continuing to take a lock at blk_execute_rq() from >usb_unbind_and_rebind_marded_interfaces(). > > Could you please you can apply this patch for mainline or not? > If not, could you please tell me why you can't allow to apply this patch? Sorry, I thought this was clear. Your patch is making the assumption that the reset is triggered by the SCSI layer. You cannot make that assumption, as there is an ioctl for resetting a USB device. In case we are getting an error during the reset (our endpoints vanish), the device driver must report that to the USB layer, so the driver will always be disconnected. We cannot drop errors. Regards Oliver