Re: [PATCH] mvsas: Mainly add version info to run testing process.

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

 



Ke Wei wrote:
Yes,  the mvi->sas_addr array is in wire big endian format. And it
will be written to two
little-endian 32-bit registers after converting to little endian. So I
think this is independent
of system architecture.


BTW, just a reminder... the values written by writel() [aka mw32, in mvsas] are converted by the API.

Thus, when writing to MMIO registers, you always pass in CPU-endian values, and mw32() will do the right thing regardless of platform.

Ditto for reading MMIO registers -- regardless of being on a big-endian or little-endian platform, the values returned are always in CPU-endian format.

So the typical cases where you must perform a conversion in the driver are

1) DMA memory. You must use le32_to_cpu(), etc. This is the most common case for endian conversions.

2) In rare cases, depending on your hardware, sometimes you must add a conversion even though you are reading data via readl() and writing via writel(). Often, this rare case occurs when reading data from EEPROM data-in registers, for example, where the EEPROM data is in big-endian format.

	Jeff


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux