From: Dan Carpenter <dan.carpenter@oracle.com>
To: peter.griffin@linaro.org
Cc: linux-remoteproc@vger.kernel.org
Subject: [bug report] remoteproc: st_slim_rproc: add a slimcore rproc driver
Date: Wed, 2 May 2018 13:18:28 +0300 [thread overview]
Message-ID: <20180502101828.GA9574@mwanda> (raw)
[ This is slightly old. It's a new static checker test I'm working on.
- dan ]
Hello Peter Griffin,
The patch bb6869b21478: "remoteproc: st_slim_rproc: add a slimcore
rproc driver" from Oct 18, 2016, leads to the following static
checker warning:
drivers/remoteproc/st_slim_rproc.c:131 slim_rproc_start()
warn: potential ! vs ~ typo
drivers/remoteproc/st_slim_rproc.c
113 /*
114 * Remoteproc slim specific device handlers
115 */
116 static int slim_rproc_start(struct rproc *rproc)
117 {
118 struct device *dev = &rproc->dev;
119 struct st_slim_rproc *slim_rproc = rproc->priv;
120 unsigned long hw_id, hw_ver, fw_rev;
121 u32 val;
122
123 /* disable CPU pipeline clock & reset CPU pipeline */
124 val = SLIM_CLK_GATE_DIS | SLIM_CLK_GATE_RESET;
125 writel(val, slim_rproc->slimcore + SLIM_CLK_GATE_OFST);
126
127 /* disable SLIM core STBus sync */
128 writel(SLIM_STBUS_SYNC_DIS, slim_rproc->peri + SLIM_STBUS_SYNC_OFST);
129
130 /* enable cpu pipeline clock */
131 writel(!SLIM_CLK_GATE_DIS,
SLIM_CLK_GATE_DIS is BIT(0) so !BIT(0) is just zero. Maybe ~BIT(0) was
intended?
132 slim_rproc->slimcore + SLIM_CLK_GATE_OFST);
133
134 /* clear int & cmd mailbox */
135 writel(~0U, slim_rproc->peri + SLIM_INT_CLR_OFST);
136 writel(~0U, slim_rproc->peri + SLIM_CMD_CLR_OFST);
137
138 /* enable all channels cmd & int */
139 writel(~0U, slim_rproc->peri + SLIM_INT_MASK_OFST);
140 writel(~0U, slim_rproc->peri + SLIM_CMD_MASK_OFST);
141
142 /* enable cpu */
143 writel(SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
144
drivers/remoteproc/st_slim_rproc.c:170 slim_rproc_stop()
warn: potential ! vs ~ typo
drivers/remoteproc/st_slim_rproc.c
158 static int slim_rproc_stop(struct rproc *rproc)
159 {
160 struct st_slim_rproc *slim_rproc = rproc->priv;
161 u32 val;
162
163 /* mask all (cmd & int) channels */
164 writel(0UL, slim_rproc->peri + SLIM_INT_MASK_OFST);
165 writel(0UL, slim_rproc->peri + SLIM_CMD_MASK_OFST);
166
167 /* disable cpu pipeline clock */
168 writel(SLIM_CLK_GATE_DIS, slim_rproc->slimcore + SLIM_CLK_GATE_OFST);
169
170 writel(!SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
^^^^^^^^^^^^
Same. SLIM_EN_RUN is BIT(0).
171
172 val = readl(slim_rproc->slimcore + SLIM_EN_OFST);
173 if (val & SLIM_EN_RUN)
174 dev_warn(&rproc->dev, "Failed to disable SLIM");
175
176 dev_dbg(&rproc->dev, "slim stopped\n");
177
178 return 0;
179 }
regards,
dan carpenter
next reply other threads:[~2018-05-02 10:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 10:18 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-06-07 8:18 [bug report] remoteproc: st_slim_rproc: add a slimcore rproc driver Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180502101828.GA9574@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-remoteproc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.