Skip to contentSkip to conversation

[0904_14] Siano: assemble all components to one kernel module

PATCH Uri Shkolnik 2 participants 2 messages Apr 27, 2009 – Apr 28, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw
Quoted 90 lines · Mauro Carvalho Chehab

From: Mauro Carvalho Chehab <[email protected]>
Subject: Re: [PATCH] [0904_14] Siano: assemble all components to one kernel module
To: "Trent Piepho" <[email protected]>
Cc: "Uri Shkolnik" <[email protected]>, [email protected]
Date: Tuesday, April 21, 2009, 9:10 PM
On Tue, 21 Apr 2009 10:54:40 -0700
(PDT)
Trent Piepho <[email protected]>

Quoted 2 lines · wrote:
Quoted 1 line · Uri Shkolnik

--- On Tue, 4/21/09, Trent Piepho <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines

From: Trent Piepho <[email protected]>
Subject: Re: [PATCH] [0904_14] Siano:

assemble all components to one kernel module

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

To: "Uri Shkolnik" <[email protected]>
Cc: "Mauro Carvalho Chehab" <[email protected]>,

"LinuxML" <[email protected]>

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Date: Tuesday, April 21, 2009, 6:17 AM

Quoted 2 lines · Uri Shkolnik

"better to have the BUS configurable,

e. g. just

Quoted 1 line
Quoted 1 line
Quoted 1 line

because you have USB interface, it doesn't

mean that you

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

want siano for USB, instead of using SDIO."

Quoted 2 lines

Since the module is using dynamic

registration, I

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

don't find it a problem.

Quoted 1 line

When the system has both USB and SDIO

buses, both USB

Quoted 1 line
Quoted 1 line
Quoted 1 line

and SDIO interface driver will be compiled

and linked to the

Quoted 1 line
Quoted 1 line
Quoted 1 line

module. When a Siano based device (or

multiple Siano

Quoted 1 line
Quoted 1 line
Quoted 1 line

devices) will be connected, they will be

register internally

Quoted 1 line
Quoted 1 line
Quoted 1 line

in the core and activated. Any combination

is allow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

(multiple SDIO, multiple USB and any mix).

This is not the way linux drivers normally

work.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Usually there are
multiple modules so that only the ones that

need to be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

loaded are loaded.
It sounds like you are designing this to be

custom compiled

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

for each
system, but that's not usually they way

things work.

Quoted 5 lines
Quoted 5 lines

I think I didn't express myself clearly.

Lets say that someone build a kernel X.
This kernel has (from all buses) only USB. The

Siano module will build with USB interface driver at this system.

Quoted 2 lines
Quoted 2 lines

If the system includes SDIO and OMAP SPI/SPP, the

module build will discard the USB interface driver, but the SDIO and the OMAP SPI will be built.

The patch you've provided just merge everything. If you're proposing a newer
model, you should send a patchset with the complete Kbuild refactor. For now,
it is better to postpone this patch until we merge non-kbuild changes.

Quoted 1 line

Can you name another driver that works this way?

It is considered better

Quoted 1 line

to build a new module for a different interface.

That way one can decide

Quoted 1 line

at run time if the interface is needed or not and only

load the module if

Quoted 1 line

needed.  If everything is built into one module

then one must decide at

Quoted 1 line

compile time what interfaces to support.  But it

is often the case that

Quoted 1 line

kernels are compiled on different systems than run

them.

This model also sounds different to me from what I've seen so far.

Quoted 8 lines

Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi,

Lets review some other DVB enabled modules

1) PLUTO Kconfig

config DVB_PLUTO2
tristate "Pluto2 cards"
depends on DVB_CORE && PCI && I2C
select I2C_ALGOBIT
select DVB_TDA1004X
help
Support for PCI cards based on the Pluto2 FPGA like the Satelco Easywatch Mobile Terrestrial DVB-T Receiver.

Since these cards have no MPEG decoder onboard, they transmit only compressed MPEG data over the PCI bus, so you need an external software decoder to watch TV on your computer.

Say Y or M if you own such a device and want to use it.

As we can see, it depends on PCI and I2C (and DVB_CORE, but that is outside the current discussion), which means, that if the target system lacks either PCI or I2C (and many Linux target do not have those) the entire Pluto module will not be built, even if selected.

DM1105 - similar case.

TTUSB_BUDGET -

config DVB_TTUSB_BUDGET
tristate "Technotrend/Hauppauge Nova-USB devices" depends on DVB_CORE && USB && I2C && PCI
select DVB_CX22700 if !DVB_FE_CUSTOMISE
select DVB_TDA1004X if !DVB_FE_CUSTOMISE
select DVB_VES1820 if !DVB_FE_CUSTOMISE
select DVB_TDA8083 if !DVB_FE_CUSTOMISE
select DVB_STV0299 if !DVB_FE_CUSTOMISE
select DVB_STV0297 if !DVB_FE_CUSTOMISE
select DVB_LNBP21 if !DVB_FE_CUSTOMISE
help
Support for external USB adapters designed by Technotrend and produced by Hauppauge, shipped under the brand name 'Nova-USB'.

These devices don't have a MPEG decoder built in, so you need an external software decoder to watch TV.

Say Y if you own such a device and want to use it.

This module while not be build (even if chosen) on target system that lacks USB stack (additional to PCI and I2C).

There are many many other examples.

First, SMS (Siano based device) requires at least one available bus (either USB, SDIO, SPI/SPP, HIF/Parallel, TS_I2C, ....), not a combination like the TTUSB. (Note, if multiple buses available, the module can use them simultaneously, for example - two different instances (SDIO and USB) dongles may co-exist on the same system).

There is no reason to prevent some systems which have only SDIO interface to work if there is no USB and vice versa.

Only if there are no supported (by SMS) buses at all, the drive will not be built.

Second, in order to reduce module size, there is no need to compile and link to the binary module a bus interface component that will never be used, more than that, if there are no suitable (external) headers, the build process will fail. So, the Kconfig and Makefile need to ensure that the module will be built and function OK on target systems which have full set AND subset of the total supported buses (by SMS).

Uri

#1 lore raw
Quoted 29 lines · Uri Shkolnik
Quoted 18 lines · Mauro Carvalho Chehab
Quoted 1 line
Quoted 1 line

If the system includes SDIO and OMAP SPI/SPP, the

module build will discard the USB interface driver, but the SDIO and the OMAP SPI will be built.

The patch you've provided just merge everything. If you're proposing a newer
model, you should send a patchset with the complete Kbuild refactor. For now,
it is better to postpone this patch until we merge non-kbuild changes.

Quoted 1 line

Can you name another driver that works this way?�

It is considered better

Quoted 1 line

to build a new module for a different interface.�

That way one can decide

Quoted 1 line

at run time if the interface is needed or not and only

load the module if

Quoted 1 line

needed.� If everything is built into one module

Quoted 9 lines

then one must decide at

Quoted 1 line

compile time what interfaces to support.� But it

is often the case that

Quoted 1 line

kernels are compiled on different systems than run

them.

This model also sounds different to me from what I've seen so far.

Quoted 6 lines

1) PLUTO Kconfig

config DVB_PLUTO2

	tristate "Pluto2 cards"
	depends on DVB_CORE && PCI && I2C

As we can see, it depends on PCI and I2C (and DVB_CORE, but that is outside the current discussion), which means, that if the target system lacks either PCI or I2C (and many Linux target do not have those) the entire Pluto module will not be built, even if selected.

I do not think you understand. This driver is for a device that is access via a PCI bus. It creates an i2c adapter that is used to control the tuner chip on the device. The device is not accessed via i2c. What's more, and this is a key point you are missing, it can not be accessed by PCI *or* I2C. This is the same with all the other drivers you may have found that use both PCI and I2C. It's a totally different situation.

Look at the how the B2C2 flexcop driver works. This hardware is availble in both PCI and USB versions.

Quoted 6 lines

config DVB_TTUSB_BUDGET
tristate "Technotrend/Hauppauge Nova-USB devices" depends on DVB_CORE && USB && I2C && PCI
Support for external USB adapters designed by Technotrend and

This module while not be build (even if chosen) on target system that lacks USB stack (additional to PCI and I2C).

This looks like a mistake. The driver is for a USB device and should not depend on PCI, but the driver uses the pci dma api.

Quoted 8 lines

First, SMS (Siano based device) requires at least one available bus (either USB, SDIO, SPI/SPP, HIF/Parallel, TS_I2C, ....), not a combination like the TTUSB. (Note, if multiple buses available, the module can use them simultaneously, for example - two different instances (SDIO and USB) dongles may co-exist on the same system).

There is no reason to prevent some systems which have only SDIO interface to work if there is no USB and vice versa.

Only if there are no supported (by SMS) buses at all, the drive will not be built.

Second, in order to reduce module size, there is no need to compile and link to the binary module a bus interface component that will never be used, more than that, if there are no suitable (external) headers, the build process will fail. So, the Kconfig and Makefile need to ensure that the module will be built and function OK on target systems which have full set AND subset of the total supported buses (by SMS).

The point you are missing is that by compiling all support into one module you are forcing the supported busses to be chosen at compile time. If they were separate modules then the supported busses could be loaded at run time.