Received: by 10.223.176.5 with SMTP id f5csp2387748wra; Thu, 8 Feb 2018 13:13:51 -0800 (PST) X-Google-Smtp-Source: AH8x226wS2bcnSYny0I3Ede8Uo9FZytHPuIOPJ/YswXY+2O9AFSnVyvp0kYtaUGRW4RO/xnWx5+Y X-Received: by 10.99.146.3 with SMTP id o3mr414106pgd.309.1518124431331; Thu, 08 Feb 2018 13:13:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518124431; cv=none; d=google.com; s=arc-20160816; b=apqpYS1g5Oi0shdqsBH2XchhPy3ohd8Y4slAHejAwltB/IY1EUQ6S/towbtpXUTUB/ SvrsoFmA6hL4JuANuyBXRd1ppNCX59zztLDP4lPR5VZxiG8bQoKFaA4vWPxR9Lu93hHW MNB4NU3o+oQQwJYxluL1orT/Xm44KClSSgnbz/AgGfJJrQ6YMAXk0hkmzf2U5uF0ZcNB BpWbmJeNjJ8/9XVDsnyTfjnzkUGq31uJsovlrDtQi2b5245qmD9ea0KwBxhqfLsPqYbG lpn/aRx2GIu1+OIGuzalSY5pu3oJbX0A7g/6RyqFhpRUYj2EGuTNOOTsXrmeM5+YiRCn 40zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=ZNpdp0BgTk79Cb48PXNOsF5sMWwFqThnX4SPhYExiVs=; b=Rh99rTdhkmghUW8Leo/+faKV1mmAB41WAIzBuaU1aWDuuu8fBj/I1yFL6XMBgqKMVH 4dxsR6B9iCkJm5aJBnR7qt+4szknGuf6QswADSGKY2QOzQZ/PH5C0zD8+smZ8IL/2HN4 fYYJ4pP9rdm7EdxmSS35evuHVrMUo7wJB/u81DaXz8NEWdo66dACO8Q/O5RkN4Dqbaot w0i68ck3tUHWm8eF9p5bm5lNCiZdCo1lOCMKVoOKZlwqayWPB6qCSV4STjlfjnL1Q+vH aqFqKRJY8DewfHAwXVer84EbI3MRj1J1HOrDzHZXY818WPE1s2QATGvxyoRLsuO/tq41 7zcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PHYyV6tt; dkim=pass header.i=@codeaurora.org header.s=default header.b=T4ipzO9P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si415338pgs.499.2018.02.08.13.13.35; Thu, 08 Feb 2018 13:13:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PHYyV6tt; dkim=pass header.i=@codeaurora.org header.s=default header.b=T4ipzO9P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752185AbeBHVMQ (ORCPT + 99 others); Thu, 8 Feb 2018 16:12:16 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47350 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751700AbeBHVMO (ORCPT ); Thu, 8 Feb 2018 16:12:14 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 181C86081C; Thu, 8 Feb 2018 21:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518124334; bh=E/0UnCbf7X9fJT31oDyo3nxSAVOpD+7LUPCDSGgYHRY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=PHYyV6ttZvvm81XVAkcZVtsxhEvQflIPAoE/VPPbXSVTzThWjtojdPO6jqIDrSYbF 6Bx5jz5HUo5Q4ceFt7oOSTuz0S/0IS0Ak9OkjPMOIkb+06MUaBFkYg7hfIvwLYj3tQ 9vNzWaZUm88C0DPsPRDEWIsJeNdDCJzhCmqplfjE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 312FE60314; Thu, 8 Feb 2018 21:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518124333; bh=E/0UnCbf7X9fJT31oDyo3nxSAVOpD+7LUPCDSGgYHRY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=T4ipzO9P4gbUkoJacJ+nKDlC/6ZzPUdY7BopOhAxOAPiBY7fYEkrNf25uhwwdCQhw pzmGaU4NJjUoDSI5ErY6f4dXqUTSdsV2EkICIPaAa68JA65X9a2When4WY/uL1o0Gf mFKYiyrbsKyTjbX2/cHcOjWdlMbsZuuoiKv5NQT8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 312FE60314 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Thu, 8 Feb 2018 21:12:12 +0000 From: Lina Iyer To: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, sboyd@codeaurora.org, rnayak@codeaurora.org, msivasub@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] drivers: qcom: add command DB driver Message-ID: <20180208211212.GA7084@codeaurora.org> References: <20180208195154.3580-1-ilina@codeaurora.org> <20180208195154.3580-2-ilina@codeaurora.org> <20180208204808.GA9676@jcrouse-lnx.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180208204808.GA9676@jcrouse-lnx.qualcomm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 08 2018 at 20:48 +0000, Jordan Crouse wrote: >On Thu, Feb 08, 2018 at 12:51:53PM -0700, Lina Iyer wrote: >> From: Mahesh Sivasubramanian >> >> Command DB is a simple database in the shared memory of QCOM SoCs, that >> provides information regarding shared resources. Some shared resources >> in the SoC have properties that are probed dynamically at boot by the >> remote processor. The information pertaining to the SoC and the platform >> are made available in the shared memory. Drivers can query this >> information using predefined strings. >> >> Signed-off-by: Mahesh Sivasubramanian >> Signed-off-by: Lina Iyer >> --- > >*snip* > >> diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c >> new file mode 100644 >> index 000000000000..050a56da76c8 >> --- /dev/null >> +++ b/drivers/soc/qcom/cmd-db.c >> @@ -0,0 +1,321 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#define NUM_PRIORITY 2 >> +#define MAX_SLV_ID 8 >> +#define CMD_DB_MAGIC 0x0C0330DBUL >> +#define SLAVE_ID_MASK 0x7 >> +#define SLAVE_ID_SHIFT 16 >> + >> +#define ENTRY_HEADER(hdr) ((void *)cmd_db_header + \ >> + sizeof(*cmd_db_header) + \ >> + hdr->header_offset) >> + >> +#define RSC_OFFSET(hdr, ent) ((void *)cmd_db_header + \ >> + sizeof(*cmd_db_header) + \ >> + hdr.data_offset + ent.offset) >> + >> +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) > >I'm not sure if this was addressed before. Why use a custom macro and not min() >or min_t()? > I didn't realize the existance of this. cscope brought out a ton of 'min' defn. Will fix in the next spin. Thanks, Lina