qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Chris Wright <chrisw@sous-sol.org>
Cc: Chris Wright <chrisw@redhat.com>,
	linux-pci@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Avi Kivity <avi@redhat.com>, Cam Macdonell <cam@cs.ualberta.ca>
Subject: [Qemu-devel] Re: [PATCH] pci: fix pci_resource_alignment prototype
Date: Thu, 9 Sep 2010 13:41:43 -0700	[thread overview]
Message-ID: <20100909134143.59154112@jbarnes-desktop> (raw)
In-Reply-To: <20100908002520.GM30129@sequoia.sous-sol.org>

On Tue, 7 Sep 2010 17:25:20 -0700
Chris Wright <chrisw@sous-sol.org> wrote:

> From: Cam Macdonell <cam@cs.ualberta.ca>
> 
> * Cam Macdonell (cam@cs.ualberta.ca) wrote:
> > It seems it was the alignment value being passed back from
> > pci_resource_alignment().  The return type is an int, which was
> > causing value of 2GB to be sign extended to to 0xffffffff80000000.
> > Changing the return type to resource_size_t allows BAR values >= 2GB
> > to be successfully assigned.
> <snip>
> > -static inline int pci_resource_alignment(struct pci_dev *dev,
> > +static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
> >                                          struct resource *res)
> 
> Yes, that's my mistake.  Thanks for debugging the issue Cam.
> This fixes the prototype for both pci_resource_alignment() and
> pci_sriov_resource_alignment().
> 
> Patch started as debugging effort from Cam Macdonell.
> 
> Cc: Cam Macdonell <cam@cs.ualberta.ca>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> [chrisw: add iov bits]
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
>  drivers/pci/iov.c |    2 +-
>  drivers/pci/pci.h |    5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index ce6a366..553d8ee 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -608,7 +608,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno,
>   * the VF BAR size multiplied by the number of VFs.  The alignment
>   * is just the VF BAR size.
>   */
> -int pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
> +resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
>  {
>  	struct resource tmp;
>  	enum pci_bar_type type;
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 679c39d..5d0aeb1 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -262,7 +262,8 @@ extern int pci_iov_init(struct pci_dev *dev);
>  extern void pci_iov_release(struct pci_dev *dev);
>  extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,
>  				enum pci_bar_type *type);
> -extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
> +extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev,
> +						    int resno);
>  extern void pci_restore_iov_state(struct pci_dev *dev);
>  extern int pci_iov_bus_range(struct pci_bus *bus);
>  
> @@ -318,7 +319,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
>  }
>  #endif /* CONFIG_PCI_IOV */
>  
> -static inline int pci_resource_alignment(struct pci_dev *dev,
> +static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
>  					 struct resource *res)
>  {
>  #ifdef CONFIG_PCI_IOV
> 
> 

Applied to my for-linus branch, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

      reply	other threads:[~2010-09-09 20:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 22:22 [Qemu-devel] Guest cannot handle a PCI BAR > 1GB Cam Macdonell
2010-09-05 16:50 ` Avi Kivity
2010-09-06 16:37   ` Cam Macdonell
2010-09-06 17:24     ` Cam Macdonell
2010-09-08  0:01       ` [Qemu-devel] [solved] " Cam Macdonell
2010-09-08  0:25         ` [Qemu-devel] [PATCH] pci: fix pci_resource_alignment prototype Chris Wright
2010-09-09 20:41           ` Jesse Barnes [this message]

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=20100909134143.59154112@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=avi@redhat.com \
    --cc=cam@cs.ualberta.ca \
    --cc=chrisw@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=qemu-devel@nongnu.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).