All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Andrew Vasquez <praka@san.rr.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
Date: Thu, 29 May 2003 10:26:16 -0400	[thread overview]
Message-ID: <3ED61888.6040407@pobox.com> (raw)
In-Reply-To: <20030529061913.GA27199@praka.local.home>

Andrew Vasquez wrote:
> On Thu, 22 May 2003, Anton Blanchard wrote:
> 
> 
>>>+#if MEMORY_MAPPED_IO
>>>+	/* Get memory mapped I/O address */
>>>+	pci_read_config_dword(ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase);
>>
>>You really want to be using pci_resource_start(ha->pdev, 1) so it will
>>work on architectures like ppc64 and sparc64.
>>
> 
> 
> You're correct -- code updated in my tree.
> 
> 
>>>+	mmapbase &= PCI_BASE_ADDRESS_MEM_MASK;
>>>+
>>>+	/* Find proper memory chunk for memory map I/O reg */
>>>+	base = mmapbase & PAGE_MASK;
>>>+	page_offset = mmapbase - base;
>>
>>Is that correct?
>>
> 
> 
> The 'mmapbase &= PCI_BASE_ADDRESS_MEM_MASK' does appear to be
> incorrect, yet, I just have one question.

s/incorrect/obsolete/

This masking is a harmless remnant of ancient 2.2.x days, when we read 
the PCI information straight out of the PCI config registers.  This 
masking is no longer needed when a driver is converted to using 
pci_resource_start (as it should be :))


   it seems several drivers
> (i.e. sym53c8xx_2, aic7xxx) ensure the memory-mapped resource begins
> on a page boundary before passing it onto ioremap().  Yet, in the code
> for __ioremap(), (arch/i386/mm/ioremap.c) there is this small comment:
> 
> 	/*
> 	 * NOTE! We need to allow non-page-aligned mappings too: we
> 	 * will obviously have to convert them into an offset in a
> 	 * page-aligned mapping, but the caller shouldn't need to know
> 	 * that small detail.
> 	 *
> 	 */
> 
> Is it safe to assume *all* platforms will handle this case internally,
> or should drivers perform the pre-process?

They better.  It is expected that you can pass the bus address returned 
from pci_resource_start directly to ioremap (after ensuring availability 
by calling pci_request_regions).

	Jeff




  reply	other threads:[~2003-05-29 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-19 22:57 [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2) Andrew Vasquez
2003-05-21 17:32 ` Andrew Vasquez
2003-05-21 22:26   ` Anton Blanchard
2003-05-29  6:19     ` Andrew Vasquez
2003-05-29 14:26       ` Jeff Garzik [this message]
2003-05-29 15:17         ` Andrew Vasquez
2003-05-29 15:33       ` Anton Blanchard

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=3ED61888.6040407@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=praka@san.rr.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.