From: Philipp Stanner <pstanner@redhat.com>
To: Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <cassel@kernel.org>,
Mikael Pettersson <mikpelinux@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Philipp Stanner <pstanner@redhat.com>
Subject: [RFC PATCH 1/3] ata: Allocate PCI iomap table statically
Date: Wed, 4 Dec 2024 18:10:32 +0100 [thread overview]
Message-ID: <20241204171033.86804-3-pstanner@redhat.com> (raw)
In-Reply-To: <20241204171033.86804-2-pstanner@redhat.com>
struct ata_host.iomap has been created and administrated so far by
pcim_iomap_table(), a problematic function that has been deprecated in
commit e354bb84a4c1c ("PCI: Deprecate pcim_iomap_table(),
pcim_iomap_regions_request_all()")
Ideally, drivers should not need a global table at all and should store
ioremaped BARs in their respective structs separately. For ATA, however,
it's far easier to deprecate pcim_iomap_table() by allocating struct
ata_host.iomap statically as an array of iomem pointers. Since
PCI_STD_NUM_BARS is currently defined to be 6, the memory overhead is
irrelevant.
Make struct ata_host.iomap a static iomem pointer table.
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
include/linux/libata.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c1a85d46eba6..d12a9627c96e 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -23,6 +23,9 @@
#include <linux/cdrom.h>
#include <linux/sched.h>
#include <linux/async.h>
+#ifdef CONFIG_PCI
+#include <linux/pci_regs.h> /* for PCI_STD_NUM_BARS */
+#endif /* CONFIG_PCI */
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
@@ -615,7 +618,9 @@ struct ata_ioports {
struct ata_host {
spinlock_t lock;
struct device *dev;
- void __iomem * const *iomap;
+#ifdef CONFIG_PCI
+ void __iomem *iomap[PCI_STD_NUM_BARS];
+#endif /* CONFIG_PCI */
unsigned int n_ports;
unsigned int n_tags; /* nr of NCQ tags */
void *private_data;
--
2.47.0
next prev parent reply other threads:[~2024-12-04 17:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 17:10 [RFC PATCH 0/3] ATA: Replace deprecated PCI functions Philipp Stanner
2024-12-04 17:10 ` Philipp Stanner [this message]
2024-12-04 17:10 ` [RFC PATCH 2/3] ata: " Philipp Stanner
2024-12-12 18:20 ` Sergey Shtylyov
2024-12-04 17:10 ` [RFC PATCH 3/3] libata-sff: Simplify request of PCI resources Philipp Stanner
2024-12-12 19:26 ` Sergey Shtylyov
2024-12-09 1:14 ` [RFC PATCH 0/3] ATA: Replace deprecated PCI functions Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241204171033.86804-3-pstanner@redhat.com \
--to=pstanner@redhat.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpelinux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox