Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp599876rwb; Wed, 16 Nov 2022 05:20:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6yZ36jHdPOU6k7jhxB25ecmfmY4MGsrM7Uu+/G6twUmvrgup6rMeNbQhmVhFfXmp+NFumP X-Received: by 2002:a63:1e05:0:b0:434:911a:301 with SMTP id e5-20020a631e05000000b00434911a0301mr21083142pge.50.1668604827136; Wed, 16 Nov 2022 05:20:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668604827; cv=none; d=google.com; s=arc-20160816; b=BaE/SrLlsVLs2f0eUPaWa4ar7APoNs5U/t0Xz5/tO2N5bYPSUpIOhEcT7JUT6zxx6l FXKFbM+3neyIStd2bcBT6+ZBaPdzZAinQUMWNWmdheuvE40tvybHqMgmAYjNn/IGL2x/ zLAegRS4UG2B/uxMQT0PtdG2+q/0ARYaBPpK46WNGPPxTvlQnXfS/OYmaRuHbeHhzRTf v7iNkbqvHYnb8v4fGuGFBJZfctfLGbscZWqJfN8s6VhZS7zVcQ7AvSR6KqD34Jery00W pcVwZA18Wk6IT5erl9WUuXU8EunhvP0ENYBuKr5WsUMVgqGXjowSEHFr6ghuTAoPpxh9 ZFfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=U8Pw6SePtdCMlgge0LehNEuPn+qhyroschFwPM3hUME=; b=gHijx3e0FVBRYL9tqGcPFLaQMl0SRnRVmPYQk+FOrgEec1XU37bErDITenFnuCU0X/ N94wGZR6IcaudVWCMkhkVZnkZwHWoyc0ynRz9xUsazTMD3iX6js4LMKSXZ5n4XzlMmTD ezS45E91Vvx6voMtHc0J6BpybUI8auT93K5Ws+6ZNjlCX8BClLygoj0u1cKSCl+jxoyZ RX3lPOFkO2YNboAsNRcBwrpBT40W0cyfAt17DNMRmK3JY6Sx0cm8Fn9ciebVPX5dYVDj eUqbHdsHwUAoaBHnoY4J59uAX381TqWC75JP88LL4+hxdpMd+XbtYOFXVj06K8VkgHJh cY0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dGXWgUoO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a632307000000b0046ff35fa651si15097404pgj.181.2022.11.16.05.20.15; Wed, 16 Nov 2022 05:20: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; dkim=pass header.i=@intel.com header.s=Intel header.b=dGXWgUoO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233574AbiKPMsM (ORCPT + 91 others); Wed, 16 Nov 2022 07:48:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237640AbiKPMsH (ORCPT ); Wed, 16 Nov 2022 07:48:07 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 036BD1FCF4 for ; Wed, 16 Nov 2022 04:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668602887; x=1700138887; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=x5iIiz9jywgrUG1nuX5QXt7YbSQl4qoJ01nGzaWkFck=; b=dGXWgUoOGijwU3F3lBtGuynEaChILNhXCYRQ5NqguJH/PnB96ZEzLqeW THShnniav/NCgd1l553GPhhuhmc6alDq9aMuWjQcBj22e0GKCQa0YO+9W Gw1B7azlNvV5PHGEHwWcjhVLQc0rrXmw+YzZfs1guZnJFj5YtmTvA2qek KR4EPfEYVjZtaV/pmxmC0a6LVY965Mcw268MvZWm7PejobFFBs8pj7JhO j1ZqeWlU00sjJwPieDdCIRBe1qIhhSUegOF4kXpdQDti1fMXMNv+J41LO rNyq/d6KXeKiG/z48rhwavCcJ0xPIiZslz7zn1miZD7/Xvz5sMAZf+j8t Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="292240421" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="292240421" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 04:48:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="633618112" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="633618112" Received: from sannilnx.jer.intel.com ([10.12.26.175]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 04:47:46 -0800 From: Alexander Usyskin To: Greg Kroah-Hartman , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin Cc: Tomas Winkler , Alexander Usyskin , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] mei: add timeout to send Date: Wed, 16 Nov 2022 14:47:33 +0200 Message-Id: <20221116124735.2493847-1-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 When driver wakes up the firmware from the low power state, it is sending a memory ready message. The send is done via synchronous/blocking function to ensure that firmware is in ready state. However, in case of firmware undergoing reset send might be block forever. To address this issue a timeout is added to blocking write command on the internal bus. Introduce the __mei_cl_send_timeout function to use instead of __mei_cl_send in cases where timeout is required. The mei_cl_write has only two callers and there is no need to split it into two functions. V2: address review comments: - split __mei_cl_send and __mei_cl_send_timeout - add units to timeout KDoc - use MAX_SCHEDULE_TIMEOUT to squash wait to one macro V3: - split the state fix into separate patch - document define unit - expand timeout KDoc Alexander Usyskin (2): mei: add timeout to send mei: bus-fixup: change pxp mode only if message was sent drivers/misc/mei/bus-fixup.c | 14 +++++++++----- drivers/misc/mei/bus.c | 22 +++++++++++++++++++++- drivers/misc/mei/client.c | 20 ++++++++++++++++---- drivers/misc/mei/client.h | 2 +- drivers/misc/mei/main.c | 2 +- drivers/misc/mei/mei_dev.h | 2 ++ 6 files changed, 50 insertions(+), 12 deletions(-) -- 2.34.1