Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp754004pxj; Thu, 13 May 2021 16:30:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsoZjKmUOeioQ15i2R43AjeXxKeGtZ0/I77JDsJ7V0+4MSCyLzULA+17IJXwr/JtsTYOWI X-Received: by 2002:a17:906:1957:: with SMTP id b23mr46170899eje.209.1620948602241; Thu, 13 May 2021 16:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620948602; cv=none; d=google.com; s=arc-20160816; b=aJoHVJ3whuyftDHyospqGiXpMomakJubeW1A1nmphzY2pTsqxvHIPQB4d3Ro++moCB +qItNHqH0LEp8iaRFxY5pg9vKmXG98E8UGvFbxloiB8Le5aQm1dYEShLGZePf2NxX5vI aQPZpV4psoOZIcWa9jkVfGjJcYy3jdC7B2b8ZsTzfyRR8vEnzQZaRCNBdjQKXUr1R8Vm WtrfMtyvgCvppv2KjHEWEgJkNDTMT9sYFUQJC/E6KL6HWISbAdzKwxtN1rrLA+2Y/5vt tTcI3Or0IKQwY09b8T+c+Dz5BoWzW4x32PYqMhj5xRGJaw80GOJSvXT9uaB4a67j+qjM DLCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3xQm+9LMy8PS8L08QfP0aJgsWgjlYVW/AhLSsoPmF+g=; b=UG6m71V3Cv3L9NzCt67McXlGEMA6MtTD+RquAbGstkoWfxD3Pwo1AUsnCGACkGas3D iH+a2XzQido7PSDyXnpZW4jaJNEwEZ1Oxx+LNTSCRZzGyeiVQL9llKbJ0v+KjqUGzvME G1e65KB8no/KEaPb2/ainzvZb+zlnlw/pPpSVBH1J5wtahb3OsC6CdZ4s4Ex0VY1CExc o1UxeagDmixfkLJSoMQN2z7TqXel8nh4CINZVtvKxYQ/5ELjJ7sccxazSO/SVfzvpknO u8piuXMyJCDLkLQKSlN/Bbq2kUIa+ptqg6Bre5uqkrt1mEQacAu7iqZHhOxs0sV7Uwes 0HBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="X+/8f3XP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh25si4290000edb.164.2021.05.13.16.29.38; Thu, 13 May 2021 16:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="X+/8f3XP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231790AbhEMT0z (ORCPT + 99 others); Thu, 13 May 2021 15:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbhEMT0u (ORCPT ); Thu, 13 May 2021 15:26:50 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [IPv6:2605:2700:0:5::4713:9cab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4EBFC061574; Thu, 13 May 2021 12:25:36 -0700 (PDT) Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id D83633E8; Thu, 13 May 2021 12:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1620933935; bh=3xQm+9LMy8PS8L08QfP0aJgsWgjlYVW/AhLSsoPmF+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X+/8f3XPl1MQ5nQMw8qPZnMaUJqFty0feSXspBZolV9TeFRlqoYfvtYa5IKATp38X 4TFaKvGcf6yM41p+AZ8gYwMbpBcXiNL8FkbkH+VZxz94d/8/Egi9pZ6IgQZjzL2yDY glVjqPZqP/oMRupIjQ/bZVwR6Ty0+DctvMp925dU= Date: Thu, 13 May 2021 14:25:32 -0500 From: Zev Weiss To: Andrew Jeffery Cc: Greg Kroah-Hartman , Jeremy Kerr , openbmc@lists.ozlabs.org, Jiri Slaby , Joel Stanley , Johan Hovold , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] serial: 8250_aspeed_vuart: initialize vuart->port in aspeed_vuart_probe() Message-ID: References: <20210510014231.647-1-zev@bewilderbeest.net> <20210510014231.647-3-zev@bewilderbeest.net> <6d4338e2-d9be-411a-aeb7-7d46121b73d4@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <6d4338e2-d9be-411a-aeb7-7d46121b73d4@www.fastmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 08:34:06PM CDT, Andrew Jeffery wrote: > > >On Mon, 10 May 2021, at 11:12, Zev Weiss wrote: >> Previously this had only been initialized if we hit the throttling path >> in aspeed_vuart_handle_irq(); moving it to the probe function is a >> slight consistency improvement and avoids redundant reinitialization in >> the interrupt handler. It also serves as preparation for converting the >> driver's I/O accesses to use port->port.membase instead of its own >> vuart->regs. >> >> Signed-off-by: Zev Weiss >> --- >> drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c >> b/drivers/tty/serial/8250/8250_aspeed_vuart.c >> index 9e8b2e8e32b6..249164dc397b 100644 >> --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c >> +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c >> @@ -349,11 +349,9 @@ static int aspeed_vuart_handle_irq(struct >> uart_port *port) >> struct aspeed_vuart *vuart = port->private_data; >> __aspeed_vuart_set_throttle(up, true); >> >> - if (!timer_pending(&vuart->unthrottle_timer)) { >> - vuart->port = up; >> + if (!timer_pending(&vuart->unthrottle_timer)) >> mod_timer(&vuart->unthrottle_timer, >> jiffies + unthrottle_timeout); >> - } >> >> } else { >> count = min(space, 256); >> @@ -511,6 +509,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev) >> goto err_clk_disable; >> >> vuart->line = rc; >> + vuart->port = serial8250_get_port(vuart->line); > >The documentation of serial8250_get_port() is somewhat concerning wrt >the use: > >https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/8250_core.c?h=v5.13-rc1#n399 Hmm, good point -- though despite that comment it looks like there is some existing code using it outside of suspend/resume callbacks (in 8250_pci.c and 8250_pnp.c). I'm not certain if those would necessarily be considered good precedent to follow for this, but I don't see any obvious better way of getting hold of the corresponding uart_8250_port (or its port.membase). I did receive a notification that Greg had added this series to his tty-testing branch; not sure if that means he thinks it's OK or if it just kind of slipped by unnoticed though. > >However, given the existing behaviour it shouldn't be problematic? > "existing behaviour" referring to what here? Thanks, Zev