* [PATCH] i2c: piix4: Fix request_region size
@ 2017-01-27 14:59 Ricardo Ribalda Delgado
2017-01-28 8:36 ` Jean Delvare
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ricardo Ribalda Delgado @ 2017-01-27 14:59 UTC (permalink / raw)
To: Andy Shevchenko, Wolfram Sang, Jean Delvare, linux-i2c, linux-kernel
Cc: Ricardo Ribalda Delgado
Since '701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")' we
are using the SMBSLVCNT register at offset 0x8. We need to request it.
Fixes: 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
Please note, not tested on hardware.
drivers/i2c/busses/i2c-piix4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index e34d82e79b98..73cc6799cc59 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-27 14:59 [PATCH] i2c: piix4: Fix request_region size Ricardo Ribalda Delgado
@ 2017-01-28 8:36 ` Jean Delvare
2017-01-28 11:00 ` Wolfram Sang
2017-01-31 13:42 ` Jean Delvare
2017-02-09 16:14 ` Wolfram Sang
2 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2017-01-28 8:36 UTC (permalink / raw)
To: Ricardo Ribalda Delgado, Andy Shevchenko, Wolfram Sang,
linux-i2c, linux-kernel
Hi Ricardo,
On ven., 2017-01-27 at 15:59 +0100, Ricardo Ribalda Delgado wrote:
> Since '701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")'
> we
> are using the SMBSLVCNT register at offset 0x8. We need to request
> it.
>
> Fixes: 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
> Please note, not tested on hardware.
> drivers/i2c/busses/i2c-piix4.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-
> piix4.c
> index e34d82e79b98..73cc6799cc59 100644
> --- a/drivers/i2c/busses/i2c-piix4.c
> +++ b/drivers/i2c/busses/i2c-piix4.c
> @@ -58,7 +58,7 @@
> #define SMBSLVDAT (0xC + piix4_smba)
>
> /* count for request_region */
> -#define SMBIOSIZE 8
> +#define SMBIOSIZE 9
>
Are you certain that all supported devices have this extra register?
>
> /* PCI Address Constants */
> #define SMBBA 0x090
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-28 8:36 ` Jean Delvare
@ 2017-01-28 11:00 ` Wolfram Sang
2017-01-28 11:13 ` Jean Delvare
0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2017-01-28 11:00 UTC (permalink / raw)
To: Jean Delvare
Cc: Ricardo Ribalda Delgado, Andy Shevchenko, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
> > /* count for request_region */
> > -#define SMBIOSIZE 8
> > +#define SMBIOSIZE 9
> >
>
> Are 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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-28 11:00 ` Wolfram Sang
@ 2017-01-28 11:13 ` Jean Delvare
2017-01-30 1:11 ` Ricardo Ribalda Delgado
0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2017-01-28 11:13 UTC (permalink / raw)
To: Wolfram Sang
Cc: Ricardo Ribalda Delgado, Andy Shevchenko, linux-i2c, linux-kernel
Hi Wolfram,
On Sat, 28 Jan 2017 12:00:21 +0100, Wolfram Sang wrote:
>
> > > /* count for request_region */
> > > -#define SMBIOSIZE 8
> > > +#define SMBIOSIZE 9
> >
> > Are 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.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-28 11:13 ` Jean Delvare
@ 2017-01-30 1:11 ` Ricardo Ribalda Delgado
0 siblings, 0 replies; 7+ messages in thread
From: Ricardo Ribalda Delgado @ 2017-01-30 1:11 UTC (permalink / raw)
To: Jean Delvare; +Cc: Wolfram Sang, Andy Shevchenko, linux-i2c, LKML
Hi Jean and Wolfram
On Sat, Jan 28, 2017 at 12:13 PM, Jean Delvare <jdelvare@suse.de> wrote:
> Hi Wolfram,
>
> On Sat, 28 Jan 2017 12:00:21 +0100, Wolfram Sang wrote:
>>
>> > > /* count for request_region */
>> > > -#define SMBIOSIZE 8
>> > > +#define SMBIOSIZE 9
>> >
>> > Are 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 :).
>
> 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!
>
> --
> Jean Delvare
> SUSE L3 Support
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-27 14:59 [PATCH] i2c: piix4: Fix request_region size Ricardo Ribalda Delgado
2017-01-28 8:36 ` Jean Delvare
@ 2017-01-31 13:42 ` Jean Delvare
2017-02-09 16:14 ` Wolfram Sang
2 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2017-01-31 13:42 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Andy Shevchenko, Wolfram Sang, linux-i2c, linux-kernel
Hi Ricardo, Wolfram,
On Fri, 27 Jan 2017 15:59:30 +0100, Ricardo Ribalda Delgado wrote:
> Since '701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")' we
> are using the SMBSLVCNT register at offset 0x8. We need to request it.
>
> Fixes: 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
> Please note, not tested on hardware.
> drivers/i2c/busses/i2c-piix4.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
> index e34d82e79b98..73cc6799cc59 100644
> --- a/drivers/i2c/busses/i2c-piix4.c
> +++ b/drivers/i2c/busses/i2c-piix4.c
> @@ -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.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: piix4: Fix request_region size
2017-01-27 14:59 [PATCH] i2c: piix4: Fix request_region size Ricardo Ribalda Delgado
2017-01-28 8:36 ` Jean Delvare
2017-01-31 13:42 ` Jean Delvare
@ 2017-02-09 16:14 ` Wolfram Sang
2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2017-02-09 16:14 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Andy Shevchenko, Jean Delvare, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
On Fri, Jan 27, 2017 at 03:59:30PM +0100, Ricardo Ribalda Delgado wrote:
> Since '701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")' we
> are using the SMBSLVCNT register at offset 0x8. We need to request it.
>
> Fixes: 701dc207bf55 ("i2c: piix4: Avoid race conditions with IMC")
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-02-09 16:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 14:59 [PATCH] i2c: piix4: Fix request_region size Ricardo Ribalda Delgado
2017-01-28 8:36 ` Jean Delvare
2017-01-28 11:00 ` Wolfram Sang
2017-01-28 11:13 ` Jean Delvare
2017-01-30 1:11 ` Ricardo Ribalda Delgado
2017-01-31 13:42 ` Jean Delvare
2017-02-09 16:14 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).