Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp273149pxt; Fri, 6 Aug 2021 01:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6JqYjU0qOy0P1zbGdyE0IHkvuDzJiXS+EjiJ9iGNWH0ysBJDDCcnpi7aKna3HGDHZ/9qc X-Received: by 2002:a17:907:76a3:: with SMTP id jw3mr8977765ejc.345.1628238436979; Fri, 06 Aug 2021 01:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628238436; cv=none; d=google.com; s=arc-20160816; b=qWF6oWuPCvU/9aqRFRCblIp7DhrH9wJrBan6uUMlmecP8QnZqNsc95RI29LCKNOOzl KM/cIgmEGssurgBH5hD0BDy+mVTCpXL6Ns6G5kbJbwGeuu1/bj7JqehyE39I756apV+G tbaRaGcNhZyHVmhejPwwSQ0lNkPaEW3GFOo1KwZITKM8/UJvjhNqJRJ47MvQMb3UUic8 HUDYbLrTYPKcaEsDbJftCRMihF1gct0XyJggav2nYUOS5DU2P+eyeDtv7CrRDJOeQ8mp Z7RHhDzX3uob31+eg8RFcSo32YpGjnEJ8RpspdqytyCPxn17q+v8M6RjgLhFCAZMooFx TYjA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PtmZiqrxoL3AsahBdEYG28E+hgOf1TAxf/savTlNyjg=; b=csUJAdyTaYuFmYz/3FL3+LXtOa0mOR5CoX5tGDT98LpWraCrpwCXKdyR9a/ew7KF1M m5WCATds95RP/3QrP4nGbrX8QYKiekyTCWZoUwdtZBwOSuOLEjRDLWwvM350kxOHDGE4 8LKWDhfrBufMGF4Tv3rf6sX4+BkI0Qk62MuMrwCSNyqyImPHfgkE4PWPdk66OvG6FK3E zxZTdiDrTJfhkdKj93ZDYPoPhMvO+XL+OYvs0kZBtA+8s360tX++1UoKnnO0oHIjrcRF jPhbQwYoUVCHiM1boxkRBSE3F5mZnA/dBwFWbdRT7bauzX/8XCng/r86esITuhFeX0hi 18LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0htH57Pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si7787350ejx.595.2021.08.06.01.26.52; Fri, 06 Aug 2021 01:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0htH57Pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244214AbhHFIWx (ORCPT + 99 others); Fri, 6 Aug 2021 04:22:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243136AbhHFITp (ORCPT ); Fri, 6 Aug 2021 04:19:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3CBD61131; Fri, 6 Aug 2021 08:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237970; bh=/1rvwdDxaYdDSPUX7l2VGsQveUviF0T/6kVQQgn0Wns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0htH57Pbp3XeBA8TcB2WVpURVoj977kY9LANxJHms6bu0k/waQmNvx8/GeysCryPN zKOImAIgefD9VRJM0AWqp2opUgwuUbZBdR+bAru/ruxQbeNDICnNduK0f5p+jaTUeF T3XKlfBM1IkiZhP62zlfQLg49xsCxeo/9IkZ8zKw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cristian Marussi , Sudeep Holla Subject: [PATCH 5.10 23/30] firmware: arm_scmi: Add delayed response status check Date: Fri, 6 Aug 2021 10:17:01 +0200 Message-Id: <20210806081113.919744983@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.126861800@linuxfoundation.org> References: <20210806081113.126861800@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cristian Marussi commit f1748b1ee1fa0fd1a074504045b530b62f949188 upstream. A successfully received delayed response could anyway report a failure at the protocol layer in the message status field. Add a check also for this error condition. Link: https://lore.kernel.org/r/20210608103056.3388-1-cristian.marussi@arm.com Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/arm_scmi/driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -436,8 +436,12 @@ int scmi_do_xfer_with_response(const str xfer->async_done = &async_response; ret = scmi_do_xfer(handle, xfer); - if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout)) - ret = -ETIMEDOUT; + if (!ret) { + if (!wait_for_completion_timeout(xfer->async_done, timeout)) + ret = -ETIMEDOUT; + else if (xfer->hdr.status) + ret = scmi_to_linux_errno(xfer->hdr.status); + } xfer->async_done = NULL; return ret;