Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2882288rwb; Mon, 15 Aug 2022 13:14:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uNLsN/GwnJLmFqcmtRdkxKrgYu5Dd/i3ezkihvgeIyu8FAPtXs77JGNpeQ0/MYNh9zEfU X-Received: by 2002:a17:907:6e12:b0:730:bc12:82e3 with SMTP id sd18-20020a1709076e1200b00730bc1282e3mr11749524ejc.36.1660594457333; Mon, 15 Aug 2022 13:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594457; cv=none; d=google.com; s=arc-20160816; b=GWUXaJ55TAaizB7CJ/Fl/vuPgmRR/f1BZFuoZu4g23ROtQIiWuRDNpA+PgarAiE2yv fZ0tsgwv2Rz47R80igJ7l9WYhAHvfbmAz5Qv0x5b1fTFmwLslZrGjLRwss0WV4CKcn80 JyUGu2PHPku14VHPk6PRMcUvewZMi1kOdrAHhT1b/q59Heeg15Ol9sUVb+Jsjrj8Fusz GdOGZfb6pvUzGGghldjofL0MEdlN8RYlAqy9uxxNTG6RyjkK9OzpjXaDKSID4yj1yHop ztRkWSGDJafptmZFAVSzRgzxjPzUk5UNtDQ/RcASRjoJfHn1Y/QONjSICkFoJqTuubkb GVpA== 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=SSRbkuib8QBnBVS8PI5o6J3VExm8WYbecs/7qeQS9O8=; b=pmKjz4Bv/CTkhBazIGjlJxf4zRMqYQ0TEvgGdFaOex9yXBjViNs5YR6SGe332NLY1W Chi53p3tpjp3EKCqY9JTGqKo8KRbQgwYue6JaRVgq6CuWgjN0yL0xxWnBsR+4Wln5Mla 6YKLYT/YW8bBcLw1zzFr/j+0iF9kJXMAtNLgqGy87TDzTUUK/69XlZd5UNVadtXrwH+J K2r9coQ314KMuZrMTH4r29n8sQabh1gzJ+Q/h8vdc8P7DgeSaQwtQHET8/pxO0jr99OV /AsO6PHXYbKiS8Q548jT5JH47AfGaCTBkGTGPwqLxSxj1zMTQHfHmP9nMUNMdGNxbpDT bFDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BaespXlP; 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 v15-20020a056402348f00b0043a10e5e81asi8676189edc.66.2022.08.15.13.13.51; Mon, 15 Aug 2022 13:14:17 -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=BaespXlP; 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 S1344090AbiHOTTp (ORCPT + 99 others); Mon, 15 Aug 2022 15:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344530AbiHOTQx (ORCPT ); Mon, 15 Aug 2022 15:16:53 -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 35FE45464E; Mon, 15 Aug 2022 11:38:27 -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 1F748B81081; Mon, 15 Aug 2022 18:38:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38D98C433D6; Mon, 15 Aug 2022 18:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588703; bh=wYG8/+iJBFUffvlOg0M3StmDyPYkTXDDtClCklYvrSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaespXlP8u2tyq0djkr03KBRVj7aVljXmCXim+X0GDmlkHFADY9mhvdvF1Oj6NsCI JopBLBFK1m7QNsO6s402TY65LPKJLAAq+XczZTtUyfDChs6wKnd7eyrGZF39hFlwo3 74X7x/v+Hb9AYRy47bk8REzXwpKyf9PDjUt9PO7U= 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.15 487/779] scsi: smartpqi: Fix DMA direction for RAID requests Date: Mon, 15 Aug 2022 20:02:11 +0200 Message-Id: <20220815180358.080884043@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 2e690d8a3444..e3d8de1159b5 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5310,10 +5310,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