Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Jean Delvare
Hi all,

Thanks for the info. I thought UML was no longer used with all the
virtualization solutions available, but apparently I was wrong.

On Sun, 9 Sep 2012 12:49:03 +0200, Peter Hüwe wrote:
> > That's because they rely on the HAS_IOMEM dependency for the whole
> > subsystem. In fact, I'm surprised you didn't have to add HAS_IOMEM
> > dependencies to more drivers.
> I changed only the ones which are available in UML.
> I now rewrote the patch to remove the global dependency and move it to all 
> the 
> drivers that really rely on HAS_IOMEM - see below.

My bet is that all I2C bus drivers do use I/O or memory mapped
operations directly or indirectly, except i2c-stub. So it would
probably make more sense, and be a less intrusive change, to move the
HAS_IOMEM dependency to drivers/i2c/busses, and move (logically or for
real) i2c-stub out of it.

Or are there really other I2C bus drivers which make sense to enable
under UML?

Are there other subsystems where the HAS_IOMEM dependency is at the
individual driver level?

-- 
Jean Delvare

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Jean Delvare
On Sun, 09 Sep 2012 17:00:54 +0200, Richard Weinberger wrote:
> Geert Uytterhoeven  schrieb:
> >s390 has neither of HAS_IOMEM and GENERIC_IO, so it won't break their
> >build.
>
> That's why it may break. If you remove the depends on HAS_IOMEM, it will be 
> built on s390 and fail if that codes uses io memory functions. Depending on 
> GENERIC_IO fixes that.

Where "that" is a problem which may not exist in the first place.

-- 
Jean Delvare

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Jean Delvare
Hallo Petter,

On Sun, 9 Sep 2012 14:15:02 +0200, Peter Hüwe wrote:
> I created a patch for your proposed solution, I moved the stub driver to the 
> end in order to have only one big if HAS_IOMEM.

There is a problem with the mux chip drivers, which then no longer
depend on HAS_IOMEM. Also, I think it is about time to admit that
i2c-stub does not fit under "I2C Hardware Bus support". It is a driver
for development, not hardware support.

So I propose the following instead:

 drivers/i2c/Kconfig|   14 +-
 drivers/i2c/busses/Kconfig |   14 +-
 drivers/i2c/muxes/Kconfig  |2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

--- linux-3.6-rc4.orig/drivers/i2c/Kconfig  2012-07-21 22:58:29.0 
+0200
+++ linux-3.6-rc4/drivers/i2c/Kconfig   2012-09-09 18:34:08.169196654 +0200
@@ -4,7 +4,6 @@
 
 menuconfig I2C
tristate "I2C support"
-   depends on HAS_IOMEM
select RT_MUTEXES
---help---
  I2C (pronounce: I-squared-C) is a slow serial bus protocol used in
@@ -86,6 +85,19 @@ config I2C_SMBUS
 source drivers/i2c/algos/Kconfig
 source drivers/i2c/busses/Kconfig
 
+config I2C_STUB
+   tristate "I2C/SMBus Test Stub"
+   depends on EXPERIMENTAL && m
+   default 'n'
+   help
+ This module may be useful to developers of SMBus client drivers,
+ especially for certain kinds of sensor chips.
+
+ If you do build this module, be sure to read the notes and warnings
+ in .
+
+ If you don't know what to do here, definitely say N.
+
 config I2C_DEBUG_CORE
bool "I2C Core debugging messages"
help
--- linux-3.6-rc4.orig/drivers/i2c/busses/Kconfig   2012-09-08 
09:36:32.086553711 +0200
+++ linux-3.6-rc4/drivers/i2c/busses/Kconfig2012-09-09 18:33:58.598196535 
+0200
@@ -3,6 +3,7 @@
 #
 
 menu "I2C Hardware Bus support"
+   depends on HAS_IOMEM
 
 comment "PC SMBus host controller drivers"
depends on PCI
@@ -850,19 +851,6 @@ config I2C_SIBYTE
help
  Supports the SiByte SOC on-chip I2C interfaces (2 channels).
 
-config I2C_STUB
-   tristate "I2C/SMBus Test Stub"
-   depends on EXPERIMENTAL && m
-   default 'n'
-   help
- This module may be useful to developers of SMBus client drivers,
- especially for certain kinds of sensor chips.
-
- If you do build this module, be sure to read the notes and warnings
- in .
-
- If you don't know what to do here, definitely say N.
-
 config SCx200_I2C
tristate "NatSemi SCx200 I2C using GPIO pins (DEPRECATED)"
depends on SCx200_GPIO
--- linux-3.6-rc4.orig/drivers/i2c/muxes/Kconfig2012-07-21 
22:58:29.0 +0200
+++ linux-3.6-rc4/drivers/i2c/muxes/Kconfig 2012-09-09 19:20:13.032141164 
+0200
@@ -3,7 +3,7 @@
 #
 
 menu "Multiplexer I2C Chip support"
-       depends on I2C_MUX
+   depends on HAS_IOMEM && I2C_MUX
 
 config I2C_MUX_GPIO
tristate "GPIO-based I2C multiplexer"


-- 
Jean Delvare

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-10 Thread Jean Delvare
On Sun, 9 Sep 2012 21:17:20 +0200, Peter Hüwe wrote:
> Hi Jean,
> Am Sonntag, 9. September 2012, 20:40:36 schrieb Jean Delvare:
> > There is a problem with the mux chip drivers, which then no longer
> > depend on HAS_IOMEM.
> The selectables on my x86 and UML machine build fine ;)
> But you're correct, we should exclude/guard them.
> 
> > Also, I think it is about time to admit that
> > i2c-stub does not fit under "I2C Hardware Bus support". It is a driver
> > for development, not hardware support.
> > 
> > So I propose the following instead:
> > 
> >  drivers/i2c/Kconfig|   14 +-
> >  drivers/i2c/busses/Kconfig |   14 +-
> >  drivers/i2c/muxes/Kconfig  |2 +-
> >  3 files changed, 15 insertions(+), 15 deletions(-)
> 
> 
> I'm perfectly fine with this.
> 
> Signed-off-by: Peter Huewe 

I slept over it and my approach makes little sense for multiplexing.
i2c-mux is useless without at least one multiplexer driver, and
with my patch, the user can't select any without CONFIG_IOMEM.

So either i2c-mux should depend on CONFIG_IOMEM too (in which case we
no longer need this dependency in drivers/i2c/muxes/Kconfig, as we will
get it by transitivity) or we should let i2c multiplexer drivers be
built even without CONFIG_IOMEM. After all, if they can be selected,
they will build, as they are all accessing the hardware indirectly
(through gpio or i2c layers.)

At the moment, it makes no sense to enable multiplexing without
CONFIG_IOMEM, as the only driver which can instantiate a root I2C
segment is i2c-stub and that driver wouldn't know how to deal with
multiplexing. So option #1 has my favors for now. If anyone ever
implements multiplexing emulation in i2c-stub then we can revisit and
let i2c-mux + the driver for the emulated mux chip be built
under !CONFIG_IOMEM. OK?

I also noticed that I2C_DEBUG_BUS has no effect under !CONFIG_IOMEM
with my previous patch, so we can hide it.

Leads me to:

From: Peter Huewe 
Subject: i2c: Make I2C available on UML

Remove the global dependency of the I2C subsystem on HAS_IOMEM and
move the dependency to the i2c/busses submenu, with an exception for
i2c-stub.

The generic I2C part does not need to have HAS_IOMEM set and thus now
becomes available in UML, so the I2C subsystem can now be used, e.g.
by the i2c-stub driver, for development of I2C device drivers.

[JD: Some adjustments.]

Signed-off-by: Peter Huewe 
Signed-off-by: Jean Delvare 
---
 drivers/i2c/Kconfig|   16 +++-
 drivers/i2c/busses/Kconfig |   14 +-
 2 files changed, 16 insertions(+), 14 deletions(-)

--- linux-3.6-rc4.orig/drivers/i2c/Kconfig  2012-07-21 22:58:29.0 
+0200
+++ linux-3.6-rc4/drivers/i2c/Kconfig   2012-09-10 09:19:06.485756611 +0200
@@ -4,7 +4,6 @@
 
 menuconfig I2C
tristate "I2C support"
-   depends on HAS_IOMEM
select RT_MUTEXES
---help---
  I2C (pronounce: I-squared-C) is a slow serial bus protocol used in
@@ -49,6 +48,7 @@ config I2C_CHARDEV
 
 config I2C_MUX
tristate "I2C bus multiplexing support"
+   depends on HAS_IOMEM
help
  Say Y here if you want the I2C core to support the ability to
  handle multiplexed I2C bus topologies, by presenting each
@@ -86,6 +86,19 @@ config I2C_SMBUS
 source drivers/i2c/algos/Kconfig
 source drivers/i2c/busses/Kconfig
 
+config I2C_STUB
+   tristate "I2C/SMBus Test Stub"
+   depends on EXPERIMENTAL && m
+   default 'n'
+   help
+ This module may be useful to developers of SMBus client drivers,
+ especially for certain kinds of sensor chips.
+
+ If you do build this module, be sure to read the notes and warnings
+ in .
+
+ If you don't know what to do here, definitely say N.
+
 config I2C_DEBUG_CORE
bool "I2C Core debugging messages"
help
@@ -103,6 +116,7 @@ config I2C_DEBUG_ALGO
 
 config I2C_DEBUG_BUS
bool "I2C Bus debugging messages"
+   depends on HAS_IOMEM
help
  Say Y here if you want the I2C bus drivers to produce a bunch of
  debug messages to the system log.  Select this if you are having
--- linux-3.6-rc4.orig/drivers/i2c/busses/Kconfig   2012-09-08 
09:36:32.0 +0200
+++ linux-3.6-rc4/drivers/i2c/busses/Kconfig2012-09-09 18:33:58.598196535 
+0200
@@ -3,6 +3,7 @@
 #
 
 menu "I2C Hardware Bus support"
+   depends on HAS_IOMEM
 
 comment "PC SMBus host controller drivers"
depends on PCI
@@ -850,19 +851,6 @@ config I2C_SIBYTE
help
  Supports the SiByte SOC on-chip I2C interfaces (2 channels).
 
-config I2C_STUB
-   tristate "I2C/SMBus Test Stub"
-   depends on EXPERIMENTAL && m
-   default 'n'
-   

Re: [uml-devel] [PATCH -next] [media] altera-stapl should depend on HAS_IOPORT

2012-09-16 Thread Jean Delvare
On Sun, 16 Sep 2012 11:21:23 +0200, Geert Uytterhoeven wrote:
> On s390:
> 
> drivers/misc/altera-stapl/altera-lpt.c: In function 'byteblaster_write':
> drivers/misc/altera-stapl/altera-lpt.c:34:2: error: implicit declaration of 
> function 'outb' [-Werror=implicit-function-declaration]
> drivers/misc/altera-stapl/altera-lpt.c: In function 'byteblaster_read':
> drivers/misc/altera-stapl/altera-lpt.c:40:2: error: implicit declaration of 
> function 'inb' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make[6]: *** [drivers/misc/altera-stapl/altera-lpt.o] Error 1
> 
> Before commit 3969d54acd70be70e1b2a72184cba5415bf326c2 ("i2c: Make I2C
> available on UML"), this was hidden because I2C depended on HAS_IOMEM, which
> is a superset of HAS_IOPORT.
> 
> Signed-off-by: Geert Uytterhoeven 

Good catch.

Acked-by: Jean Delvare 

> --
> http://kisskb.ellerman.id.au/kisskb/buildresult/7194502/
> http://kisskb.ellerman.id.au/kisskb/buildresult/7194476/
> ---
>  drivers/misc/altera-stapl/Kconfig |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/misc/altera-stapl/Kconfig 
> b/drivers/misc/altera-stapl/Kconfig
> index 7f01d8e..c7e4c77 100644
> --- a/drivers/misc/altera-stapl/Kconfig
> +++ b/drivers/misc/altera-stapl/Kconfig
> @@ -2,7 +2,7 @@ comment "Altera FPGA firmware download module"
>  
>  config ALTERA_STAPL
>   tristate "Altera FPGA firmware download module"
> - depends on I2C
> + depends on I2C && HAS_IOPORT
>   default n
>   help
> An Altera FPGA module. Say Y when you want to support this tool.


-- 
Jean Delvare

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel