2010-07-14 12:39:35

by Christoph Egger

[permalink] [raw]
Subject: [PATCH 00/11] Removing dead code

Hi all!

As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux'
configuration system.

I've been running a check on the drivers/net sourcetree for
config Items not defined in Kconfig and found 11 such
cases. Sourcecode blocks depending on these Items are not reachable
from a vanilla kernel -- dead code. I've seen such dead blocks made on
purpose e.g. while integrating new features into the kernel but
generally they're just useless.

Each of the patches in this patchset removes on such dead
config Item, I'd be glad if you consider applying them. I've been
doing deeper analysis of such issues before and can do so again but
I'm not so sure they were fastly usefull.

I build the patches against a vanilla kernel in order to
try if the kernel compiles with this patches

Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.

Regards

Christoph Egger

[0] http://vamos1.informatik.uni-erlangen.de/

Christoph Egger (11):
Removing dead RT2800PCI_SOC
Removing dead {AR,WAVE}LAN
Removing dead CASSINI_QGE_DEBUG
Removing dead CASSINI_MULTICAST_REG_WRITE
Removing dead CASSINI_NAPI
Removing dead CHELSIO_T1_COUGAR
Removing dead ARCH_PNX010X
Removing dead SH_HICOSH4
Removing dead ETRAX_NETWORK_RED_ON_NO_CONNECTION
Removing dead NETWINDER_{T,R}X_DMA_PROBLEMS
Removing dead REDWOOD_{5,6}

drivers/net/Space.c | 6 --
drivers/net/cassini.c | 25 +--------
drivers/net/cassini.h | 4 -
drivers/net/chelsio/subr.c | 48 +---------------
drivers/net/cris/eth_v10.c | 4 -
drivers/net/cs89x0.c | 96 +------------------------------
drivers/net/cs89x0.h | 4 -
drivers/net/irda/w83977af_ir.c | 33 +---------
drivers/net/smc91x.h | 37 ------------
drivers/net/wireless/rt2x00/Kconfig | 5 --
drivers/net/wireless/rt2x00/rt2800pci.c | 39 -------------
11 files changed, 9 insertions(+), 292 deletions(-)



2010-07-16 15:46:31

by Gertjan van Wingerde

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On 07/16/10 12:08, Helmut Schaa wrote:
> On Fri, Jul 16, 2010 at 9:18 AM, Gertjan van Wingerde
> <[email protected]> wrote:
>>
>> On 07/16/10 08:57, Helmut Schaa wrote:
>>> On Thu, Jul 15, 2010 at 10:41 AM, Bartlomiej Zolnierkiewicz <[email protected] <mailto:[email protected]>> wrote:
>>>
>>> On Wednesday 14 July 2010 04:44:44 pm Felix Fietkau wrote:
>>> > On 2010-07-14 3:15 PM, John W. Linville wrote:
>>> > > On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
>>> > >> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected] <mailto:[email protected]>> wrote:
>>> > >> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected] <mailto:[email protected]>> wrote:
>>> > >> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
>>> > >> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
>>> > >> >> so all Code depending on that can't ever be selected and, if there's
>>> > >> >> no plan to add these options, should be cleaned up
>>> > >> >>
>>> > >> >> Signed-off-by: Christoph Egger <[email protected] <mailto:[email protected]>>
>>> > >> >
>>> > >> > NAK,
>>> > >> >
>>> > >> > this is not dead code, it is needed for the Ralink System-on-Chip
>>> > >> > Platform devices.
>>> > >> >
>>> > >> > While I can't fix Kconfig errors and the current KConfig file may be
>>> > >> > wrong, this code cannot and will not be deleted.
>>> > >>
>>> > >> When the config option was introduced, the config options RALINK_RT288X and
>>> > >> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
>>> > >>
>>> > >> But since testing is done on SoC boards by Helmut and Felix, I assume the code
>>> > >> isn't dead but actually in use.
>>> > >
>>> > > Perhaps Helmut and Felix can send us the missing code?
>>> > The missing code is a MIPS platform port, which is currently being
>>> > maintained in OpenWrt, but is not ready for upstream submission yet.
>>> > I'm not working on this code at the moment, but I think it will be
>>> > submitted once it's ready.
>>>
>>> People are using automatic scripts to catch unused config options nowadays
>>> so the issue is quite likely to come back again sooner or later..
>>>
>>> Would it be possible to improve situation somehow till the missing parts
>>> get merged? Maybe by adding a tiny comment documenting RT2800PCI_SOC
>>> situation to Kconfig (if the config option itself really cannot be removed)
>>> until all code is ready etc.?
>>>
>>>
>>> Or we could just remove RT2800PCI_SOC completely and build the soc specific
>>> parts always as part of rt2800pci. I mean it's not much code, just the platform
>>> driver stuff and the eeprom access.
>>>
>>
>> I'm not sure if that is feasible. Sure, we can reduce the usage of the variable by
>> unconditionally compiling in the generic SOC code, but we should not unconditionally
>> register the SOC platform device, which is currently also under the scope of this
>> Kconfig variable.
>
> Ehm, no, the platform device is not registered in rt2800pci at all,
> it's just the platform
> driver that gets registered there. The platform device will be
> registered in the according
> board init code (that only resides in openwrt at the moment).
>

OK. Didn't know that. Sounds good then.

However, I've tried this in my local tree, and now compilation fails on the x86 platform
due to a missing KSEG1ADDR macro. How do you suggest to handle the potentially missing
macro?

---
Gertjan.

Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On Wednesday 14 July 2010 04:44:44 pm Felix Fietkau wrote:
> On 2010-07-14 3:15 PM, John W. Linville wrote:
> > On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
> >> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected]> wrote:
> >> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
> >> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> >> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> >> >> so all Code depending on that can't ever be selected and, if there's
> >> >> no plan to add these options, should be cleaned up
> >> >>
> >> >> Signed-off-by: Christoph Egger <[email protected]>
> >> >
> >> > NAK,
> >> >
> >> > this is not dead code, it is needed for the Ralink System-on-Chip
> >> > Platform devices.
> >> >
> >> > While I can't fix Kconfig errors and the current KConfig file may be
> >> > wrong, this code cannot and will not be deleted.
> >>
> >> When the config option was introduced, the config options RALINK_RT288X and
> >> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
> >>
> >> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> >> isn't dead but actually in use.
> >
> > Perhaps Helmut and Felix can send us the missing code?
> The missing code is a MIPS platform port, which is currently being
> maintained in OpenWrt, but is not ready for upstream submission yet.
> I'm not working on this code at the moment, but I think it will be
> submitted once it's ready.

People are using automatic scripts to catch unused config options nowadays
so the issue is quite likely to come back again sooner or later..

Would it be possible to improve situation somehow till the missing parts
get merged? Maybe by adding a tiny comment documenting RT2800PCI_SOC
situation to Kconfig (if the config option itself really cannot be removed)
until all code is ready etc.?

I bet that Christoph would be willing to update his patch if you ask him
nicely..

Thanks,
--
Bartlomiej Zolnierkiewicz

2010-07-14 12:46:56

by Luis Correia

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
> While RT2800PCI_SOC exists in Kconfig, it depends on either
> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> so all Code depending on that can't ever be selected and, if there's
> no plan to add these options, should be cleaned up
>
> Signed-off-by: Christoph Egger <[email protected]>

NAK,

this is not dead code, it is needed for the Ralink System-on-Chip
Platform devices.

While I can't fix Kconfig errors and the current KConfig file may be
wrong, this code cannot and will not be deleted.

Luis Correia
rt2x00 project admin



> ---
> ?drivers/net/wireless/rt2x00/Kconfig ? ? | ? ?5 ----
> ?drivers/net/wireless/rt2x00/rt2800pci.c | ? 39 -------------------------------
> ?2 files changed, 0 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
> index eea1ef2..d59195a 100644
> --- a/drivers/net/wireless/rt2x00/Kconfig
> +++ b/drivers/net/wireless/rt2x00/Kconfig
> @@ -58,11 +58,6 @@ config RT2800PCI_PCI
> ? ? ? ?depends on PCI
> ? ? ? ?default y
>
> -config RT2800PCI_SOC
> - ? ? ? boolean
> - ? ? ? depends on RALINK_RT288X || RALINK_RT305X
> - ? ? ? default y
> -
> ?config RT2800PCI
> ? ? ? ?tristate "Ralink rt28xx/rt30xx/rt35xx (PCI/PCIe/PCMCIA) support (EXPERIMENTAL)"
> ? ? ? ?depends on (RT2800PCI_PCI || RT2800PCI_SOC) && EXPERIMENTAL
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index b2f2327..1445038 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -85,18 +85,9 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
> ? ? ? ?rt2800_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
> ?}
>
> -#ifdef CONFIG_RT2800PCI_SOC
> -static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
> -{
> - ? ? ? u32 *base_addr = (u32 *) KSEG1ADDR(0x1F040000); /* XXX for RT3052 */
> -
> - ? ? ? memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
> -}
> -#else
> ?static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
> ?{
> ?}
> -#endif /* CONFIG_RT2800PCI_SOC */
>
> ?#ifdef CONFIG_RT2800PCI_PCI
> ?static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
> @@ -1160,25 +1151,6 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
> ?#endif /* CONFIG_RT2800PCI_PCI */
> ?MODULE_LICENSE("GPL");
>
> -#ifdef CONFIG_RT2800PCI_SOC
> -static int rt2800soc_probe(struct platform_device *pdev)
> -{
> - ? ? ? return rt2x00soc_probe(pdev, &rt2800pci_ops);
> -}
> -
> -static struct platform_driver rt2800soc_driver = {
> - ? ? ? .driver ? ? ? ? = {
> - ? ? ? ? ? ? ? .name ? ? ? ? ? = "rt2800_wmac",
> - ? ? ? ? ? ? ? .owner ? ? ? ? ?= THIS_MODULE,
> - ? ? ? ? ? ? ? .mod_name ? ? ? = KBUILD_MODNAME,
> - ? ? ? },
> - ? ? ? .probe ? ? ? ? ?= rt2800soc_probe,
> - ? ? ? .remove ? ? ? ? = __devexit_p(rt2x00soc_remove),
> - ? ? ? .suspend ? ? ? ?= rt2x00soc_suspend,
> - ? ? ? .resume ? ? ? ? = rt2x00soc_resume,
> -};
> -#endif /* CONFIG_RT2800PCI_SOC */
> -
> ?#ifdef CONFIG_RT2800PCI_PCI
> ?static struct pci_driver rt2800pci_driver = {
> ? ? ? ?.name ? ? ? ? ? = KBUILD_MODNAME,
> @@ -1194,17 +1166,9 @@ static int __init rt2800pci_init(void)
> ?{
> ? ? ? ?int ret = 0;
>
> -#ifdef CONFIG_RT2800PCI_SOC
> - ? ? ? ret = platform_driver_register(&rt2800soc_driver);
> - ? ? ? if (ret)
> - ? ? ? ? ? ? ? return ret;
> -#endif
> ?#ifdef CONFIG_RT2800PCI_PCI
> ? ? ? ?ret = pci_register_driver(&rt2800pci_driver);
> ? ? ? ?if (ret) {
> -#ifdef CONFIG_RT2800PCI_SOC
> - ? ? ? ? ? ? ? platform_driver_unregister(&rt2800soc_driver);
> -#endif
> ? ? ? ? ? ? ? ?return ret;
> ? ? ? ?}
> ?#endif
> @@ -1217,9 +1181,6 @@ static void __exit rt2800pci_exit(void)
> ?#ifdef CONFIG_RT2800PCI_PCI
> ? ? ? ?pci_unregister_driver(&rt2800pci_driver);
> ?#endif
> -#ifdef CONFIG_RT2800PCI_SOC
> - ? ? ? platform_driver_unregister(&rt2800soc_driver);
> -#endif
> ?}
>
> ?module_init(rt2800pci_init);
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

2010-07-14 12:39:45

by Christoph Egger

[permalink] [raw]
Subject: [PATCH 01/11] Removing dead RT2800PCI_SOC

While RT2800PCI_SOC exists in Kconfig, it depends on either
RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
so all Code depending on that can't ever be selected and, if there's
no plan to add these options, should be cleaned up

Signed-off-by: Christoph Egger <[email protected]>
---
drivers/net/wireless/rt2x00/Kconfig | 5 ----
drivers/net/wireless/rt2x00/rt2800pci.c | 39 -------------------------------
2 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index eea1ef2..d59195a 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -58,11 +58,6 @@ config RT2800PCI_PCI
depends on PCI
default y

-config RT2800PCI_SOC
- boolean
- depends on RALINK_RT288X || RALINK_RT305X
- default y
-
config RT2800PCI
tristate "Ralink rt28xx/rt30xx/rt35xx (PCI/PCIe/PCMCIA) support (EXPERIMENTAL)"
depends on (RT2800PCI_PCI || RT2800PCI_SOC) && EXPERIMENTAL
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b2f2327..1445038 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -85,18 +85,9 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
rt2800_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
}

-#ifdef CONFIG_RT2800PCI_SOC
-static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
-{
- u32 *base_addr = (u32 *) KSEG1ADDR(0x1F040000); /* XXX for RT3052 */
-
- memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
-}
-#else
static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
{
}
-#endif /* CONFIG_RT2800PCI_SOC */

#ifdef CONFIG_RT2800PCI_PCI
static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
@@ -1160,25 +1151,6 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
#endif /* CONFIG_RT2800PCI_PCI */
MODULE_LICENSE("GPL");

-#ifdef CONFIG_RT2800PCI_SOC
-static int rt2800soc_probe(struct platform_device *pdev)
-{
- return rt2x00soc_probe(pdev, &rt2800pci_ops);
-}
-
-static struct platform_driver rt2800soc_driver = {
- .driver = {
- .name = "rt2800_wmac",
- .owner = THIS_MODULE,
- .mod_name = KBUILD_MODNAME,
- },
- .probe = rt2800soc_probe,
- .remove = __devexit_p(rt2x00soc_remove),
- .suspend = rt2x00soc_suspend,
- .resume = rt2x00soc_resume,
-};
-#endif /* CONFIG_RT2800PCI_SOC */
-
#ifdef CONFIG_RT2800PCI_PCI
static struct pci_driver rt2800pci_driver = {
.name = KBUILD_MODNAME,
@@ -1194,17 +1166,9 @@ static int __init rt2800pci_init(void)
{
int ret = 0;

-#ifdef CONFIG_RT2800PCI_SOC
- ret = platform_driver_register(&rt2800soc_driver);
- if (ret)
- return ret;
-#endif
#ifdef CONFIG_RT2800PCI_PCI
ret = pci_register_driver(&rt2800pci_driver);
if (ret) {
-#ifdef CONFIG_RT2800PCI_SOC
- platform_driver_unregister(&rt2800soc_driver);
-#endif
return ret;
}
#endif
@@ -1217,9 +1181,6 @@ static void __exit rt2800pci_exit(void)
#ifdef CONFIG_RT2800PCI_PCI
pci_unregister_driver(&rt2800pci_driver);
#endif
-#ifdef CONFIG_RT2800PCI_SOC
- platform_driver_unregister(&rt2800soc_driver);
-#endif
}

module_init(rt2800pci_init);
--
1.7.0.4


2010-07-16 07:18:40

by Gertjan van Wingerde

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On 07/16/10 08:57, Helmut Schaa wrote:
> On Thu, Jul 15, 2010 at 10:41 AM, Bartlomiej Zolnierkiewicz <[email protected] <mailto:[email protected]>> wrote:
>
> On Wednesday 14 July 2010 04:44:44 pm Felix Fietkau wrote:
> > On 2010-07-14 3:15 PM, John W. Linville wrote:
> > > On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
> > >> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected] <mailto:[email protected]>> wrote:
> > >> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected] <mailto:[email protected]>> wrote:
> > >> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> > >> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> > >> >> so all Code depending on that can't ever be selected and, if there's
> > >> >> no plan to add these options, should be cleaned up
> > >> >>
> > >> >> Signed-off-by: Christoph Egger <[email protected] <mailto:[email protected]>>
> > >> >
> > >> > NAK,
> > >> >
> > >> > this is not dead code, it is needed for the Ralink System-on-Chip
> > >> > Platform devices.
> > >> >
> > >> > While I can't fix Kconfig errors and the current KConfig file may be
> > >> > wrong, this code cannot and will not be deleted.
> > >>
> > >> When the config option was introduced, the config options RALINK_RT288X and
> > >> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
> > >>
> > >> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> > >> isn't dead but actually in use.
> > >
> > > Perhaps Helmut and Felix can send us the missing code?
> > The missing code is a MIPS platform port, which is currently being
> > maintained in OpenWrt, but is not ready for upstream submission yet.
> > I'm not working on this code at the moment, but I think it will be
> > submitted once it's ready.
>
> People are using automatic scripts to catch unused config options nowadays
> so the issue is quite likely to come back again sooner or later..
>
> Would it be possible to improve situation somehow till the missing parts
> get merged? Maybe by adding a tiny comment documenting RT2800PCI_SOC
> situation to Kconfig (if the config option itself really cannot be removed)
> until all code is ready etc.?
>
>
> Or we could just remove RT2800PCI_SOC completely and build the soc specific
> parts always as part of rt2800pci. I mean it's not much code, just the platform
> driver stuff and the eeprom access.
>

I'm not sure if that is feasible. Sure, we can reduce the usage of the variable by
unconditionally compiling in the generic SOC code, but we should not unconditionally
register the SOC platform device, which is currently also under the scope of this
Kconfig variable.

---
Gertjan.


Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC


On Wednesday 14 July 2010 02:52:14 pm Ivo Van Doorn wrote:
> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected]> wrote:
> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> >> so all Code depending on that can't ever be selected and, if there's
> >> no plan to add these options, should be cleaned up
> >>
> >> Signed-off-by: Christoph Egger <[email protected]>
> >
> > NAK,
> >
> > this is not dead code, it is needed for the Ralink System-on-Chip
> > Platform devices.
> >
> > While I can't fix Kconfig errors and the current KConfig file may be
> > wrong, this code cannot and will not be deleted.
>
> When the config option was introduced, the config options RALINK_RT288X and
> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
>
> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> isn't dead but actually in use.
>
> Ivo

I fully agree with Luis and Ivo that the proposed patch is invalid and
shouldn't be applied (the "code cannot and will not be deleted" anyway)..

[ Under "The New Normal" rules the code doesn't even have to work to be
merged and/or stay in the kernel so 9 months of code not being used by
any real user doesn't matter a tiny bit.. ]

--
Bartlomiej Zolnierkiewicz

2010-07-14 14:44:56

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On 2010-07-14 3:15 PM, John W. Linville wrote:
> On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
>> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected]> wrote:
>> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
>> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
>> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
>> >> so all Code depending on that can't ever be selected and, if there's
>> >> no plan to add these options, should be cleaned up
>> >>
>> >> Signed-off-by: Christoph Egger <[email protected]>
>> >
>> > NAK,
>> >
>> > this is not dead code, it is needed for the Ralink System-on-Chip
>> > Platform devices.
>> >
>> > While I can't fix Kconfig errors and the current KConfig file may be
>> > wrong, this code cannot and will not be deleted.
>>
>> When the config option was introduced, the config options RALINK_RT288X and
>> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
>>
>> But since testing is done on SoC boards by Helmut and Felix, I assume the code
>> isn't dead but actually in use.
>
> Perhaps Helmut and Felix can send us the missing code?
The missing code is a MIPS platform port, which is currently being
maintained in OpenWrt, but is not ready for upstream submission yet.
I'm not working on this code at the moment, but I think it will be
submitted once it's ready.

- Felix

2010-07-16 10:08:26

by Helmut Schaa

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On Fri, Jul 16, 2010 at 9:18 AM, Gertjan van Wingerde
<[email protected]> wrote:
>
> On 07/16/10 08:57, Helmut Schaa wrote:
> > On Thu, Jul 15, 2010 at 10:41 AM, Bartlomiej Zolnierkiewicz <[email protected] <mailto:[email protected]>> wrote:
> >
> > ? ? On Wednesday 14 July 2010 04:44:44 pm Felix Fietkau wrote:
> > ? ? > On 2010-07-14 3:15 PM, John W. Linville wrote:
> > ? ? > > On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
> > ? ? > >> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected] <mailto:[email protected]>> wrote:
> > ? ? > >> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected] <mailto:[email protected]>> wrote:
> > ? ? > >> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> > ? ? > >> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> > ? ? > >> >> so all Code depending on that can't ever be selected and, if there's
> > ? ? > >> >> no plan to add these options, should be cleaned up
> > ? ? > >> >>
> > ? ? > >> >> Signed-off-by: Christoph Egger <[email protected] <mailto:[email protected]>>
> > ? ? > >> >
> > ? ? > >> > NAK,
> > ? ? > >> >
> > ? ? > >> > this is not dead code, it is needed for the Ralink System-on-Chip
> > ? ? > >> > Platform devices.
> > ? ? > >> >
> > ? ? > >> > While I can't fix Kconfig errors and the current KConfig file may be
> > ? ? > >> > wrong, this code cannot and will not be deleted.
> > ? ? > >>
> > ? ? > >> When the config option was introduced, the config options RALINK_RT288X and
> > ? ? > >> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
> > ? ? > >>
> > ? ? > >> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> > ? ? > >> isn't dead but actually in use.
> > ? ? > >
> > ? ? > > Perhaps Helmut and Felix can send us the missing code?
> > ? ? > The missing code is a MIPS platform port, which is currently being
> > ? ? > maintained in OpenWrt, but is not ready for upstream submission yet.
> > ? ? > I'm not working on this code at the moment, but I think it will be
> > ? ? > submitted once it's ready.
> >
> > ? ? People are using automatic scripts to catch unused config options nowadays
> > ? ? so the issue is quite likely to come back again sooner or later..
> >
> > ? ? Would it be possible to improve situation somehow till the missing parts
> > ? ? get merged? ?Maybe by adding a tiny comment documenting RT2800PCI_SOC
> > ? ? situation to Kconfig (if the config option itself really cannot be removed)
> > ? ? until all code is ready etc.?
> >
> >
> > Or we could just remove RT2800PCI_SOC completely and build the soc specific
> > parts always as part of rt2800pci. I mean it's not much code, just the platform
> > driver stuff and the eeprom access.
> >
>
> I'm not sure if that is feasible. Sure, we can reduce the usage of the variable by
> unconditionally compiling in the generic SOC code, but we should not unconditionally
> register the SOC platform device, which is currently also under the scope of this
> Kconfig variable.

Ehm, no, the platform device is not registered in rt2800pci at all,
it's just the platform
driver that gets registered there. The platform device will be
registered in the according
board init code (that only resides in openwrt at the moment).

Helmut

2010-07-16 17:45:30

by Helmut Schaa

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

Am Freitag 16 Juli 2010 schrieb Gertjan van Wingerde:
> On 07/16/10 12:08, Helmut Schaa wrote:
> > On Fri, Jul 16, 2010 at 9:18 AM, Gertjan van Wingerde
> > <[email protected]> wrote:
> >>
> >> On 07/16/10 08:57, Helmut Schaa wrote:
> >>> On Thu, Jul 15, 2010 at 10:41 AM, Bartlomiej Zolnierkiewicz <[email protected] <mailto:[email protected]>> wrote:
> >>>
> >>> On Wednesday 14 July 2010 04:44:44 pm Felix Fietkau wrote:
> >>> > On 2010-07-14 3:15 PM, John W. Linville wrote:
> >>> > > On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
> >>> > >> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected] <mailto:[email protected]>> wrote:
> >>> > >> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected] <mailto:[email protected]>> wrote:
> >>> > >> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> >>> > >> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> >>> > >> >> so all Code depending on that can't ever be selected and, if there's
> >>> > >> >> no plan to add these options, should be cleaned up
> >>> > >> >>
> >>> > >> >> Signed-off-by: Christoph Egger <[email protected] <mailto:[email protected]>>
> >>> > >> >
> >>> > >> > NAK,
> >>> > >> >
> >>> > >> > this is not dead code, it is needed for the Ralink System-on-Chip
> >>> > >> > Platform devices.
> >>> > >> >
> >>> > >> > While I can't fix Kconfig errors and the current KConfig file may be
> >>> > >> > wrong, this code cannot and will not be deleted.
> >>> > >>
> >>> > >> When the config option was introduced, the config options RALINK_RT288X and
> >>> > >> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
> >>> > >>
> >>> > >> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> >>> > >> isn't dead but actually in use.
> >>> > >
> >>> > > Perhaps Helmut and Felix can send us the missing code?
> >>> > The missing code is a MIPS platform port, which is currently being
> >>> > maintained in OpenWrt, but is not ready for upstream submission yet.
> >>> > I'm not working on this code at the moment, but I think it will be
> >>> > submitted once it's ready.
> >>>
> >>> People are using automatic scripts to catch unused config options nowadays
> >>> so the issue is quite likely to come back again sooner or later..
> >>>
> >>> Would it be possible to improve situation somehow till the missing parts
> >>> get merged? Maybe by adding a tiny comment documenting RT2800PCI_SOC
> >>> situation to Kconfig (if the config option itself really cannot be removed)
> >>> until all code is ready etc.?
> >>>
> >>>
> >>> Or we could just remove RT2800PCI_SOC completely and build the soc specific
> >>> parts always as part of rt2800pci. I mean it's not much code, just the platform
> >>> driver stuff and the eeprom access.
> >>>
> >>
> >> I'm not sure if that is feasible. Sure, we can reduce the usage of the variable by
> >> unconditionally compiling in the generic SOC code, but we should not unconditionally
> >> register the SOC platform device, which is currently also under the scope of this
> >> Kconfig variable.
> >
> > Ehm, no, the platform device is not registered in rt2800pci at all,
> > it's just the platform
> > driver that gets registered there. The platform device will be
> > registered in the according
> > board init code (that only resides in openwrt at the moment).
> >
>
> OK. Didn't know that. Sounds good then.
>
> However, I've tried this in my local tree, and now compilation fails on the x86 platform
> due to a missing KSEG1ADDR macro. How do you suggest to handle the potentially missing
> macro?

We can convert it to an ioremap call, that should be available on all platforms.

Helmut


2010-07-14 13:30:18

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On Wed, Jul 14, 2010 at 02:52:14PM +0200, Ivo Van Doorn wrote:
> On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected]> wrote:
> > On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
> >> While RT2800PCI_SOC exists in Kconfig, it depends on either
> >> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
> >> so all Code depending on that can't ever be selected and, if there's
> >> no plan to add these options, should be cleaned up
> >>
> >> Signed-off-by: Christoph Egger <[email protected]>
> >
> > NAK,
> >
> > this is not dead code, it is needed for the Ralink System-on-Chip
> > Platform devices.
> >
> > While I can't fix Kconfig errors and the current KConfig file may be
> > wrong, this code cannot and will not be deleted.
>
> When the config option was introduced, the config options RALINK_RT288X and
> RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)
>
> But since testing is done on SoC boards by Helmut and Felix, I assume the code
> isn't dead but actually in use.

Perhaps Helmut and Felix can send us the missing code?

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2010-07-14 12:52:17

by Ivo Van Doorn

[permalink] [raw]
Subject: Re: [PATCH 01/11] Removing dead RT2800PCI_SOC

On Wed, Jul 14, 2010 at 2:46 PM, Luis Correia <[email protected]> wrote:
> On Wed, Jul 14, 2010 at 13:39, Christoph Egger <[email protected]> wrote:
>> While RT2800PCI_SOC exists in Kconfig, it depends on either
>> RALINK_RT288X or RALINK_RT305X which are both not available in Kconfig
>> so all Code depending on that can't ever be selected and, if there's
>> no plan to add these options, should be cleaned up
>>
>> Signed-off-by: Christoph Egger <[email protected]>
>
> NAK,
>
> this is not dead code, it is needed for the Ralink System-on-Chip
> Platform devices.
>
> While I can't fix Kconfig errors and the current KConfig file may be
> wrong, this code cannot and will not be deleted.

When the config option was introduced, the config options RALINK_RT288X and
RALINK_RT305X were supposed to be merged as well soon after by somebody (Felix?)

But since testing is done on SoC boards by Helmut and Felix, I assume the code
isn't dead but actually in use.

Ivo