From: Martin Wilck <martin.wilck@ts.fujitsu.com>
To: "djwong@us.ibm.com" <djwong@us.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
"jbarnes@virtuousgeek.org" <jbarnes@virtuousgeek.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [REGRESSSION 2.6.37-rc2][PATCH] pci: Fix mmap address check in pci_mmap_fits
Date: Tue, 16 Nov 2010 11:03:58 +0100 [thread overview]
Message-ID: <4CE2570E.50609@ts.fujitsu.com> (raw)
In-Reply-To: <20101116075814.GR14383@tux1.beaverton.ibm.com>
Hi Darrick,
> I think what we want here is for pci_start to be 0 when mmap_api ==
> PCI_MMAP_PROCFS. The following patch makes that change, after which the Matrox
> and Mach64 X drivers work again.
Of course. I made a stupid mistake when I introduced the enum :-( Thanks
for spotting and fixing it so quickly.
Jesse, please apply Darrick's fix.
Martin
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index 95712a3..63d5042 100644
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -715,7 +715,7 @@ int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma,
> nr = (vma->vm_end - vma->vm_start)>> PAGE_SHIFT;
> start = vma->vm_pgoff;
> size = ((pci_resource_len(pdev, resno) - 1)>> PAGE_SHIFT) + 1;
> - pci_start = (mmap_api == PCI_MMAP_SYSFS) ?
> + pci_start = (mmap_api == PCI_MMAP_PROCFS) ?
> pci_resource_start(pdev, resno)>> PAGE_SHIFT : 0;
> if (start>= pci_start&& start< pci_start + size&&
> start + nr<= pci_start + size)
--
Dr. Martin Wilck
PRIMERGY System Software Engineer
x86 Server Engineering
FUJITSU
Fujitsu Technology Solutions GmbH
Heinz-Nixdorf-Ring 1
33106 Paderborn, Germany
Phone: ++49 5251 525 2796
Fax: ++49 5251 525 2820
Email: martin.wilck@ts.fujitsu.com
Internet: http://ts.fujitsu.com
Company Details: http://ts.fujitsu.com/imprint
prev parent reply other threads:[~2010-11-16 10:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 7:22 Incorrect size checks on mmap() for sysfs PCI resource files is breaking X? Darrick J. Wong
2010-11-16 7:53 ` Dave Airlie
2010-11-16 7:59 ` Darrick J. Wong
2010-11-16 7:58 ` [REGRESSSION 2.6.37-rc2][PATCH] pci: Fix mmap address check in pci_mmap_fits Darrick J. Wong
2010-11-16 10:03 ` Martin Wilck [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=4CE2570E.50609@ts.fujitsu.com \
--to=martin.wilck@ts.fujitsu.com \
--cc=djwong@us.ibm.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.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