Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2592365pxu; Mon, 7 Dec 2020 10:16:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4rhRe/U/Xntk2BeNh9mn62n2OpP+gA0zG1OeymWtp/HE4kEwnukVsY2SRoj6TFaxmxtuA X-Received: by 2002:a50:d4d9:: with SMTP id e25mr10888528edj.243.1607365012258; Mon, 07 Dec 2020 10:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607365012; cv=none; d=google.com; s=arc-20160816; b=KmE1U0GuyJlDdgJe3B1VAlejA+i9QpxUeNwFPCi9LPaj4Eyho1N63wRk9Kf2KUsAxP W0dmZhjuD0GwxuyV56odQO4IMyQl1LSyawZEY9atsUETm5oYhztKTL0jAI6xm0ZB9HHR fUaZMGYgN9ppVCAQ73m0rx2mjaHTsY2kMVtNDGo5LlcWpcIaqGSXuUcbDVZxSi2N3Rbx nbS+K3TgVdXX4GQSBjM4+ba0zYfj/ymTI19Iwjc1e8ccDsFeeXP2sxSfnqvV63Axi4Dz 0Vt0WF0jjRtmh5LAUq0PvkDOzF9CR8oXzsDjTP7DWf4UOvAZP3Bme9P/PRZNg82UpA67 mzBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=GM5JYOH/FKUqpm98Q4LGzAP9NniGeon6h7FY522+ZHE=; b=LmgP9Qz5BgeY6MK1EpFDLnnrGqnljR64vMKQUyb8pJ9EhNVddaOafyrluKm/FP7Hc9 CAQRU7iHr/mescgIUfMa5h9vZD79ViTaDelPB06cAqkjzsW18EJ5olbpD/pYBW/B7QkD mIt7xdral12Kb9M7lp6a/cJehcIbDIQtM3u5SjPgz552ye6pzwMBaqluBNSvksjnqdFg uasA4PlW5djmrHjsHuNHKj7cS7d668LnjM3owOMpt7WzAkXA9p5CEtktfgKsabemUaCE MGUj/FLQepJ6XTA5lz8DCvpwFAm8Wssm7AruSV/9OVsS3fOIVILjZnhNEYgkpaR36WIW evSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lmBK9f4D; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy24si6976031ejb.348.2020.12.07.10.16.22; Mon, 07 Dec 2020 10:16:52 -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=@chromium.org header.s=google header.b=lmBK9f4D; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726069AbgLGSNs (ORCPT + 99 others); Mon, 7 Dec 2020 13:13:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgLGSNr (ORCPT ); Mon, 7 Dec 2020 13:13:47 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38BA4C061794 for ; Mon, 7 Dec 2020 10:13:07 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id e5so74858pjt.0 for ; Mon, 07 Dec 2020 10:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=GM5JYOH/FKUqpm98Q4LGzAP9NniGeon6h7FY522+ZHE=; b=lmBK9f4Db/klpOOK6amKYfXRwn0Bhpc2Qm6wRLS1PvYzYV82J6FTgGehulFBGauUkt r6YKp5PGmjxfI7quSk43Vai27uXbE/l+RVQ3Ai6DRRPq1Uo1QEk2XC17EtUzfkRuO1Ez cj7s35KNXA+MGglkf47ugdLxZrfI17LUkXtic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=GM5JYOH/FKUqpm98Q4LGzAP9NniGeon6h7FY522+ZHE=; b=lCFLgSDeM49OT/SaD0DDLjDk+P5yxKZRPZ9pGrzay4R8/JXIJEsC+oRIkw4jI16oqw 8TfYDuV2btLhmzGNoD4Soj8cevDp4ofLXeUyPJ9amK2ACXDYc9g/HMAmMPfHFtNDiK7r Mnxxz2X4VOYzK658SeH2KPpOrmug0eQrFk14SLCWKE+AeC2k78D4T3EPrLFG+KWQKCWq Ge65x9urUrjApQBuu0S7DX6xtpYETlz2e5BR9JDz59fP4p5xyAgT/7h9rxMKlG8k6pUL vVzRxo0jIAYqvVfsSRcSZdipMmt/R8Dmu6Y/GaVFRNw3XgXWvKJBkXeFA404czxip54+ HTdQ== X-Gm-Message-State: AOAM532Ix6zOldTmGPvCxD4rOR2rhyheJnTtbjC5j0DbtKvMc1sdDYlm 2mEmGlP5fSKbq0rgykzKIpzIe8GgzKq1Pw== X-Received: by 2002:a17:90a:a393:: with SMTP id x19mr80366pjp.68.1607364786560; Mon, 07 Dec 2020 10:13:06 -0800 (PST) Received: from chromium.org ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id c133sm3671543pfb.8.2020.12.07.10.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 10:13:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1607321610-25052-1-git-send-email-dikshita@codeaurora.org> References: <1607321610-25052-1-git-send-email-dikshita@codeaurora.org> Subject: Re: [PATCH v3] venus: core: add support to dump FW region From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal To: dikshita@codeaurora.org, linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Date: Mon, 07 Dec 2020 10:13:03 -0800 Message-ID: <160736478377.1580929.9110917864533891175@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting dikshita@codeaurora.org (2020-12-06 22:13:30) > From: Dikshita Agarwal >=20 > Add support to dump video FW region during FW crash > using devcoredump helpers. >=20 > Signed-off-by: Dikshita Agarwal > --- One nit below. Reviewed-by: Stephen Boyd Usually this contains a "Changes from v1" section. What changed? > 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(+) >=20 > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/pla= tform/qcom/venus/core.c > index 5102403..f23923d 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -22,6 +24,33 @@ > #include "firmware.h" > #include "pm_helpers.h" > =20 > +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 =3D core->dev; > + mem_phys =3D core->fw.mem_phys; > + mem_size =3D core->fw.mem_size; > + > + mem_va =3D memremap(mem_phys, mem_size, MEMREMAP_WC); > + if (!mem_va) > + return; > + > + data =3D vmalloc(mem_size); > + if (!data) { > + memunmap(mem_va); > + return; > + } > + > + memcpy(data, mem_va, mem_size); > + dev_coredumpv(dev, data, mem_size, GFP_KERNEL); > + memunmap(mem_va); Technically we could unmap right after memcpy() so that the mapping only exists for the memcpy() and then mem_va isn't "alive" for the dev_coredumpv() call. > +} > + > static void venus_event_notify(struct venus_core *core, u32 event)