RE: [PATCH net 1/4] net: freescale/fman: Split the main resource region reservation

From: Madalin Bucur
Date: Thu Dec 03 2020 - 10:48:24 EST


> -----Original Message-----
> From: Patrick Havelange <patrick.havelange@xxxxxxxxxxxxx>
> Sent: 03 December 2020 15:51
> To: Madalin Bucur <madalin.bucur@xxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: Patrick Havelange <patrick.havelange@xxxxxxxxxxxxx>
> Subject: [PATCH net 1/4] net: freescale/fman: Split the main resource
> region reservation
>
> The main fman driver is only using some parts of the fman memory
> region.
> Split the reservation of the main region in 2, so that the other
> regions that will be used by fman-port and fman-mac drivers can
> be reserved properly and not be in conflict with the main fman
> reservation.
>
> Signed-off-by: Patrick Havelange <patrick.havelange@xxxxxxxxxxxxx>

I think the problem you are trying to work on here is that the device
tree entry that describes the FMan IP allots to the parent FMan device the
whole memory-mapped registers area, as described in the device datasheet.
The smaller FMan building blocks (ports, MDIO controllers, etc.) are
each using a nested subset of this memory-mapped registers area.
While this hierarchical depiction of the hardware has not posed a problem
to date, it is possible to cause issues if both the FMan driver and any
of the sub-blocks drivers are trying to exclusively reserve the registers
area. I'm assuming this is the problem you are trying to address here,
besides the stack corruption issue. While for the latter I think we can
put together a quick fix, for the former I'd like to take a bit of time
to select the best fix, if one is really needed. So, please, let's split
the two problems and first address the incorrect stack memory use.

Regards,
Madalin