Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3962221yba; Tue, 9 Apr 2019 08:17:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyl1gwC/WWv+///FvTEKUJQcGfieIOJbbBC7yTBgoKtHLPhCmGLR4xGe/LsRsFJtUP9XSZ1 X-Received: by 2002:a63:2b4c:: with SMTP id r73mr35900662pgr.181.1554823067339; Tue, 09 Apr 2019 08:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554823067; cv=none; d=google.com; s=arc-20160816; b=HWUoeGuuHvGMyJ6ySGhOP3ysTBsEPcUEbVHJ5ijmVpymCXEHbUy5hg+sJ4E0LEBE7H uLwpcSRjMAoTk/RvhuGM/TxI0ueSyv6xINmyjeAvxFi3nPyfpECfUUuZe+tY68w/LGu5 pmqlcp6pnvvSElzS2truj9dZU9OiTd0Fo+/aD/OqeanLxRPL5xlULdeR+VQqUupD9aLz AgcuLM4QqTRoC/LNg/PrkYPgym4cFGQR3k8Bl1HIbshWjhk//K/Kpk6sPupApOZSfmRG NLJciLKxtXiKuIamF95mIw03dLuLnI/IzCsGVuSUHFm+7Md5bNHc/LrXwuDZ/NvljsU6 qxrA== 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=KyDoJ4EF4tKFatRTJIVOBt2T69QEP0WdD+xc0GB6Pf8=; b=0yWBQZw+Ey18eowLlOM5AuEvvG4e8EarnWyh3213Whx0pDDc1p3rL4fhJYVd8lPTKA Mu3/KnS/+fwUiZT3jegzhrmVrWDE4LF1d5aloY3pIJ+Q+C1WbsOsTjDJXazLlPu8ibql vlLlL8qfE2ZDCqaRrbH0mD9A3unW0PyzjjVtqI7BVbFN20fed58zEaYHaIGdOkRRmG2D pWT3NYzNv8q+uvbap2ev566HhfsYbQ6jlWrK4MwOw6qKimBHKbZ1u1J95eoJNS0HN9W+ w1gj2+hvGE116X0NEPq7+PVD97QsOTBMab71E/7pEIL39hrcj/xH+wswIGyXP/G1IbkJ xfhA== 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 i63si3420121pli.195.2019.04.09.08.17.31; Tue, 09 Apr 2019 08:17:47 -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 S1726636AbfDIPQx (ORCPT + 99 others); Tue, 9 Apr 2019 11:16:53 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36956 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbfDIPQv (ORCPT ); Tue, 9 Apr 2019 11:16:51 -0400 Received: by mail-pl1-f196.google.com with SMTP id w23so9592313ply.4; Tue, 09 Apr 2019 08:16:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=KyDoJ4EF4tKFatRTJIVOBt2T69QEP0WdD+xc0GB6Pf8=; b=sEb6V+GjGpX/adAxqjtR3ah3mJ5NNIR/J7jAVigYyPqa+Lb9uCNMWya45zHB9YPGWL kbpVGsu3nwzmgI/bNglWgr7PTpsXmMbdu/rl20ZsFyxHzleDptVgePn0Gz8Yc2SSn0Dl oLawAkzn9RAN108UPSblsxYAIgrQK2BIrG03OGvtl4rtQ0HZQNe5kPgk0IcPUdPwHaVI SuAN4IgkhZwWVl5D4yC6Tk7Dy/ZFsX0mPEDxh5SZu/luY+3Z6ZBI0l6Iyw9LArKxsAjg WxJ6cn0WS0S4VrNGgZRsM73qyh35EytCFGKB6U7elXMxrmDm630UZseS6QtkoAjJ8kCC UobQ== X-Gm-Message-State: APjAAAV/eJlVLKrwc7OVhqbSpOM/o3BNnCB3uD8QpKZ6HEs2oKTkpSTV qZ80rvFLQVXnlTdyRXI7+9s= X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr38121413plb.112.1554823010201; Tue, 09 Apr 2019 08:16:50 -0700 (PDT) Received: from ?IPv6:2620:15c:2cd:203:5cdc:422c:7b28:ebb5? ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id g73sm60597977pfd.185.2019.04.09.08.16.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 08:16:49 -0700 (PDT) Message-ID: <1554823007.161891.6.camel@acm.org> Subject: Re: [PATCH] usb: uas: fix usb subsystem hang after power off hub port From: Bart Van Assche To: Alan Stern , "Martin K. Petersen" Cc: Kento.A.Kobayashi@sony.com, "James E.J. Bottomley" , Oliver Neukum , gregkh@linuxfoundation.org, USB Storage list , Jacky.Cao@sony.com, Kernel development list , SCSI development list , USB list Date: Tue, 09 Apr 2019 08:16:47 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-7" X-Mailer: Evolution 3.26.2-1 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 Tue, 2019-04-09 at 10:44 -0400, Alan Stern wrote: +AD4 On Mon, 8 Apr 2019, Martin K. Petersen wrote: +AD4 +AD4 +AD4 +AD4 +AD4 Alan, +AD4 +AD4 +AD4 +AD4 +AD4 So it looks as though the SCSI subsystem doesn't like to have a reset +AD4 +AD4 +AD4 handler call scsi+AF8-remove+AF8-host. +AD4 +AD4 +AD4 +AD4 Are you talking about a PCI device removal handler or a SCSI error +AD4 +AD4 handler? +AD4 +AD4 The context of this discussion is a USB mass-storage device where the +AD4 device's port on its upstream hub has been powered off. The +AD4 powered-off port causes an executing command to time out. As a result +AD4 the SCSI error handler runs and calls the USB reset routine, but the +AD4 reset fails because the kernel is unable to communicate with the device +AD4 through the powered-off port. This causes the USB reset routine to +AD4 unbind the device from its USB driver, which in turn calls +AD4 scsi+AF8-remove+AF8-host -- while the error handler is still running. From which context does that unbind happen? From inside a SCSI EH callback or from the context of a workqueue? I think the former is not allowed but that the latter is allowed. The SRP initiator driver (ib+AF8-srp.c) follows the latter approach. See also srp+AF8-queue+AF8-remove+AF8-work(). Bart.