Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp538621pxb; Thu, 23 Sep 2021 05:49:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgRW1TI7JgfFBiOEyFOuy6gQTSkQg7mXfZ79TtRe6K4nxd2nDRHPM8psyIJumiKY7i1A0p X-Received: by 2002:a17:906:2bc7:: with SMTP id n7mr4681705ejg.238.1632401351797; Thu, 23 Sep 2021 05:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632401351; cv=none; d=google.com; s=arc-20160816; b=Kvx8btefBnlimyjLjkLYv09eNdrlvLuDRKHXkhQru+oRztxPpXydfGAG4WcnkxqHHB CzBxyrfNLrseKwyTM9GO8ROfDlppmlWViBAY1lnw6egQ2Cj3ymOP/CYOfRMTCdOpxb+k JY4gCdyOlxHxmvQv0N3Ivu6i4vud6PDMBCdlE51JWk1w5ln2hzd9Hoko3pCiA5jesZRq i7u8E49RPvQGplxhf04kWe6vDTMgtYH0oYar+6USxcGNz2tzV9MfILoGnYZ2zYL8kexX D1DghuQMlt6AlM3Z40GoHqcphqvQ7Fus6NPkjI6XhWif953uy6Q2lPd7TaCI1/G1jDdw 3rSg== 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=MOEoOm0A6Knk1Gx88rLXlWQqwc5poz0/5WU4cVxmfVc=; b=xkoxnXkPHJB63hD3HOk0481XJOixNmwSBlNVBOGYii/vpuLAK3Mne0xE7IcEOLv+ib LgfGUtiRFHryYbnp9HIXaxKejq1Wk4fJ7gPPw/UDWB3Ygnf3qFDoe+4YIWipG/XGBdrB eqUVYuI8Pd46nvHtUUQvHcbrB+Nws//TsiBj+16oO3Uf9s1tF11UTJ1Duyz7/BB+gJ3a 1NZxyPv6tYkQWVWW6z0j2sA96dV4HWfdI0+cIOLuVdUlY6OL6/EypC0MqeY2AT7I4LUe EbkpINm7PWZKxjQpPV9fx8WW1Qg0AoBV9Rng3rcNDQkRp/Dxn6KpPs4RxjO5Xb6lM/kl 8dRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EAMMIvVO; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc1si6304216ejc.377.2021.09.23.05.48.37; Thu, 23 Sep 2021 05:49:11 -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=@kernel.org header.s=k20201202 header.b=EAMMIvVO; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241081AbhIWMsV (ORCPT + 99 others); Thu, 23 Sep 2021 08:48:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241090AbhIWMrY (ORCPT ); Thu, 23 Sep 2021 08:47:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D9D06115A; Thu, 23 Sep 2021 12:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632401152; bh=MOEoOm0A6Knk1Gx88rLXlWQqwc5poz0/5WU4cVxmfVc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EAMMIvVO0qp0vY0Vp9vAxvSbYybtNM3d6vzy+t/43GrnCw0mncqpK4bLiTm/8kCdl VjZQSg/zSvCoQFx3H9X/9ub9GHVKCN206xXyXEevjxX0XV5zJ/tVsEBu7qPr7Bawjo DcbkKNaNSc8LDd9cqokx1CEEyPFjBmRq5Hb/gi4LCYzlyFsYyfJA82t4lcCSzrlgo+ jeJaN/eCFzQV0WFEydlm5e1H5ZYhPlwA/+/pS/PqmEAxPPryp7ofzRfkXnYVSs2E56 dNX17V7bAG+D8/ywwGfUTw6YdDV4V6xsB0fkV4cmvTWRySFmRpX5E3gy+ykk+XID/p 5pH+XcgKYwsLQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1mTO6s-0001ay-7w; Thu, 23 Sep 2021 14:45:54 +0200 Date: Thu, 23 Sep 2021 14:45:54 +0200 From: Johan Hovold To: Tony Lindgren Cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] serial: core: Add new prep_tx for power management Message-ID: References: <20210921103346.64824-1-tony@atomide.com> <20210921103346.64824-4-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921103346.64824-4-tony@atomide.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 01:33:43PM +0300, Tony Lindgren wrote: > If the serial driver implements PM runtime with autosuspend, the port may > be powered off for TX. To wake up the port, let's add new prep_tx() call > for serial drivers to implement as needed. We call it from serial > write_room() and write() functions. If the serial port is not enabled, > we just return 0. This isn't right. If there's room in the driver buffer, there's no reason to not accept those characters. It's the drivers responsibility to resume writing when write() is called and that me need to be done in a runtime resume callback in case the device is suspended. No need to be patching line disciplines for this. Johan