Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2329728pxb; Sat, 28 Aug 2021 11:13:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwslU2q/BPQJLaYWSTyti7jgXMnFfL4eHsL2M7YElMunxvW3iQlbJb//QHvDvI74bPcOANd X-Received: by 2002:a17:906:4c42:: with SMTP id d2mr16479532ejw.301.1630174428138; Sat, 28 Aug 2021 11:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630174428; cv=none; d=google.com; s=arc-20160816; b=l0hVSw4b3k0kMDXIl5nyflC4xGsf73qEnKa9RepT2RhYbroOBtvI9VjzdFkz3LFuhf kNX9kkuQd8kkANxGRdMJq68wmgUcPvibKigHNSx96DxFRtU0KOKi6PwvQUF6rhHcRWfN 89Yt7EylpJ2IPp4ChaP+LHNPQdUF4OoHLzSH04YJsRzRKsH6wQlO0WEyGSnPlkytNeYI cVep+mgMIG35S55JyJYXrGsBTl46mljdd4jGM4HFyWcDuSjw9NRwy0NHbC8L3xBpKSBZ UqWMRgAEmqzH6guSh5I+n4DvR16wKTSynD6PxBZXbY49Nzlx3vr0Hkr9871kmrAm7DRj Rf5A== 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:date:cc:to:from:subject:message-id:dkim-signature :dkim-signature; bh=K2BoyJj8+bGbXVWWBgQTfxfDFmmC2G+S85PVkQP+MkQ=; b=e0LtydstrzzCBlL1PTO8FH+VgkPg7qozO6Z4QuMCWfAu7ckpVtcceR7iJ+GWKTPr4a +vUDdvWbdG1t3OOd/NmfclVJ/2D1zSD6ZS7IzgF9fBCzV/l1TJVSHdl05JTpGiPGGB89 imaliaKvA9clErKOuO13vYlO2t65XHWO2hJnI5KNBJdYPwM2IOmeBLoHp4ZPkh/tgNfe ZHvDOjaJP+ysZUoxz8dRzFQR90+R8Wn15kJNurM7k/prVDs1JtYHHnTLlBMzV5eLbA4j 9lZvuqSqidSdaA89vp+CO6k/TKyb+jyRG6Stvt4GmPtjAourc+rE7fMv6/i0+CbfCZyu M2hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=VE0Pw2Xy; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=VE0Pw2Xy; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 22si6439122ejw.427.2021.08.28.11.13.23; Sat, 28 Aug 2021 11:13:48 -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=@hansenpartnership.com header.s=20151216 header.b=VE0Pw2Xy; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=VE0Pw2Xy; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbhH1SKs (ORCPT + 99 others); Sat, 28 Aug 2021 14:10:48 -0400 Received: from bedivere.hansenpartnership.com ([96.44.175.130]:51654 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhH1SKs (ORCPT ); Sat, 28 Aug 2021 14:10:48 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 8C4DC12802DB; Sat, 28 Aug 2021 11:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1630174197; bh=Jri9M2z+L6BNmQfbdTcw8CwtirXkoSroHqBCKW2QoKg=; h=Message-ID:Subject:From:To:Date:From; b=VE0Pw2XySNP/vbDkD8F/k4zuQTiJmro3a5Lr24d4Vt1ElhqFD1RZKupP0loobS+oZ /72Q2DdyA5vwCpf3GTYGHeP5JpYSJ9qTyS5IRPkRU/BGQqNs9Z7a96fgtbsG/KwLex ocqzfhVfRWa4DnATzLneJpDW0urqguylsNHyrD98= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xF9_Z2rMan6; Sat, 28 Aug 2021 11:09:57 -0700 (PDT) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::527]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 2BD7A12802CC; Sat, 28 Aug 2021 11:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1630174197; bh=Jri9M2z+L6BNmQfbdTcw8CwtirXkoSroHqBCKW2QoKg=; h=Message-ID:Subject:From:To:Date:From; b=VE0Pw2XySNP/vbDkD8F/k4zuQTiJmro3a5Lr24d4Vt1ElhqFD1RZKupP0loobS+oZ /72Q2DdyA5vwCpf3GTYGHeP5JpYSJ9qTyS5IRPkRU/BGQqNs9Z7a96fgtbsG/KwLex ocqzfhVfRWa4DnATzLneJpDW0urqguylsNHyrD98= Message-ID: <4313aa33c50578e6b3c52437d27704f24e27ae8f.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.14-rc7 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Sat, 28 Aug 2021 11:09:55 -0700 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 A single fix for a race introduced by a fix that went up in 5.14-rc5. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Li Jinlin (1): scsi: core: Fix hang of freezing queue between blocking and running device And the diffstat: drivers/scsi/scsi_sysfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index ae9bfc658203..c0d31119d6d7 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -808,12 +808,15 @@ store_state_field(struct device *dev, struct device_attribute *attr, ret = scsi_device_set_state(sdev, state); /* * If the device state changes to SDEV_RUNNING, we need to - * rescan the device to revalidate it, and run the queue to - * avoid I/O hang. + * run the queue to avoid I/O hang, and rescan the device + * to revalidate it. Running the queue first is necessary + * because another thread may be waiting inside + * blk_mq_freeze_queue_wait() and because that call may be + * waiting for pending I/O to finish. */ if (ret == 0 && state == SDEV_RUNNING) { - scsi_rescan_device(dev); blk_mq_run_hw_queues(sdev->request_queue, true); + scsi_rescan_device(dev); } mutex_unlock(&sdev->state_mutex);