From patchwork Mon Nov 16 08:44:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11907775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1148CC55ABD for ; Mon, 16 Nov 2020 08:45:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89FAF21D93 for ; Mon, 16 Nov 2020 08:45:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0DjqTzTk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="nKf4wSaS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89FAF21D93 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=LFROo7z8iTSNfvZoAeOu9xrUhPezPKKvEraWssqp/BM=; b=0DjqTzTkVz4FaEWeDuApZQM++f Mienu7BOWx1ebJywYxaH8bQg19zJjiI2KUFuhbuBwkd4s5m2v96HCgaYJ3YXIG4cg3kJb1yZ9JnZy o4kcVcNSWOIoDKWALs9hxfMgNxUq2dRLYzivFQlb1xi2vZwfv9IzNs41IFtztCICl7IgyldST8o9r TBSZ/VLk2hM7aDjCsOHWVFj5Mqc936AgOPLel+KdQbXbIHn3hCx7He9zmvHMuwox5G1fk+Zog7pZS 1QO7U4EgcY+k3rK/UoeNGxxEs8X6/N2RQe/WuCh/QX0Tkr0Ul1NgQ5ipmlWHV6V32UsUYrOVg7PRd Ig8o8z7w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kea7r-00040V-Cq; Mon, 16 Nov 2020 08:44:39 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kea7n-0003z5-1w for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 08:44:35 +0000 Received: by mail-qt1-x84a.google.com with SMTP id v9so9651365qtw.12 for ; Mon, 16 Nov 2020 00:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=EYm0YpIuSEKXmoOwhp5dqYgsEVKwf0LgB8WVW+JP2iU=; b=nKf4wSaSa1Oa8WDBPXVMJS40jcU8haoimLiQE4LfvJHnlVTCGBPYDFtq64KX0dTsOr obCVwYpP64WhpR0b9chrWC0mfd4H5bO2PsZl1s7Etb/70r1OgMrFl/R8UFeI2/0wMnEO g4wFxUz0iKZ03GJiOe434LYHYNM7zKVuzQPa8861/k3RbQDcbfnPEWeK55g1taexjf4R pUTtXwPqyFjRXYBXQbsichx3gtULikKwqPwEPtE1HHC9JJf64SoJ3+aL24QGVJqswkx9 VY0NY6kk/7z52wHBAFQFqxo7cWHhM5RIGxm2QW/FQcnmRPElsjd4ee/lsZps0rUEJh5y qJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=EYm0YpIuSEKXmoOwhp5dqYgsEVKwf0LgB8WVW+JP2iU=; b=gZkcTQh4eqPjYGNwJe/YZtE/+JBVB3jqXYkuc6f7RqdyqhmiljlBOKRxPdk3etuC/p 0D/R+tPq2Pq70yrZeDjXs2bUE4zMDjKZRIN9AGgRiN3XycALcUCiG/WIqVQARjSv1zrs XkIwTp9cHzxS+UdT/1d6tpcvEliG+GkihMl4sI5niGJGqYE5/t5H/y1zuy7JzxQsFMHb yt2VDsZ6wYfN1n0H4GuaG7toxNdnbxfqnHNerD4oewCPUSAA5kED+zo3xoQUfy7TcSgV L49YmatK+ukDUTBzy6XBxFqBY7CNcoKcVhW4iHMyqD5Ye02Xt4rig6J7HfF0TQRkOlZo cUNA== X-Gm-Message-State: AOAM532lLaMnKT7RW/o7H3sGSi8i6lm9vmP2oDk8dcz+uqDpUy9b0oE+ U7DZc/VqJLZlVQpzNZJ7qAHJc4OFe0lu X-Google-Smtp-Source: ABdhPJzNwWAgPW2u7kRBv4mmNN2RUlmEWb2T+8MS/r1URNN52cr2jtibw6055Yx7UYTLAjL3HZeWEe5EC4RK X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a0c:df0f:: with SMTP id g15mr14565849qvl.19.1605516271856; Mon, 16 Nov 2020 00:44:31 -0800 (PST) Date: Mon, 16 Nov 2020 16:44:10 +0800 Message-Id: <20201116084413.3312631-1-tzungbi@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog Subject: [PATCH v2 0/3] remoteproc/mediatek: read IPI buffer offset from FW binary From: Tzung-Bi Shih To: ohad@wizery.com, bjorn.andersson@linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_034435_154891_23E10F64 X-CRM114-Status: GOOD ( 10.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-remoteproc@vger.kernel.org, tzungbi@google.com, linux-mediatek@lists.infradead.org, pihsun@chromium.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series reads the address of IPI (inter-processor-interrupt) shared buffer from the FW binary itself. The 1st patch fixes a boundary check bug. The 2nd patch skips a program header to parse if filesz is 0. The 3rd patch parses the FW binary to find the shared buffer address. Changes from v1: (https://patchwork.kernel.org/project/linux-arm-kernel/cover/20201113070207.836613-1-tzungbi@google.com/) - rebase on top of some sparse error fixing - update 3rd patch's commit message to the latest The series bases on https://patchwork.kernel.org/project/linux-arm-kernel/cover/20201116082537.3287009-1-tzungbi@google.com/ Tzung-Bi Shih (3): remoteproc/mediatek: fix boundary check remoteproc/mediatek: skip if filesz is 0 remoteproc/mediatek: read IPI buffer offset from FW drivers/remoteproc/mtk_scp.c | 89 +++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 32 deletions(-)