[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56DF9A1D.8090100@huawei.com>
Date: Wed, 9 Mar 2016 11:35:57 +0800
From: Jiancheng Xue <xuejiancheng@...wei.com>
To: Boris Brezillon <boris.brezillon@...e-electrons.com>
CC: Brian Norris <computersforpeace@...il.com>, <robh+dt@...nel.org>,
<pawel.moll@....com>, <mark.rutland@....com>,
<ijc+devicetree@...lion.org.uk>, <galak@...eaurora.org>,
<dwmw2@...radead.org>, <zajec5@...il.com>, <jteki@...nedev.com>,
<ezequiel@...guardiasur.com.ar>, <juhosg@...nwrt.org>,
<shijie.huang@...el.com>, <mika.westerberg@...ux.intel.com>,
<furquan@...gle.com>, <han.xu@...escale.com>,
<fabio.estevam@...escale.com>, <manabian@...il.com>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-mtd@...ts.infradead.org>, <yanhaifeng@...ilicon.com>,
<yanghongwei@...ilicon.com>, <suwenping@...ilicon.com>,
<raojun@...ilicon.com>, <ml.yang@...ilicon.com>,
<gaofei@...ilicon.com>, <zhangzhenxing@...ilicon.com>,
<xuejiancheng@...ilicon.com>, Binquan Peng <pengbinquan@...wei.com>
Subject: Re: [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash
controller driver
Hi Boris,
On 2016/3/8 17:46, Boris Brezillon wrote:
>> [...]
>>>> +static int hisi_spi_nor_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf,
>>>> + int len)
>>>> +{
>>>> + struct hifmc_priv *priv = nor->priv;
>>>> + struct hifmc_host *host = priv->host;
>>>> + int ret;
>>>> +
>>>> + ret = hisi_spi_nor_send_cmd(nor, opcode, len);
>>>> + if (ret)
>>>> + return ret;
>>>> +
>>>> + memcpy(buf, host->iobase, len);
>>>
>>> sparse doesn't like any of these memcpy()'s, since that's __iomem. Are
>>> you sure you want a regular memcpy here, and elsewhere?
>>>
>> It's not a must to use memcpy though host->iobase represents a segment of inner memory
>> which stores data from flash device byte by byte. I will give up using memcpy here and
>> hisi_spi_nor_write_reg() in next version. Thank you!
>
> Or you can use memcpy_fromio(), which should give you better perfs than
> using readX() accessors in a loop.
>
Thank you very much for your suggestion. I'll look into sparse and this function.
Regards,
Jiancheng
Powered by blists - more mailing lists