Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5988527ybc; Wed, 27 Nov 2019 12:59:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzVR8vzyKuO9Z2IaDUaFb99DYQpltRcWmbKU5exmxjiFkKo6bjGP2VhjF1akgn2/f3v3P7M X-Received: by 2002:a17:906:f756:: with SMTP id jp22mr49964676ejb.234.1574888386708; Wed, 27 Nov 2019 12:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888386; cv=none; d=google.com; s=arc-20160816; b=wX+jqoS5e/at7nCQRY4xUkZ0ZU8ZaQkDxT+48zUoZvQalmEAcEwHLm7UmMR2zeQZn6 jSBuaMU/hx8pYBrjy46I+m9hX4qz8t/ZGNghvIihc1mYgptJmVXzz1QvIAO9i8N8kPHH l1odRDhF2vjNkIUseDwus4dqcv/uppzfdaJ9tAaDDKwif8sgrDILrEW1yod5r5GKVT2d Ga7L3/i9uWLV8QqkwraxUoCMBwYG03ZSZ6sUJF1HqofCCMaNP6DbzZCwUbYG4zSTjp/D 3AfGS6/9qUGoa5sjShT1rlQYNN0CgrYDjVKxPUfwry9odXBkuNLSpi2lECdAfEf0UJfY 5ADg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XRfKVEWq5VeciyZJ8VkWIulFGoC07q1LvL1c35HBp2Y=; b=a5acRsVveI7iJnw12Ld6se7YCDY6wukYUmslWtEzGSx6qQqiWI93YK3rUwIIK5bpAS 8UL1A8RJOMVbd753Oz3oe53SVAlK1H1uVNtqOBs+PA0A/X3kxSRJUHAFezbkBvnk5EPQ svPyXrNpH2/rhh2vuRHOZJiAaXLucqVGsfDaU70WaLGjjBpt7VwBQiKQ5lmtdwqExars 9LvdfiLesk+aEUaISFD2Zi/6kyCmL+x2UGgGj/UuseoQscHa8tgNKXQVyYFyXoDTsdhZ cJMcZl0drI8dYh1h1twaZlcofubGQwi+vpYGpO2Io+58MWi0EpGConYZ5zkPQLrAifrh 3+0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UEkwHJvb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si10866069edt.451.2019.11.27.12.59.23; Wed, 27 Nov 2019 12:59:46 -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=UEkwHJvb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731046AbfK0U6b (ORCPT + 99 others); Wed, 27 Nov 2019 15:58:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:49790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731323AbfK0U62 (ORCPT ); Wed, 27 Nov 2019 15:58:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A83D621556; Wed, 27 Nov 2019 20:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888308; bh=ijZUssjHtXM9YfOAy7rCU8OcNgoZ6UItBKk+B3wUlS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEkwHJvbo+WhcQMD40TAdREv1QrXbNiaM6dMRYY1jmH0BHceDk/Z/657B5Zy1NyxX hxUpEewsJ9kWbSbDrfnp9Evb1CeRAfpr6ZRqEE//mWj5OVVbaH5nZLL8DlPw06T9SB 811UfcNZR4IKo7WUtSP5acK6HMegMSzOsh2MufsU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 083/306] scsi: dc395x: fix DMA API usage in sg_update_list Date: Wed, 27 Nov 2019 21:28:53 +0100 Message-Id: <20191127203120.999425797@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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