Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2271286yba; Mon, 15 Apr 2019 08:19:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0tucj9CbpkzZoaPIDuWo/BqkM2NfpiDp4aOgt6AVf1n933enVRJtRfi2AZgrPMC0B7Ll/ X-Received: by 2002:a63:7808:: with SMTP id t8mr67402869pgc.127.1555341570987; Mon, 15 Apr 2019 08:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555341570; cv=none; d=google.com; s=arc-20160816; b=LhwU6pXVCOGH2ERXKs25JcVrXDZ+PnsV1cONXxzk6Yh+i/SccqCpakXpC0kWDxEKnx S6ixjJQU+vY7fynI6idmelGVlx4bDy5xp8gxHm3TRcrtuR96KkWgL0J2g71eix8MA/ZN Qh1nExDN7hOReH1tkfkKaA/qoNrxL5rpppypl9qNEbRVzYW+8HWRo7wHomiVmcwK83WF D/nOk3xgseZ8Fy8RsFLQKea2BuqwBekzs6WWcvnJ2SzBfC50CgI4wOO0LFyvpLU/nTR1 D8ERN0h+rmmMLQ7ghCIavnJ15fzFyVPxDnpiZauUlNzfga4064lZd6oOX055SDa1jhWP 4JzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=K5CjGFKUV9PGHPfTKDbIUgPZxiBmI6WWN0M7f7H6wk0=; b=cc57dV8Fny1u8RXDSi2HdAYKap3rmIvLMHhNVRoD47euRzbvusnWkBOj4YzrQ6dCsp 6GwGyXW+6rpXHP3t9maRMlHF/X4cLP3VdCtEwV6cavCFajI/5DLC54Ho6OUkPJhsKdAu rDwa8+hAtX1CucRyiT/Eix6G7pMfEmzx7ipvzSgau0RQpgRom2/rtdNIkmbLdWilo703 8CuJKGXJILOEkgMImvg7xBll+UhvA/jx6cZ+YlAOvJaJWsao2NL+Dg6HRYUlw0Hm92Jq 0wznyXjwAirCAz9iwaMCrogI/YOa2vKkRSTARURAYdSxWQaY5X04MubGd6BCZLfFOfy1 n7ng== 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 p8si44647210pgb.77.2019.04.15.08.19.14; Mon, 15 Apr 2019 08:19:30 -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 S1727612AbfDOPSc (ORCPT + 99 others); Mon, 15 Apr 2019 11:18:32 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:39390 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726522AbfDOPSb (ORCPT ); Mon, 15 Apr 2019 11:18:31 -0400 Received: (qmail 4942 invoked by uid 2102); 15 Apr 2019 11:18:30 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 15 Apr 2019 11:18:30 -0400 Date: Mon, 15 Apr 2019 11:18:30 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Kento.A.Kobayashi@sony.com cc: bvanassche@acm.org, , , , , , , , , Subject: RE: [PATCH] usb: uas: fix usb subsystem hang after power off hub port In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Apr 2019 Kento.A.Kobayashi@sony.com wrote: > Hi > > >The unbind happens from inside the SCSI EH callback. If that really is not allowed, we'll need to change it. Or we can just change it regardless, since the effort required is pretty small. > > > >Kento, please try the patch below. Does it help with your problem? > > Thank you for suggestion about this problem. > I confirmed your patch fixes this problem. Good; I will submit it. > I think you change policy for error handler to not calling unbind, right? That's right. > In addition, I have a question about this patch. > Could you please tell me why it should not be allowed that the unbind is occurred from eh callback? The SCSI core does not handle unbind properly when it occurs inside an error handler callback. If you want to know more about why the SCSI core behaves this way, you should ask the SCSI developers -- I don't know the answer. > This patch will ignore all error which is returned from usb_reset_and_verify_device. > But my patch will ignore error only being returned ENODEV case. > I think side effect of your patch is bigger than my patch. The only other errors that usb_reset_and_verify_device() can return are EINVAL and EISDIR. These error codes occur in three situations: The device has already been disconnected; The device has no parent hub (it is a root hub); The device is currently suspended. The first situation is just as bad as -ENODEV. The second cannot happen for a USB mass storage device. The third can happen only if an error occurs when usb_reset_device() tries to carry out a resume, and that's also just as bad as -ENODEV. So although the side effects are larger than with your patch, they are not any worse. Furthermore, they handle correctly some situations that your patch does not handle. > So I want to know why the unbind is occurred from eh callback should not be allowed. Ask the SCSI developers. Alan Stern