Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1506711ybk; Thu, 21 May 2020 08:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ80eHMVY0E4ADZAWqcgb5AAzdXLd0KvZcKph52y68b9BKnhChLZ+Bp34Rw9K5AJv/Jje8 X-Received: by 2002:a17:906:b4e:: with SMTP id v14mr4017873ejg.302.1590074912542; Thu, 21 May 2020 08:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590074912; cv=none; d=google.com; s=arc-20160816; b=qqL+2tkTOQzdsu1hvfWxk4D8FT/Nvi6Cq3P5lWPub0D33ky9jKeByq9HqAIdn4GwXg 9DKdAR6A6u6BUmi9M2tmFW00ju2sBb4zT1783imlUCA0B2BdXxzpMfkOJan3gpzo75wE S4q9QvmReARHLwef9yFAnssgp+n7PNsKhVPho8R7Wrp94/eoNPeQzRDfNshnqhrCJBrU 1ReWvo2kO1DzM107DSkQaE6lcvk5yDvhAYQt+8t8hsmY0QJePPqDiuMd0H9GiAlDhiRo /WHvfwao978tZxm57ZZXm0qKXushF6nEb/7chX3YYEJUy7Gpo7Cacuhacg5X8yYZOBAm szXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LYSo8N584tT9rOnnU2YLgA+ftAMtmA/pOekE/Rft5sY=; b=AkvHfJhkH4UL0N2IjrEcZt4AYO7Mn5iDN8TZ57feG88glekz342UI5BERkFOayHTbS WyzylJJBzQawWt24ryY0oEMOF2l1gZuN7/iEpebidIMTs1oGteAZOOS0Onb4jb+9uOMT yP2s/TETK3GkWmQTD8Mc9aoV1mt+2WKoKmykfpT2qOMJoNvfDtHhqN+Aj3fy17xwrm1T n2rYxcg6UlFiea1VUuwtwGAic15wQ+iZY+/g1M6FolnmjN++a0EpZHYeOYXS0VonTvsA uJ5OtCylJi5JqJcXApn7bCnKjCqdCsJ2ISiDPxbT0ffOrHvjM/4UfFtQeIl7R3IaxZVR wJRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eEX+c8UL; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se14si3630903ejb.103.2020.05.21.08.28.09; Thu, 21 May 2020 08:28:32 -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=@kernel.org header.s=default header.b=eEX+c8UL; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730440AbgEUPZ7 (ORCPT + 99 others); Thu, 21 May 2020 11:25:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730047AbgEUPZ6 (ORCPT ); Thu, 21 May 2020 11:25:58 -0400 Received: from localhost.localdomain (unknown [157.51.235.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3C8EA204EA; Thu, 21 May 2020 15:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590074757; bh=qRG8lbmluipgAY768NW15223dzdqeUdbfiaiiG1Jky4=; h=From:To:Cc:Subject:Date:From; b=eEX+c8ULA4bklVxe9vhjkTy5tOkb54z2mq6pGaSGbzm0CPyi7J5Xm5msCsQVevR3I EFu4VN+F2Ueurx/NoMfscmXa/vcmpQcwtfvVReafAQJaoMtA9FPECsnHEsaZ8kal0E 35keX7e1F6FQ38oJahsO3HVWUvI3L4GT9F5d8FOs= From: mani@kernel.org To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, jhugo@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 00/14] MHI patches for v5.8 Date: Thu, 21 May 2020 20:55:26 +0530 Message-Id: <20200521152540.17335-1-mani@kernel.org> X-Mailer: git-send-email 2.26.GIT MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Manivannan Sadhasivam Hi Greg, Here is the set of MHI patches for v5.8. Most of the patches are cleanup and refactoring ones. All of them are reviewed by myself and Jeff and also verified on x86 and ARM64 architectures for functionality. Here is the short summary: ------------------------------------------------------------- - The firmware download was handled by a worker thread which gets scheduled when the device powers up. But this thread waits until the device gets into PBL state (notified using PM state worker). Sometimes, there might be delay for the device to enter PBL state and due to that the firmware worker thread will timeout. So in order to handle this situation effectively, the firmware load is now directly called by PM state worker instead of scheduling the thread. - Return proper error codes incase of error while loading the AMSS firmware through BHIE protocol - The MHI register space of the device accepts only non-zero values for the sequence identifier. But there is a possibility that the host might write zero (due to the use of prandom_u32() API). Hence, a macro is introduced which provides non-zero sequence identifiers and used them in all places. - Moved all common TRE generation code to mhi_gen_tre() function - The MHI host reads channel ID from the event ring element of the client device. This ID can be of any value between 0 to 255 but the host may not support all those IDs. So reject the event ring elements whose channel IDs are not within the limits of the controller. - Limit the transfer length read from the client device. This value should be within the size of the MHI host buffer but there are chances this can be larger. - Remove the system worker thread for processing the SYS_ERR condition and instead call the function directly from EE worker. This is done to avoid any possible race while MHI shutting down. - Handle MHI power off in the state worker thread as like MISSION_MODE. This helps in preventing a possible race condition where a power off is issued by the controller while processing mission mode. - Skip the handling of BHI interrupt when the register access is not allowed due to the device in wrong PM state. - The write_lock of 'mhi_chan->lock' should only protect 'db_mode'. Hence, use it properly in places where it is protecting other unwanted regions. - Reset the client device if it is in SYS_ERR state during power up. ------------------------------------------------------------- Please consider merging! Thanks, Mani Bhaumik Bhatt (4): bus: mhi: core: Handle firmware load using state worker bus: mhi: core: Return appropriate error codes for AMSS load failure bus: mhi: core: Improve debug logs for loading firmware bus: mhi: core: Ensure non-zero session or sequence ID values are used Hemant Kumar (9): bus: mhi: core: Refactor mhi queue APIs bus: mhi: core: Cache intmod from mhi event to mhi channel bus: mhi: core: Add range check for channel id received in event ring bus: mhi: core: Read transfer length from an event properly bus: mhi: core: Remove the system error worker thread bus: mhi: core: Handle disable transitions in state worker bus: mhi: core: Skip handling BHI irq if MHI reg access is not allowed bus: mhi: core: Do not process SYS_ERROR if RDDM is supported bus: mhi: core: Handle write lock properly in mhi_pm_m0_transition Jeffrey Hugo (1): bus: mhi: core: Handle syserr during power_up drivers/bus/mhi/core/boot.c | 75 ++++++------ drivers/bus/mhi/core/init.c | 8 +- drivers/bus/mhi/core/internal.h | 9 +- drivers/bus/mhi/core/main.c | 194 ++++++++++++++++++-------------- drivers/bus/mhi/core/pm.c | 86 +++++++++----- include/linux/mhi.h | 4 - 6 files changed, 217 insertions(+), 159 deletions(-) -- 2.26.GIT