linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Arnd Bergmann" <arnd@arndb.de>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Baoquan He" <bhe@redhat.com>
Cc: "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Mateusz Jończyk" <mat.jonczyk@o2.pl>
Subject: Re: [PATCH] MIPS: pci-legacy: Override pci_address_to_pio
Date: Tue, 14 Jan 2025 19:20:09 +0000	[thread overview]
Message-ID: <fb3aa671-45bc-4d57-b90b-2056eeed0ea6@app.fastmail.com> (raw)
In-Reply-To: <5ef27e01-2c5a-400a-be32-d3bcdeea6d26@app.fastmail.com>



在2025年1月14日一月 下午7:03,Arnd Bergmann写道:
> On Tue, Jan 14, 2025, at 19:11, Jiaxun Yang wrote:
>> 
>> +unsigned long pci_address_to_pio(phys_addr_t address)
>> +{
>> +	if (address > IO_SPACE_LIMIT)
>> +		return (unsigned long)-1;
>> +
>> +	return (unsigned long) address;
>> +}
>> +
>>  /*
>
> Isn't the argument to this function a CPU physical address? I
> don't think there is a point comparing it to IO_SPACE_LIMIT
> on architectures where I/O space is memory mapped.

Actually not. It seems like the argument here is just raw PIO offset,
without applying mips_io_port_base.

We should validate it to ensure it's within the range specified by
mips_io_port_base (which is sized by IO_SPACE_LIMIT).

Thanks
>
> I see that you copied the above from the the non-PCI_IOBASE case
> of drivers/pci/pci.c, but that only really makes sense for
> architectures that have special port I/O instructions (x86,
> ia64) or that use logic_pio.
>
>       Arnd

-- 
- Jiaxun

  reply	other threads:[~2025-01-14 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 18:11 [PATCH] MIPS: pci-legacy: Override pci_address_to_pio Jiaxun Yang
2025-01-14 18:42 ` Mateusz Jończyk
2025-01-14 18:51   ` Jiaxun Yang
2025-01-19 11:42   ` Mateusz Jończyk
2025-01-14 18:46 ` Greg KH
2025-01-14 18:55   ` Jiaxun Yang
2025-01-14 19:03 ` Arnd Bergmann
2025-01-14 19:20   ` Jiaxun Yang [this message]
2025-01-15  7:38     ` Arnd Bergmann
2025-01-15  8:57       ` Maciej W. Rozycki
2025-01-15  9:26       ` Jiaxun Yang
2025-01-20 19:41 ` Thomas Bogendoerfer

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=fb3aa671-45bc-4d57-b90b-2056eeed0ea6@app.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=arnd@arndb.de \
    --cc=bhe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mat.jonczyk@o2.pl \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).