From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4705EEE14D0 for ; Wed, 6 Sep 2023 20:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236840AbjIFUGs (ORCPT ); Wed, 6 Sep 2023 16:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbjIFUGm (ORCPT ); Wed, 6 Sep 2023 16:06:42 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C231D7; Wed, 6 Sep 2023 13:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694030799; x=1725566799; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Yy84/Xk9VMmXeaZDz9etLBxRJHsaQPXyEOL3fPHQHKM=; b=WNV+hUF/7GnCcCzy0gKb4uiEwPOq1k0K3gRGhwpM55hYh+/iDzS2rFEj ogec0Do4ReYKT8FP5RCItK9//H9NRahBY698Hg+HX5qKsGKyVKSyu/gXu bBYfMZBJuiAb0xMxZLOS/3bhQCliJJUxDLwrN4D26+lXIkBv3N8zibHOZ u4pqxk/hp72vIF9LpkawPpKrJ6r4M6Pl4DxgrYA1KI//NYfZFlu3S+XOZ rSvtgeJzsvwtimZSiKG2iwMOmxBL4soHx8YzdIVz3i+35SXddmfpobHxZ Bd7TWOjAZ1Twk1D5qeNUvs8yoRcuk06LDMAr5M5Gk+wzlC5teMAsW0HB1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="443559590" X-IronPort-AV: E=Sophos;i="6.02,233,1688454000"; d="scan'208";a="443559590" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 13:06:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="811807912" X-IronPort-AV: E=Sophos;i="6.02,233,1688454000"; d="scan'208";a="811807912" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 13:06:36 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qdynJ-00796e-1l; Wed, 06 Sep 2023 23:06:33 +0300 Date: Wed, 6 Sep 2023 23:06:33 +0300 From: Andy Shevchenko To: Stephen Boyd Cc: Mika Westerberg , Hans de Goede , Mark Gross , linux-kernel@vger.kernel.org, patches@lists.linux.dev, platform-driver-x86@vger.kernel.org, Kuppuswamy Sathyanarayanan , Prashant Malani Subject: Re: [PATCH v2 2/3] platform/x86: intel_scu_ipc: Check status upon timeout in ipc_wait_for_interrupt() Message-ID: References: <20230906180944.2197111-1-swboyd@chromium.org> <20230906180944.2197111-3-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230906180944.2197111-3-swboyd@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 06, 2023 at 11:09:42AM -0700, Stephen Boyd wrote: > It's possible for the completion in ipc_wait_for_interrupt() to timeout, > simply because the interrupt was delayed in being processed. A timeout > in itself is not an error. This driver should check the status register > upon a timeout to ensure that scheduling or interrupt processing delays > don't affect the outcome of the IPC return value. > > CPU0 SCU > ---- --- > ipc_wait_for_interrupt() > wait_for_completion_timeout(&scu->cmd_complete) > [TIMEOUT] status[IPC_STATUS_BUSY]=0 > > Fix this problem by reading the status bit in all cases, regardless of > the timeout. If the completion times out, we'll assume the problem was > that the IPC_STATUS_BUSY bit was still set, but if the status bit is > cleared in the meantime we know that we hit some scheduling delay and we > should just check the error bit. Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko