Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3499367pxb; Mon, 9 Nov 2020 12:51:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0f77MO3oy6KQ/A9RMEJ8d81UBZKJPihiugvU21U8T9Jx0Soz/n/Ta4GJ4V9HgGyBS433W X-Received: by 2002:a17:906:a108:: with SMTP id t8mr16641137ejy.435.1604955069016; Mon, 09 Nov 2020 12:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604955069; cv=none; d=google.com; s=arc-20160816; b=K1jvNxxnoAECwn2HrkTznLf/5fph+so9/Tg9W1ugtCCRQNg/xVoJxCt3ViGkdnJxSR 1bQhLXuwUZ50LhrJQH7lUvECPvWjehs0sZ+Fcn8KVO/hHXxOk9dqhnWzSKdMr+cyC0j/ aOTTFIAKRDVdG/efJv2+F8u2dnAx1kqEfiZqnqbIJy08yOAHooyI3idcvU7sVByud7lU A/80vdGeAXdUvMnHwrN/kmYrcpo4c4g2GKIDAleR0bIQO8VdM8+P9J41SPql2mY22oMG Kb1rQG8CSfDknRcGZRN4OBtxFQ4/5N8pJwi10VZryvjy6gePTTSYlmu/DX+oLOe5nGPl O8RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Iin0vDUK3sevQI2bAvaPfD3H/W4vZ+Pqy7XQDqW23fY=; b=exm0T7VehI6Piz6OOTGCBrZlH9P3M4FWLxofFTChzambzNFiBg6WF0meQJVPkixZ+U j2+aH2yDMfSkaQsC+gZAHcUqx8fmpjDNSc0GAvNwpGuSEC4GHfQ6+kzzzbHm8KLQ6lVF Z/S43ASd90U6us5q45Zh+KfItE5L1ppAD54NrZd3n87T8rPBIkmeFqD9TvccsqcpbvF1 Ay5uDVeKgHUlP2Et3bVlzUkWQnm0EgssSJmVcelMvUwkkPQt207vd9xMo3sB3tON9E0N wNZ2/3pm+TlIB3gysgrrx6Mf6QxA7NDFPqPTaR8EIlewOOKX5L1E8ymOdrFNxJThUuOR yeaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DOFz7xZ/"; 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 be25si8015078edb.288.2020.11.09.12.50.46; Mon, 09 Nov 2020 12:51:08 -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="DOFz7xZ/"; 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 S1729777AbgKIUrB (ORCPT + 99 others); Mon, 9 Nov 2020 15:47:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729452AbgKIUrA (ORCPT ); Mon, 9 Nov 2020 15:47:00 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A397DC0613CF for ; Mon, 9 Nov 2020 12:47:00 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id r186so8177997pgr.0 for ; Mon, 09 Nov 2020 12:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Iin0vDUK3sevQI2bAvaPfD3H/W4vZ+Pqy7XQDqW23fY=; b=DOFz7xZ/ueIU8DDLtiktNgoKvoTu7cz/YyeBYMzuuQFVEfvPWbAm8Djo1KFovcE1gU MG+zMJVNHqmMpmxbHm9g3E3Vqc3HnqQlL2YNtnbvK23DkvRKTUgGgOqFdUbDhlsZv4nf Ui8fDrJIbijZ+JqXK64ym4YMLl4X4bH5i0lcRED8B+ZnGjZK0QJ0lvwD8PDEJcYY7Ptg pJzjgrqN1sRaB0OZfukknG0QzBwzkK/oLsCC6M24Gh1p4+p1Ep8QKQRLa+y82/fu692e pvjW2sf4FhxhfuEcDrK7QXoULZDbNDEUumn1f65Ws+2CsTdmBnyuDaEuerVk0s5J3H6Y U3Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Iin0vDUK3sevQI2bAvaPfD3H/W4vZ+Pqy7XQDqW23fY=; b=jcxwCR9ZbyuYpDKBkWm7Ycg8rW4b7naWIqepuvyYhvxjg53cpkTjLeWS8KkARR/6Y1 EC9PKdi5dzhhuhn1JRQaDlU8JKxBMC99gG/TDSpM9lc1NQXGWuUao7/xKl5drOWuCq7Z qNF6Z0az3YgwNn4ru9NlEk0X/xEftJUao9akyPlbhE6VbhyL1siojhYGRBqC+9pUVkA5 inPwU/4lE4q0aOjJyFihcHksQA0ikw8DKzpw4TK/1tFDOH235AcA8Iu2nRM4zExNkrV2 BeYoyBOKv5yUhUjDSIAlqS/FF7CSUChRjr2GCoTpVf0MYt0pKTLUSzLJuegnJRaxT56M noIw== X-Gm-Message-State: AOAM530hWmCLkLqWmi1BysnEZ06Z5J6PmqNwMwZ2/NITZjCm2/WYb16X aMG+nbRkzo9q2X0ZJlpummVuzA== X-Received: by 2002:a63:3202:: with SMTP id y2mr13744540pgy.97.1604954820247; Mon, 09 Nov 2020 12:47:00 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a24sm12294500pfl.174.2020.11.09.12.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:46:59 -0800 (PST) Date: Mon, 9 Nov 2020 13:46:57 -0700 From: Mathieu Poirier To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 25/26] coresight: etm4x: Add support for sysreg only devices Message-ID: <20201109204657.GD3396611@xps15> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-27-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028220945.3826358-27-suzuki.poulose@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 10:09:44PM +0000, Suzuki K Poulose wrote: > Add support for devices with system instruction access only. > They don't have a memory mapped interface and thus are not > AMBA devices. > > Cc: Mathieu Poirier > Cc: Mike Leach > Signed-off-by: Suzuki K Poulose > --- > .../coresight/coresight-etm4x-core.c | 50 +++++++++++++++++-- > 1 file changed, 45 insertions(+), 5 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index 25fab5513604..50a574228866 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1623,9 +1624,6 @@ static int etm4_probe(struct device *dev, void __iomem *base) > return -ENOMEM; > } > > - if (fwnode_property_present(dev_fwnode(dev), "qcom,skip-power-up")) > - drvdata->skip_power_up = true; > - > drvdata->base = base; > > spin_lock_init(&drvdata->spinlock); > @@ -1648,6 +1646,11 @@ static int etm4_probe(struct device *dev, void __iomem *base) > if (!drvdata->arch) > return -EINVAL; > > + /* Skip programming TRCPDCR for system instructions. */ It would be nice to mention that TRCPDCR is not available in system instruction mode. > + if (!desc.access.io_mem || > + fwnode_property_present(dev_fwnode(dev), "qcom,skip-power-up")) > + drvdata->skip_power_up = true; > + > etm4_init_trace_id(drvdata); > etm4_set_default(&drvdata->config); > > @@ -1706,6 +1709,20 @@ static int etm4_probe_amba(struct amba_device *adev, const struct amba_id *id) > return ret; > } > > +static int etm4_probe_platform_dev(struct platform_device *pdev) > +{ > + int ret; > + > + pm_runtime_get_noresume(&pdev->dev); > + pm_runtime_set_active(&pdev->dev); > + pm_runtime_enable(&pdev->dev); > + > + ret = etm4_probe(&pdev->dev, NULL); > + > + pm_runtime_put(&pdev->dev); > + return ret; > +} > + > static struct amba_cs_uci_id uci_id_etm4[] = { > { > /* ETMv4 UCI data */ > @@ -1781,6 +1798,20 @@ static struct amba_driver etm4x_amba_driver = { > .id_table = etm4_ids, > }; > > +static const struct of_device_id etm_sysreg_match[] = { s/etm_sysreg_match/etm4_sysreg_match > + { .compatible = "arm,coresight-etm-sysreg" }, See my comment in the next patch. With the above: Reviewed-by: Mathieu Poirier > + {} > +}; > + > +static struct platform_driver etm4_platform_driver = { > + .probe = etm4_probe_platform_dev, > + .driver = { > + .name = "coresight-etm4x", > + .of_match_table = etm_sysreg_match, > + .suppress_bind_attrs = true, > + }, > +}; > + > static int __init etm4x_init(void) > { > int ret; > @@ -1793,10 +1824,19 @@ static int __init etm4x_init(void) > > ret = amba_driver_register(&etm4x_amba_driver); > if (ret) { > - pr_err("Error registering etm4x driver\n"); > - etm4_pm_clear(); > + pr_err("Error registering etm4x AMBA driver\n"); > + goto clear_pm; > } > > + ret = platform_driver_register(&etm4_platform_driver); > + if (!ret) > + return 0; > + > + pr_err("Error registering etm4x platform driver\n"); > + amba_driver_unregister(&etm4x_amba_driver); > + > +clear_pm: > + etm4_pm_clear(); > return ret; > } > > -- > 2.24.1 >