From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 A5329C2D0A3 for ; Wed, 4 Nov 2020 10:44:06 +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 C5D0F20786 for ; Wed, 4 Nov 2020 10:44:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l0g+iNrc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5D0F20786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Yz49t2zQK4lPN4QqsF+9OCTS4vSsa5fQysxgsch2IVo=; b=l0g+iNrc9NOWZTjWlYxRy5pYR QAzGim9N5MBCYAcyzkmqEhu03jz5yDQT7a2ozx6e/U3hGn9IBxOjKzXGchpj2Ki26+31iSIHiCjws 7pkZhTRSjwRdkIbhRzFg61Ex6HBh9y2rtqYRirLHvQelY80wkS/Xgo3TWsV3Fkd++q7i55w0xY06c iCXP+Rn/vqRKm/qZPoPixlBzkGy10dLOn8joU8HJmgioP126OBfuQPE065L4Tjr3CR1p+KANW10ku uYL+sTzdcPRzbvG23Y2W8mD+pLirFgB4GBMM0E01V6KpLvAlW0dPId6DvckBCbzL7vNCOxqREv1aA jFFjWlCPw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGG6-000501-LK; Wed, 04 Nov 2020 10:43:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGFm-0004oA-N2 for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 10:42:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0E9813D5; Wed, 4 Nov 2020 02:42:57 -0800 (PST) Received: from [10.57.20.162] (unknown [10.57.20.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BAEEE3F66E; Wed, 4 Nov 2020 02:42:56 -0800 (PST) Subject: Re: [PATCH v3 09/26] coresight: Convert coresight_timeout to use access abstraction To: Mathieu Poirier References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-11-suzuki.poulose@arm.com> <20201103180329.GB2855763@xps15> From: Suzuki K Poulose Message-ID: Date: Wed, 4 Nov 2020 10:42:56 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201103180329.GB2855763@xps15> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_054259_018455_55942E80 X-CRM114-Status: GOOD ( 23.83 ) 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: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/3/20 6:03 PM, Mathieu Poirier wrote: > On Wed, Oct 28, 2020 at 10:09:28PM +0000, Suzuki K Poulose wrote: >> Convert the generic routines to use the new access abstraction layer >> gradually, starting with coresigth_timeout. >> >> Cc: Mike Leach >> Reviewed-by: Mathieu Poirier >> Signed-off-by: Suzuki K Poulose >> --- >> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c >> index 5baf29510f1b..34c74b05c542 100644 >> --- a/drivers/hwtracing/coresight/coresight-catu.c >> +++ b/drivers/hwtracing/coresight/coresight-catu.c >> @@ -401,8 +401,9 @@ static const struct attribute_group *catu_groups[] = { >> >> static inline int catu_wait_for_ready(struct catu_drvdata *drvdata) >> { >> - return coresight_timeout(drvdata->base, >> - CATU_STATUS, CATU_STATUS_READY, 1); >> + struct csdev_access *csa = &drvdata->csdev->access; >> + >> + return coresight_timeout(csa, CATU_STATUS, CATU_STATUS_READY, 1); >> } >> >> static int catu_enable_hw(struct catu_drvdata *drvdata, void *data) >> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c >> index e96deaca8cab..42ba989a6b5e 100644 >> --- a/drivers/hwtracing/coresight/coresight-core.c >> +++ b/drivers/hwtracing/coresight/coresight-core.c >> @@ -1412,23 +1412,26 @@ static void coresight_remove_conns(struct coresight_device *csdev) >> } >> >> /** >> - * coresight_timeout - loop until a bit has changed to a specific state. >> - * @addr: base address of the area of interest. >> - * @offset: address of a register, starting from @addr. >> + * coresight_timeout - loop until a bit has changed to a specific register >> + * state. >> + * @csa: coresight device access for the device >> + * @offset: Offset of the register from the base of the device. >> * @position: the position of the bit of interest. >> * @value: the value the bit should have. >> * >> * Return: 0 as soon as the bit has taken the desired state or -EAGAIN if >> * TIMEOUT_US has elapsed, which ever happens first. >> */ >> - >> -int coresight_timeout(void __iomem *addr, u32 offset, int position, int value) >> +int coresight_timeout(struct csdev_access *csa, >> + u32 offset, >> + int position, >> + int value) > > There is no need for stacking, please maximise the 80 characters. The function > stubs in coresight.h should also be revised. > >> { >> int i; >> u32 val; >> >> for (i = TIMEOUT_US; i > 0; i--) { >> - val = __raw_readl(addr + offset); >> + val = csdev_access_read32(csa, offset); > > I vaguely remember commenting on this, or perhaps it was on some othe patch you > wrote... Anyways, I think it is a good thing to go from an unordered access to > an ordered access for the timeout function. Yes, you did mention it in the v1. > > With the above: > > Reviewed-by: Mathieu Poirier Thanks, will address the comments. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel