Re: [PATCH] serial: 8250: Move alpha-specific quirk out of the core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 16, 2021 at 09:36:20PM +0100, Ulrich Teichert wrote:
> > struct uart_8250_port contains mcr_mask and mcr_force members whose
> > sole purpose is to work around an alpha-specific quirk.  This code
> > doesn't belong in the core where it is executed by everyone else,
> > so move it to a proper ->set_mctrl callback which is used on alpha only.
[...]
> > The quirk applies to non-PCI alphas and arch/alpha/Kconfig specifies
> > "select FORCE_PCI if !ALPHA_JENSEN".  So apparently the only affected
> > machine is the EISA-based Jensen that Linus was working on back then:
[...]
> > Up until now the quirk is not applied unless CONFIG_PCI is disabled.
> > If users forget to do that, the serial ports aren't usable on Jensen
> > and the machine may not boot in the first place.  Avoid by confining
> > the quirk to CONFIG_ALPHA_JENSEN instead.
> 
> Wouldn't that mean that you can't use a generic Alpha kernel on the Jensen
> anymore? CONFIG_ALPHA_JENSEN is only set if you specifically select the
> Jensen as target, not when you build a generic kernel. That would be a step
> back in my opinion, as the Debian generic kernel from debian-ports did
> as least boot up on real hardware and the serial console worked just fine

The generic Alpha kernel has CONFIG_PCI=y, so the quirk is not applied,
both with and without the present patch.

You should be able to trigger the lockup that the quirk seeks to avoid
by closing the tty of either of the serial ports.  E.g., if you're using
the serial console, "cat" something to the other serial port's tty.
That will clear TIOCM_OUT2 in serial8250_do_shutdown() and should thus
provoke the lockup.  Alternatively, compile and run the little program
below on the Jensen.  (Pass a serial port tty as argument.)

Should you not be able to reproduce the lockup, then the quirk wouldn't
be necessary anymore and could be removed.

Thanks!

Lukas

-- >8 --

#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <sys/ioctl.h>

#define TIOCM_OUT1	0x2000
#define TIOCM_OUT2	0x4000

int main(int argc, char* argv[]) {
	int fd, ret, flags;

	if (argc < 2)
		return 1;

	fd = open(argv[1], O_RDWR);
	if (fd < 0)
		return 2;

	ret = ioctl(fd, TIOCMGET, &flags);
	if (ret < 0)
		goto close;

	flags &= ~(TIOCM_OUT1 | TIOCM_OUT2);
	ret = ioctl(fd, TIOCMSET, &flags);

close:
	close(fd);

	return ret;
}



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux