From: Alexander Gordeev <agordeev@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH RFC 09/15] pci: Add pci_bar_set()
Date: Wed, 13 Apr 2016 20:39:35 +0200 [thread overview]
Message-ID: <20160413183934.GD26689@agordeev.lab.eng.brq.redhat.com> (raw)
In-Reply-To: <20160413163843.4ninacw5axlghab3@hawk.localdomain>
On Wed, Apr 13, 2016 at 06:38:43PM +0200, Andrew Jones wrote:
> On Mon, Apr 11, 2016 at 01:04:21PM +0200, Alexander Gordeev wrote:
> > Cc: Thomas Huth <thuth@redhat.com>
> > Cc: Andrew Jones <drjones@redhat.com>
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > ---
> > lib/pci.c | 8 ++++++++
> > lib/pci.h | 1 +
> > 2 files changed, 9 insertions(+)
> >
> > diff --git a/lib/pci.c b/lib/pci.c
> > index 43e9c0c38434..46aee60e0f90 100644
> > --- a/lib/pci.c
> > +++ b/lib/pci.c
> > @@ -84,6 +84,14 @@ phys_addr_t pci_bar_size(pcidevaddr_t dev, int bar_num)
> > }
> > }
> >
> > +void pci_bar_set(pcidevaddr_t dev, int bar_num, uint64_t addr)
> > +{
> > + int off = PCI_BASE_ADDRESS_0 + bar_num * 4;
>
> Blank line here please. Please run the kernel's checkpatch script on all
> your patches. We strive to follow the kernel coding style. (Well, don't
> look at the legacy code :-)
>
> > + pci_config_writel(dev, off, (uint32_t)addr);
> > + if (pci_bar_is64(dev, bar_num))
> > + pci_config_writel(dev, (uint32_t)(addr >> 32), off + 4);
>
> This pci_config_writel() call is using offset as the 3rd parameter, but
> it should be the 2nd.
Bummer.
> Also, where do you introduce pci_config_writel()? I haven't closely
> reviewed all the previous patches, but so far I only see uses of it, no
> introduction of it. Does this series compile one patch at a time? We
> should ensure it does to maintain bisectability.
06/15 "pci/x86: Add remaining PCI configuration space accessors"
pci_config_read*/write* accessors are not expected implemented
on archs that do not include lib/pci.c. Once lib/pci.c added
to an arch accessors must be introduced to lib/asm/pci.h as well.
Also, no generic implementation introduced as there is no such
thing as generic PCI access.
If it makes sense?
> Thanks,
> drew
>
> > +}
> > +
> > bool pci_bar_is_memory(pcidevaddr_t dev, int bar_num)
> > {
> > uint32_t bar = pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
> > diff --git a/lib/pci.h b/lib/pci.h
> > index 09b500ea19f0..69d2a62f1b32 100644
> > --- a/lib/pci.h
> > +++ b/lib/pci.h
> > @@ -15,6 +15,7 @@ enum {
> > PCIDEVADDR_INVALID = 0xffff,
> > };
> > pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id);
> > +void pci_bar_set(pcidevaddr_t dev, int bar_num, uint64_t addr);
> > phys_addr_t pci_bar_addr(pcidevaddr_t dev, int bar_num);
> > phys_addr_t pci_bar_size(pcidevaddr_t dev, int bar_num);
> > bool pci_bar_is64(pcidevaddr_t dev, int bar_num);
> > --
> > 1.8.3.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-13 18:40 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 11:04 [PATCH RFC 00/15] PCI bus support Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 01/15] Update ioremap() prototype to conform to the Linux one Alexander Gordeev
2016-04-11 11:34 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 02/15] x86: Add basic ioremap() implementation Alexander Gordeev
2016-04-11 11:45 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 03/15] x86/vmexit: Make use of ioremap() Alexander Gordeev
2016-04-11 11:46 ` Andrew Jones
2016-04-11 12:02 ` Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 04/15] pci: Fix indentation in generic PCI files Alexander Gordeev
2016-04-11 11:50 ` Andrew Jones
2016-04-11 12:06 ` Alexander Gordeev
2016-04-11 12:21 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 05/15] pci/x86: Rename pci_config_read() to pci_config_readl() Alexander Gordeev
2016-04-11 11:51 ` Andrew Jones
2016-04-13 12:55 ` Thomas Huth
2016-04-14 13:13 ` Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 06/15] pci/x86: Add remaining PCI configuration space accessors Alexander Gordeev
2016-04-14 7:29 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 07/15] pci: Add pci_probe() and pci_shutdown() Alexander Gordeev
2016-04-14 7:45 ` Thomas Huth
2016-04-14 13:23 ` Alexander Gordeev
2016-04-22 15:04 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 08/15] pci: Rework pci_bar_addr() Alexander Gordeev
2016-04-13 13:28 ` Thomas Huth
2016-04-13 17:46 ` Alexander Gordeev
2016-04-13 18:05 ` Andrew Jones
2016-04-22 15:20 ` Andrew Jones
2016-04-22 15:22 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 09/15] pci: Add pci_bar_set() Alexander Gordeev
2016-04-13 15:01 ` Thomas Huth
2016-04-13 16:38 ` Andrew Jones
2016-04-13 18:39 ` Alexander Gordeev [this message]
2016-04-14 7:30 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 10/15] pci: Add pci_print() and pci_type_desc() Alexander Gordeev
2016-04-14 7:43 ` Thomas Huth
2016-04-14 8:34 ` Alexander Gordeev
2016-04-14 8:41 ` Thomas Huth
2016-04-14 9:42 ` Andrew Jones
2016-04-22 15:35 ` Andrew Jones
2016-05-18 9:03 ` Alexander Gordeev
2016-05-23 15:10 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 11/15] pci/x86: Adopt PCI framework changes Alexander Gordeev
2016-04-22 15:37 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 12/15] Factor out generic architecture code Alexander Gordeev
2016-04-14 7:50 ` Thomas Huth
2016-04-14 8:16 ` Alexander Gordeev
2016-04-22 15:40 ` Andrew Jones
2016-04-22 16:14 ` Alexander Gordeev
2016-04-22 15:54 ` Andrew Jones
2016-04-22 16:35 ` Alexander Gordeev
2016-04-26 8:24 ` Alexander Gordeev
2016-04-26 9:37 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 13/15] pci/arm: Add generic ECAM host support Alexander Gordeev
2016-04-22 17:07 ` Andrew Jones
2016-05-29 19:54 ` Alexander Gordeev
2016-05-30 6:12 ` Andrew Jones
2016-05-30 6:28 ` Alexander Gordeev
2016-05-30 6:40 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 14/15] pci: Add pci-testdev PCI bus test device Alexander Gordeev
2016-04-22 17:23 ` Andrew Jones
2016-05-23 8:02 ` Alexander Gordeev
2016-05-23 15:17 ` Andrew Jones
2016-05-29 17:48 ` Alexander Gordeev
2016-05-30 6:09 ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 15/15] pci/arm: Add pci-testdev PCI device operation test Alexander Gordeev
2016-04-22 17:33 ` Andrew Jones
2016-05-29 20:03 ` Alexander Gordeev
2016-05-30 6:15 ` Andrew Jones
2016-05-31 20:13 ` Alexander Gordeev
2016-05-31 20:27 ` Andrew Jones
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=20160413183934.GD26689@agordeev.lab.eng.brq.redhat.com \
--to=agordeev@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).