Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260823rwb; Mon, 15 Aug 2022 22:35:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5tJDlwoFg3t9z3fG65TzXFm1soOXa40B3VTeUJfYWRvtyeNLASwFTBT8ohihZurzP3fL80 X-Received: by 2002:a17:902:e5d1:b0:16f:15a1:6dbc with SMTP id u17-20020a170902e5d100b0016f15a16dbcmr20425551plf.73.1660628127316; Mon, 15 Aug 2022 22:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628127; cv=none; d=google.com; s=arc-20160816; b=H+VDLmIBa0lEKFs/piWJOwlEVxcI6/CJhwd2SnWafpCfR16XXzcsQe9gfpiNpTmJXd tnzwe1YKhpIlNS8EBfKnqzWyxXF2KZhgpLlHZTb7Mn7qaMz3lEbMn3ht8SxukSRGcJLh LpTlEDHEU1QHerUIJLhH5ejlH29mq8IlRKmJX9IlKJVAoakffIlYBD4tTKTBxTRsFsIy nDJbsV/rD2LZqoAN2k8ZTizM+X/HVOCa13cmUIo4598RKT7cuf2ltQx2vGEKOkRUE+aw N9ET7Bi41mESXd2D9dr5hOE1mxol3qePbXiRIcsYwVMlQA2ReKrPcfumPmgwfJrUe6WI /reA== 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=d4+YYPBXnSBTCvW/VSYWsRjXAaE3lDCoOF0Z8smKCHU=; b=gyzd1s0plAKbpM8u7b750OJlsdbT9yfhESwAQRoOA6rHJ1fwYvOvjgoV+0Neg3Kw+E PxeqHr/rRpLNZyfoBxkufx1/vjE7NnnD3TgrlrthhBVouM0vTT/A9w0C3EHOQi1OSU/x AJI0tVBXa0JVV36BnX08MdmdIVhs75ZmdPn6NIvjNYxKGMZUCLwuIkNmSNpoXUHvRfnh 0+yQRVPqzeqHEGvY2hmf8oV9dkFGRt9XaYOeQkR3DYqntg/kqF16FcMmM3GAAu/s4j3p tPzRY2gA3CdMAUBYmnNxqGKaM51yH1h8zopf4WtHAxQxrC47c455x53B4o47+rTyiEpB Z9gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qnPp15OH; 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 j1-20020a636e01000000b004202cb15b7dsi13269000pgc.81.2022.08.15.22.35.16; Mon, 15 Aug 2022 22:35:27 -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=qnPp15OH; 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 S232295AbiHPEpD (ORCPT + 99 others); Tue, 16 Aug 2022 00:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232533AbiHPElY (ORCPT ); Tue, 16 Aug 2022 00:41:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A6A0BE1B; Mon, 15 Aug 2022 13:32:46 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8A89A61135; Mon, 15 Aug 2022 20:32:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5467FC433D6; Mon, 15 Aug 2022 20:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595564; bh=iA3kgPdrYq8HZkBGT4PqxpGRtbzq58obzUta28Y1qg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnPp15OHFgIuWAG2GMmcmoPNkBOEIUvJMkUO7xNe/soay5QcnlVEtNt6KWRlXdZ6b NW92h+BSuBn7L6Biz37NXBfzJcKhDHCm2kBczesAR+7jktQH9gte4BxyeG1XRhvNxL bozc4cjQoKjAVNg5yUbNcbq3qedVatlpe2hwHhfM= 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 5.19 0805/1157] scsi: smartpqi: Fix DMA direction for RAID requests Date: Mon, 15 Aug 2022 20:02:41 +0200 Message-Id: <20220815180511.689130614@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 7c0d069a3158..e1fc6f5b9612 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5484,10 +5484,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