i2c: piix4: Fix request_region size
PATCH 1/1 i2c: piix4: Fix request_region size
Since '701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")' we are using the SMBSLVCNT register at offset 0x8. We need to request it.
---
Please note, not tested on hardware.
drivers/i2c/busses/i2c-piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-piix4.c +1 -1
@@ -58,7 +58,7 @@#define SMBSLVDAT (0xC + piix4_smba)/* count for request_region */ -#define SMBIOSIZE 8 +#define SMBIOSIZE 9/* PCI Address Constants */ #define SMBBA 0x090
Signature · 1 line
2.11.0
Hi Ricardo,
Quoted 22 lines · Ricardo Ribalda Delgado
Since '
701dc207bf55("i2c: piix4: Avoid race conditions with IMC")' we
are using the SMBSLVCNT register at offset0x8. We need to request it.Fixes 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")Signed-off-by Ricardo Ribalda Delgado <[email protected]>---
Please note, not tested on hardware.
drivers/i2c/busses/i2c-piix4.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c- renamed from drivers/i2c/busses/i2c-piix4.c +0
-0
piix4.c
indexe34d82e79b98..73cc6799cc59100644drivers/i2c/busses/i2c-piix4.c +0
-0@@ -58,7 +58,7 @@ #define SMBSLVDAT (0xC + piix4_smba)
/* count forrequest_region*/
drivers/i2c/busses/i2c-piix4.c line 61
Quoted 2 lines
drivers/i2c/busses/i2c-piix4.c +1
-1-#define SMBIOSIZE 8 +#define SMBIOSIZE 9
Are you certain that all supported devices have this extra register?
Quoted 3 lines
/* PCI Address Constants */
#define SMBBA0x090
--
Jean Delvare
SUSE L3 Support
Quoted 7 lines
drivers/i2c/busses/i2c-piix4.c line 61
Quoted 5 lines
/* count for
request_region*/drivers/i2c/busses/i2c-piix4.c +1
-1-#define SMBIOSIZE 8 +#define SMBIOSIZE 9Are you certain that all supported devices have this extra register?
Isn't it better to have a potentially unused register mapped than a potentially used register unmapped?
Hi Wolfram,
Quoted 9 lines · Wolfram Sang
Quoted 6 lines
drivers/i2c/busses/i2c-piix4.c line 61
Quoted 4 lines
/* count for
request_region*/drivers/i2c/busses/i2c-piix4.c +1
-1-#define SMBIOSIZE 8 +#define SMBIOSIZE 9Are you certain that all supported devices have this extra register?
Isn't it better to have a potentially unused register mapped than a potentially used register unmapped?
My concern is that the region request could fail due to a conflict with another device, if the physical I/O region is only 8 and we try to request 9.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Hi Jean and Wolfram
Quoted 12 lines · Jean Delvare
Hi Wolfram,
Quoted 9 lines · Wolfram Sang
Quoted 6 lines
drivers/i2c/busses/i2c-piix4.c line 61
Quoted 4 lines
/* count for
request_region*/drivers/i2c/busses/i2c-piix4.c +1
-1-#define SMBIOSIZE 8 +#define SMBIOSIZE 9Are you certain that all supported devices have this extra register?
Isn't it better to have a potentially unused register mapped than a potentially used register unmapped
We have been "lucky" that it is a ioport and not a mmap region, otherwise we would have seen a nice oops :).
Quoted 4 lines
My concern is that the region request could fail due to a conflict with another device, if the physical I/O region is only 8 and we try to request 9.
I do not think that this is the case, if you check the top of the file you can see how there are many other definitions for registers. I expect that SMBIOSIZE=8 is just the original author being conservative.
Of course I cannot say that there is one platform where one extra ioport can cause a conflict, but I believe that we must request all the ports that we will use.
Regards!
Quoted 4 lines
--
Jean Delvare
SUSE L3 Support
Signature · 1 line
Ricardo Ribalda
Hi Ricardo, Wolfram,
Quoted 15 lines · Ricardo Ribalda Delgado
Since '
701dc207bf55("i2c: piix4: Avoid race conditions with IMC")' we are using the SMBSLVCNT register at offset0x8. We need to request it.Fixes 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")Signed-off-by Ricardo Ribalda Delgado <[email protected]>---
Please note, not tested on hardware.drivers/i2c/busses/i2c-piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-piix4.c +0
-0
drivers/i2c/busses/i2c-piix4.c line 64
Quoted 8 lines
drivers/i2c/busses/i2c-piix4.c +1
-1@@ -58,7 +58,7 @@#define SMBSLVDAT (0xC + piix4_smba)/* count for request_region */ -#define SMBIOSIZE 8 +#define SMBIOSIZE 9/* PCI Address Constants */ #define SMBBA 0x090
I checked all the datasheets I have access to, and it should be good.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Wolfram Sang
AppliedQuoted 5 lines · Ricardo Ribalda Delgado
Since '
701dc207bf55("i2c: piix4: Avoid race conditions with IMC")' we are using the SMBSLVCNT register at offset0x8. We need to request it.Fixes 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")Signed-off-by Ricardo Ribalda Delgado <[email protected]>
Applied to for-current, thanks!