* Re: [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support
@ 2007-01-08 1:33 Jeff Garzik
2007-01-08 10:28 ` Alan
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2007-01-08 1:33 UTC (permalink / raw)
To: Uwe Koziolek; +Cc: Alan, linux.ide, Sven Ladegast
Uwe Koziolek wrote:
> This patch includes the PATA support for SiS180 importing PATA functionality from pata_sis.c
>
> Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>
>
> --- a/drivers/ata/sata_sis.c 2007-01-07 20:54:38.000000000 +0100
> +++ b/drivers/ata/sata_sis.c 2007-01-07 23:42:29.000000000 +0100
> @@ -138,6 +138,10 @@
> .port_ops = &sis_ops,
> };
>
> +#ifdef CONFIG_PATA_SIS
> +extern struct ata_port_info sis_info133;
> +#endif
This is a poor way to share code between modules. It fails when
pata_sis is a module, and it forces another driver to be loaded, simply
then to be used as a code library.
If the shared code is tiny, just create a header file and #include it
(sata_promise and sata_sx4 do this). Otherwise, create a shared library
module.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support
2007-01-08 1:33 [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support Jeff Garzik
@ 2007-01-08 10:28 ` Alan
2007-01-08 11:44 ` Jeff Garzik
0 siblings, 1 reply; 6+ messages in thread
From: Alan @ 2007-01-08 10:28 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Uwe Koziolek, linux.ide, Sven Ladegast
> If the shared code is tiny, just create a header file and #include it
> (sata_promise and sata_sx4 do this). Otherwise, create a shared library
> module.
pata_sis is both the SiS driver and the shared library. What needs fixing
IMHO is the Kconfig so that the user isn't aware of this. Then all the
CONFIG ifdef stuff goes away too.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support
2007-01-08 10:28 ` Alan
@ 2007-01-08 11:44 ` Jeff Garzik
2007-01-08 12:51 ` Alan
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2007-01-08 11:44 UTC (permalink / raw)
To: Alan; +Cc: Uwe Koziolek, linux.ide, Sven Ladegast
Alan wrote:
>> If the shared code is tiny, just create a header file and #include it
>> (sata_promise and sata_sx4 do this). Otherwise, create a shared library
>> module.
>
> pata_sis is both the SiS driver and the shared library. What needs fixing
It is /very/ bad policy to force the user to load a driver that drives
real hardware, just to be able to access a few functions. Hardware and
probe side effects are a very real possibility, and with this setup, the
user has /less/ control than normal over things such as load order when
pata_sis is loaded as a dependency.
If the duplicated code in question is small, just putting it in a header
file a la drivers/ata/sata_promise.h is fine. Otherwise, a library
approach with no side effects should be chosen.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support
2007-01-08 11:44 ` Jeff Garzik
@ 2007-01-08 12:51 ` Alan
2007-01-08 12:50 ` Jeff Garzik
0 siblings, 1 reply; 6+ messages in thread
From: Alan @ 2007-01-08 12:51 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Uwe Koziolek, linux.ide, Sven Ladegast
> It is /very/ bad policy to force the user to load a driver that drives
> real hardware, just to be able to access a few functions. Hardware and
> probe side effects are a very real possibility, and with this setup, the
No they are not.
> user has /less/ control than normal over things such as load order when
> pata_sis is loaded as a dependency.
Where did I put the 2x4
Right....
* Whack * ;)
The only probing the SiS driver does is for devices matching the SiS PCI
identifiers in question. Since they are intergrated bridges it's actually
physically impossible to obtain a box which contains both at once
* Whack * ;)
If it was added as a library then the non library driver would look
contain only a call to register the pci driver and a PCI table. The other
7.5K would be waste space. That also means there is no load order issue.
* Whack * ;)
Now if this was an ISA driver or poked around in ugly places your
argument would make sense. In this case I don't think your argument makes
sense, but if you want a pointless tiny pata_sis module to waste memory
on everyones boxes you can just ask and I'll send you a diff or two.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support
2007-01-08 12:51 ` Alan
@ 2007-01-08 12:50 ` Jeff Garzik
2007-01-08 15:30 ` Alan
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2007-01-08 12:50 UTC (permalink / raw)
To: Alan; +Cc: Uwe Koziolek, linux.ide, Sven Ladegast
Alan wrote:
> If it was added as a library then the non library driver would look
> contain only a call to register the pci driver and a PCI table. The other
> 7.5K would be waste space. That also means there is no load order issue.
Ok there is no load order issue, but it's still an ugly solution.
Far better would be, then, to combine the drivers into a single ata_sis
driver, it sounds like.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-01-08 15:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-08 1:33 [PATCH 2.6.20-rc3-mm1 2/2] libata: SiS 180 pata/sata support Jeff Garzik
2007-01-08 10:28 ` Alan
2007-01-08 11:44 ` Jeff Garzik
2007-01-08 12:51 ` Alan
2007-01-08 12:50 ` Jeff Garzik
2007-01-08 15:30 ` Alan
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).