Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2469687pxj; Mon, 10 May 2021 03:52:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIeY2+okaufZn/q+N6P6wcW9tH7mH5cQAzmEFCWoXOSmazVUNUD59af0RBqBxRH9Hhl2dB X-Received: by 2002:a17:906:36da:: with SMTP id b26mr25284785ejc.8.1620643975737; Mon, 10 May 2021 03:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620643975; cv=none; d=google.com; s=arc-20160816; b=Ph9ga4riMkkntyGzdXqa6BEfv5Dpqwsay14D5K4S34DnmFOCOGE1r45rZtxXXYCveW t6vFQwjCqLvWM0k81xFDeXtiv89sOVcy6fUmGv1NiCOfhlAgRbU+Qmyq5t/iXPOSNwKQ p7HQeyML3DxehFAuR6RGKZTmnXB3AN308QHEvK9QA1ZJSq0UXrQZG6NXo5loDyGLgQ5i pmjn+R10ztHV2cotzmmodalAfNz91um3SkKarVc8E6szMA7tuJL43MKmwjyuBrhSGYYl RDcohqU+7kDqs8YrCOIzNDQsifxAb/AeJ8yFpTGeeNRp4lmvPj7GfBsZ8S3EJ3vluIro qNqw== 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=+LpET3cml2tAtHpE7zCQV9IlAVE851garQD8cjss/zs=; b=RzJtDxE8UWOI3fl73G52vOZS9qyHagpv0PQPGsLfn2dWSvwq/0mEjZtFEjYRU0fwya 2fp9WCQSAlECG9EyFwBfSaf07vBbz7S49XmARDNEnfbIzMRiKiRdAhjYX0c4p+gCW2nA x34KPj7VPwRuU1kpnMJxTdB7/5nvhm25lesmZ22x5Xq4fsdoCcNG7rctB3k0fKZyG3Zk C9oOzxpvrbro+Rci0y7G8ddbSthd9gjw/8V3MZ5+5VOcmlUKUbBRUlahZDjw31phylS3 C28+dpZHLyB8yg1/eagYmc9LQppM3lHEfl+226fKifJKUkxsd56GBlfFSBaelrhKQj1n ev9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=srWrbjFK; 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 r1si4462285ejd.259.2021.05.10.03.52.32; Mon, 10 May 2021 03:52:55 -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=srWrbjFK; 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 S233591AbhEJKuQ (ORCPT + 99 others); Mon, 10 May 2021 06:50:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232933AbhEJKkt (ORCPT ); Mon, 10 May 2021 06:40:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D15826186A; Mon, 10 May 2021 10:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642682; bh=5L52u4bfiX8uu+L/FtN7BAOI0ZOjpAOD9bJcsfCuiwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=srWrbjFKonyfYdXfuxFH0zjBD9WJUJfuSK7H9eXiN3FBtvj+vBOfTMqZb1Cb9upPQ +foeulzN7TO4GijPpaB+WOKHokInvpEup5vfo6KdquJ2JsYurJ1jB1kW0YhusTmmIv ARDL7oLgSNlAjiLwWt+OqYEI5w0RhntDxJ9VeUgQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeffrey Hugo , Loic Poulain , Manivannan Sadhasivam Subject: [PATCH 5.10 001/299] bus: mhi: core: Fix check for syserr at power_up Date: Mon, 10 May 2021 12:16:38 +0200 Message-Id: <20210510102004.871308809@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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: Jeffrey Hugo commit 6403298c58d4858d93648f553abf0bcbd2dfaca2 upstream. The check to see if we have reset the device after detecting syserr at power_up is inverted. wait_for_event_timeout() returns 0 on failure, and a positive value on success. The check is looking for non-zero as a failure, which is likely to incorrectly cause a device init failure if syserr was detected at power_up. Fix this. Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up") Signed-off-by: Jeffrey Hugo Reviewed-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1613165243-23359-1-git-send-email-jhugo@codeaurora.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Greg Kroah-Hartman --- drivers/bus/mhi/core/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -992,7 +992,7 @@ int mhi_async_power_up(struct mhi_contro &val) || !val, msecs_to_jiffies(mhi_cntrl->timeout_ms)); - if (ret) { + if (!ret) { ret = -EIO; dev_info(dev, "Failed to reset MHI due to syserr state\n"); goto error_bhi_offset;