]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: stmmac_platform: fix parsing of DT binding
authorNiklas Cassel <niklas.cassel@axis.com>
Wed, 7 Dec 2016 14:20:05 +0000 (15:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 18:07:10 +0000 (13:07 -0500)
commit5cb2f7a524c5094f0c481eff81f8569f2c63ebfd
tree77105e3a9bde70e955c6ce307633f3e1ae02ae96
parent75ccd5e69f1a61da639f2f32e15d2ce1b1ee15e5
net: stmmac: stmmac_platform: fix parsing of DT binding

commit ad87472daf36 ("net: stmmac: fixed the pbl setting with DT")
changed the parsing of the DT binding.

Before ad87472daf36, snps,fixed-burst and snps,mixed-burst were parsed
regardless if the property snps,pbl existed or not.
After the commit, fixed burst and mixed burst are only parsed if
snps,pbl exists. Now when snps,aal has been added, it too is only
parsed if snps,pbl exists.

Since the DT binding does not specify that fixed burst, mixed burst
or aal depend on snps,pbl being specified, undo changes introduced
by ad87472daf36.

The issue commit ad87472daf36 ("net: stmmac: fixed the pbl setting with
DT") tries to address is solved in another way:
The databook specifies that all values other than
1, 2, 4, 8, 16, or 32 results in undefined behavior,
so snps,pbl = <0> is invalid.

If pbl is 0 after parsing, set pbl to DEFAULT_DMA_PBL.
This handles the case where the property is omitted, and also handles
the case where the property is specified without any data.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Acked-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c