All of lore.kernel.org
 help / color / mirror / Atom feed
* Is drivers/net/wan/lmc dead?
@ 2022-03-21 21:40 Jakub Kicinski
  2022-03-21 22:10 ` Arnd Bergmann
  2022-03-22  8:14 ` Krzysztof Hałasa
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub Kicinski @ 2022-03-21 21:40 UTC (permalink / raw)
  To: Krzysztof Hałasa, Andrew Stanley-Jones, Rob Braun,
	Michael Graff, Matt Thomas, Arnd Bergmann, Krzysztof Halasa
  Cc: netdev

Hi!

The driver for LAN Media WAN interfaces spews build warnings on
microblaze.

CCing usual suspects and people mentioned as authors in the source code.

As far as I can tell it has no maintainer.

It has also received not received a single functional change that'd
indicate someone owns this HW since the beginning of the git era.

Can we remove this driver or should we invest effort into fixing it?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is drivers/net/wan/lmc dead?
  2022-03-21 21:40 Is drivers/net/wan/lmc dead? Jakub Kicinski
@ 2022-03-21 22:10 ` Arnd Bergmann
  2022-03-21 23:06   ` Jakub Kicinski
  2022-03-22  8:14 ` Krzysztof Hałasa
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2022-03-21 22:10 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Krzysztof Hałasa, Andrew Stanley-Jones, Rob Braun,
	Michael Graff, Matt Thomas, Krzysztof Halasa, netdev

On Mon, Mar 21, 2022 at 10:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Hi!
>
> The driver for LAN Media WAN interfaces spews build warnings on
> microblaze.
>
> CCing usual suspects and people mentioned as authors in the source code.
>
> As far as I can tell it has no maintainer.
>
> It has also received not received a single functional change that'd
> indicate someone owns this HW since the beginning of the git era.
>
> Can we remove this driver or should we invest effort into fixing it?

I have not seen the exact error, but I suspect the problem is that
microblaze selects CONFIG_VIRT_TO_BUS without actually
providing those interfaces. The easy workaround would be to
have microblaze not select that symbol.

Drivers using virt_to_bus() are inherently nonportable because
they don't work on architectures that use an IOMMU or swiotlb,
or that require cache maintenance for DMA operations.

$ git grep -wl virt_to_bus drivers/
drivers/atm/ambassador.c
drivers/atm/firestream.c
drivers/atm/horizon.c
drivers/atm/zatm.c
drivers/block/swim3.c
drivers/gpu/drm/mga/mga_dma.c
drivers/net/appletalk/ltpc.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/amd/ni65.c
drivers/net/ethernet/apple/bmac.c
drivers/net/ethernet/apple/mace.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/i825xx/82596.c
drivers/net/ethernet/i825xx/lasi_82596.c
drivers/net/ethernet/i825xx/lib82596.c
drivers/net/hamradio/dmascc.c
drivers/net/wan/cosa.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/z85230.c
drivers/scsi/3w-xxxx.c
drivers/scsi/a2091.c
drivers/scsi/a3000.c
drivers/scsi/dpt_i2o.c
drivers/scsi/gvp11.c
drivers/scsi/mvme147.c
drivers/scsi/qla1280.c
drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c
drivers/vme/bridges/vme_ca91cx42.c

Among the drivers/net/wan/ drivers, I think lmc is actually
one of the newer pieces of hardware, most of the other ones
appear to even predate PCI.

        Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is drivers/net/wan/lmc dead?
  2022-03-21 22:10 ` Arnd Bergmann
@ 2022-03-21 23:06   ` Jakub Kicinski
  2022-03-22  8:33     ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2022-03-21 23:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Krzysztof Hałasa, Andrew Stanley-Jones, Rob Braun,
	Michael Graff, Matt Thomas, Krzysztof Halasa, netdev

On Mon, 21 Mar 2022 23:10:32 +0100 Arnd Bergmann wrote:
> On Mon, Mar 21, 2022 at 10:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
> > The driver for LAN Media WAN interfaces spews build warnings on
> > microblaze.
> >
> > CCing usual suspects and people mentioned as authors in the source code.
> >
> > As far as I can tell it has no maintainer.
> >
> > It has also received not received a single functional change that'd
> > indicate someone owns this HW since the beginning of the git era.
> >
> > Can we remove this driver or should we invest effort into fixing it?  
> 
> I have not seen the exact error, but I suspect the problem is that
> microblaze selects CONFIG_VIRT_TO_BUS without actually
> providing those interfaces. The easy workaround would be to
> have microblaze not select that symbol.

FWIW the warning is that virt_to_bus() discards the __iomem qualifier.
I think it's a macro on most platforms but not microblaze.
Anyway, some approximation of "VIRT_TO_BUS on mircoblaze is broken"
sounds right.

> Drivers using virt_to_bus() are inherently nonportable because
> they don't work on architectures that use an IOMMU or swiotlb,
> or that require cache maintenance for DMA operations.
> 
> $ git grep -wl virt_to_bus drivers/
> drivers/atm/ambassador.c
> drivers/atm/firestream.c
> drivers/atm/horizon.c
> drivers/atm/zatm.c
> drivers/block/swim3.c
> drivers/gpu/drm/mga/mga_dma.c
> drivers/net/appletalk/ltpc.c
> drivers/net/ethernet/amd/au1000_eth.c
> drivers/net/ethernet/amd/ni65.c
> drivers/net/ethernet/apple/bmac.c
> drivers/net/ethernet/apple/mace.c
> drivers/net/ethernet/dec/tulip/de4x5.c
> drivers/net/ethernet/i825xx/82596.c
> drivers/net/ethernet/i825xx/lasi_82596.c
> drivers/net/ethernet/i825xx/lib82596.c
> drivers/net/hamradio/dmascc.c
> drivers/net/wan/cosa.c
> drivers/net/wan/lmc/lmc_main.c
> drivers/net/wan/z85230.c
> drivers/scsi/3w-xxxx.c
> drivers/scsi/a2091.c
> drivers/scsi/a3000.c
> drivers/scsi/dpt_i2o.c
> drivers/scsi/gvp11.c
> drivers/scsi/mvme147.c
> drivers/scsi/qla1280.c
> drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c
> drivers/vme/bridges/vme_ca91cx42.c
> 
> Among the drivers/net/wan/ drivers, I think lmc is actually
> one of the newer pieces of hardware, most of the other ones
> appear to even predate PCI.

You know what's even newer than lmc?  Me :S  This HW is so old
many of us have never interacted with these technologies directly.

How do we start getting rid of this stuff? Should we send out patches
to delete anything that's using virt_to_bus() under net|atm and see
which ones don't get shot down?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is drivers/net/wan/lmc dead?
  2022-03-21 21:40 Is drivers/net/wan/lmc dead? Jakub Kicinski
  2022-03-21 22:10 ` Arnd Bergmann
@ 2022-03-22  8:14 ` Krzysztof Hałasa
  2022-03-22  8:54   ` Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Hałasa @ 2022-03-22  8:14 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Stanley-Jones, Rob Braun, Michael Graff, Matt Thomas,
	Arnd Bergmann, netdev

Jakub Kicinski <kuba@kernel.org> writes:

> It has also received not received a single functional change that'd
> indicate someone owns this HW since the beginning of the git era.
>
> Can we remove this driver or should we invest effort into fixing it?

Ahh, it's where they took a tulip (DEC Ethernet controller) and added
an FPGA/PLD frontend converting Ethernet to/from sync serial (buffering
etc). I guess they were tulip experts and didn't want to mess with PCI
directly.

Alan Cox wrote in 2008 (commit 8ab7b66796):
> Not sure anyone uses this driver any more, maybe we should just drop it ?
> Code is still foul but at least a fraction less broken.

C101, N2 (including hd64570), Cosa, hostess_sv11, Sealevel (including
z85230) are ISA. The last motherboard with ISA slot (just one) I used
was Pentium II + i440LX (or something). Sure, the serial links needed
only obsolete hardware (I had been using an old Pentium ~ 100 MHz router
for years back then). But it was ~ 20 years ago. Are there places on
Earth where such stuff still exists, and uses relatively up-to-date
Linux kernels?

Farsync, LMC, PC300, PCI200SYN and wanXL are PCI. While PCI is obsolete,
I think it's quite possible for such hw to be in active use. wanXL were
expensive (and bit older) cards and thus rare, but PC300 and PCI200SYN
were common at some point (as common as V.35/X.21 etc. stuff could be).
I don't know about Farsync or LMC (though I still have one or two of
the latter, somewhere).

The remaining - fsl_ucc_hdlc, lapbether, slic_ds26522 - are either
embedded drivers (Motorola QUICC engine, Dallas Semi T1/E1/J1 frontend)
or pure software device. QUICC isn't exactly new :-) but it seems to be
referenced by arm64 and PPC DTS files (so this isn't the original
~68020 QUICC).
-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is drivers/net/wan/lmc dead?
  2022-03-21 23:06   ` Jakub Kicinski
@ 2022-03-22  8:33     ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2022-03-22  8:33 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Krzysztof Hałasa, Andrew Stanley-Jones, Rob Braun,
	Michael Graff, Matt Thomas, Krzysztof Halasa, netdev,
	Martin Schiller, Linux X25

On Tue, Mar 22, 2022 at 12:06 AM Jakub Kicinski <kuba@kernel.org> wrote:
> On Mon, 21 Mar 2022 23:10:32 +0100 Arnd Bergmann wrote:
> > On Mon, Mar 21, 2022 at 10:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
> > > The driver for LAN Media WAN interfaces spews build warnings on
> > > microblaze.
> > >
> > > CCing usual suspects and people mentioned as authors in the source code.
> > >
> > > As far as I can tell it has no maintainer.
> > >
> > > It has also received not received a single functional change that'd
> > > indicate someone owns this HW since the beginning of the git era.
> > >
> > > Can we remove this driver or should we invest effort into fixing it?
> >
> > I have not seen the exact error, but I suspect the problem is that
> > microblaze selects CONFIG_VIRT_TO_BUS without actually
> > providing those interfaces. The easy workaround would be to
> > have microblaze not select that symbol.
>
> FWIW the warning is that virt_to_bus() discards the __iomem qualifier.
> I think it's a macro on most platforms but not microblaze.
> Anyway, some approximation of "VIRT_TO_BUS on mircoblaze is broken"
> sounds right.

Ok, I've reproduced it now, and I see that microblaze gets the virt_to_bus()
definition from include/asm-generic/io.h. The definition is in fact
correct, though
arguably microblaze (also h8300 and xtensa, probably more) should not
set CONFIG_VIRT_TO_BUS anyway because they do not use PCI
hardware from the 1990s.

The warning that I get is actually about the descriptor pointers
being marked 'volatile' (not '__iomem') and used as normal pointers
when passed to virt_to_bus(). Not sure whether the volatile here is
correct or not, but either removing it from lmc or adding it to the
virt_to_bus() prototype would avoid the warning.

> > Drivers using virt_to_bus() are inherently nonportable because
> > they don't work on architectures that use an IOMMU or swiotlb,
> > or that require cache maintenance for DMA operations.
> >
> > $ git grep -wl virt_to_bus drivers/
> > drivers/atm/ambassador.c
> > drivers/atm/firestream.c
> > drivers/atm/horizon.c
> > drivers/atm/zatm.c
> > drivers/block/swim3.c
> > drivers/gpu/drm/mga/mga_dma.c
> > drivers/net/appletalk/ltpc.c
> > drivers/net/ethernet/amd/au1000_eth.c
> > drivers/net/ethernet/amd/ni65.c
> > drivers/net/ethernet/apple/bmac.c
> > drivers/net/ethernet/apple/mace.c
> > drivers/net/ethernet/dec/tulip/de4x5.c
> > drivers/net/ethernet/i825xx/82596.c
> > drivers/net/ethernet/i825xx/lasi_82596.c
> > drivers/net/ethernet/i825xx/lib82596.c
> > drivers/net/hamradio/dmascc.c
> > drivers/net/wan/cosa.c
> > drivers/net/wan/lmc/lmc_main.c
> > drivers/net/wan/z85230.c
> > drivers/scsi/3w-xxxx.c
> > drivers/scsi/a2091.c
> > drivers/scsi/a3000.c
> > drivers/scsi/dpt_i2o.c
> > drivers/scsi/gvp11.c
> > drivers/scsi/mvme147.c
> > drivers/scsi/qla1280.c
> > drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c
> > drivers/vme/bridges/vme_ca91cx42.c
> >
> > Among the drivers/net/wan/ drivers, I think lmc is actually
> > one of the newer pieces of hardware, most of the other ones
> > appear to even predate PCI.
>
> You know what's even newer than lmc?  Me :S  This HW is so old
> many of us have never interacted with these technologies directly.
>
> How do we start getting rid of this stuff? Should we send out patches
> to delete anything that's using virt_to_bus() under net|atm and see
> which ones don't get shot down?

I found the email from Martin Schiller that gives some background
on how hdlc/x25 is being used:
https://lore.kernel.org/lkml/407acd92c92c3ba04578da89b1a0f191@dev.tdt.de/

In short (and confirmed by Krzysztof's reply), most of the hdlc wan
hardware has been obsolete, but the subsystem itself is still used with
out-of-tree drivers. The situation for ATM is similar IIRC, as nobody uses
actual ATM is pretty much obsolete (I don't know how common it is in
practice) but DSL is still widely used.

I think we can probably come up with a set of atm, wan and appletalk
drivers that use either an ISA bus or the virt_to_bus() interface as
a starting point for a mass removal. From what I can tell, the majority
of the drivers using virt_to_bus() are platform specific already, mostly
m68k, and rooting out virt_to_bus() from all platform-independent
drivers would be good.

       Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is drivers/net/wan/lmc dead?
  2022-03-22  8:14 ` Krzysztof Hałasa
@ 2022-03-22  8:54   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2022-03-22  8:54 UTC (permalink / raw)
  To: Krzysztof Hałasa
  Cc: Jakub Kicinski, Andrew Stanley-Jones, Rob Braun, Michael Graff,
	Matt Thomas, netdev, Zhao Qiang

On Tue, Mar 22, 2022 at 9:14 AM Krzysztof Hałasa <khalasa@piap.pl> wrote:
> QUICC isn't exactly new :-) but it seems to be referenced by arm64 and
> PPC DTS files (so this isn't the original ~68020 QUICC).

Zhao Qiang from NXP added the fsl,ucc-hdlc node to arm64 ls1043a,
so I assume they actually support that device. The chip was introduced
in 2015, with a 15+ year product longevity cycle. The older arm32 based
ls1021 and the ls1088 also mention the quicc engine in the marketing
material but not the kernel sources, and I found no evidence of them
on any of the later layerscape chips.

       Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-22  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 21:40 Is drivers/net/wan/lmc dead? Jakub Kicinski
2022-03-21 22:10 ` Arnd Bergmann
2022-03-21 23:06   ` Jakub Kicinski
2022-03-22  8:33     ` Arnd Bergmann
2022-03-22  8:14 ` Krzysztof Hałasa
2022-03-22  8:54   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.