Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp774475ybc; Sat, 16 Nov 2019 08:27:34 -0800 (PST) X-Google-Smtp-Source: APXvYqyE31X1tUJuA2xE9Qj2svboQ54wyGb54GgWP5NM5eKUeA44SXzWHP/1yRHrlJ23JnMAGgcQ X-Received: by 2002:a17:906:5397:: with SMTP id g23mr10561553ejo.93.1573921654732; Sat, 16 Nov 2019 08:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921654; cv=none; d=google.com; s=arc-20160816; b=yjDMvqzP6JdujFjjjUbT0r6GZ2ykb6gsqQ8cQZKC0ZnLBb6KdOgTJUaSmkDBZ3ek3y vLLap/e1mFWNOTvwr5ii66o+fYnAW3Amxwa786mtuCBfvKnBwOHLnX5bJty6Ve9nSNnJ /66hviIfMGddO/S9HJHSgxhUYOUysAseeIJoEwph31EbmtQphSLxW+6aZKGaE5p0EAxO uRiuVWvGZOxaACXJjRMvLi1jHyVHEWCt002WafQSNmLkRv1bd437i0ob3uinms0BgtG3 VqXoS7nmN/HkJXJKvxGGkPmVZqfltIcbK+OU5QG8czwsn7XfrN0iiJ4C6FjXHXeKvnD4 bdmg== 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=XRfKVEWq5VeciyZJ8VkWIulFGoC07q1LvL1c35HBp2Y=; b=wWky0WFKNN7gTHlbP2hF3we1YRDu/5qpUhZkTZjOuFG/IgKEjJ7HjVg0cm+/9A3CSF XLhce/v7p5UzpeN5DBUtGghWq2yJd6/Dl8bBMy2L/g9Buhn8xVG+hAZMGue+jPxgQDWU GvdMqEfAigxmMo87L4KySziIvQ9SkzHVOUZf5rg9ta+496AWzGrAygTNtLhCuUorOr1T r7pHSkB+z3bFRq0snLZSMWrr/CwC6QsNckPlbde3tlDBdb4E5lH0rN83dddCURvZlSmc 4kNUuBPFPgcDuJHluPySLGHNxxhEy0vV5qMiA8+BZ6YryfUsepaue6lvHqAZ55mCys7C YjAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WH67GIgC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v2si7564323ejh.313.2019.11.16.08.27.10; Sat, 16 Nov 2019 08:27:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WH67GIgC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730859AbfKPQYq (ORCPT + 99 others); Sat, 16 Nov 2019 11:24:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:45928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728273AbfKPPmW (ORCPT ); Sat, 16 Nov 2019 10:42:22 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (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 59EC22084B; Sat, 16 Nov 2019 15:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918942; bh=ijZUssjHtXM9YfOAy7rCU8OcNgoZ6UItBKk+B3wUlS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WH67GIgCzA333QEVnaJXmu0QNTIR9v139PM9cZbNAi5w0gw+p5Fpei69X/F30D6Bf meFFNGL3OY0JLQZP3Nx7bJ+Rgz4RleSzpppOecQqbTHJh0iZDOTgz/dGI5dkGUfOuU P6PhogyHukgO4FUYeZaLb2x+Ta+jpSU7t07quDGw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christoph Hellwig , "Martin K . Petersen" , Sasha Levin , dc395x@twibble.org, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 064/237] scsi: dc395x: fix DMA API usage in sg_update_list Date: Sat, 16 Nov 2019 10:38:19 -0500 Message-Id: <20191116154113.7417-64-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-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: Christoph Hellwig [ Upstream commit 6c404a68bf83b4135a8a9aa1c388ebdf98e8ba7f ] We need to transfer device ownership to the CPU before we can manipulate the mapped data. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/dc395x.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 08161df64ead5..3943347ec3c7c 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1969,6 +1969,11 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) xferred -= psge->length; } else { /* Partial SG entry done */ + pci_dma_sync_single_for_cpu(srb->dcb-> + acb->dev, + srb->sg_bus_addr, + SEGMENTX_LEN, + PCI_DMA_TODEVICE); psge->length -= xferred; psge->address += xferred; srb->sg_index = idx; -- 2.20.1