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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23ADFC77B75 for ; Mon, 8 May 2023 13:35:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234307AbjEHNfP (ORCPT ); Mon, 8 May 2023 09:35:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbjEHNfI (ORCPT ); Mon, 8 May 2023 09:35:08 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F07530E73; Mon, 8 May 2023 06:35:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 6F0548111; Mon, 8 May 2023 13:35:04 +0000 (UTC) Date: Mon, 8 May 2023 16:35:03 +0300 From: Tony Lindgren To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v10 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: <20230508133503.GX14287@atomide.com> References: <20230508110339.38699-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org * Andy Shevchenko [230508 12:11]: > On Mon, May 08, 2023 at 02:03:35PM +0300, Tony Lindgren wrote: > > We want to enable runtime PM for serial port device drivers in a generic > > way. To do this, we want to have the serial core layer manage the > > registered physical serial controller devices. > > > > To do this, let's set up a struct bus and struct device for the serial > > core controller as suggested by Greg and Jiri. The serial core controller > > devices are children of the physical serial port device. The serial core > > controller device is needed to support multiple different kind of ports > > connected to single physical serial port device. > > > > Let's also set up a struct device for the serial core port. The serial > > core port instances are children of the serial core controller device. > > > > With the serial core port device we can now flush pending TX on the > > runtime PM resume as suggested by Johan. > > Sorry, I'm on vacation. But just brief comments below. > In general looks good to me. OK have a nice vacation :) > > -obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > +obj-$(CONFIG_SERIAL_CORE) += serial_base.o > > +serial_base-objs := serial_core.o serial_base_bus.o serial_ctrl.o serial_port.o > > 'objs' is for user space tools, kernel should use 'y' Oh OK. > > +static DEFINE_RUNTIME_DEV_PM_OPS(serial_port_pm, NULL, > > + serial_port_runtime_resume, NULL); > > Maybe > > static DEFINE_RUNTIME_DEV_PM_OPS(serial_port_pm, > NULL, serial_port_runtime_resume, NULL); > > for better logical split? Sure. Thanks, Tony