From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E88BC38A24 for ; Thu, 7 May 2020 08:52:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EB9D2084D for ; Thu, 7 May 2020 08:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588841525; bh=5hAkM6lcDiWiYAX0JYFT1ZvhiB6Q7ZILZYrICV3hyO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cnPmtDvbo2z65qzMav4+KJpkdM9eWuLltqMzZ2l7/lxt+ZV9ESMbRmYdRV1pyVWIy nruCKMlo6qoDh74JlGPY5E468nf9SXeEPE4dHS9YW08bJ8J4V1KqjSSQ6MpGUu0eN5 1PhK0ahO0MArQRt+lSKrmiewGVDY3Vj6eWc5TN0E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725900AbgEGIwF (ORCPT ); Thu, 7 May 2020 04:52:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:51906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgEGIwE (ORCPT ); Thu, 7 May 2020 04:52:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F59F2073A; Thu, 7 May 2020 08:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588841523; bh=5hAkM6lcDiWiYAX0JYFT1ZvhiB6Q7ZILZYrICV3hyO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nFelzp4BBbqSIoPSjX0FfSvPb0NM2nuSDtG6Jx46W7ihh6ifBJvY1IBbOFoxaAE/r J6vuz201vOW99hGdcvt3oeCZSiskcVJPHD62BkkMpbj4oEyKj/T/VSO0p4TqwBJuuA DbgUJm4Uo+pddDqcOv9X7cnpR3cuuZxAeyoMEiWs= Date: Thu, 7 May 2020 10:52:01 +0200 From: Greg Kroah-Hartman To: Mikulas Patocka Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org, Arnd Bergmann , linux-serial@vger.kernel.org, linux-rtc@vger.kernel.org Subject: Re: [PATCH 2/2 v4] alpha: add a delay before serial port read Message-ID: <20200507085201.GA1097552@kroah.com> References: <20200506114711.GB3024358@kroah.com> <20200506154938.GA3537174@kroah.com> <20200506160823.GA3559699@kroah.com> <20200506174528.GB3711921@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Thu, May 07, 2020 at 04:18:49AM -0400, Mikulas Patocka wrote: > > > On Wed, 6 May 2020, Greg Kroah-Hartman wrote: > > > On Wed, May 06, 2020 at 01:04:38PM -0400, Mikulas Patocka wrote: > > > > > > I've created this patch that adds a global macro/variable > > > serial_port_needs_delay. I've also deleted UPQ_DELAY_BEFORE_READ and test > > > serial_port_needs_delay directly in io_serial_in, so that the compiler > > > will optimize it out on non-alpha architectures. > > > > That's not good, what about systems with hundreds of serial ports? > > I doubt that someone will conect hundreds of serial ports to such an old > alpha machine :) > > > > > But, there is no other way to detect this based on hardware > > > > signatures/types instead? That is usually the best way to do it, right? > > > > > > It's hard to detect Alpha without using '#ifdef CONFIG_ALPHA' :) The ISA > > > serial port hardware is simple, so I think that you can't distinguish it > > > just based on its behavior. > > > > The ISA serial port hardware does not have a unique vendor/product id > > somewhere? Some other sort of definition that we can use to determine > > exactly what type of system we are running on? > > AFAIK it doesn't. You can only distinguish 8250, 16550 and 16550A - but > not the vendor. > > > > Index: linux-stable/drivers/tty/serial/8250/8250_port.c > > > =================================================================== > > > --- linux-stable.orig/drivers/tty/serial/8250/8250_port.c 2020-05-06 18:54:24.000000000 +0200 > > > +++ linux-stable/drivers/tty/serial/8250/8250_port.c 2020-05-06 18:54:24.000000000 +0200 > > > @@ -30,6 +30,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > > > #include > > > #include > > > @@ -442,6 +443,9 @@ static unsigned int mem32be_serial_in(st > > > > > > static unsigned int io_serial_in(struct uart_port *p, int offset) > > > { > > > + if (serial_port_needs_delay) > > > + ndelay(300); > > > > Again, this should be a per-port thing, not all ports in the system are > > this broken, right? > > > > thanks, > > > > greg k-h > > Here is the patch that uses per-port flag UPQ_DELAY_BEFORE_READ. The flag > is activated if we have the specific PCI-ISA bridge and if the serial port > is an ISA port. Better, care to submit this in a format that it can be applied in? thanks, greg k-h