From: Arnd Bergmann <arnd@arndb.de>
To: Srikanth Thokala <sthokal@xilinx.com>
Cc: bhelgaas@google.com, will.deacon@arm.com, michals@xilinx.com,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Generic Configuration Access Mechanism support
Date: Mon, 19 May 2014 19:03:04 +0200 [thread overview]
Message-ID: <4223392.yrWc3QAXY9@wuerfel> (raw)
In-Reply-To: <1400422125-2209-1-git-send-email-sthokal@xilinx.com>
On Sunday 18 May 2014 19:38:45 Srikanth Thokala wrote:
> +
> + if (cfg->ops->is_valid_cfg_access) {
> + if (!cfg->ops->is_valid_cfg_access(bus, devfn)) {
> + *val = PCI_CFG_INVALID_DEVFN;
> + return PCIBIOS_DEVICE_NOT_FOUND;
> + }
> + }
Can you explain why this callback is needed? If the space for the
bus is mapped, any access should just work.
> +
> +/* Generic PCI CAM/ECAM Configuration Bus Operations */
> +
> +struct pci_cfg_bus_ops pci_cfg_cam_bus_ops = {
> + .bus_shift = PCI_CFG_CAM_BUS_NUM,
> + .map_bus = pci_cfg_map_bus_cam,
> +};
> +EXPORT_SYMBOL_GPL(pci_cfg_cam_bus_ops);
> +
> +struct pci_cfg_bus_ops pci_cfg_ecam_bus_ops = {
> + .bus_shift = PCI_CFG_ECAM_BUS_NUM,
> + .map_bus = pci_cfg_map_bus_ecam,
> +};
> +EXPORT_SYMBOL_GPL(pci_cfg_ecam_bus_ops);
> +
> +struct pci_ops pci_cfg_ops = {
> + .read = pci_cfg_read,
> + .write = pci_cfg_write,
> +};
> +EXPORT_SYMBOL_GPL(pci_cfg_ops);
If we can find a way to remove the is_valid_cfg_access() check, we're
probably better off removing the cfg_bus_ops as well, and exporting
two sets of pci_ops. There will be a little more duplication here, but
also less complexity in this module, and more importantly in the drivers
using it.
Arnd
next prev parent reply other threads:[~2014-05-19 17:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 14:08 [PATCH] PCI: Generic Configuration Access Mechanism support Srikanth Thokala
2014-05-19 16:32 ` Will Deacon
2014-05-19 16:59 ` Arnd Bergmann
2014-05-19 17:03 ` Arnd Bergmann [this message]
2014-05-20 14:31 ` Srikanth Thokala
2014-05-21 7:52 ` Arnd Bergmann
2014-05-21 8:54 ` Srikanth Thokala
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=4223392.yrWc3QAXY9@wuerfel \
--to=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=michals@xilinx.com \
--cc=sthokal@xilinx.com \
--cc=will.deacon@arm.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