Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp342262rdb; Thu, 5 Oct 2023 07:33:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh9BDdfVb8TUJbIID8FLd/OtbzqaGJh5NZtbhWyOJFP9KteTrPZs2iuxLvCo1F8nKkgkSL X-Received: by 2002:a05:6e02:dd1:b0:351:5acb:271 with SMTP id l17-20020a056e020dd100b003515acb0271mr5091027ilj.1.1696516421554; Thu, 05 Oct 2023 07:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516421; cv=none; d=google.com; s=arc-20160816; b=vWUir3+khxJ+5qO+omzAtk0uylY1pEV3b5Ed/e4FcwRDz+lowu/TcVMvDKS5Xqq4uE 9Ge5jscDxIvgteIF03iqw8qoyCJOCgG/DVDm3XAQMtHN49TdPWNGLeKstSdeW+pLHb0C 0vF+GA7biuE+5+C4Ujq8OfgS9OGv5qoqntKRW408JGVqF+KAT3el2/0pIp0VgrdV8FFs UW6jHmjQEN66fw47GqfCz73RklYwc5j2WFGw41H8p94Iuq47gg69T7Tk0XkqoPhAdKF5 27l0X3gY8790BaKM1OlQKnFU/mczXsJ1KS786Rt394biOtOeqJUF0x7sUBxrGr3OfI+e JTRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IYzc0PFMNIMubbBTN2J0lMv1ly5O7xmsB+qeWi09t2I=; fh=15S+QsWEb5SXkptZcUHGiLPZWTAPBzzFxi7qrZndS6c=; b=cCKqYDAJiP8n01YnuvNCl21hArDzaEDqGtHhrynlbpYIMUpwgG33dJ1CvX7bmF+/Tq XieQa0FqkNSpG503mEZzDuabXp9GtnVMZhb7P3v/hWuzSxa/FoYzJUEbNqDm0pHnqFLG /b/oYaLAAVK938bCA9peuZFgYLNYnjHqHw1sc6ODwzfejrPz+J3Q+T1hQbmjrBHu587S 1YJzXgTtVCL9gTlfKKWLoeV8mT5ZiqMB6s7Qtq/CydFfARP4XlrhYzcayJb5+SISysW5 ywlppHNaAem4QRL4sk0QgIO0vxnVWX7491pwCLkKdBjL76/ihl8+lzUDsR8gORF7cVa+ zRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DaVpxLG1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k4-20020a6555c4000000b00578c914490bsi1576769pgs.494.2023.10.05.07.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DaVpxLG1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 37EF785BF2F3; Thu, 5 Oct 2023 07:33:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235610AbjJEOdb (ORCPT + 99 others); Thu, 5 Oct 2023 10:33:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235180AbjJEObh (ORCPT ); Thu, 5 Oct 2023 10:31:37 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 153C110CE; Thu, 5 Oct 2023 06:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696513714; x=1728049714; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/qcg9z9QjvBBFf2lrrpqt3uTlEPx56wjWhM7cNUhZdk=; b=DaVpxLG1ZwQB4MHj+/gzTu8CSLiAGjp1z7nfUXvDWVUsfBxC9+pPwnxq f2fuCpmdjz1WD0FRy27NWgiox21j32NZDBeAVXEWSamm+jtJT1uBu2u+K TXJR6Vej63HpBHDONxpncO2INswa4IznDOSwWeqZU2krjD0X1ff4u4lV+ CQ8pbtDRLhnbxFcp+JHh9tdd8UcmfZ66BW/2R0yGB4FUP/4HJFwhl12mX +a0GDs2kblAc8s06lMcu2OEXqrWXg8dL8WL21FwaFuKkSsZN99MyoO9Jf Vk/EV5dyAxKoA98FpEAS3cRtJUydqJqemDopwGrKx8yW+nXVHJpM1XB3c w==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="469745820" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="469745820" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 05:00:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="867860677" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="867860677" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 05:00:54 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qoN2B-000000030w6-1WjO; Thu, 05 Oct 2023 15:00:51 +0300 Date: Thu, 5 Oct 2023 15:00:51 +0300 From: Andy Shevchenko To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Dhruva Gole , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Maximilian Luz Subject: Re: [PATCH] serial: core: Fix checks for tx runtime PM state Message-ID: References: <20231005075644.25936-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005075644.25936-1-tony@atomide.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:33:40 -0700 (PDT) On Thu, Oct 05, 2023 at 10:56:42AM +0300, Tony Lindgren wrote: > Maximilian reported that surface_serial_hub serdev tx does not work during > system suspend. During system suspend, runtime PM gets disabled in > __device_suspend_late(), and tx is unable to wake-up the serial core port > device that we use to check if tx is safe to start. Johan summarized the > regression noting that serdev tx no longer always works as earlier when the > serdev device is runtime PM active. > > The serdev device and the serial core controller devices are siblings of > the serial port hardware device. The runtime PM usage count from serdev I'm a bit lost in terminology here. AFAIU there are: 1) children of the serial physical device; 2) siblings (to each other). But may be I mistakenly deciphered the diagram from the previous discussion. > device does not propagate to the serial core device siblings, it only > propagates to the parent. > > In addition to the tx issue for suspend, testing for the serial core port > device can cause an unnecessary delay in enabling tx while waiting for the > serial core port device to wake-up. The serial core port device wake-up is > only needed to flush pending tx when the serial port hardware device was > in runtime PM suspended state. > > To fix the regression, we need to check the runtime PM state of the parent > serial port hardware device for tx instead of the serial core port device. > > As the serial port device drivers may or may not implement runtime PM, we > need to also add a check for pm_runtime_enabled(). Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko