Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp849974rwb; Thu, 8 Dec 2022 03:54:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6c15w9U5oFCBLNX12scDffrVauvhUUxPCzsrAWsCKkFEeA+3HQkDhkcnUwmc7+0so2qXro X-Received: by 2002:aa7:cd04:0:b0:46b:34c:5574 with SMTP id b4-20020aa7cd04000000b0046b034c5574mr46435645edw.175.1670500473639; Thu, 08 Dec 2022 03:54:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670500473; cv=none; d=google.com; s=arc-20160816; b=v9VCK1C7fABTahjzu0HP1ReDlWd3N8AU4JxT7W1B2ZxeCBNqevvF6XkKy05L1TPGbG 37Zj2+jah9e0shIDf1q/2L5tEIE05bgDM9uuN0bI8mE59HRQN2c2wMvc2mbDs+6z5iW0 THur8qQHPtka1DfzOnVUHZfH6iux0r9lvFQfXFUeitvXdYSpKqMGwJtsN4cxngsny/9Z ZgDRANMQ1R/4b6vAl66qPB/aJuf90JrFfG6mwfTi/3GAEgg76ttDFnkYgqQrMdXnM2sF rxTW6Us44FcalaqoLRf8iPqQLspPiE9GnlSkB2Mgdir73M34/baIx22MnIkewNC/Dt5/ hxEQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DrmBteN89uvc0gwkq7J8d1dUOFgafsklD/X/NHqS2GU=; b=m6MCnqVYavWZ9ht0TFrNObRIWeySrUT6SFzfhRSDE278ybCo/HnyhPJclgwtsrpjnf UaDZJoCj99Z/83icS6Ym/aL1qBF8o6SPQHpr3MgbcXKiHqO79bBzm2NAcyhMQ2V+HtJ4 dp/63EldHwmcDSCgkxDjqvGpm2v35UiTMpNo7uddrCTJEH5q0OkTfYm1nRYpnCufg3SK EmXN9shpGruy1a4GHIy2CSX5ISN9BVu1QjQztuUY4nXbJ0sSt4wEUbX2Q70mNbNe2syT 4hgHrS+/oDWAE2kXDFXW0DANkhc+GzBhNfcvPQWV/TAvSNjzK5c3alE8WOzMWifwXRem +XFg== 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 y19-20020a056402359300b0046d594327b8si4388124edc.319.2022.12.08.03.54.14; Thu, 08 Dec 2022 03:54:33 -0800 (PST) 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 S229573AbiLHLNe (ORCPT + 72 others); Thu, 8 Dec 2022 06:13:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLHLNd (ORCPT ); Thu, 8 Dec 2022 06:13:33 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0778D3F05B; Thu, 8 Dec 2022 03:13:32 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4E1EA8109; Thu, 8 Dec 2022 11:13:31 +0000 (UTC) Date: Thu, 8 Dec 2022 13:13:30 +0200 From: Tony Lindgren To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial , linux-omap@vger.kernel.org, LKML Subject: Re: [RFC PATCH v4 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: References: <20221207124305.49943-1-tony@atomide.com> <7f105ff9-cdc3-f98e-2557-812361faa94@linux.intel.com> <3c87186b-336f-6884-a2c-6ee3c9d70@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c87186b-336f-6884-a2c-6ee3c9d70@linux.intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 * Ilpo Järvinen [221208 10:48]: > On Thu, 8 Dec 2022, Tony Lindgren wrote: > > > * Ilpo Järvinen [221208 09:12]: > > > On Wed, 7 Dec 2022, Tony Lindgren wrote: > > > > + ret = serial_core_add_one_port(drv, port); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + mutex_lock(&port_mutex); > > > > + > > > > + /* Inititalize a serial core controller device if needed */ > > > > + ctrl_dev = serial_core_ctrl_find(drv, port->dev, port->ctrl_id); > > > > + if (!ctrl_dev) { > > > > + ctrl_dev = serial_core_ctrl_device_add(port); > > > > + if (!ctrl_dev) > > > > + goto err_remove_port; > > > > + allocated = true; > > > > + } > > > > + > > > > + /* Initialize a serial core port device */ > > > > + ret = serial_core_port_device_add(ctrl_dev, port); > > > > > > How is ->port_dev supposed to work here? > > > > > > ->port_dev is not set until in serial_core_port_device_add() but you made > > > serial_core_add_one_port() call before that. > > > > Hmm do you mean you want to call serial_core_add_one_port() later after > > serial_core_port_device_add()? > > > > Or are you seeing some uninitialized use of port->port_dev (and not > > port->dev)? > > With the other patch on top of this, yes, I did see uninitialized > port->port_dev already in serial_core_add_one_port()->uart_configure_port(). > While that could be solved by removing the pm_runtime_*() calls from > there, I think it's a generic problem because after > serial_core_add_one_port() the port can have anything happening on it, no? OK. Sounds like it should get sorted out by moving the call to serial_core_add_one_port() to happen after the devices are created. Regards, Tony