Skip to contentSkip to conversation

i2c: Drop legacy muxing pseudo-drivers

PATCH Applied Jean Delvare 4 participants 13 messages Sep 28, 2023 – Oct 16, 2024

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

PATCH v2 1/1 i2c: Drop legacy muxing pseudo-drivers

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

---
Changes since v1:
* Added Nick's ack.
* Rebased on top of v6.6-rc3.

 MAINTAINERS                            |    2 
 drivers/i2c/busses/Kconfig             |   26 ---
 drivers/i2c/busses/Makefile            |    2 
 drivers/i2c/busses/i2c-amd756-s4882.c  |  245 ---------------------------------
 drivers/i2c/busses/i2c-amd756.c        |    4 
 drivers/i2c/busses/i2c-nforce2-s4985.c |  240 --------------------------------
 drivers/i2c/busses/i2c-nforce2.c       |   16 --
 7 files changed, 1 insertion(+), 534 deletions(-)
MAINTAINERS +0 -2
@@ -9871,12 +9871,10 @@ F:	Documentation/i2c/busses/i2c-viapro.r
 F:	drivers/i2c/busses/i2c-ali1535.c
 F:	drivers/i2c/busses/i2c-ali1563.c
 F:	drivers/i2c/busses/i2c-ali15x3.c
-F:	drivers/i2c/busses/i2c-amd756-s4882.c
 F:	drivers/i2c/busses/i2c-amd756.c
 F:	drivers/i2c/busses/i2c-amd8111.c
 F:	drivers/i2c/busses/i2c-i801.c
 F:	drivers/i2c/busses/i2c-isch.c
-F:	drivers/i2c/busses/i2c-nforce2-s4985.c
 F:	drivers/i2c/busses/i2c-nforce2.c
 F:	drivers/i2c/busses/i2c-piix4.c
 F:	drivers/i2c/busses/i2c-sis5595.c
drivers/i2c/busses/Kconfig +0 -26
@@ -62,19 +62,6 @@ config I2C_AMD756
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-amd756.
 
-config I2C_AMD756_S4882
-	tristate "SMBus multiplexing on the Tyan S4882"
-	depends on I2C_AMD756 && X86
-	help
-	  Enabling this option will add specific SMBus support for the Tyan
-	  S4882 motherboard.  On this 4-CPU board, the SMBus is multiplexed
-	  over 8 different channels, where the various memory module EEPROMs
-	  and temperature sensors live.  Saying yes here will give you access
-	  to these in addition to the trunk.
-
-	  This driver can also be built as a module.  If so, the module
-	  will be called i2c-amd756-s4882.
-
 config I2C_AMD8111
 	tristate "AMD 8111"
 	depends on PCI
@@ -239,19 +226,6 @@ config I2C_NFORCE2
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-nforce2.
 
-config I2C_NFORCE2_S4985
-	tristate "SMBus multiplexing on the Tyan S4985"
-	depends on I2C_NFORCE2 && X86
-	help
-	  Enabling this option will add specific SMBus support for the Tyan
-	  S4985 motherboard.  On this 4-CPU board, the SMBus is multiplexed
-	  over 4 different channels, where the various memory module EEPROMs
-	  live.  Saying yes here will give you access to these in addition
-	  to the trunk.
-
-	  This driver can also be built as a module.  If so, the module
-	  will be called i2c-nforce2-s4985.
-
 config I2C_NVIDIA_GPU
 	tristate "NVIDIA GPU I2C controller"
 	depends on PCI
drivers/i2c/busses/Makefile +0 -2
@@ -14,14 +14,12 @@ obj-$(CONFIG_I2C_ALI1535)	+= i2c-ali1535
 obj-$(CONFIG_I2C_ALI1563)	+= i2c-ali1563.o
 obj-$(CONFIG_I2C_ALI15X3)	+= i2c-ali15x3.o
 obj-$(CONFIG_I2C_AMD756)	+= i2c-amd756.o
-obj-$(CONFIG_I2C_AMD756_S4882)	+= i2c-amd756-s4882.o
 obj-$(CONFIG_I2C_AMD8111)	+= i2c-amd8111.o
 obj-$(CONFIG_I2C_CHT_WC)	+= i2c-cht-wc.o
 obj-$(CONFIG_I2C_I801)		+= i2c-i801.o
 obj-$(CONFIG_I2C_ISCH)		+= i2c-isch.o
 obj-$(CONFIG_I2C_ISMT)		+= i2c-ismt.o
 obj-$(CONFIG_I2C_NFORCE2)	+= i2c-nforce2.o
-obj-$(CONFIG_I2C_NFORCE2_S4985)	+= i2c-nforce2-s4985.o
 obj-$(CONFIG_I2C_NVIDIA_GPU)	+= i2c-nvidia-gpu.o
 obj-$(CONFIG_I2C_PIIX4)		+= i2c-piix4.o
 obj-$(CONFIG_I2C_SIS5595)	+= i2c-sis5595.o
drivers/i2c/busses/i2c-amd756-s4882.c deleted +0 -245

245 lines not on this page · raw message

drivers/i2c/busses/i2c-amd756.c +1 -3
@@ -283,7 +283,7 @@ static const struct i2c_algorithm smbus_
 	.functionality	= amd756_func,
 };
 
-struct i2c_adapter amd756_smbus = {
+static struct i2c_adapter amd756_smbus = {
 	.owner		= THIS_MODULE,
 	.class          = I2C_CLASS_HWMON | I2C_CLASS_SPD,
 	.algo		= &smbus_algorithm,
@@ -398,5 +398,3 @@ module_pci_driver(amd756_driver);
 MODULE_AUTHOR("Merlin Hughes <[email protected]>");
 MODULE_DESCRIPTION("AMD756/766/768/8111 and nVidia nForce SMBus driver");
 MODULE_LICENSE("GPL");
-
-EXPORT_SYMBOL(amd756_smbus);
drivers/i2c/busses/i2c-nforce2-s4985.c deleted +0 -240

240 lines not on this page · raw message

drivers/i2c/busses/i2c-nforce2.c +0 -16
@@ -117,20 +117,6 @@ static const struct dmi_system_id nforce
 
 static struct pci_driver nforce2_driver;
 
-/* For multiplexing support, we need a global reference to the 1st
-   SMBus channel */
-#if IS_ENABLED(CONFIG_I2C_NFORCE2_S4985)
-struct i2c_adapter *nforce2_smbus;
-EXPORT_SYMBOL_GPL(nforce2_smbus);
-
-static void nforce2_set_reference(struct i2c_adapter *adap)
-{
-	nforce2_smbus = adap;
-}
-#else
-static inline void nforce2_set_reference(struct i2c_adapter *adap) { }
-#endif
-
 static void nforce2_abort(struct i2c_adapter *adap)
 {
 	struct nforce2_smbus *smbus = adap->algo_data;
@@ -411,7 +397,6 @@ static int nforce2_probe(struct pci_dev
 		return -ENODEV;
 	}
 
-	nforce2_set_reference(&smbuses[0].adapter);
 	return 0;
 }
 
@@ -420,7 +405,6 @@ static void nforce2_remove(struct pci_de
 {
 	struct nforce2_smbus *smbuses = pci_get_drvdata(dev);
 
-	nforce2_set_reference(NULL);
 	if (smbuses[0].base) {
 		i2c_del_adapter(&smbuses[0].adapter);
 		release_region(smbuses[0].base, smbuses[0].size);
Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer
#1 lore raw

Hi Jean,

Quoted 10 lines · Jean Delvare

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

Quoted 7 lines

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

I think I commented here that I had double thoughts on this. I said that on one hand I like the cleanup, but on the other what's wrong keeping them here?

Maybe someone is still using these devices.

BTW, do you really have them?

Andi

#2 lore raw
Quoted 2 lines

I think I commented here that I had double thoughts on this. I

Didn't you get Jean's and my reply?

#3 lore raw
Quoted 4 lines · Wolfram Sang
Quoted 2 lines

I think I commented here that I had double thoughts on this. I

Didn't you get Jean's and my reply?

I have been notified that this message could be seen as impolite. It was *totally* not meant this way. I was really wondering if the mails didn't get through. Such things happen, so I wanted to rule them out. It maybe was too brief. I really appreciate Andi's effort in the I2C subsystem and have zero bad feelings or whatsoever. So, if it sounded otherwise, I am sorry. I try to add a few more words in the future.

maintainer
#4 lore raw

Hi Wolfram,

Quoted 4 lines · Wolfram Sang
Quoted 3 lines · Wolfram Sang
Quoted 2 lines

I think I commented here that I had double thoughts on this. I

Quoted 8 lines
Quoted 1 line

Didn't you get Jean's and my reply?

I have been notified that this message could be seen as impolite. It was *totally* not meant this way. I was really wondering if the mails didn't get through. Such things happen, so I wanted to rule them out. It maybe was too brief. I really appreciate Andi's effort in the I2C subsystem and have zero bad feelings or whatsoever. So, if it sounded otherwise, I am sorry. I try to add a few more words in the future.

Thanks for the clarification and thanks for the kind words.

I didn't actually read it as unpolite.

I haven't received your replies and Jean's either, indeed I was surprised to see this patch again. Maybe my notmuch filters need to be a bit refined.

Anyway I will go hunt for them :)

Thanks again,
Andi

#5 lore raw
Quoted 6 lines · Andi Shyti

Hi Wolfram,

I haven't received your replies and Jean's either, indeed I was surprised to see this patch again. Maybe my notmuch filters need to be a bit refined.

https://lore.kernel.org/linux-i2c/[email protected]/
for the lore thread, FWIW. I too fight with my inbox filters.

Signature · 2 lines
Thanks,
~Nick Desaulniers
#6 lore raw
In reply to Andi Shyti
Quoted 18 lines · Andi Shyti

Hi Jean,

Quoted 14 lines · Jean Delvare

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

Quoted 5 lines
Quoted 3 lines

I think I commented here that I had double thoughts on this. I

Please consider using an explicit NACK if you feel strongly. My reading of your comment was that you did not feel strongly.

Quoted 2 lines

said that on one hand I like the cleanup, but on the other what's wrong keeping them here?

We can always resurrect the driver if someone complains, which I believe there's prior art for. Nothing is ever truly dead with git. "That is not dead which can eternal lie, and with strange aeons even death may die" or something.

Quoted 4 lines

Maybe someone is still using these devices.

BTW, do you really have them?

I think Wolfram wrote the drivers. If he's the sole author and stuck with maintaining these, I can totally see a maintainer saying "it's time to put this old dog down."

Signature · 2 lines
Thanks,
~Nick Desaulniers
#7 lore raw
Quoted 2 lines

We can always resurrect the driver if someone complains, which I

Or write a new and better one as Jean offered.

Quoted 3 lines

I think Wolfram wrote the drivers. If he's the sole author and stuck with maintaining these, I can totally see a maintainer saying "it's time to put this old dog down."

It is Jean who wrote the drivers. But your reasoning still holds true for me.

#8 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 4 lines

I think Wolfram wrote the drivers. If he's the sole author and stuck with maintaining these, I can totally see a maintainer saying "it's time to put this old dog down."

It is Jean who wrote the drivers. But your reasoning still holds true for me.

Oops! Yes sorry for mixing you two up; I should have commented back when I checked the git log and noticed that so it would have been fresh in my mind (or just run git log again now).

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer
#9 lore raw
In reply to Nick Desaulniers

Hi Nick,

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I think I commented here that I had double thoughts on this. I

Please consider using an explicit NACK if you feel strongly. My reading of your comment was that you did not feel strongly.

I'm not strong...

Quoted 9 lines
Quoted 2 lines

said that on one hand I like the cleanup, but on the other what's wrong keeping them here?

We can always resurrect the driver if someone complains, which I believe there's prior art for. Nothing is ever truly dead with git. "That is not dead which can eternal lie, and with strange aeons even death may die" or something.

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

Maybe someone is still using these devices.

BTW, do you really have them?

I think Wolfram wrote the drivers. If he's the sole author and stuck with maintaining these, I can totally see a maintainer saying "it's time to put this old dog down."

... for this reason. The maintainer/author of the driver might feel this being a bit of a heavy burden to carry around.

I personally prefer the drivers to stay, but I'm not going to nack this patch and I'm not going to ack it either. In any case I'm not blocking it.

Thanks,
Andi

Applied
#10 lore raw
In reply to Jean Delvare
Quoted 10 lines · Jean Delvare

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

Quoted 7 lines

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

Applied to for-next, thanks!

#11 lore raw

Hi Wolfram,

Quoted 15 lines · Wolfram Sang
Quoted 14 lines · Jean Delvare

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

Quoted 5 lines
Quoted 3 lines

Applied to for-next, thanks!

What happened to this patch? This was one year ago but I can't find it upstream. Should I resend it?

Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer
#12 lore raw

Hi Jean,

Quoted 16 lines · Jean Delvare
Quoted 15 lines · Wolfram Sang
Quoted 14 lines · Jean Delvare

The i2c-amd756-s4882 and i2c-nforce2-s4985 muxing pseudo-drivers were written at a time when the i2c core did not support muxing. They are essentially board-specific hacks. If we had to add support for these boards today, we would implement it in a completely different way.

These Tyan server boards are 18 years old by now, so I very much doubt any of these is still running today. So let's just drop this clumsy code. If anyone really still needs this support and complains, I'll rewrite it in a proper way on top of i2c-mux.

This also fixes the following warnings:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static? drivers/i2c/busses/i2c-nforce2.c:123:20: warning: symbol 'nforce2_smbus' was not declared. Should it be static?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Applied to for-next, thanks!

What happened to this patch? This was one year ago but I can't find it upstream. Should I resend it?

I tried to apply it but I get some conflicts. Can you please resend it and I will queue it up for the next merge request.

Thanks,
Andi