Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3038978pxu; Mon, 14 Dec 2020 18:51:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxN5K6PY7PxlfuviXNf7ewDH6Lse4b0hicEJfq8aRBc3Tpja1pHGEXp1ktVURKffzrdl4dS X-Received: by 2002:aa7:c44b:: with SMTP id n11mr27073265edr.216.1608000666753; Mon, 14 Dec 2020 18:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608000666; cv=none; d=google.com; s=arc-20160816; b=LpCvJUWijmRP8LSZUvvClnOMVLUjJmMbHreVubPQW41JJLkS4d+lAD6V6CVNDQtbis UwwPhDrPngDyhXFMu/5FRNNha+ISWP5WXeqNHgaUDUVppcucp2+K5jj08uk5lbwupaNO eeZInVKgHVbuV3gTXYKVvs1nYRkZS2OOWGy8h5ZNX/VR+lmWLyAdD+KUEWQ3tXhwTZjn gnQEEsL9Ia1vFxbnbqj/FaDxiXBvRFKPNrlct5hNikId+Nm94yxgves6+2uxVcbit0Af WlwQ3VCIy349A24KHh5kfTnoZ0cAkDEE6tT1njYLkAEkI/x4ZNSS0ge1QBzO3f2qQZH6 3ZrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=OE9Bb/mebGq5IQ0pCbTX8QkKgB3rp/03lLTqI0xRKXs=; b=rgiFKJvnB8mvQixk7wzppKWOaeL2w1Niq3YD8VOtg0rlmKro3P0qtI37fY3tbJhbph roZtdXZkcWlsl00FK/55LTmdF83LZKZN6IOPwzWUiDE69Ljsw8CDlE0NhwkmmgzSH9F/ C95VFeRqljDfzFaEtWY5qP1nKqTRcVMGdT4JUY3TOHyyjjjSdt++L6YRkkVjIYc8f9OV 5lFTFe5Ed3VIXgB/vx8eIisPrzqwcEk7hwC8OZFYA9Uom1SLnmHNkFXWVTbLfFpNHzY4 jkz8fnv+OwX8dWDRKAxYNnnduWTpGqxew7XKgyHwB1D/29ahjknqfhsrKHi0rQgAGoFD 4u0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aRJ8lCan; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si166391edp.56.2020.12.14.18.50.43; Mon, 14 Dec 2020 18:51:06 -0800 (PST) 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=@linaro.org header.s=google header.b=aRJ8lCan; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbgLOCZ5 (ORCPT + 99 others); Mon, 14 Dec 2020 21:25:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727677AbgLOCZb (ORCPT ); Mon, 14 Dec 2020 21:25:31 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 474B8C0617A6 for ; Mon, 14 Dec 2020 18:24:51 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id v14so15482175wml.1 for ; Mon, 14 Dec 2020 18:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OE9Bb/mebGq5IQ0pCbTX8QkKgB3rp/03lLTqI0xRKXs=; b=aRJ8lCanJ+XgPi264EPRH8ikBySk1KRXkEP+4pqT257TrDqvg0P0BLjyx8UI1KOa6H arfSX+iKDTpsyBHWViuh9chb79KswbRPtTNr2Cf7qtDkPnEXp9wZow00eemuTIGZbRvm ss5IHW0OQEO5ZJhRjVamy0bgWebWVzkM1KJrrKiF7hfFaKvrpDgHKkQmt9SBd5/GkV08 0lPO6DNlOPMQlI1z1OBN9MtXumSiFLYeTPdf2wN/otpQk5OT2EJjq/BOFBHWiVUEGbzW vJKYfRvq3LMoR6oG2sm480rHk6aYiXZPoKs/eqz/kQNy8vBYpAuSDhiiOry87KQT0TEq BZ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OE9Bb/mebGq5IQ0pCbTX8QkKgB3rp/03lLTqI0xRKXs=; b=noyWWvaim6CNfpZgYvOfNLNcpr5eK6f+lWZUWWOot9U9DIAg4TE6bprR69r61m275K U/voYrsySaFwfn9E9pJSAeDeUN/DamNE9dbkx/x8DUiHvonjg7t5Kij/JbrVUgUVxsim OeSlb0IjmV0A+bijjfofCiBwiq76ueaoJfj5SRIKT/+ID2sEKq+Eq1E5Kv78cHLxNqay +HU/NXHYBPgWDrvDyQXlwef9Fq1QlxmMTlH99txNRH4pS/AEsj9An4e1leNxmQ1M/0E0 pbdaMLJjJRk454Ke+HCidCEFVNko9X9CjLRVrpw/SrOJ3289O13IbiVj1/w9R5yk+Jiw Yv8w== X-Gm-Message-State: AOAM531pYtJFSyM3oWG0DEyTMmRP2yKVCysNK9+HXlx1i4kEVVyuDCzE nEcR1z5OmXmZL+rr7REhdnFfdg== X-Received: by 2002:a05:600c:274d:: with SMTP id 13mr30751217wmw.77.1607999089909; Mon, 14 Dec 2020 18:24:49 -0800 (PST) Received: from [192.168.0.3] (hst-208-199.medicom.bg. [84.238.208.199]) by smtp.googlemail.com with ESMTPSA id 89sm36734823wre.51.2020.12.14.18.24.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Dec 2020 18:24:49 -0800 (PST) Subject: Re: [PATCH v4] venus: core: add support to dump FW region To: Dikshita Agarwal , linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org References: <1607951031-12980-1-git-send-email-dikshita@codeaurora.org> From: Stanimir Varbanov Message-ID: <3afbf03a-50ec-9b00-d11b-574ce9c05bb3@linaro.org> Date: Tue, 15 Dec 2020 04:24:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1607951031-12980-1-git-send-email-dikshita@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/14/20 3:03 PM, Dikshita Agarwal wrote: > Add support to dump video FW region during FW crash > using devcoredump helpers. > > Major changes since v1: > - update the name of function (Stephen) > - store start address and size in resource structure during > probe and reuse while dumping (Stephen, Stanimir) The changes should go to ... > > Signed-off-by: Dikshita Agarwal > Reviewed-by: Stephen Boyd > --- ... here > drivers/media/platform/qcom/venus/core.c | 31 ++++++++++++++++++++++++++++ > drivers/media/platform/qcom/venus/core.h | 2 ++ > drivers/media/platform/qcom/venus/firmware.c | 3 +++ > 3 files changed, 36 insertions(+) > > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c > index bdd293f..2ddbd36 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -7,8 +7,10 @@ > #include > #include > #include > +#include > #include > #include > +#include drop this leftover. > #include > #include > #include > @@ -22,6 +24,33 @@ > #include "firmware.h" > #include "pm_helpers.h" > > +static void venus_coredump(struct venus_core *core) > +{ > + struct device *dev; > + phys_addr_t mem_phys; > + size_t mem_size; > + void *mem_va; > + void *data; > + > + dev = core->dev; > + mem_phys = core->fw.mem_phys; > + mem_size = core->fw.mem_size; > + > + mem_va = memremap(mem_phys, mem_size, MEMREMAP_WC); > + if (!mem_va) > + return; > + > + data = vmalloc(mem_size); > + if (!data) { > + memunmap(mem_va); > + return; > + } > + > + memcpy(data, mem_va, mem_size); > + memunmap(mem_va); > + dev_coredumpv(dev, data, mem_size, GFP_KERNEL); > +} > + > static void venus_event_notify(struct venus_core *core, u32 event) > { > struct venus_inst *inst; > @@ -67,6 +96,8 @@ static void venus_sys_error_handler(struct work_struct *work) > > venus_shutdown(core); > > + venus_coredump(core); > + > pm_runtime_put_sync(core->dev); > > while (core->pmdomains[0] && pm_runtime_active(core->pmdomains[0])) > diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > index 3a477fc..b37de95 100644 > --- a/drivers/media/platform/qcom/venus/core.h > +++ b/drivers/media/platform/qcom/venus/core.h > @@ -178,6 +178,8 @@ struct venus_core { > struct device *dev; > struct iommu_domain *iommu_domain; > size_t mapped_mem_size; > + phys_addr_t mem_phys; > + size_t mem_size; > } fw; > struct mutex lock; > struct list_head instances; > diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c > index d03e2dd..89defc2 100644 > --- a/drivers/media/platform/qcom/venus/firmware.c > +++ b/drivers/media/platform/qcom/venus/firmware.c > @@ -201,6 +201,9 @@ int venus_boot(struct venus_core *core) > return -EINVAL; > } > > + core->fw.mem_size = mem_size; > + core->fw.mem_phys = mem_phys; > + > if (core->use_tz) > ret = qcom_scm_pas_auth_and_reset(VENUS_PAS_ID); > else > With those fixes: Reviewed-by: Stanimir Varbanov -- regards, Stan