Received: by 10.192.165.148 with SMTP id m20csp1411641imm; Wed, 2 May 2018 21:46:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqaxOIOf1ri7CzD2Mi/meQ6zSR+W3A05mqPmuKHI1HjMYTRHsZL4G2c5eSM95o9lxTWTAI1 X-Received: by 2002:a63:18c:: with SMTP id 134-v6mr4400894pgb.138.1525322780913; Wed, 02 May 2018 21:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525322780; cv=none; d=google.com; s=arc-20160816; b=TlEDO3xr9vZf7R5/+p/WJcg3OcXX9SLxzWsX2n11qvK/4KXq61FZp4DwAcjSa8OTrx RSU+GEANqmLwGNWedy2gwInGrG41dhjPsOuZ40nsEDLHcK5xd+n7u7pWdUxmCgH8ZVSY z6xkAnuJm5+4IyIz8hwhppguR5l7OZthcv/gVD6hoFlJX6ZigBg1wqZ1HNuicl3d8x8E hTDdJLwHpNqVh+EExfsjH1ejYOsNTG8WdH1cRCF1E4jJVwZvopeNVqbFrQt1VycVcUJK n9IQIgKNQrCVMxnk4SA1l97hjAhk9aCJY9bnch3U3ImJb/bRD/+quvAebnS1ODWu48Hv Q4Qg== 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 :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=dbFvVSZpyG34kCzphsPfkAUR0gkhL6gpP+C7uSTgU3A=; b=VntYf36WyAHPriMLxZAybS8liD5GWE/+mAxRHK2+iH9XeIubvcMO9B6qybW5by92XO nR1rJTKaJ1c0F8urcTEJdvB25Vbs5VH8MAjrKozmcIpmbhNUawQ7YeKRX/qn4y2s15Pt 28sScLf5shd3gdDetDYc2I8h5BCJdFEPrCLDIHci9g+UL3RakT8I9Jn6gFZE+tWxNhx5 fKMIOlsjPVxOmEBRTOOoqnYx4XYSv+Nd5A+bHidYat7SvYHRDZSwjCTJSGihjVP3kJeJ 9RRowBgHb0FOvQ5Cmioi39WPXsYjYbDW9IiN/i0SUv4p8hNJvSSKF0TSC8XnWR5Y6TXi Zv6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i2dzt6mf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f131si7378413pfc.316.2018.05.02.21.46.04; Wed, 02 May 2018 21:46:20 -0700 (PDT) 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=@google.com header.s=20161025 header.b=i2dzt6mf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632AbeECEpw (ORCPT + 99 others); Thu, 3 May 2018 00:45:52 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39426 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbeECEpv (ORCPT ); Thu, 3 May 2018 00:45:51 -0400 Received: by mail-pg0-f67.google.com with SMTP id e1-v6so878719pga.6 for ; Wed, 02 May 2018 21:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dbFvVSZpyG34kCzphsPfkAUR0gkhL6gpP+C7uSTgU3A=; b=i2dzt6mfd3Hd00c9Cxe5vpMhMq2SgJIP+hxZ1zDDwaEAQ+dHorUP1tFZCV85pa8z6n Qo2G9SEG5AqJiqRl/bbXE/QizrOVtfwpU53c3ayre7mWFujuf78nVQeaON/CThzWI+6I zJI+irFa/qvXUIbSsHwTu624pBgyK5Qh0LAqofY5Skjg6G+WNl26VhffnU3FBzWOiLPH mn0uhCkiWvlpPL5XRO3epnDYVe2ra617Au83osmUa5Y50YkYVlt8DLpxNp9QcdtJag5R suNBMwfBcdZqavEkgkmvObuEG1+wwqylatCFzbxmtEKbZbdvWl6Gpe4f94y+7mtv6PEX 3AWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dbFvVSZpyG34kCzphsPfkAUR0gkhL6gpP+C7uSTgU3A=; b=aPhgslKYb1V040x1QXd50N7WcfUyJvxdIx9TRovSw4AkjmGaU9MxU6bYz+W8F61/rp BBXIgTZqeopn4pW8sSQ/GAfuTGGYJsNqermWuFq5WVMCM/UTgeXY9mY1u6ioPwcpIVOe vFFD9zKSJ+oP8Gx0ew/l2q0T7tzFBuPAWEUGNq15C4iCaEFlUBJZS/xNQF+D2BNim4CM jMeesk0/s/FwB2DRY1RhCkp8uvhX0Pjmn3quA81YNxLk+RMoBJeZFM0ZpzEyFNoHC+qE cbQxiRzZON6hxeyAwcCNFLuzNZjr4tda5DuHt9j0bz2hGxWo+YDB3KnJT3JiowCFncvX rnvQ== X-Gm-Message-State: ALQs6tDPnpkRyWn8VAVAaPe2jRYVKmaJ3SjJ7RGUp6kVA7uCXVr/nZWv RdAPHLo/Z9ffiAV2W+KB8a8Og8sgjcFkaA== X-Received: by 2002:a63:6196:: with SMTP id v144-v6mr18481032pgb.264.1525322750275; Wed, 02 May 2018 21:45:50 -0700 (PDT) Received: from astrachan.mtv.corp.google.com ([2620:0:1000:1600:4394:e3d:8eee:a828]) by smtp.gmail.com with ESMTPSA id k13sm30127317pfj.186.2018.05.02.21.45.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 21:45:49 -0700 (PDT) From: Alistair Strachan To: linux-kernel@vger.kernel.org Cc: Alistair Strachan , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen , Greg Hartman , devel@driverdev.osuosl.org, kernel-team@android.com Subject: [PATCH 1/3] staging: Android: vsoc: Create wc kernel mapping for region shm. Date: Wed, 2 May 2018 21:45:21 -0700 Message-Id: <20180503044521.156965-1-astrachan@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog 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 Map the region shm as write-combining instead of uncachable. Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg Cc: Todd Kjos Cc: Martijn Coenen Cc: Greg Hartman Cc: devel@driverdev.osuosl.org Cc: kernel-team@android.com Signed-off-by: Alistair Strachan --- drivers/staging/android/TODO | 1 - drivers/staging/android/vsoc.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO index 2ea6f97b8f0f..ebd6ba3ae02e 100644 --- a/drivers/staging/android/TODO +++ b/drivers/staging/android/TODO @@ -18,7 +18,6 @@ vsoc.c, uapi/vsoc_shm.h waiting threads. We should eventually use multiple queues and select the queue based on the region. - Add debugfs support for examining the permissions of regions. - - Use ioremap_wc instead of ioremap_nocache. - Remove VSOC_WAIT_FOR_INCOMING_INTERRUPT ioctl. This functionality has been superseded by the futex and is there for legacy reasons. diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c index 587c66d709b9..794137b7751f 100644 --- a/drivers/staging/android/vsoc.c +++ b/drivers/staging/android/vsoc.c @@ -802,9 +802,7 @@ static int vsoc_probe_device(struct pci_dev *pdev, dev_info(&pdev->dev, "shared memory @ DMA %p size=0x%zx\n", (void *)vsoc_dev.shm_phys_start, vsoc_dev.shm_size); - /* TODO(ghartman): ioremap_wc should work here */ - vsoc_dev.kernel_mapped_shm = ioremap_nocache( - vsoc_dev.shm_phys_start, vsoc_dev.shm_size); + vsoc_dev.kernel_mapped_shm = pci_iomap_wc(pdev, SHARED_MEMORY_BAR, 0); if (!vsoc_dev.kernel_mapped_shm) { dev_err(&vsoc_dev.dev->dev, "cannot iomap region\n"); vsoc_remove_device(pdev);