Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp569005ybz; Fri, 24 Apr 2020 05:36:33 -0700 (PDT) X-Google-Smtp-Source: APiQypI0kQWSgRuqViOg0p5l1sc0P+D8mUipeAqNotaI2oDK35hCXyQdBe7C3vTONSYzo1Ymuy2h X-Received: by 2002:a17:906:c06:: with SMTP id s6mr6686489ejf.198.1587731792993; Fri, 24 Apr 2020 05:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731792; cv=none; d=google.com; s=arc-20160816; b=JMKy7ykGJyHh0sun7F725//wGpqxD5nozCzUKEimtCjShBaM8CiqmJaP6XSKMQ5dTP MROsQVoAAf5LyM2uW18RkuXkJYaEd91DSEbggwW2q+waowUnxhlKMTHJqALnE+R1wwdB 7RdMsdR4Il7RsU6WuH5TDTYtGBt+zYap6euVkva8+bw5YNyQlkC0SItwdXOTIhwGeJbj c7yha9Tbxun56xBofJv3QcFU29ttSFhr18EU3lzz4Dchqm6cdNlYiHGr2Bbv+lqTn0+g Ohh721YyD3VFJJQGdvEwtVkvEnYuW9irCeu3dgmrSVxQsIlc98j4pOAJWMXyEKbnIovc GGPQ== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=IvY86w/vlNrYbumK2FD/WXZkSLCgw1+aTH4H/Oj108s=; b=HtWU6TRGIpz+6Aq9ZFSBcLAEjM4VL6Dnbv006i8308peyUddn4Qjw0xRc5u2/6RbCI 6FW/S01HvD4qrxI7s0H5dZGMXvkSWJVPLwqvRwhoY/KGBy2QTw/ANG8BcKdnVx8LmcjU kV+nVO7t0d+E9dfj3Y1AsLLaa3wO2pYgpJe3InRLmXwJjZfZBVRzAmEA0f45pRmE0yM+ lVYUuvToyjZxg4hRVnsKOw1ziHpoQQrkaavr1TDsbrFsAXSYCct1H09dzSLpleoN3h/U F1qstkJoQd1UAJi1/WlKKp7bFavgPrgfKuaWGXQOqRTue4drsAjpeLI5tXoW8sa9tWuk Nn9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cO/yWddv"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o24si2736594edr.456.2020.04.24.05.36.09; Fri, 24 Apr 2020 05:36:32 -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=@kernel.org header.s=default header.b="cO/yWddv"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728529AbgDXMch (ORCPT + 99 others); Fri, 24 Apr 2020 08:32:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgDXMW4 (ORCPT ); Fri, 24 Apr 2020 08:22:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1134721473; Fri, 24 Apr 2020 12:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730975; bh=nYV0G6EkJ94yM3KWpVtyeNfmNdgWB3s/ofgybmqmjF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cO/yWddvHRabF4ldWzBKshFvAg8FH6fdwC2X1jPezTSnsN3EeSNGXeSE1Re35f1U2 PvN3Ju7BI6PMWIqNRquuza10rHC9SBRueBjQJNeGPHmvBuN0Th6nfYIqzZPWtbh+Ld oylOwjOQ7opX7WTasAypxJcpAOQkYVkFGoKrCnOo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bodo Stroesser , Mike Christie , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH AUTOSEL 5.6 16/38] scsi: target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Date: Fri, 24 Apr 2020 08:22:14 -0400 Message-Id: <20200424122237.9831-16-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122237.9831-1-sashal@kernel.org> References: <20200424122237.9831-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bodo Stroesser [ Upstream commit 066f79a5fd6d1b9a5cc57b5cd445b3e4bb68a5b2 ] In case command ring buffer becomes inconsistent, tcmu sets device flag TCMU_DEV_BIT_BROKEN. If the bit is set, tcmu rejects new commands from LIO core with TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, and no longer processes completions from the ring. The reset_ring attribute can be used to completely clean up the command ring, so after reset_ring the ring no longer is inconsistent. Therefore reset_ring also should reset bit TCMU_DEV_BIT_BROKEN to allow normal processing. Link: https://lore.kernel.org/r/20200409101026.17872-1-bstroesser@ts.fujitsu.com Acked-by: Mike Christie Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/target_core_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 0b9dfa6b17bc7..f769bb1e37356 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -2073,6 +2073,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level) mb->cmd_tail = 0; mb->cmd_head = 0; tcmu_flush_dcache_range(mb, sizeof(*mb)); + clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags); del_timer(&udev->cmd_timer); -- 2.20.1