Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp648598pxb; Fri, 15 Oct 2021 13:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqNZwdxw12hLGk8PNBTc4QnNyI2oylw8tn6JKxjrXQlrE7dXVcjNKfhjmgg6Dv7ReNwe2B X-Received: by 2002:a05:6a00:21c2:b0:44c:fa0b:f72 with SMTP id t2-20020a056a0021c200b0044cfa0b0f72mr13190574pfj.13.1634328098826; Fri, 15 Oct 2021 13:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634328098; cv=none; d=google.com; s=arc-20160816; b=Ax7P0gL9ZPpcpsUnQfGX70pJM0zyQZ8uHhEQFGjoGKEXDN6ifPcCV/Y+B8yWauOdUZ Jp7NRp7Uf93RL1t1b2Fn0hiQJCSj4QZRJlP4+0rMzn0q+NzisvszfuHLcI4tSw+R78vH yoj5/XLvGwVv9PwTurkvgBxLuvnHJdJCPdc7qpYoBKZXlehp9FFFs+77HSLY6+IF7UZ+ e45ZiUjtu9oO+xX7r2KS0DE6aQfU2ZMs5BS3FR2RmegKY1Dr5hQNiL5gf3/PCvAKx9Lc A+imbDPEcJfb/5QSIFM6gPjPaSr/XAGeHBggn+fw9PGT6THGaofD5P0L0kF8oInVPjFo FzWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+RYm6WHwxk20rxa8imObpyrIWoPGhtYO3GmlDuIJo6k=; b=BmWR5tkOllFHW6DubKzoFGTtimVHLHlNt43ZwrDPxcPmsJHcASBoeBkiRKsQH+NZac Hp6TpfV9MEd0RgJk7DAGMSwQns5msACXXbamqHJIXW6Q72qLo12zsqDos8toT1h+H9HY zyV4RBK5w27eQlOmLoy6/RqH+6vT/T9oM/TaAK3vLfWmQD/ziFjqF2sys0VlD7AeGpxW +azD/rKLvBzOc9JLCCKR5RUmPMgCRqmYJ9VH8CsrCF/iBVpPVVvpMKjgU6Qc68f5Fr5y 1jSSnP+cgqgFil6JrwLGsuAmYRAYX2okDyp+XiMC1p+EsKKCgnTFwhA0OKH0VHxauekv ReIQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si3645176pgk.421.2021.10.15.13.01.23; Fri, 15 Oct 2021 13:01:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238424AbhJOL2k (ORCPT + 99 others); Fri, 15 Oct 2021 07:28:40 -0400 Received: from muru.com ([72.249.23.125]:44942 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233342AbhJOL2j (ORCPT ); Fri, 15 Oct 2021 07:28:39 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 08AAB80F1; Fri, 15 Oct 2021 11:27:03 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: Andy Shevchenko , Jiri Slaby , Johan Hovold , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCHv3 0/4] Get rid of pm_runtime_irq_safe() for 8250_omap Date: Fri, 15 Oct 2021 14:26:22 +0300 Message-Id: <20211015112626.35359-1-tony@atomide.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here are v3 patches to get rid of pm_runtime_irq_safe() for the 8250_omap driver. Based on comments from Andy, Johan and Greg, I improved a bunch of things as listed below. For removing the pm_runtime_irq_safe() usage, serial TX is the last remaining issue. We deal with TX by waking up the port and returning 0 bytes written from write_room() and write() if the port is not available because of PM runtime autoidle. This series also removes the dependency to Andy's pending generic serial layer PM runtime patches, and hopefully makes that work a bit easier :) Regards, Tony Chganges since v2: - Use locking instead of atomic_t as suggested by Greg Changes since v1: - Separated out line discipline patches, n_tty -EAGAIN change I still need to retest - Changed prep_tx() to more generic wakeup() as also flow control needs it - Changed over to using wakeup() with device driver runtime PM instead of write_room() - Added runtime_suspended flag for drivers and generic serial layer PM to use Tony Lindgren (4): serial: core: Add wakeup() and start_pending_tx() for power management serial: 8250: Implement wakeup for TX and use it for 8250_omap serial: 8250_omap: Require a valid wakeirq for deeper idle states serial: 8250_omap: Drop the use of pm_runtime_irq_safe() Documentation/driver-api/serial/driver.rst | 9 +++ drivers/tty/serial/8250/8250_omap.c | 44 ++++++++++---- drivers/tty/serial/8250/8250_port.c | 39 ++++++++++++- drivers/tty/serial/serial_core.c | 68 +++++++++++++++++++++- include/linux/serial_core.h | 3 + 5 files changed, 149 insertions(+), 14 deletions(-) -- 2.33.0