Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2925013iog; Mon, 27 Jun 2022 05:54:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sShQTL4khv+rdfCoikRJ0lGbQ37grH+d0KPiEnIzJcDxCWLXIMH1pe0C8YunYlaTM3xinW X-Received: by 2002:a05:6a00:244a:b0:4fa:ebf9:75de with SMTP id d10-20020a056a00244a00b004faebf975demr14878228pfj.73.1656334479397; Mon, 27 Jun 2022 05:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656334479; cv=none; d=google.com; s=arc-20160816; b=gmagR/ydzxZN2Qy8fRAXoGzJhHZAkuq7zdKqlx55bmXuH8bHvahrSnRiPtq4NoK3OC F/Rc7jNrtIMLlZlywN6NxZCOtNtlDRB2D/n7twBpuP3qGPjhjqA38MKzy0mGUXzQYXlr WV9Rmf/VMyoEyUd697VXwCD/XuO6JSviq00R0yrXl/UHoFSHK5jPkka5zp3mml9kZlxR 9u98tIr5pnsZ7aedi2HKAkcMtSDgu4xD449/xe7ph65ds6TEJGywdPagmg1PFE3N32VU XnJPUWlp3vtjrb1geYHts+t/MEn3n7HXMU0Kt05v1NX4ol3tYAHQaEgL5FWfsq1DNyi9 mJEQ== 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=DeY//XetWXD8OJ+IL6dmlpxJWrl8qZohFOLjzbVFkTg=; b=SELoZV0FyHhNKQEit39qK3BgMXgIZDUqXRAdyCWqK22TlJwpv5/h+VDJ91sEkYack1 j4XqHdJlFv2CVG/xi4ofkN0xpvYDeTw4FFgNp9VzC30SSjfNfx+9YYv1PpO76ts18rR6 RxtLnvVWgGejAkOzWlAv11vpKmWZKZFgeuWi7X/gdpWPFHZg4zi3o5a3U1emVjauGPju ay5FlmEb5LgZhbPzgjSqMqUnmcp5FU9/yTb+//60lSrnsMeITzYRtijQj9jGPcGNzAH5 kofKrupgJobJOm6lVf/KIhKTlBB5Ikrv3y10oEk0xjspx0Tgr+vqkbHuIYpAzYhM8oPg gbdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1Pzi1/gc"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a056a0024c600b0051be84abcc0si15722685pfv.87.2022.06.27.05.54.27; Mon, 27 Jun 2022 05:54:39 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1Pzi1/gc"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235890AbiF0M2m (ORCPT + 99 others); Mon, 27 Jun 2022 08:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235907AbiF0M2W (ORCPT ); Mon, 27 Jun 2022 08:28:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C767363F4; Mon, 27 Jun 2022 05:28:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 92733B81110; Mon, 27 Jun 2022 12:28:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F28F7C3411D; Mon, 27 Jun 2022 12:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656332899; bh=ItpgoEcOuwDEFm+eFghMeChypkh3vU8dbMK2C/PstZk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1Pzi1/gcvjNfq0hTLc2246UYLr1cBss+sqkSAubLHFv005K2lJhz/KgtJq0as3QSN YoyVuLjwAMvFv8mn7Ysasd3NK1lDlUI8ECSp+h1GOD0XAsmSlAXz85XZwoi6GMCPfe eyyHKtgLIi2ya+3tyMXACRZSaq+SGyR9ewTfOLZQ= Date: Mon, 27 Jun 2022 14:16:47 +0200 From: Greg Kroah-Hartman To: Tony Lindgren Cc: Andy Shevchenko , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , 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: <20220615062455.15490-1-tony@atomide.com> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 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? > 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. > 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? 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. thanks, greg k-h