Re: 回覆: [net-next 3/3] net: ftgmac100: Support for AST2700
From: Andrew Lunn
Date: Wed Nov 13 2024 - 21:44:28 EST
> > > - map = le32_to_cpu(rxdes->rxdes3);
> > > + map = le32_to_cpu(rxdes->rxdes3) | ((rxdes->rxdes2 &
> > > +FTGMAC100_RXDES2_RXBUF_BADR_HI) << 16);
> >
> > Is this safe? You have to assume older generation of devices will return 42 in
> > rxdes3, since it is not used by the hardware.
>
> Why does it need to return 42 in rxdes3?
> The packet buffer address of the RX descriptor is used in both software and hardware.
42 is just a random value. The point is, what do older generation of
devices return here? Some random value? Something well defined?
You basically need to convince us that you are not breaking older
systems by accessing registers which they do not have. Describe in the
commit message how you know this is safe, what testing you have done
etc.
Andrew