[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4dd2bbcb-07ea-b45a-3067-a4353d3ff81a@pensando.io>
Date: Tue, 23 Jul 2019 16:23:19 -0700
From: Shannon Nelson <snelson@...sando.io>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v4 net-next 02/19] ionic: Add hardware init and device
commands
On 7/23/19 4:05 PM, David Miller wrote:
> From: Shannon Nelson <snelson@...sando.io>
> Date: Tue, 23 Jul 2019 15:50:22 -0700
>
>> On 7/23/19 2:18 PM, David Miller wrote:
>>> From: Shannon Nelson <snelson@...sando.io>
>>> Date: Mon, 22 Jul 2019 14:40:06 -0700
>>>
>>>> +void ionic_init_devinfo(struct ionic_dev *idev)
>>>> +{
>>>> + idev->dev_info.asic_type = ioread8(&idev->dev_info_regs->asic_type);
>>>> + idev->dev_info.asic_rev = ioread8(&idev->dev_info_regs->asic_rev);
>>>> +
>>>> + memcpy_fromio(idev->dev_info.fw_version,
>>>> + idev->dev_info_regs->fw_version,
>>>> + IONIC_DEVINFO_FWVERS_BUFLEN);
>>>> +
>>>> + memcpy_fromio(idev->dev_info.serial_num,
>>>> + idev->dev_info_regs->serial_num,
>>>> + IONIC_DEVINFO_SERIAL_BUFLEN);
>>> ...
>>>> + sig = ioread32(&idev->dev_info_regs->signature);
>>> I think if you are going to use the io{read,write}{8,16,32,64}()
>>> interfaces then you should use io{read,write}{8,16,32,64}_rep()
>>> instead of memcpy_{to,from}io().
>>>
>> Sure.
> Note, I could be wrong. Please test.
>
> I think the operation of the two things might be different.
It seems to me that memcpy() usually just does the right thing in most
cases, so that's what I went with. Looking into some of the
definitions, and at how I used memcpy_...(), I think there are some
appropriate ways to use ioread32_rep() in a couple of my cases, and
another case or two where the memcpy variant may not make much
difference with ioread8_rep(). It's also possible that sparse may have
an opinion. I'll look at them.
sln
Powered by blists - more mailing lists