2023-05-31 10:46:45

by Sui Jingfeng

[permalink] [raw]
Subject: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

As some arch(m68k for example) doesn't have config_pci enabled, drivers[1]
call pci_clear_master() without config_pci guard can not pass compile test.

drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:
In function 'etnaviv_gpu_pci_fini':
>> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:32:9:
error: implicit declaration of function 'pci_clear_master';
did you mean 'pci_set_master'? [-Werror=implicit-function-declaration]
32 | pci_clear_master(pdev);
| ^~~~~~~~~~~~~~~~
| pci_set_master
cc1: some warnings being treated as errors

[1] https://patchwork.freedesktop.org/patch/539977/?series=118522&rev=1

V2:
* Adjust commit log style to meet the convention and add Fixes tag

Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Sui Jingfeng <[email protected]>
---
include/linux/pci.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index d0c19ff0c958..71c85380676c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1904,6 +1904,7 @@ static inline int pci_dev_present(const struct pci_device_id *ids)
#define pci_dev_put(dev) do { } while (0)

static inline void pci_set_master(struct pci_dev *dev) { }
+static inline void pci_clear_master(struct pci_dev *dev) { }
static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
static inline void pci_disable_device(struct pci_dev *dev) { }
static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; }
--
2.25.1



2023-05-31 17:53:47

by Sui Jingfeng

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

Hi,


Thanks a lot.

Can you receive my email?

I reply several email to you, but Thunderbird told me that may mail is
returned.

Maybe you could read the content at lore.

```

The recipient's server is busy or down now.
SMTP error, OPEN: Host kernel.org(35.85.114.177) OPEN said 521 5.7.1 Service unavailable; client [114.242.206.163] blocked using zen.spamhaus.org

```


On 2023/6/1 01:28, Bjorn Helgaas wrote:
> On Wed, May 31, 2023 at 06:27:44PM +0800, Sui Jingfeng wrote:
>> As some arch(m68k for example) doesn't have config_pci enabled, drivers[1]
>> call pci_clear_master() without config_pci guard can not pass compile test.
>>
>> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:
>> In function 'etnaviv_gpu_pci_fini':
>>>> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:32:9:
>> error: implicit declaration of function 'pci_clear_master';
>> did you mean 'pci_set_master'? [-Werror=implicit-function-declaration]
>> 32 | pci_clear_master(pdev);
>> | ^~~~~~~~~~~~~~~~
>> | pci_set_master
>> cc1: some warnings being treated as errors
>>
>> [1] https://patchwork.freedesktop.org/patch/539977/?series=118522&rev=1
>>
>> V2:
>> * Adjust commit log style to meet the convention and add Fixes tag
>>
>> Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()")
>> Reported-by: kernel test robot <[email protected]>
>> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>> Reviewed-by: Geert Uytterhoeven <[email protected]>
>> Signed-off-by: Sui Jingfeng <[email protected]>
> Applied to pci/misc for v6.5 as follows:
>
> Author: Sui Jingfeng <[email protected]>
> Date: Wed May 31 18:27:44 2023 +0800
>
> PCI: Add pci_clear_master() stub for non-CONFIG_PCI
>
> Add a pci_clear_master() stub when CONFIG_PCI is not set so drivers that
> support both PCI and platform devices don't need #ifdefs or extra Kconfig
> symbols for the PCI parts.
>
> [bhelgaas: commit log]
> Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()")
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Sui Jingfeng <[email protected]>
> Signed-off-by: Bjorn Helgaas <[email protected]>
> Reviewed-by: Geert Uytterhoeven <[email protected]>
>
>> ---
>> include/linux/pci.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index d0c19ff0c958..71c85380676c 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> @@ -1904,6 +1904,7 @@ static inline int pci_dev_present(const struct pci_device_id *ids)
>> #define pci_dev_put(dev) do { } while (0)
>>
>> static inline void pci_set_master(struct pci_dev *dev) { }
>> +static inline void pci_clear_master(struct pci_dev *dev) { }
>> static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
>> static inline void pci_disable_device(struct pci_dev *dev) { }
>> static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; }
>> --
>> 2.25.1
>>

2023-05-31 18:01:51

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

On Wed, May 31, 2023 at 06:27:44PM +0800, Sui Jingfeng wrote:
> As some arch(m68k for example) doesn't have config_pci enabled, drivers[1]
> call pci_clear_master() without config_pci guard can not pass compile test.
>
> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:
> In function 'etnaviv_gpu_pci_fini':
> >> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:32:9:
> error: implicit declaration of function 'pci_clear_master';
> did you mean 'pci_set_master'? [-Werror=implicit-function-declaration]
> 32 | pci_clear_master(pdev);
> | ^~~~~~~~~~~~~~~~
> | pci_set_master
> cc1: some warnings being treated as errors
>
> [1] https://patchwork.freedesktop.org/patch/539977/?series=118522&rev=1
>
> V2:
> * Adjust commit log style to meet the convention and add Fixes tag
>
> Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()")
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Reviewed-by: Geert Uytterhoeven <[email protected]>
> Signed-off-by: Sui Jingfeng <[email protected]>

Applied to pci/misc for v6.5 as follows:

Author: Sui Jingfeng <[email protected]>
Date: Wed May 31 18:27:44 2023 +0800

PCI: Add pci_clear_master() stub for non-CONFIG_PCI

Add a pci_clear_master() stub when CONFIG_PCI is not set so drivers that
support both PCI and platform devices don't need #ifdefs or extra Kconfig
symbols for the PCI parts.

[bhelgaas: commit log]
Fixes: 6a479079c072 ("PCI: Add pci_clear_master() as opposite of pci_set_master()")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sui Jingfeng <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>

> ---
> include/linux/pci.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index d0c19ff0c958..71c85380676c 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1904,6 +1904,7 @@ static inline int pci_dev_present(const struct pci_device_id *ids)
> #define pci_dev_put(dev) do { } while (0)
>
> static inline void pci_set_master(struct pci_dev *dev) { }
> +static inline void pci_clear_master(struct pci_dev *dev) { }
> static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
> static inline void pci_disable_device(struct pci_dev *dev) { }
> static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; }
> --
> 2.25.1
>

2023-05-31 18:51:16

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

On Thu, Jun 01, 2023 at 01:44:52AM +0800, Sui Jingfeng wrote:
> Can you receive my email?
>
> I reply several email to you, but Thunderbird told me that may mail is
> returned.
>
> Maybe you could read the content at lore.

I do receive your email (at least some; obviously if there are things
I don't receive I wouldn't know). I read most Linux email via lei [1],
so if it shows up on lore, I should see it.

Bjorn

[1] https://people.kernel.org/monsieuricon/lore-lei-part-1-getting-started

2023-06-20 04:16:11

by Sui Jingfeng

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

Hi, Dear Bjorn


Where is the formal(unstream) PCI git branch where we could see the
latest patch ?


On 2023/6/1 02:03, Bjorn Helgaas wrote:
> On Thu, Jun 01, 2023 at 01:44:52AM +0800, Sui Jingfeng wrote:
>> Can you receive my email?
>>
>> I reply several email to you, but Thunderbird told me that may mail is
>> returned.
>>
>> Maybe you could read the content at lore.
> I do receive your email (at least some; obviously if there are things
> I don't receive I wouldn't know). I read most Linux email via lei [1],
> so if it shows up on lore, I should see it.
>
> Bjorn
>
> [1] https://people.kernel.org/monsieuricon/lore-lei-part-1-getting-started

Thanks for the link.


2023-06-20 11:24:09

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

On Tue, Jun 20, 2023 at 12:04:40PM +0800, Sui Jingfeng wrote:
> Where is the formal(unstream) PCI git branch where we could see the latest
> patch ?

Here's the "misc" branch: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=misc

And here's the "next" branch that will be merged for v6.5, which
includes "misc" and other things: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=next

2023-06-20 12:01:47

by Sui Jingfeng

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

Hi,

On 2023/6/20 19:06, Bjorn Helgaas wrote:
> On Tue, Jun 20, 2023 at 12:04:40PM +0800, Sui Jingfeng wrote:
>> Where is the formal(unstream) PCI git branch where we could see the latest
>> patch ?
> Here's the "misc" branch: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=misc
>
> And here's the "next" branch that will be merged for v6.5, which
> includes "misc" and other things: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=next


Thanks for you kindness reply and guidance, now I know that.


2023-06-20 12:40:39

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: Add dummy implement for pci_clear_master() function

On Tue, Jun 20, 2023 at 06:06:00AM -0500, Bjorn Helgaas wrote:
> On Tue, Jun 20, 2023 at 12:04:40PM +0800, Sui Jingfeng wrote:
> > Where is the formal(unstream) PCI git branch where we could see the latest
> > patch ?
>
> Here's the "misc" branch: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=misc
>
> And here's the "next" branch that will be merged for v6.5, which
> includes "misc" and other things: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=next

I forgot to mention: in case you need to find other git branches, most
subsystems list this in the MAINTAINERS file, e.g.,

PCI SUBSYSTEM
...
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git