Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1767635iol; Fri, 10 Jun 2022 14:43:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQKof3Rq54CsCif0btSQSl2kjnzcRm2YHYBhlPV0MwiAXS9mIqY7qFrJLI6NolVSsLNCFz X-Received: by 2002:a17:907:d24:b0:712:1c03:c04 with SMTP id gn36-20020a1709070d2400b007121c030c04mr5781291ejc.375.1654897385829; Fri, 10 Jun 2022 14:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654897385; cv=none; d=google.com; s=arc-20160816; b=YHcT4Wuf6bUPXV0r1/XmpG1wQNW1fwW1oMSTqIDB7oqb3Q7DyaUrytwJFIUcUTDQlF shcI2m+O3ZKiVwY7YZHv5Lozg9e4hVBBFZbUTKL+kNfBmLAJdulib+PO94E1O70tlPFi xFwhb+fQjOTbqqZPZm81zyNh0iMCTGXFimRseEC3kJNtgF83X2rLGn91v59q65zLtL6z 1ZuTQyNZHg7RX0m9LGV46QQVsrL8ITi278imKmQ/iQQqPxFnvNDEQFF3ibjB/5hODCEI HOYEaIHRXT3C70alsG20Y2+5dJ7OZKQGrCCeLBj6BNuytZTAR1EfjpX7NO84supsNOJB td1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=OmNB8Tcgddvh+DStPNDRj/l3PH4AXfXE+UIaJzFaKDU=; b=f10YNuqr01RleazEC1yilDrR3EZws72TG9Poo96VdqJ14AXSko+ScgsewrQ1RgQYPN kMLrqtivp0O8yjxP1nIubNH61b2J86XlK4ySAgGwKm7gzimti62aVD+EQ8zDn2aL/1kw ghO5PqwgL/EksdenoAvYKBxiFVLsXc2Q7auuep0cSwPH4WP99B1TCEzzkTKaaW//P9cT ZdjK0Rd3tsbsN1fxMXn6UZbndc7771W81VYVL7BRq6a0MiPk0bt9X7SAbu4LcS8HlyV7 NhfcPcqJigsoWPvT6epr9vzsYBVBBQKUHS74nSgHlkWRE0zbSemwquei9GXu4R0z9mty jByw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PeEQYbTq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv11-20020a17090760cb00b0071235bb5185si168600ejc.712.2022.06.10.14.42.23; Fri, 10 Jun 2022 14:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PeEQYbTq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1349900AbiFJUif (ORCPT + 99 others); Fri, 10 Jun 2022 16:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350581AbiFJUi2 (ORCPT ); Fri, 10 Jun 2022 16:38:28 -0400 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC86B30E752 for ; Fri, 10 Jun 2022 13:38:23 -0700 (PDT) Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-fdfe64231dso656713fac.1 for ; Fri, 10 Jun 2022 13:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=OmNB8Tcgddvh+DStPNDRj/l3PH4AXfXE+UIaJzFaKDU=; b=PeEQYbTqlBNmQVeOneHYbMQ2SNrnE9oRTTJBeeItlAIoqfZ+jTsaeM3pXbv4byuW2/ AfTroOiJeqAqHgr6g/W5/8NxXUIGHdQ7BxUq1EEr3ZV/U/uQjrGlxVpcIR3cc5hcxYdl QtdINxF1F92WAg6BPLRNtQNPQFQiMlm1VhshM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=OmNB8Tcgddvh+DStPNDRj/l3PH4AXfXE+UIaJzFaKDU=; b=TsT4sKPDWzVD8r6eCWgqo+Bt4HSBoli+c1QDqR+XfdAx1MnP7GNau4krYDsPfFqPKd 3udnOUQFA4h5WUkcWeV6zgWmbLbqocpoycV6b4s4NxT12RulGkbd4Ri997xDOk+NKdGv Q+fooft2eXYfOkV+rrd0qPlKGQcX4g8cBHezCuJf0oZ+LYBt0fHpamwPaLEdS0Fy1yfM RU5ehIiT0S0tU7ravuJONi7n2u5KN0z7a64KdQfd4xzUikV024fXMz6iCtTYivso0H9S GxGDwKyj5aWM911D+5TcaB0kdcQzYOes+KJpiqQJmzn8f27GaT+jTz0wgN2QCUbLYhlC axWA== X-Gm-Message-State: AOAM532wykGIKMwF/L7FqrZuKB1ymWKQihLA2PDwqYuolTTjStXRRLSr VJzWWkS+dVmPAkFyQXd0fZ7Eakwv88JZ+zFNSPHOsW0fRBA= X-Received: by 2002:a05:6870:b381:b0:fe:2004:b3b5 with SMTP id w1-20020a056870b38100b000fe2004b3b5mr922317oap.63.1654893502377; Fri, 10 Jun 2022 13:38:22 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 10 Jun 2022 13:38:21 -0700 MIME-Version: 1.0 In-Reply-To: <1654775566-21953-1-git-send-email-quic_dikshita@quicinc.com> References: <1654775566-21953-1-git-send-email-quic_dikshita@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 10 Jun 2022 13:38:21 -0700 Message-ID: Subject: Re: [PATCH] venus: Add support for SSR trigger using fault injection To: Dikshita Agarwal , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, stanimir.varbanov@linaro.org, quic_vgarodia@quicinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Dikshita Agarwal (2022-06-09 04:52:46) > diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c > index 52de47f..a0bfb9e 100644 > --- a/drivers/media/platform/qcom/venus/dbgfs.c > +++ b/drivers/media/platform/qcom/venus/dbgfs.c > @@ -4,13 +4,31 @@ > */ > > #include > +#include > > #include "core.h" > > +#ifdef CONFIG_FAULT_INJECTION > +static DECLARE_FAULT_ATTR(venus_ssr_attr); > +#endif > + > +bool venus_fault_inject_ssr(void) > +{ > +#ifdef CONFIG_FAULT_INJECTION > + return should_fail(&venus_ssr_attr, 1); > +#else > + return false; > +#endif > +} It would be better to remove the ifdef in this function and define a static inline version that returns false when CONFIG_FAULT_INJECTION is disabled so that the compiler doesn't have to insert a function call to venus_fault_inject_ssr() when the config is disabled. It may also be good to avoid the jump when enabled by exporting the attribute to the irq handler file. > + > void venus_dbgfs_init(struct venus_core *core) > { > core->root = debugfs_create_dir("venus", NULL); > debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug); > + > +#ifdef CONFIG_FAULT_INJECTION > + fault_create_debugfs_attr("fail_ssr", core->root, &venus_ssr_attr); > +#endif > } > > void venus_dbgfs_deinit(struct venus_core *core)