Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1746746ybg; Sat, 19 Oct 2019 01:37:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6rJkpQ3opdYx9/1YIUquE3f3Vr9l7QkvMzGFlkSs6FjBVb8oNZivRo4mCfwN7P9PZnVDe X-Received: by 2002:a17:906:7e0c:: with SMTP id e12mr12517665ejr.20.1571474224471; Sat, 19 Oct 2019 01:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474224; cv=none; d=google.com; s=arc-20160816; b=N3xMItu9S9/K++HnI/fQQpg2he7XhVMwsgj9a3NUIPSQS0C2Flg3wC+DaCJHx70TUh xvZ1th6WVvL5+XEObq8oapAh0j0mXf2PgXOPBdqJJv9f1VG34KznP75u50MmRb+BWsoj R2Lf1PXv5IbT6T2ahOc9pzA6OtvW8v957+jKq/lDiSXYYLcXottJwkHHfUHMU0VAWBFf 3HuyXX34rM5gNp8KvwKxR3YFqftU5tuCB0iMG9zwayzTOOUSk+4zsHGQ306KkdsfBNia V4eqOi0bCU6D1noZMc2EJAYTq7ou7YjwsoBNzYIbB/2n++krhCCVGoE/0g9b3ijys2aa ZYuA== 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; bh=5L89fA5qbTnX82EiJWm4JM3e53bqecjDJrjVSQtHUqI=; b=BU/fNsxeEYgTdcFaCcEVuwWQv0jcjZn7EfkU5G5gfVEoPEkUdcUM0JY8uz6U7IgtkP B1tGMiMUgRyXFT4g8i9v+vs3eBIhRx/THk4JwAqeHiitseWzQjSmS2CcjnzXiWs008tw CGTOGhjhzeZi6RgCQaGNSTSfFcXtP5U1vF1govdhZFZEFGoY05vt7nj6MEW3juo2JFt3 D8nLgUhqHY0gUvoCCduLn+KAf4CZG34QfRduPNBlAwuxZMrnte+qaAHikumfShfKIm6R YQr0i6qE2EYF52spsrCaWR0CqOTTrDhqQOJ0B6OR4DGBQhBVYE+GXtJqcgF9fMfsxI+B Z0Hw== ARC-Authentication-Results: i=1; mx.google.com; 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 o7si5405342edc.342.2019.10.19.01.36.41; Sat, 19 Oct 2019 01:37:04 -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; 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 S2505480AbfJRPon (ORCPT + 99 others); Fri, 18 Oct 2019 11:44:43 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:50833 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408927AbfJRPmk (ORCPT ); Fri, 18 Oct 2019 11:42:40 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MTREY-1iT8oJ32Uu-00TnA9; Fri, 18 Oct 2019 17:42:35 +0200 From: Arnd Bergmann To: Daniel Mack , Haojian Zhuang , Robert Jarzmik Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Arnd Bergmann Subject: [PATCH 43/46] ARM: pxa: pci-it8152: add platform checks Date: Fri, 18 Oct 2019 17:41:58 +0200 Message-Id: <20191018154201.1276638-43-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191018154052.1276506-1-arnd@arndb.de> References: <20191018154052.1276506-1-arnd@arndb.de> M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tTwT7XaArfI935W5g+JvGv/8cmuPrNLfZe+hRPqyC0na1ARqm6VDysZSp/KaDh3kyECHfn DkMYGehNO7cuKNmxd5h7cN0RUU1GAeALUm3m6dcV+LE9RzT4e48WWeP6OLmqM/tWse1AJEjcf CC2GVCoYUa1FCftOz2XA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The it8152 driver does a few things differently from everyone else. Make sure that these have no effect when running on anything other than a pxa2xx. Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/pci-it8152.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/pci-it8152.c b/arch/arm/mach-pxa/pci-it8152.c index af99c990f0c1..fe8cf7d2234d 100644 --- a/arch/arm/mach-pxa/pci-it8152.c +++ b/arch/arm/mach-pxa/pci-it8152.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -274,10 +275,21 @@ static int it8152_pci_platform_notify_remove(struct device *dev) int dma_set_coherent_mask(struct device *dev, u64 mask) { - if (mask >= PHYS_OFFSET + SZ_64M - 1) - return 0; + /* We've always done it like this, but it looks wrong */ + if (cpu_is_pxa2xx()) { + if (mask >= PHYS_OFFSET + SZ_64M - 1) + return 0; - return -EIO; + return -EIO; + } + + /* generic implementation from kernel/dma/mapping.c */ + mask = (dma_addr_t)mask; + if (!dma_supported(dev, mask)) + return -EIO; + + dev->coherent_dma_mask = mask; + return 0; } int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) @@ -331,6 +343,10 @@ void pcibios_set_master(struct pci_dev *dev) { u8 lat; + /* running on something else */ + if (!cpu_is_pxa2xx()) + return; + /* no need to update on-chip OHCI controller */ if ((dev->vendor == PCI_VENDOR_ID_ITE) && (dev->device == PCI_DEVICE_ID_ITE_8152) && -- 2.20.0