mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] mcb-pci: fix memory overlapping on MCB devices
@ 2023-03-23 12:49 Rodríguez Barbarin, José Javier
  2023-03-23 12:49 ` [PATCH 1/1] mcb: Remove requesting memory region to avoid memory overlapping Rodríguez Barbarin, José Javier
  0 siblings, 1 reply; 5+ messages in thread
From: Rodríguez Barbarin, José Javier @ 2023-03-23 12:49 UTC (permalink / raw)
  To: morbidrsa, linux-kernel
  Cc: jth, Sanjuán García, Jorge, Rodríguez Barbarin,
	José Javier

mcb-pci driver is allocating the memory region for the "chameleon table"
with a fixed size of 0x200. This region is only use to do a initial
parsing to discover the devices implemented as IP Cores.

If the "chameleon table" is actually smalled than 0x200 and the first
device offset happen to be within 0x200, a memory overlapping can ocurr.

Here an extract of the memory overlapping when registering a 16z125 IP Core:

[   31.016972] 8250_men_mcb mcb0-16z125-0:0:0: can't request region for resource [mem 0xa8200100-0xa820010f]
[   31.016994] 8250_men_mcb: probe of mcb0-16z125-0:0:0 failed with error -16
[   31.017010] 8250_men_mcb mcb0-16z125-1:0:0: can't request region for resource [mem 0xa8200110-0xa820011f]

And here, the memory allocated for the chameleon table parsing:

user@host:$ sudo /proc/iomem
...
a8200000-a82001ff : mcb_pci
...

This patch solves this problem by not allocating the memory region of the
"chamelon table" that is only needed for parsing. Just do an ioremap instead.

This patch is based on linux-next (next-20230323)

Javier Rodriguez (1):
  mcb: Remove requesting memory region to avoid memory overlapping

 drivers/mcb/mcb-pci.c | 10 ----------
 1 file changed, 10 deletions(-)

-- 
2.34.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-23 15:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 12:49 [PATCH 0/1] mcb-pci: fix memory overlapping on MCB devices Rodríguez Barbarin, José Javier
2023-03-23 12:49 ` [PATCH 1/1] mcb: Remove requesting memory region to avoid memory overlapping Rodríguez Barbarin, José Javier
2023-03-23 14:25   ` Johannes Thumshirn
2023-03-23 15:11     ` Rodríguez Barbarin, José Javier
2023-03-23 15:53       ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®