Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1860575rda; Tue, 24 Oct 2023 05:48:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxYhBNcoA4XVOO2K2miyY1AED9dDkeqCLUD540+wyiCTE4fNputOWr11mJtfQpM3FY7iSj X-Received: by 2002:a17:902:e80d:b0:1c2:193e:1126 with SMTP id u13-20020a170902e80d00b001c2193e1126mr17735033plg.28.1698151729633; Tue, 24 Oct 2023 05:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698151729; cv=none; d=google.com; s=arc-20160816; b=fu2pKQIvU57PI5o/D8+JNGHEImtyCSnFXlU6qfcjBcfpjstlr0V9+dZ73KPBfEJ+2b D8dNmO9z7VFq6ZZFyzj57qrNl983ngy82Q7N/wB8yc6R8srrtgppuVmdaJyPcBokuQRd OcQwB8C+uVgh5JcOgfJWBV2yoga9717KRloijqleSs4B3W/rR17T3LkSAlai3JHEGDEP r2nb2gPcDZ16iqknAqJ0byusZd0VZOc46tYgFviSsERgXU9336FXBKPbtIgR6fiYOXeD 12Y32RbXSMZ6GEot//b4Pzylk0GcQinoHfEZXjK1FzCyJVSzWyTnvcsKBguclbuWsxTf emVg== 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=N8XUAQ1X86UqnzeU/VNsgwId8LNU/X/BWi1vuXRLBjM=; fh=/gL4WBYQzx9MiwB0QMlYuAI29F8Fz/3O6jV9/SRHokQ=; b=P5Xal5KmzImqdYFtFRQPZsWFUKGpNrkrwN2wyU4a2f3ur7WD7uzLUJCjcDUxxRKy/L cfUHYLJJi8G9XESfxJG+JjEweDzY229o/L7d78SBJgnKXUeeMFVvcrBGKcCvK7Vj6RMr DMPZbSnOiULogVFvTqTnM4bJDVVGU6wytdRckfz9GGqi/+BGZEZ8IhSET4RaiHQDfj1I U9AOiw6NiUy9SzXbMBQqaiHLaW+7FRWYhWryjw1xoy1ZYED5NchD9yH32cSrOw2CrRU/ WRJKjI9LZAsF6f9xTgJM+dM+CAS6xTWh6NMe/4TQHQk9Hf53e97LAtl8XTivIQ6XGJJQ CMTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a9nueoFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p8-20020a170902bd0800b001c33d339754si8317783pls.136.2023.10.24.05.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 05:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a9nueoFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 912A18041E9E; Tue, 24 Oct 2023 05:48:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234343AbjJXMsj (ORCPT + 99 others); Tue, 24 Oct 2023 08:48:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233166AbjJXMsi (ORCPT ); Tue, 24 Oct 2023 08:48:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF41D90; Tue, 24 Oct 2023 05:48:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DB66C433C8; Tue, 24 Oct 2023 12:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698151716; bh=LnrL2yfzGVg4sIenkOpUYqQHA/djZgb+WbIlUzSlrJ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a9nueoFl1ofosx00OlKeHdcbGrbWORJpO+SiMaF+Knb+VCDG24zZewxxMTT+D6Mvr jYZHvrFGnt5hjRtgOreucZunIKkCmwQ23hDfzvI74Ggt8rSZIf425uPZpIp7SiK5eO bu3nPbziYKnRsjQpxT+5xKpGnb3eyZtKsdihyHnbURRc2j1dzEGuvtBLNuKD+ErI77 2FEdYIlEeQ5RIs1iOgvuMI0EXnX8dwwtcADLSPI2dR/B7QD/6CiYmr7p6rZl43u0w2 kDXdajp7YyIJkM3VAeURsGk3cmmNhP3ya0526fFlNnTC5pFup1PGVyHSEdol8/ZdRO NsAxkimHrjK4Q== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qvGq5-0005c4-1L; Tue, 24 Oct 2023 14:48:53 +0200 Date: Tue, 24 Oct 2023 14:48:53 +0200 From: Johan Hovold To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Andy Shevchenko , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , John Ogness , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Maximilian Luz Subject: Re: [RFC PATCH 1/2] serial: core: Move tty and serdev to be children of serial core port device Message-ID: References: <20231024113624.54364-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231024113624.54364-1-tony@atomide.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 05:48:45 -0700 (PDT) On Tue, Oct 24, 2023 at 02:36:18PM +0300, Tony Lindgren wrote: > Let's move tty and serdev controller to be children of the serial core port > device. This way the runtime PM usage count of a child device propagates > to the serial hardware device. > The tty device moves happily with just a change of the parent device. > @@ -3153,7 +3153,8 @@ static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *u > * setserial to be used to alter this port's parameters. > */ > tty_dev = tty_port_register_device_attr_serdev(port, drv->tty_driver, > - uport->line, uport->dev, port, uport->tty_groups); > + uport->line, uport->dev, &uport->port_dev->dev, port, > + uport->tty_groups); > if (!IS_ERR(tty_dev)) { > device_set_wakeup_capable(tty_dev, 1); > } else { > struct device *tty_port_register_device_attr_serdev(struct tty_port *port, > struct tty_driver *driver, unsigned index, > - struct device *device, void *drvdata, > + struct device *host, struct device *parent, void *drvdata, > const struct attribute_group **attr_grp) > { > struct device *dev; > > tty_port_link_device(port, driver, index); > > - dev = serdev_tty_port_register(port, device, driver, index); > + dev = serdev_tty_port_register(port, host, parent, driver, index); > if (PTR_ERR(dev) != -ENODEV) { > /* Skip creating cdev if we registered a serdev device */ > return dev; > } > > - return tty_register_device_attr(driver, index, device, drvdata, > + return tty_register_device_attr(driver, index, parent, drvdata, > attr_grp); > } Looks like this patch breaks the wakeup-irq hack in uart_suspend_port(): tty_dev = device_find_child(uport->dev, &match, serial_match_port); if (tty_dev && device_may_wakeup(tty_dev)) { enable_irq_wake(uport->irq); put_device(tty_dev); mutex_unlock(&port->mutex); return 0; } There may be more of these hard-coded assumptions, this one I happened to be aware of. Johan