Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp747859rwb; Thu, 8 Dec 2022 02:23:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Kc9LUGUkQdM/o2oHmaR8pOxfQvKdCzTnAGfNg/NB8IGABAF1Xbvc8OhIR8LSri2NVTyBC X-Received: by 2002:a63:5f83:0:b0:478:ab05:4da9 with SMTP id t125-20020a635f83000000b00478ab054da9mr18165745pgb.369.1670495007313; Thu, 08 Dec 2022 02:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670495007; cv=none; d=google.com; s=arc-20160816; b=zBLcJY0VfsEy7Xt35u/xxQQZKZAvY6p+nHdsnvnMhVx+XmQbC7thJWN0Xsv1SgrhX+ SGAtbMNY539RRkYAGeUKtr+l9umReoaG1KIxtfZJSTEtVFAZ1cElUDwUVHZg/qsyPVQm Lb38s5MM8Ze/SThm2PqaSJ3HDc8nKieHDEFdLb/WiixW/fxSVQocogLMsjuzrTKD6KUh Yv6eo0MyN9c+mdPyd5jA6EXtk6uU/bxfpuEa+TJERu3smsgXZkaR1h5RBEeSu9XiUhqy ggTXpE9iNyxv/P31h+uXBlmLqZEAtkHYDRUcSrAH90rDEctLqtUYQMVN2F9fT39I8Wqw PexA== 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=Tfshuo/fBDd2mMr7bjtp7pobUzbdctfS+NAoOSOw4HU=; b=CW6vGp7yFu1DyKx+/vzmVsbCtvNqmv0hK9oYY//mBVgC0lf32dj4UKoloZKi9DP/hN BK7aaF3guW0rCOUd5QZCRmJUZevh2xwM8IW94khqeitToj5tk/LXt+zUoPPlwDaugJQ1 0OjKEA3SfrM/brpl06yzbvXddiYcOtjVgnD3WO+yxESU7PX9EUNCZ90ibsLJnZnt1WkH MyjKBO6rgZtNKfPRYDkOYRXm10Kv5cYzYLMkSqmIU7/JbFFHz5B8GMfLwz24Cj+Ox32n 7DerJ1IDcg/LVMvOPaxQXkYinhfFv7QWX7MT8MeEr1thXYeW2peDdR1kqKq6PleF7yN3 9Oqg== 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 j3-20020a635943000000b00476a08c5d9bsi22647328pgm.602.2022.12.08.02.23.17; Thu, 08 Dec 2022 02:23:27 -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 S229750AbiLHKPw (ORCPT + 75 others); Thu, 8 Dec 2022 05:15:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiLHKPu (ORCPT ); Thu, 8 Dec 2022 05:15:50 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78C8CBD0; Thu, 8 Dec 2022 02:15:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 795D88109; Thu, 8 Dec 2022 10:15:46 +0000 (UTC) Date: Thu, 8 Dec 2022 12:15:45 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7f105ff9-cdc3-f98e-2557-812361faa94@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 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)? Regards, Tony