Message ID | 20230522105049.1467313-26-schnelle@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1354087vqo; Mon, 22 May 2023 03:54:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4bN/DYqw0R+w2/3yPrD2ACSkNHJWDONYvuQmCH7BtDQs7GNYzpkLE66BtnQbC6qruj3MP5 X-Received: by 2002:a05:6a00:1a86:b0:648:cfbb:885c with SMTP id e6-20020a056a001a8600b00648cfbb885cmr13154526pfv.29.1684752870484; Mon, 22 May 2023 03:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684752870; cv=none; d=google.com; s=arc-20160816; b=RA58PkS7u5bsv2qgr5892syvHMmvzbgMFYXoYWij+eooBV8E0y+b9n8JOAurS8QChe eXrJrqrQPNbVSrcwzplQDbSaow6AJjGVIFJf6OAEvo2MFD2jXxCwpDniYRQalPHuBYZk SR+DX7coDjhGn397cjKIPNzE4UCYKtNb6SG4z2tZpkMk0pCOH/CeKQr1pk+fu1jH01Lb aBdIPNfrj9noqJD7aoaWskvlUEpbMUv7GO+Po77D+ekhkyLamgxWJBew1dSfSa3uUqQH ulmlARfmX/ssVxcgeVlQFwFoCayp7abgZ0QQvw7cTd4zEm1iasksZuQJWqENsGqDOYKL Fzmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kOVkRocUNzoCE3Ax5Q0vzHkYAKeyWtHflf+V2JFhZf0=; b=JAMTmm5xY53VjRM1mPoXl11elOo+dwFBhA5dffMsimhCWaOmoVRPdTJEzHLrr8QlIX vlok09d0xm1zM2ON2ugScs+bqEKZmmOCRQX2cGBWPDSO1TI/hOLQN1RD6Pw5/Rijuuxn NsZHrs4AVcrPozKZhOMYm8zGAFHfdOJwnq+XkKSLN13DMslnwu75vCLgo5Qmlxh/0E37 bKxrBqlo93D9IBatuN/0P/IX0uOVRkKvxOm2Itspmuwcbfido1Wfv2JcNtgOXAQA920y fL/9CQlokrusydz52gOCO4kbpop9fZRe4GFmvj/m0iBv6+4q4WUw6d7ZxkGqVIjZdWaW OAng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=H59bd4cB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020aa79851000000b0064ad90e94easi874014pfq.194.2023.05.22.03.54.18; Mon, 22 May 2023 03:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=H59bd4cB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233050AbjEVKxX (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 06:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232982AbjEVKwG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 06:52:06 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E104FE56; Mon, 22 May 2023 03:51:30 -0700 (PDT) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M9qg9D015336; Mon, 22 May 2023 10:51:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=kOVkRocUNzoCE3Ax5Q0vzHkYAKeyWtHflf+V2JFhZf0=; b=H59bd4cB44i8p9lHZcNLtdBgO7LwkI4vcfWimglf/EirGSAG0UYGfuKSDVqMTedixpCx Eq5ic2rwAXfSS4JAvklRh2PvbdzwtIE8d4KKdXq19v7MRY/KhRpTUEtXRDMApDCUFBZr 4CXN1GElFtf5nDZq3KBP/7IKM3Tqc0reb2gjcA/sXYVBybrf+aKB4iQuFveMM5iI6Ipf +R4uAJv8tV7pLIsMm++BLpLvN/yvIFog3W6O6pfIQV+yLxYMSI26DqdyqtDMQyjuKiFM zCuQT2I7uhZbX6xKRRxxh8TDv9i8MuRNxiIuAIcjPg6KOI5s40WrZyZeUWVSmFY0NMw3 9Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqfq39r0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:20 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34M9cE0Z029654; Mon, 22 May 2023 10:51:20 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqfq39qyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:19 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34M3P0dq016258; Mon, 22 May 2023 10:51:18 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3qppdk0w99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:18 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34MApCjB37356186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 10:51:12 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AA692004B; Mon, 22 May 2023 10:51:12 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2411A20043; Mon, 22 May 2023 10:51:12 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 May 2023 10:51:12 +0000 (GMT) From: Niklas Schnelle <schnelle@linux.ibm.com> To: Arnd Bergmann <arnd@arndb.de>, Bjorn Helgaas <bhelgaas@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Alan Stern <stern@rowland.harvard.edu>, "Rafael J. Wysocki" <rafael@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann <arnd@kernel.org> Subject: [PATCH v5 25/44] PCI/sysfs: Make I/O resource depend on HAS_IOPORT Date: Mon, 22 May 2023 12:50:30 +0200 Message-Id: <20230522105049.1467313-26-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522105049.1467313-1-schnelle@linux.ibm.com> References: <20230522105049.1467313-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: XA-F9FHMBXeah8fQ5YuIlUwTaeRSmasl X-Proofpoint-GUID: dUS_Pkqk5J8FLYkSzVrfagtH8ZX07pRa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-22_06,2023-05-22_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220089 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766591426261529616?= X-GMAIL-MSGID: =?utf-8?q?1766591426261529616?= |
Series |
treewide: Remove I/O port accessors for HAS_IOPORT=n
|
|
Commit Message
Niklas Schnelle
May 22, 2023, 10:50 a.m. UTC
If legacy I/O spaces are not supported simply return an error when trying to access them via pci_resource_io(). This allows inb() and friends to become undefined when they are known at compile time to be non-functional in a later patch. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> --- drivers/pci/pci-sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index ab32a91f287b..d9eede2dbc0e 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1083,6 +1083,7 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count, bool write) { +#ifdef CONFIG_HAS_IOPORT struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); int bar = (unsigned long)attr->private; unsigned long port = off; @@ -1116,6 +1117,9 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, return 4; } return -EINVAL; +#else + return -ENXIO; +#endif } static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj,