Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2998833iog; Mon, 27 Jun 2022 07:13:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDoC/AP9uQGq8zF6fsCvy0nyBLotEpBzotYJpFcq5NZ4AeS5S2o/9uG60wXmuoiiJIvi56 X-Received: by 2002:a17:906:d550:b0:726:2b34:2fd6 with SMTP id cr16-20020a170906d55000b007262b342fd6mr12686859ejc.311.1656339181389; Mon, 27 Jun 2022 07:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656339181; cv=none; d=google.com; s=arc-20160816; b=EtdqaRLdBbuEQWkzZj5JZWCi3jsHS8HalTKv1KpHVxqzHTb2H4mFDOGUNt/hMORH9c NpeI+xzZxutbMC1/xIRYfCEsDHpmi3dF3REDc7IW5HyagQL2WBM9zVejME/1RjAI2oeo fdW+5xAIRWnQlAzeMMzU2lUNaPkZ5EjBGRL+hwlPeNXUd3M/woldXXJdBJ7BuYJ+9oc8 GckWVJotQNf8nWRcCl4QYO7D+N2IXcDfVRz1KuI8p1AFXhRdktK5WTExw1HismLDE6OQ ZvJO94nKmXuhwT5/IIzQwjlxgt4PJUIAn5Ph2QeRL4T+IKkMySY0m1Q3i8OHr7/LZOD7 e5QA== 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; bh=Ex2a23T5ZBQnetIHYy7yUq2OJmV0jqOfZ+WXNbcR/4s=; b=I2Z7zm8luJy4z9zu3TVIIIDC10FNLZj0AD/+J6rBlzxUbgVTQe118PgvwQAhqVuE3i T2XUD1HuICATIxNe+8dkVY6ozt8p7Aets9MYoRGebsdXgLavJSTNWT3/96yomMrXi99h KeoNNTq3fHZDyZAQX05pKiE1qiPoG3a6qMsdmNOWLj1lluI+yRoLQE2AXhv01eAl3wSG q4+uGhefHxj41AzGwiUSa5UW6JP8DqYeSh5HTMO4S1okSQvYzdtg9OsetcvEkHIHbP1b fA6u1aNs7qRqs3xrNJUNak4IK1jBb9CHhKaicia7LDPE5seZlm+X6yneTJoWdhXg9iXz 4KNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji22-20020a170907981600b006e8bbf3d88fsi13504614ejc.15.2022.06.27.07.12.35; Mon, 27 Jun 2022 07:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236704AbiF0Nsb (ORCPT + 99 others); Mon, 27 Jun 2022 09:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbiF0NsU (ORCPT ); Mon, 27 Jun 2022 09:48:20 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 73935247; Mon, 27 Jun 2022 06:48:15 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 6ED768106; Mon, 27 Jun 2022 13:43:04 +0000 (UTC) Date: Mon, 27 Jun 2022 16:48:13 +0300 From: Tony Lindgren To: Greg Kroah-Hartman Cc: Andy Shevchenko , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: References: <20220615062455.15490-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Greg Kroah-Hartman [220627 12:23]: > On Wed, Jun 15, 2022 at 09:24:55AM +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 serial port controllers. For runtime PM, we need a way to find > > the serial ports for each serial port controller device. > > > > The serial core manages ports. Each serial controller can have multiple > > ports. As serial core has no struct device, and the serial port device > > drivers have their own driver data, we cannot currently start making > > use of serial core generic data easily without changing all the serial > > port device drivers. > > Really? Why not make struct uart_port a real struct device? Okie dokie > > We could consider adding a serial core specific struct device. It would > > be a child of the serial port device, and would allow us eventually to use > > device_links to add generic runtime PM calls for example. But as the serial > > core layer is not a device driver, driver specific features would need to > > be added, and are probably not justified for a virtual device. > > I think it's very justified, let's not paper over this whole thing by > adding a kref stuck in in the middle and trying to hook up the PM code > to it, instead of just using all of the PM logic that the driver model > already provides. OK. Having the serial controller be the parent device for the port device will make runtime PM work as designed :) > > Considering the above, let's improve the serial core layer so we can > > manage the serial port controllers better. Let's register the controllers > > with the serial core layer in addition to the serial ports. > > Why can't controllers be a device as well? The controllers are devices already probed by the serial port drivers. What's missing is mapping the ports (as devices based on the comments above) to the controller devices. I don't think we need another struct device for the serial controller in addition to the serial port driver device and it's child port devices. > Let's try to work with the driver model here, not work around it, if at > all possible. We never did a full conversion of the serial layer to the > driver core all those decades ago. Perhaps now is the time to really do > that. Yes so it seems. Regards, Tony