From: Bjorn Helgaas <helgaas@kernel.org>
To: Sinan Kaya <okaya@kernel.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions
Date: Mon, 17 Dec 2018 13:27:21 -0600 [thread overview]
Message-ID: <20181217192721.GA28981@google.com> (raw)
In-Reply-To: <20181201204137.1786-1-okaya@kernel.org>
On Sat, Dec 01, 2018 at 08:41:35PM +0000, Sinan Kaya wrote:
> Need stub functions in order to be able to compile ACPI without PCI
> support.
>
> Signed-off-by: Sinan Kaya <okaya@kernel.org>
I can't tell where this series is since I only got the pieces that
touch PCI and the version numbers and n/n numbers don't make much
sense then, so apologies if I'm responding to an obsolete patch.
> ---
> include/linux/pci.h | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 11c71c4ecf75..15407f469d41 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -682,10 +682,22 @@ struct pci_ops {
> * ACPI needs to be able to access PCI config space before we've done a
> * PCI bus scan and created pci_bus structures.
> */
> +#ifdef CONFIG_PCI
> int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
> int reg, int len, u32 *val);
> int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
> int reg, int len, u32 val);
> +#else
> +static inline int raw_pci_read(unsigned int domain, unsigned int bus,
> + unsigned int devfn, int reg, int len, u32 *val)
> +{
> + *val = 0;
> + return -EINVAL;
Why do you return 0 here? If a PCI config access fails, you usually
get ~0.
> +}
> +static inline int raw_pci_write(unsigned int domain, unsigned int bus,
> + unsigned int devfn, int reg, int len, u32 val)
> +{ return -EINVAL; }
> +#endif
>
> #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
> typedef u64 pci_bus_addr_t;
> @@ -1599,7 +1611,27 @@ pci_release_mem_regions(struct pci_dev *pdev)
> }
>
> #else /* CONFIG_PCI is not enabled */
> +static inline int pci_bus_read_config_byte(struct pci_bus *bus,
> + unsigned int devfn, int where, u8 *val)
> +{ return -EINVAL; }
Should these set *val as well? To ~0 (or 0) to match above, I assume?
> +static inline int pci_bus_read_config_word(struct pci_bus *bus,
> + unsigned int devfn, int where, u16 *val)
> +{ return -EINVAL; }
> +static inline int pci_bus_read_config_dword(struct pci_bus *bus,
> + unsigned int devfn, int where, u32 *val)
> +{ return -EINVAL; }
> +static inline int pci_bus_write_config_byte(struct pci_bus *bus,
> + unsigned int devfn, int where, u8 val)
> +{ return -EINVAL; }
> +static inline int pci_bus_write_config_word(struct pci_bus *bus,
> + unsigned int devfn, int where, u16 val)
> +{ return -EINVAL; }
> +static inline int pci_bus_write_config_dword(struct pci_bus *bus,
> + unsigned int devfn, int where, u32 val)
> +{ return -EINVAL; }
> +static inline struct pci_bus *pci_find_bus(int domain, int busnr)
> +{ return NULL; }
> static inline void pci_set_flags(int flags) { }
> static inline void pci_add_flags(int flags) { }
> static inline void pci_clear_flags(int flags) { }
> --
> 2.19.0
>
next prev parent reply other threads:[~2018-12-17 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 20:41 [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Sinan Kaya
2018-12-01 20:41 ` [PATCH v1 2/2] PCI/ACPI: alloc ACPI to be built without PCI support Sinan Kaya
2018-12-02 17:43 ` Sinan Kaya
2018-12-03 8:19 ` Ingo Molnar
2018-12-03 14:02 ` Sinan Kaya
2018-12-17 19:28 ` Bjorn Helgaas
2018-12-17 19:27 ` Bjorn Helgaas [this message]
2018-12-18 1:52 ` [PATCH v1 1/2] PCI: Stub out read/write/raw/find functions Sinan Kaya
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=20181217192721.GA28981@google.com \
--to=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=okaya@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).