Re: Replace two ioread32 with ioread64_lo_hi non_atomic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

since you called ioread64_lo_hi, you may have a problem with 32-bit, but have you looked at 32-bit arch calls for ioread in the kernel?
VNSvIPortD is macro right?

On Tue, Apr 26, 2022 at 12:32 AM Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx> wrote:
Hi,

in this patch:
[PATCH 4/5] staging: vt6655: Replace two VNSvInPortD with ioread64_lo_hi

I tried to combine two reads in one.

        if (ww == W_MAX_TIMEOUT)
                return false;
-       VNSvInPortD(iobase + MAC_REG_TSFCNTR, (u32 *)pqwCurrTSF);
-       VNSvInPortD(iobase + MAC_REG_TSFCNTR + 4, (u32 *)pqwCurrTSF + 1);
+       *pqwCurrTSF = ioread64_lo_hi(iobase + MAC_REG_TSFCNTR);

        return true;
  }

works fine on 64 bit machines but fails on 32 bit machines.

Which of the following ways is the preferred one:

Adding
#include <linux/io-64-nonatomic-lo-hi.h>
before #include "asm/io.h"
But it seems that this has never been used in a driver before?

Switch back to two reads with ioread32?

Or another proposal?

Thanks for your support.

Bye Philipp

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


--
Ozgur Kara
Linux Kernel Developer

ozgurk@xxxxxxxx
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux