Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3469764rwa; Tue, 23 Aug 2022 05:24:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6GOA3ryKJUg8WkvAA5YHXtvKhZ9wKLC6roLNcMAsf94k4v0l0tURNB6DwPkNV5MDFFO40p X-Received: by 2002:a17:90b:190b:b0:1fa:a374:f563 with SMTP id mp11-20020a17090b190b00b001faa374f563mr3109933pjb.52.1661257464191; Tue, 23 Aug 2022 05:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257464; cv=none; d=google.com; s=arc-20160816; b=TUhA38ms4Y77j2EqhwnrfzyXVg1DVY9i447ARWTgRDQHMmRJ23svVDW5U1exjRswyz 6K7MzemE9C4KaRugiLNI4V6YNlWnQBybEjWMjLz8ftPZJNiPI8qgDgbTHo94NPQCll8f l5+vFkzeokEaDNrDy31g2gqPqmJ3tL4IzRlScmCL7p+FobAITNHnjJ5VwfyKn2/5sMGP MkhXPLWDYR9GkWNxXJ3uTZmnh57ASWdISClwazhDwsL0oXTLjFewDv2suAnxMGRiQlmJ D+L79wU3Cth8WtYcfgKnNaK3J9C5DipksRgkKwkm7NhNLiD862csfTr/YS/wg9e8yp2e Otqw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nyvQjswMWjfy4Aa5yNYze3+8P9cRvzUUY3SOZ9QMDjg=; b=OfEmQxiVBCBAfzNXnTW1JTqASsR4GdWOh231KahOlHcgbSfz/HW+nesBG5IOuwkvlj FGlXfQ2wcvSNGOlonI9bnbrncZ3CA1NZ+aftyV7FZ7ApowhwSHFwEY47ZWSIEUB20IFb DjZUfRrcQGxbVX1ZsyUfxOwEv0f98WgeUdOrFVWH7GmXcbvglNgxLkT5BwwpSYSNiN/N yzIKYk2iZhByLiaPXpHQM2v0gNk+bHYXwK2YpDT99YXj+FOzrNGF/xwT0TKot6iHdsXs Qoirb+8P13Bky7dtsVpr3I+AbIiDya6OdZ489o7ttbW1ZnEvLS7m3wCDV9UNKbjmxTKc Bf8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WovB5bfC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q70-20020a632a49000000b0042a529a3455si1123653pgq.260.2022.08.23.05.24.12; Tue, 23 Aug 2022 05:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WovB5bfC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242617AbiHWJtq (ORCPT + 99 others); Tue, 23 Aug 2022 05:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241981AbiHWJrL (ORCPT ); Tue, 23 Aug 2022 05:47:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D220A8E0D1; Tue, 23 Aug 2022 01:44:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0BFA9B81C62; Tue, 23 Aug 2022 08:43:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 112E6C433C1; Tue, 23 Aug 2022 08:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244233; bh=ukwapbfI9bnj1qkrK8Q3hXNU2QLw365AmtkZrw2+F0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WovB5bfCKWi36ckgoYiR/GkAjL5bY7YhN7eb9g6CWMqTEPzLqMgkNdA+yMz4kuI6B H432rz4gXYL2pDKogvINx5bQ3fs6gBCKMeYceke/r59BRxtSeD2OnIpNayXJ8YRSKI gmxVoYEuOEm4hPnnC3ifJWVid2vpr+Cp+uATzMAg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Benesh , Scott Teel , Mike McGowen , Kevin Barnett , Mahesh Rajashekhara , Don Brace , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 106/229] scsi: smartpqi: Fix DMA direction for RAID requests Date: Tue, 23 Aug 2022 10:24:27 +0200 Message-Id: <20220823080057.470653754@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mahesh Rajashekhara [ Upstream commit 69695aeaa6621bc49cdd7a8e5a8d1042461e496e ] Correct a SOP READ and WRITE DMA flags for some requests. This update corrects DMA direction issues with SCSI commands removed from the controller's internal lookup table. Currently, SCSI READ BLOCK LIMITS (0x5) was removed from the controller lookup table and exposed a DMA direction flag issue. SCSI READ BLOCK LIMITS was recently removed from our controller lookup table so the controller uses the respective IU flag field to set the DMA data direction. Since the DMA direction is incorrect the FW never completes the request causing a hang. Some SCSI commands which use SCSI READ BLOCK LIMITS * sg_map * mt -f /dev/stX status After updating controller firmware, users may notice their tape units failing. This patch resolves the issue. Also, the AIO path DMA direction is correct. The DMA direction flag is a day-one bug with no reported BZ. Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver") Link: https://lore.kernel.org/r/165730605618.177165.9054223644512926624.stgit@brunhilda Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 4055753b495a..5b1f15720947 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -4652,10 +4652,10 @@ static int pqi_raid_submit_scsi_cmd_with_io_request( } switch (scmd->sc_data_direction) { - case DMA_TO_DEVICE: + case DMA_FROM_DEVICE: request->data_direction = SOP_READ_FLAG; break; - case DMA_FROM_DEVICE: + case DMA_TO_DEVICE: request->data_direction = SOP_WRITE_FLAG; break; case DMA_NONE: -- 2.35.1