Skip to contentSkip to conversation

net: dsa: mv88e6xxx: Add MV88E6352 DT compatible

PATCH NAK Marek Vasut 3 participants 12 messages Sep 12, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: mv88e6xxx: Add MV88E6352 DT compatible

Add DT compatible string for MV88E6352 switch.

---
 drivers/net/dsa/mv88e6xxx/chip.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/dsa/mv88e6xxx/chip.c +4 -0
index e07838430d16..15427380e32e 100644
@@ -4796,6 +4796,10 @@ static const struct of_device_id mv88e6xxx_of_match[] = {
 		.compatible = "marvell,mv88e6190",
 		.data = &mv88e6xxx_table[MV88E6190],
 	},
+	{
+		.compatible = "marvell,mv88e6352",
+		.data = &mv88e6xxx_table[MV88E6352],
+	},
 	{ /* sentinel */ },
 };
 
Signature · 1 line
2.18.0
maintainer NAK
#1 lore raw
Quoted 13 lines · Marek Vasut

Add DT compatible string for MV88E6352 switch.

---
 drivers/net/dsa/mv88e6xxx/chip.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/dsa/mv88e6xxx/chip.c +0 -0
index e07838430d16..15427380e32e 100644

drivers/net/dsa/mv88e6xxx/chip.c static const struct of_device_id mv88e6xxx_of_match[] = { · line 4802

Quoted 7 lines
drivers/net/dsa/mv88e6xxx/chip.c +4 -0
@@ -4796,6 +4796,10 @@ static const struct of_device_id mv88e6xxx_of_match[] = {
 		.compatible = "marvell,mv88e6190",
 		.data = &mv88e6xxx_table[MV88E6190],
 	},
+	{
+		.compatible = "marvell,mv88e6352",
+		.data = &mv88e6xxx_table[MV88E6352],
+	},

NACK.

Not needed. Lots of devices use the 6352. It is compatible to the marvell,mv88e6085.

Andrew

#2 lore raw
Quoted 24 lines · Andrew Lunn
Quoted 13 lines · Marek Vasut

Add DT compatible string for MV88E6352 switch.

---
 drivers/net/dsa/mv88e6xxx/chip.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/dsa/mv88e6xxx/chip.c +0 -0
index e07838430d16..15427380e32e 100644

drivers/net/dsa/mv88e6xxx/chip.c static const struct of_device_id mv88e6xxx_of_match[] = { · line 4802

Quoted 7 lines
drivers/net/dsa/mv88e6xxx/chip.c +4 -0
@@ -4796,6 +4796,10 @@ static const struct of_device_id mv88e6xxx_of_match[] = {
 		.compatible = "marvell,mv88e6190",
 		.data = &mv88e6xxx_table[MV88E6190],
 	},
+	{
+		.compatible = "marvell,mv88e6352",
+		.data = &mv88e6xxx_table[MV88E6352],
+	},

NACK.

Quoted 2 lines

Not needed. Lots of devices use the 6352. It is compatible to the marvell,mv88e6085.

So I should have both values in my DT, that is

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

? That works for me ...

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#3 lore raw
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Andrew

#4 lore raw
Quoted 4 lines · Andrew Lunn

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

To extend what Andrew stated above, Documentation/devicetree/bindings/net/dsa/marvell.txt (as of 22936c3e6e8c) says which of the two strings you should use for
each model.

The "marvell,mv88e6085" and "marvell,mv88e6190" compatible strings are best thought of as the "where is the identification register" setting; from that point the driver can figure out everything else.

-- brandon

#5 lore raw
In reply to Andrew Lunn
Quoted 8 lines · Andrew Lunn
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Well, until you find a difference between those chips which you cannot discern based solely on the ID register content. Then it's better to have a compatible to match on which matches the actual chip.

You can always patch the code to handle the difference between those chips based on the extra DT information, but you cannot always patch the DT itself, since it can be in ROM or whatnot.

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#6 lore raw
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Andrew Lunn
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Quoted 8 lines
Quoted 4 lines

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Well, until you find a difference between those chips which you cannot discern based solely on the ID register content. Then it's better to have a compatible to match on which matches the actual chip.

Hi Marek

We have been around this loop before. The problem with putting in a more specific compatible is that nothing is validating it. So it is going to be wrong, simple because people cut/paste, and don't necessary change it. So when we do need to look at it, we cannot look at it, because it is wrong.

I would only add a more specific compatible if and when we need it, it is actually used, and we can verify it is correct.

Andrew

#7 lore raw
Quoted 17 lines · Andrew Lunn
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Andrew Lunn
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Quoted 8 lines
Quoted 4 lines

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Well, until you find a difference between those chips which you cannot discern based solely on the ID register content. Then it's better to have a compatible to match on which matches the actual chip.

Hi Marek

Quoted 8 lines

We have been around this loop before. The problem with putting in a more specific compatible is that nothing is validating it. So it is going to be wrong, simple because people cut/paste, and don't necessary change it. So when we do need to look at it, we cannot look at it, because it is wrong.

I would only add a more specific compatible if and when we need it, it is actually used, and we can verify it is correct.

You may need it in the future and it may not be possible to adjust the DT then. So having a specific compatible and fallback compatible is I think the way to go. You can always match on the fallback and if the time comes, you can match on the specific one because it's there. In addition to that, such a DT would fully correctly describe the hardware, unlike one with only a fallback compatible.

Regarding validation, I don't see other systems using this approach (specific + fallback compatible) having a problem with validation. What is the trick there ?

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#8 lore raw
Quoted 34 lines · Marek Vasut
Quoted 17 lines · Andrew Lunn
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Andrew Lunn
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Quoted 8 lines
Quoted 4 lines

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Well, until you find a difference between those chips which you cannot discern based solely on the ID register content. Then it's better to have a compatible to match on which matches the actual chip.

Hi Marek

Quoted 8 lines

We have been around this loop before. The problem with putting in a more specific compatible is that nothing is validating it. So it is going to be wrong, simple because people cut/paste, and don't necessary change it. So when we do need to look at it, we cannot look at it, because it is wrong.

I would only add a more specific compatible if and when we need it, it is actually used, and we can verify it is correct.

You may need it in the future and it may not be possible to adjust the DT then. So having a specific compatible and fallback compatible is I think the way to go. You can always match on the fallback and if the time comes, you can match on the specific one because it's there. In addition to that, such a DT would fully correctly describe the hardware, unlike one with only a fallback compatible.

Quoted 3 lines

Regarding validation, I don't see other systems using this approach (specific + fallback compatible) having a problem with validation. What is the trick there ?

The trick is, they actually use the specific version, not the generic. So it is validated, because if the specific version is wrong, the device generally does not work.

We have no way to do that in this case. We load the driver based on the generic version. It then goes and looks at the ID registers, and from that decides what the device really is.

So far, Marvell have not messed this up. The ID registers have been correct. I trust the ID registers much more than anything in device tree. It is baked into silicon.

But you are talking of a theoretical case where the ID register is wrong. For this to get passed us and out their in the wild, with DT blown in ROM, that probably means there are a batch with the correct ID and a batch with incorrect IDs. Those with incorrect IDs are failing. You are arguing that we should then enable the use of the specific compatible. And i expect that breaks more devices than it fixes, because people have cut/pasted the wrong value.

Andrew

#9 lore raw
Quoted 35 lines · Andrew Lunn
Quoted 34 lines · Marek Vasut
Quoted 17 lines · Andrew Lunn
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Andrew Lunn
Quoted 1 line

compatible = "marvell,mv88e6352", "marvell,mv88e6085";

Just "marvell,mv88e6085";

Quoted 8 lines
Quoted 4 lines

Please take a look at all the other DT files using the Marvell chips. You will only ever find "marvell,mv88e6085" or "marvell,mv88e6190", because everything is compatible to one of these two.

Well, until you find a difference between those chips which you cannot discern based solely on the ID register content. Then it's better to have a compatible to match on which matches the actual chip.

Hi Marek

Quoted 8 lines

We have been around this loop before. The problem with putting in a more specific compatible is that nothing is validating it. So it is going to be wrong, simple because people cut/paste, and don't necessary change it. So when we do need to look at it, we cannot look at it, because it is wrong.

I would only add a more specific compatible if and when we need it, it is actually used, and we can verify it is correct.

You may need it in the future and it may not be possible to adjust the DT then. So having a specific compatible and fallback compatible is I think the way to go. You can always match on the fallback and if the time comes, you can match on the specific one because it's there. In addition to that, such a DT would fully correctly describe the hardware, unlike one with only a fallback compatible.

Quoted 7 lines
Quoted 3 lines

Regarding validation, I don't see other systems using this approach (specific + fallback compatible) having a problem with validation. What is the trick there ?

The trick is, they actually use the specific version, not the generic. So it is validated, because if the specific version is wrong, the device generally does not work.

Many of them use the fallback version to avoid polluting the tables in the kernel with redundant compat strings. The specific string is only added into the driver if there is a HW difference which needs to be dealt with.

Quoted 3 lines

We have no way to do that in this case. We load the driver based on the generic version. It then goes and looks at the ID registers, and from that decides what the device really is.

And this works fine, until marvell screws it up in one of those chips.

Quoted 3 lines

So far, Marvell have not messed this up. The ID registers have been correct. I trust the ID registers much more than anything in device tree. It is baked into silicon.

But the DT should correctly describe the hardware, if it doesn't, it's just broken.

Quoted 7 lines

But you are talking of a theoretical case where the ID register is wrong. For this to get passed us and out their in the wild, with DT blown in ROM, that probably means there are a batch with the correct ID and a batch with incorrect IDs. Those with incorrect IDs are failing. You are arguing that we should then enable the use of the specific compatible. And i expect that breaks more devices than it fixes, because people have cut/pasted the wrong value.

I am arguing you should have both specific compatible which describes which exact chip is in that device AND a fallback compatible which the driver matches on.

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#10 lore raw
Quoted 2 lines

But the DT should correctly describe the hardware, if it doesn't, it's just broken.

It is more subtle than that. It can be broken, yet work, because it contains information which we don't use. I really expect there will be cut/paste errors, meaning the more specific compatible is sometimes wrong. But since at the moment we don't use it, such a broken DT blob will work. Until the day we need to make use of the more specific compatible because there really is broken silicon. At that point, we introduce a regression. All the devices with broke, yet up until now working DT blobs, stop working. Are you really going to argue they where always broken, so we don't care we introduced a regression?

Anyway, this is just rehasing an old discussion. Please go read the archive. See if you have anything new to add which was not discussed before.

Andrew

#11 lore raw
Quoted 7 lines · Andrew Lunn
Quoted 2 lines

But the DT should correctly describe the hardware, if it doesn't, it's just broken.

It is more subtle than that. It can be broken, yet work, because it contains information which we don't use. I really expect there will be cut/paste errors, meaning the more specific compatible is sometimes wrong.

If your DT is bogus, nothing can be done about that.

Quoted 6 lines

But since at the moment we don't use it, such a broken DT blob will work. Until the day we need to make use of the more specific compatible because there really is broken silicon. At that point, we introduce a regression. All the devices with broke, yet up until now working DT blobs, stop working. Are you really going to argue they where always broken, so we don't care we introduced a regression?

If the DT is broken, it's already a bug and we cannot do anything about that but maybe fix the DT somehow.

Quoted 3 lines

Anyway, this is just rehasing an old discussion. Please go read the archive. See if you have anything new to add which was not discussed before.

Hehe, I've seen those discussions before too.

Signature · 2 lines
Best regards,
Marek Vasut