From patchwork Mon Nov 4 17:22:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178444 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1773617ilf; Mon, 4 Nov 2019 09:25:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxDVWY0DlMo8Sm2dafoFGB/81f6B1tTvdG12xWJhYKYMsAcuAbr45meK3/aypaxOqBdYqb0 X-Received: by 2002:a17:906:4e88:: with SMTP id v8mr24390812eju.93.1572888340662; Mon, 04 Nov 2019 09:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888340; cv=none; d=google.com; s=arc-20160816; b=HlbVrGMvXmRlGhnBHCY7lGBdKJXa3VgonjbMk622IZEgMdmul1JTeCcnI+2EqO9zaH vJgD+QaPDpduSX2uEH4rZImbIhOitJNIA6bCJurpbzZTYoUgpd098NMSViG3A0aaH1F6 NvgIcrZ27P3V9J2Ad8WPtSICs2Wy4AldUBAtxgiYyim0ELbIveW/0RSrNc4P8TfTCbIx h+hK98+kSYKnm45iUyrp5mTXeRvOMy8ddoQoZjmLJCnV3jhRvQwegNDO5qhH2EPU7UeO NOHGP35Sji65mzOTlOiSpYAcCIut1E37Apovl9509DmVRYYWh82G8z2VxWtwHwzWfWP/ QcxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=RIE+EgOtTrp9Aw3k4CsYN7GGPkAgexAC1RqFRA/UgKU=; b=ib96zfTxyP8qnh0D8IQZwK0Y6+0ErR+Wj7B2zFAfksnCMWMbliwgYc4SViHIw9dkSC +PJ3qP4WENCA4pSRXMLtWPaOzLf1S7f4tVTeis8Y/VeVjYLPUqCtifazj+cG0CJ8Jstw BzSnR0d6QCEL7/1HylCX/tY342pVg+DvRzmCEJV2WcSMpdApq1oM4s9yg7JcoMmPc9dY wrCIUkV+j7lNV3ulXZklNuyFO4Vwd1Qy8SbDADAbts0aIYWPDqY35JXeHXTiaKMIpjtk ZEeCsxcjGFKwjr/2CYcEnbNMMVBSzk91jRH6JTNV/LXFeRXUBBc6ETUOT+wsxbR269zE 6LvA== 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 f2si3316647ejr.260.2019.11.04.09.25.40; Mon, 04 Nov 2019 09:25:40 -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; 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 S1729427AbfKDRZj (ORCPT + 26 others); Mon, 4 Nov 2019 12:25:39 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6147 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728965AbfKDRZg (ORCPT ); Mon, 4 Nov 2019 12:25:36 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 875FAF13A01864A1C39C; Tue, 5 Nov 2019 01:25:31 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 01:25:22 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v3 1/5] lib: logic_pio: Enforce LOGIC_PIO_INDIRECT region ops are set at registration Date: Tue, 5 Nov 2019 01:22:15 +0800 Message-ID: <1572888139-47298-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572888139-47298-1-git-send-email-john.garry@huawei.com> References: <1572888139-47298-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the only LOGIC_PIO_INDIRECT host (hisi-lpc) now sets the ops prior to registration, enforce this check for accessors ops at registration instead of in the IO port accessors to simplify and marginally optimise the code. A slight misalignment is also tidied. Also add myself as an author. Suggested-by: Bjorn Helgaas Signed-off-by: John Garry --- lib/logic_pio.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/lib/logic_pio.c b/lib/logic_pio.c index 905027574e5d..f511a99bb389 100644 --- a/lib/logic_pio.c +++ b/lib/logic_pio.c @@ -3,6 +3,7 @@ * Copyright (C) 2017 HiSilicon Limited, All Rights Reserved. * Author: Gabriele Paoloni * Author: Zhichang Yuan + * Author: John Garry */ #define pr_fmt(fmt) "LOGIC PIO: " fmt @@ -39,7 +40,8 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range) resource_size_t iio_sz = MMIO_UPPER_LIMIT; int ret = 0; - if (!new_range || !new_range->fwnode || !new_range->size) + if (!new_range || !new_range->fwnode || !new_range->size || + (new_range->flags == LOGIC_PIO_INDIRECT && !new_range->ops)) return -EINVAL; start = new_range->hw_start; @@ -237,7 +239,7 @@ type logic_in##bw(unsigned long addr) \ } else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \ struct logic_pio_hwaddr *entry = find_io_range(addr); \ \ - if (entry && entry->ops) \ + if (entry) \ ret = entry->ops->in(entry->hostdata, \ addr, sizeof(type)); \ else \ @@ -253,7 +255,7 @@ void logic_out##bw(type value, unsigned long addr) \ } else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \ struct logic_pio_hwaddr *entry = find_io_range(addr); \ \ - if (entry && entry->ops) \ + if (entry) \ entry->ops->out(entry->hostdata, \ addr, value, sizeof(type)); \ else \ @@ -261,7 +263,7 @@ void logic_out##bw(type value, unsigned long addr) \ } \ } \ \ -void logic_ins##bw(unsigned long addr, void *buffer, \ +void logic_ins##bw(unsigned long addr, void *buffer, \ unsigned int count) \ { \ if (addr < MMIO_UPPER_LIMIT) { \ @@ -269,7 +271,7 @@ void logic_ins##bw(unsigned long addr, void *buffer, \ } else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \ struct logic_pio_hwaddr *entry = find_io_range(addr); \ \ - if (entry && entry->ops) \ + if (entry) \ entry->ops->ins(entry->hostdata, \ addr, buffer, sizeof(type), count); \ else \ @@ -286,7 +288,7 @@ void logic_outs##bw(unsigned long addr, const void *buffer, \ } else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \ struct logic_pio_hwaddr *entry = find_io_range(addr); \ \ - if (entry && entry->ops) \ + if (entry) \ entry->ops->outs(entry->hostdata, \ addr, buffer, sizeof(type), count); \ else \ From patchwork Mon Nov 4 17:22:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178445 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1773719ilf; Mon, 4 Nov 2019 09:25:44 -0800 (PST) X-Google-Smtp-Source: APXvYqz02GpySVE8nF2nN9nkPVe508iBwvGArqBrQrtvbfMhtzCccTHWYv+XEnueSYOcHIA/XMpj X-Received: by 2002:a17:906:1cd8:: with SMTP id i24mr24980515ejh.149.1572888344775; Mon, 04 Nov 2019 09:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888344; cv=none; d=google.com; s=arc-20160816; b=B8BaoLqHwiWeEHhs6qYtXG7ycBT8c5rKr+3CGqGMcdoUSwboba5IzA692wUTV/wzNy OLCMDNlndp2EVU4d5Q0xJPD/OiFPAb3ExbWAJQM7lobYc/PAcUihmp0Awkzrk16iaeDK tPa98hjE5IffqZRN0nVILhV65B9LfRKGH8XzrYfZBnhPdDtkchZL3sNtnWj8coHh9M8q UqsPvyGIXmvu85wtIrUX4lSwTWY5RRte+/w4e2LrnR2fdRlBWadW6ntebEIhvGQWCtvW Slrl4X0dg17kSxqIvagV6ltgwX20NMuB6OkV75TNwp1jlaaAryDHrTxRL5s5Gi5ojm/G KlXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=JdQFib1xvODx7RhbI3e4cwp5glGU2LMu5gkpRj2H6os=; b=O5llPEhGQ96L4baId5POJDQbfL31NQKtoMXZIyZGWafW6ibEdcMxIc74k993W1v21r nZQ9fTLyNVi621/ZZ1Ft/Kp5P0zf+tf3Tm4sB4PcAzLJ2bQY5vr3cDAuPjr4NQZgpd+C fq6anV/A7LYC9oHkMyKoifxeiH65TQwEd/iNtWXV/KkOkISBHPh1hcZUiDBLxSYaC9/9 fl2G7uks7kUp1lqLMh9Hx9ldOWzLJk5G12GfgJKqpG18dEnABZ05H6TW6C5G/sKl0MPI Twh6buLoUVNFPwhxCYNVVg4jBAs1+dtoa+Mzm5q1lhyz+qpvfsi2+SJVsHmVfzSiE3uE QZ4Q== 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 f2si3316647ejr.260.2019.11.04.09.25.44; Mon, 04 Nov 2019 09:25:44 -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; 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 S1729485AbfKDRZn (ORCPT + 26 others); Mon, 4 Nov 2019 12:25:43 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6145 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728321AbfKDRZf (ORCPT ); Mon, 4 Nov 2019 12:25:35 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 808AC1CF5697FE0F6D55; Tue, 5 Nov 2019 01:25:31 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 01:25:22 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v3 2/5] logic_pio: Define PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO Date: Tue, 5 Nov 2019 01:22:16 +0800 Message-ID: <1572888139-47298-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572888139-47298-1-git-send-email-john.garry@huawei.com> References: <1572888139-47298-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the goal of expanding the test coverage of the HiSi LPC driver to !ARM64, define a dummy PIO_INDIRECT_SIZE for !CONFIG_INDIRECT_PIO, which is required by the named driver. Signed-off-by: John Garry --- include/linux/logic_pio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h index 88e1e6304a71..54945aa824b4 100644 --- a/include/linux/logic_pio.h +++ b/include/linux/logic_pio.h @@ -108,10 +108,10 @@ void logic_outsl(unsigned long addr, const void *buffer, unsigned int count); * area by redefining the macro below. */ #define PIO_INDIRECT_SIZE 0x4000 -#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE) #else -#define MMIO_UPPER_LIMIT IO_SPACE_LIMIT +#define PIO_INDIRECT_SIZE 0 #endif /* CONFIG_INDIRECT_PIO */ +#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE) struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode); unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode, From patchwork Mon Nov 4 17:22:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178442 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1773466ilf; Mon, 4 Nov 2019 09:25:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzG6UyhcAFdwlnrxTw5MyHG9OvAbNduUHf4ZnNM/+6mL1Nix6rt/dflB1fTE3B4g1/5Q/6u X-Received: by 2002:a17:906:1e07:: with SMTP id g7mr25703066ejj.256.1572888335296; Mon, 04 Nov 2019 09:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888335; cv=none; d=google.com; s=arc-20160816; b=Z/CeE+wB+Za+yFBgKCbo7Inbi2MLlmv7hYVaceHITYavl5Iw3dzSV01p+j5LipK3kk ooovOPWLSs3DN7IqWoaNdBWXdtw6yaKik22dN7ffeaY0HCYMeKNwReJ57HT+iSLek05b TeC8sdwNCk/OuKfXLrKYytKdqYG7PG2AnY9efa/VbbyMG75CluGOS4jp537La+Ko7ojR YYGz87EierytB+H+2yFHPJPIiNQFBSyzO1xGVbMlDODAsexlPNtAhRsnHSABzewJDzkL pC9QjV4w6UotFYiQSUt1+CSBdhRJGQi5t0ppbHFo3HG0sJuMIDXpxZu7csDD6Wzc9/5t nZ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=1NOYylUOkHzzGL4Uue6Mxpnd2d3WCuxLQ7Rjp8YOuII=; b=uqu/GG9JxTrCCAsQE/JbGrSANW95hxGVxctEvxSCIpzwRB3zp7uqfWO4WWclFYasZ5 z929HWgCbQz+swFZskN8SNffyZ/JkMA6bcoUcZcRIrU0OdsriXZf0Og1qOgrBxvYqNcX gtX3b37yUCPvcx5wvi35nDc75O1O7vgSUYmJUX/sErO16QZJ9gvGE8DPiXN71354OkXp sNkKBchNzzk2HRB8sueHeruKPW058zHWtS+Y237/2zmV1Hyi+YnTBt+3vNXINwIySKOz QohCMwjElQpIOo35o4XBr3yENGW6kMJedKIAf2tz/LXf96h8XVAazNH8AkN0guKG51yA FDdA== 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 f2si3316647ejr.260.2019.11.04.09.25.35; Mon, 04 Nov 2019 09:25:35 -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; 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 S1729293AbfKDRZd (ORCPT + 26 others); Mon, 4 Nov 2019 12:25:33 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:47212 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728321AbfKDRZd (ORCPT ); Mon, 4 Nov 2019 12:25:33 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AC5162BC5EFDC1B2CBAA; Tue, 5 Nov 2019 01:25:31 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 01:25:22 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v3 3/5] bus: hisi_lpc: Clean some types Date: Tue, 5 Nov 2019 01:22:17 +0800 Message-ID: <1572888139-47298-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572888139-47298-1-git-send-email-john.garry@huawei.com> References: <1572888139-47298-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse complains of these: drivers/bus/hisi_lpc.c:82:38: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:82:38: expected void const volatile [noderef] *addr drivers/bus/hisi_lpc.c:82:38: got unsigned char * drivers/bus/hisi_lpc.c:131:35: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:131:35: expected unsigned char *mbase drivers/bus/hisi_lpc.c:131:35: got void [noderef] *membase drivers/bus/hisi_lpc.c:186:35: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:186:35: expected unsigned char *mbase drivers/bus/hisi_lpc.c:186:35: got void [noderef] *membase drivers/bus/hisi_lpc.c:228:16: warning: cast to restricted __le32 drivers/bus/hisi_lpc.c:251:13: warning: incorrect type in assignment (different base types) drivers/bus/hisi_lpc.c:251:13: expected unsigned int [unsigned] [usertype] val drivers/bus/hisi_lpc.c:251:13: got restricted __le32 [usertype] Clean them up. Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 20c957185af2..8101df901830 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -74,7 +74,7 @@ struct hisi_lpc_dev { /* About 10us. This is specific for single IO operations, such as inb */ #define LPC_PEROP_WAITCNT 100 -static int wait_lpc_idle(unsigned char *mbase, unsigned int waitcnt) +static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt) { u32 status; @@ -209,7 +209,7 @@ static u32 hisi_lpc_comm_in(void *hostdata, unsigned long pio, size_t dwidth) struct hisi_lpc_dev *lpcdev = hostdata; struct lpc_cycle_para iopara; unsigned long addr; - u32 rd_data = 0; + __le32 rd_data = 0; int ret; if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) @@ -244,13 +244,12 @@ static void hisi_lpc_comm_out(void *hostdata, unsigned long pio, struct lpc_cycle_para iopara; const unsigned char *buf; unsigned long addr; + __le32 _val = cpu_to_le32(val); if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) return; - val = cpu_to_le32(val); - - buf = (const unsigned char *)&val; + buf = (const unsigned char *)&_val; addr = hisi_lpc_pio_to_addr(lpcdev, pio); iopara.opflags = FG_INCRADDR_LPC; From patchwork Mon Nov 4 17:22:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178443 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1773539ilf; Mon, 4 Nov 2019 09:25:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwLim5vtV6OZtXWmijfKc3da2ZDDaHZsW1x4itGJ35SVfG3Ll+9xawOhowxICdBehoxvUiu X-Received: by 2002:a17:906:6b94:: with SMTP id l20mr22766678ejr.238.1572888337901; Mon, 04 Nov 2019 09:25:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888337; cv=none; d=google.com; s=arc-20160816; b=jsOHKd8Ou0ztF58ta+4C2czCvDbwvhBS13A/0gfVmyYNDX9QY9P6rnEiD3/T9afcaY 7atw7wfAZDTKTb7HpxqFpw35bl5TIl3dLqcR2TGBLNY9aRlY0ewxls/BWgbhvMWilAqx ohUtrqp6rfB+EFWbwfKpuDFNDg/hgGVKYYpXtQBzMLWIFMn03sdA4grwVu+5Jko7X1qQ 3xoEGX7XtaxJ8VvJGfkfUH1pVwJ34BKkWQFaHtaTUu8PudyA/dx/sGoP9GFT9iQbFPz0 pkh0oQkL2o4Fdn2VKrnQOBwfSQtS3MYf/8KESyjrC8/IDwvWnAfXgqnz/SU+wTotUokm aoLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=gTGFSfLyeXyD+5IqSm6H1qf5HW4GZPut+P6qpUwgy2k=; b=Fp9w5TPUdfundmCgbfSYqI6HWzWzUHozaXW3ZFBgyoFKT5A6zufKU7n2UENWArXln4 uh9qUKunCz4SNmH39c3eqmHkzDklsLbc8qExnEzBoQvL7Ec+rz71pGCzGsNzaCL+zUUS ai+k7OiDYjzd9qROhTiKW+cU6C/fyTtWDi3cmf0M0B0LSUC0MYbDvNwGwx3xdwgkMI0U Z6GhU00tkuks8kwYEGsSNY64Y+k91gizhEIAAcuT36F4DsKTZcNLJQSv4GZsxg2cWdOK 9ELP1vLXMITR0CBCIGtnANx67OKAB1iamhAVSR8kWFOtkNsDsdpOAouST7baAc4v7q0U fgSw== 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 f2si3316647ejr.260.2019.11.04.09.25.37; Mon, 04 Nov 2019 09:25:37 -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; 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 S1729397AbfKDRZg (ORCPT + 26 others); Mon, 4 Nov 2019 12:25:36 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6144 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728709AbfKDRZe (ORCPT ); Mon, 4 Nov 2019 12:25:34 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7C74F61AA012ECC36D09; Tue, 5 Nov 2019 01:25:31 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 01:25:22 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v3 4/5] bus: hisi_lpc: Expand build test coverage Date: Tue, 5 Nov 2019 01:22:18 +0800 Message-ID: <1572888139-47298-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572888139-47298-1-git-send-email-john.garry@huawei.com> References: <1572888139-47298-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the driver will only ever be built for ARM64 because it selects CONFIG_INDIRECT_PIO, which itself depends on ARM64. Expand build test coverage for the driver to other architectures by only selecting CONFIG_INDIRECT_PIO for ARM64, when we really want it. We don't include ALPHA, C6X, HEXAGON, and PARISC architectures as they don't define {read, write}sb. Signed-off-by: John Garry --- drivers/bus/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 6b331061d34b..70886abe008e 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -41,8 +41,9 @@ config MOXTET config HISILICON_LPC bool "Support for ISA I/O space on HiSilicon Hip06/7" - depends on ARM64 && (ARCH_HISI || COMPILE_TEST) - select INDIRECT_PIO + depends on (ARM64 && ARCH_HISI) || (COMPILE_TEST && !ALPHA && !HEXAGON && !PARISC && !C6X) + depends on HAS_IOMEM + select INDIRECT_PIO if ARM64 help Driver to enable I/O access to devices attached to the Low Pin Count bus on the HiSilicon Hip06/7 SoC. From patchwork Mon Nov 4 17:22:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 178446 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1773813ilf; Mon, 4 Nov 2019 09:25:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzqtZTwr9uBFk72DSeJg7005BMjGV0X3IArcG/0ZMZAz1RsWPq6flxrZbZf2szhHF+Ajbbe X-Received: by 2002:a17:906:118d:: with SMTP id n13mr24375267eja.229.1572888348416; Mon, 04 Nov 2019 09:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888348; cv=none; d=google.com; s=arc-20160816; b=Wp9gmQZb1ZZy6eHcSt5bXwvQTOU+6HVyfbD+w0rSDIbN0qDbj4Y6D88Bm5f1lvbJN2 ONizciaAIOdM/YuE4Dhc+FUBw0bLMcT7YSruznGEEgxRhxLqpl/rdYzB+sORJJFMjd9o X7oB06i8DJ7Ss/il12MXUgjhUap7SKgmgStTlneiGYXxXJbnwPrHdxKiBpnDsPvoUMTf Ku8bUiY/i/LJUSluHhFsz8zYk9QXl6uNPDikRSenC/fDtMEncU7LooPv6V88RH6A3v4q WGatX7c2/lIeb9iPFhnHuULwxCsL0a0/2NInWeEmsKj2AFFY6RBKveyjvQ3J2LXHj75t FJCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=cLaA0X0P2YYwrOqreDb4rq8wBE7Dn/V3Ia42O7na1Ks=; b=t9t+44CP8bcloi0MTkwK6Kac+Iksf1Wl3Rwk3NVph2Ushy7xZXZDlXjfq89KoCijCh +L8PMx9QUJSpxf4jXYHuF5p/wqKNwoM1quNngHJFTmJh5xhdhvu8hU2+CId+NwqVQqua URJBtoCGixGNUsGPOrdgXSdD0BHP9ZiwwpWqSCY814ynso72aJdD+kyCsLaAyGXL+JCb boIgfj1KoerqOvX986YLA4UZIfxkzvx+jmJfdqfUiL80HdHtnu/4h7tCHbV5LQ7h+v2O GtqycpQnWLcWxr6ky4CZGY1/lCaWO30roInDfSIWEUB3YXiiwkIPPY6iw9qri7/h7doW eweQ== 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 f2si3316647ejr.260.2019.11.04.09.25.48; Mon, 04 Nov 2019 09:25:48 -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; 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 S1729495AbfKDRZq (ORCPT + 26 others); Mon, 4 Nov 2019 12:25:46 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6146 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728322AbfKDRZf (ORCPT ); Mon, 4 Nov 2019 12:25:35 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 842DED078D7C1634B1EF; Tue, 5 Nov 2019 01:25:31 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 01:25:23 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v3 5/5] logic_pio: Build into a library Date: Tue, 5 Nov 2019 01:22:19 +0800 Message-ID: <1572888139-47298-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572888139-47298-1-git-send-email-john.garry@huawei.com> References: <1572888139-47298-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Object file logic_pio.o is always built. Ideally the object file should only be built when required. This is tricky, as that would be for archs which define PCI_IOBASE, but no common config option exists for that. For now, continue to always build but at least ensure the symbols are not included in the vmlinux when not referenced. Suggested-by: Arnd Bergmann Signed-off-by: John Garry --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/lib/Makefile b/lib/Makefile index c5892807e06f..27645143d8bb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -108,7 +108,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o -obj-y += logic_pio.o +lib-y += logic_pio.o obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o