Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4083403imb; Wed, 6 Mar 2019 05:02:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxUochf9wPoV1uKHnZCJuCyMN2X3Pulr56dROHy92cbFgchBmvJ36BWXeDNy1Yj3n4BbvEP X-Received: by 2002:a17:902:b413:: with SMTP id x19mr6859839plr.256.1551877330963; Wed, 06 Mar 2019 05:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551877330; cv=none; d=google.com; s=arc-20160816; b=p3tDj1QImo8IPs4VwsVkPxUokRbZt8YnNXVtfw39/rDu8aZPkk5i/OobUq9cPIFXOi u3rkqpvkqoRhbEivyTO8qptRv3ody5yavHG3vCEXbimwN+FEqoA5+RAyM+1NqdYDV77w dhdno1ObyJOEulSYQQu+MYYqdMbUnv4ZF8j1VjAbYOJuBL4ZAVXBKpiYC/s8EckTcgR0 ZEyPkit6B9wsoWXF2n7J79kSDoWyguD9/27rcNjR8MYEqNM89NonoLFJFKktu8hPEm2+ iAEQYpStmVhghEsNS4OiiwIHWCTMzd4Ot/R4qjzqKV0aIe8P1Q3mbLJbL3P3m6sdh3IY jp6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8lgpO6Nc3rni5EmlwzR6zMwCapbBbmxD/kLh39iky6A=; b=y1ZKAARK0Hp8iCqQfxlw55k2YQbRgPcQ+ZMUWzohcs3jeKnkXRGvkFk1WhBkW5/UHq n/UBX4BPDWMcQed3wr/oclxDeB1X3gm4HvSSTLhHmohiL6ZSwXaYWkMr43yCZqV+apvD Mw1qc+baLa8qooj3mVpUYJg1ngkReqBBha6dqp/DiV78N+dSaBvADMYZU4jbYx0qnB98 qtSzmvyZs+tyXeET2L6CgTTiuDvdbSsby1lahWAgAnCSSkTOfIvJsOUEYEnSP6rBfFUp 2VsFexe+dhB7OL0I2RY3xTfWi1skKIQd4GThxvLkReuHSMmr6ki1EmARa9F4aVJTq2Rl u+pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bCM5IHx0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si1449184plq.29.2019.03.06.05.01.54; Wed, 06 Mar 2019 05:02:10 -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=@chromium.org header.s=google header.b=bCM5IHx0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730237AbfCFK65 (ORCPT + 99 others); Wed, 6 Mar 2019 05:58:57 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39719 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729405AbfCFK64 (ORCPT ); Wed, 6 Mar 2019 05:58:56 -0500 Received: by mail-ed1-f65.google.com with SMTP id p27so9951623edc.6 for ; Wed, 06 Mar 2019 02:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8lgpO6Nc3rni5EmlwzR6zMwCapbBbmxD/kLh39iky6A=; b=bCM5IHx0ckrPyZj4A+iDvAEUWOtnHcZyOqoXsqk7aKHk5A/60rqAVhPQhGXvOk26i+ NSzNkQIP78O6sidlRmIYGt+wlgX6wpRu4I5N6093eCgBOU1GANiRpz1SDMtZKNJgMF8N yMMWOzJ/h5GsU4MclwWD7+jWKEJLG5mAhqsSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8lgpO6Nc3rni5EmlwzR6zMwCapbBbmxD/kLh39iky6A=; b=RO1xLNez/2yvh+bnJhXDLxOiunwY5gNPUnMcrGr54WrMkiHHhAaaayduG1KIqpV63d Q5igjKnGuE4quj/YnJkSdX/h79PwniunA3P41yOd83OgboQV3z0gZQqrSEZ9KaW2TOYN NgGqaODadQ8cqCdiv2yxks7v378wBsYU5oS0tD2sMvSQNnhAqlfAlhFyro9aZzYGCIwH X+MW5/NCHKS/ErasHO4Q6DnSE8inGvjalxjb3Wn3uyEqL4QZ/BGrZSHEHdce2QJCboUu ugcdY5wjlKsUJEbFhly5LujZAehNiy6+GQQ3ADB8pjfxXzu+830gd7U48H15OyaY7iMe aKRg== X-Gm-Message-State: APjAAAUYCxYHdokeN7KOb9/ZlbSQ4OEIrJfNFsS8xl6eH+wbbtGrPbwi HkFvSf8WKtxjern6ELzaLqzDJVfQEBH3miO5iNgVrg== X-Received: by 2002:a50:bb21:: with SMTP id y30mr22432999ede.156.1551869935168; Wed, 06 Mar 2019 02:58:55 -0800 (PST) MIME-Version: 1.0 References: <1551865835-50974-1-git-send-email-bibby.hsieh@mediatek.com> <1551865835-50974-9-git-send-email-bibby.hsieh@mediatek.com> In-Reply-To: <1551865835-50974-9-git-send-email-bibby.hsieh@mediatek.com> From: Pi-Hsun Shih Date: Wed, 6 Mar 2019 18:58:44 +0800 Message-ID: Subject: Re: [PATCH v2 08/10] soc: mediatek: cmdq: add polling function To: Bibby Hsieh Cc: Jassi Brar , Matthias Brugger , Rob Herring , CK HU , Daniel Kurtz , Sascha Hauer , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , srv_heupstream@mediatek.com, Sascha Hauer , Philipp Zabel , Nicolas Boichat , YT Shen , Daoyuan Huang , Jiaguang Zhang , Dennis-YC Hsieh , Houlong Wei , ginny.chen@mediatek.com, kendrick.hsu@mediatek.com, Frederic Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 6, 2019 at 5:51 PM Bibby Hsieh wrote: > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c > index d3873ab..71c167c 100644 > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c > @@ -231,6 +231,27 @@ int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event) > } > EXPORT_SYMBOL(cmdq_pkt_clear_event); > > +int cmdq_pkt_poll(struct cmdq_pkt *pkt, u8 subsys, > + u16 offset, u32 value, u32 mask) > +{ > + int err; > + > + if (mask != 0xffffffff) { > + err = cmdq_pkt_append_command(pkt, CMDQ_GET_ARG_C(~mask), > + CMDQ_GET_ARG_B(~mask), > + 0, 0, 0, 0, 0, CMDQ_CODE_MASK); All other codes use CMDQ_IMMEDIATE_VALUE instead of 0 for arguments of cmdq_pkt_append_command. Also use CMDQ_IMMEDIATE_VALUE here? > + > + if (err != 0) > + return err; > + } > + offset = offset | 0x1; > + > + return cmdq_pkt_append_command(pkt, CMDQ_GET_ARG_C(value), > + CMDQ_GET_ARG_B(value), > + offset, subsys, 0, 0, 0, CMDQ_CODE_POLL); > +} > +EXPORT_SYMBOL(cmdq_pkt_poll); > +