Microsemi / switchtec-kernel

A kernel module for the Microsemi PCIe switch
GNU General Public License v2.0
45 stars 31 forks source link

switchtec-kernel for 32-bit systems #39

Closed ComiXZonE closed 6 years ago

ComiXZonE commented 6 years ago

Greetings,

I'm building a switchtec kernel module for kernel 4.4.84 which is being ran on 32-bit ARM. I pulled the code from backport_4.4_to_4.7 branch and had a build error regarding writeq() call in 'switchtec.c'. After some investigation, I found that writeq() is supported only on 64-bit systems.

I managed to pass the build when I substituted that call with writel() and I am aware that the semantics are probably affected by that.

What I would like to ask is what would be the modification we could do in order to preserve correctness when building the driver for a 32-bit system.

Thank you in advance.

lsgunth commented 6 years ago

switchtec.c should include <linux/io-64-nonatomic-lo-hi.h> so that writeq is replaced by two writels on systems that do not support it.

We had that in the NTB driver but when the DMA code was added, we missed adding it to switchtec.c.

Logan

ComiXZonE commented 6 years ago

Hi Logan,

Build passed successfully. Thanks for the quick reply!

wesleywesley commented 6 years ago

@ComiXZonE @lsgunth

to follow "13) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes:"[1] I ask for your permission before using the Reported-by(for ComiXZonE) and Suggested-by(for Isgunth) tag.

And ComiXZonE , the name/email address used for the tags.

[1] https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

ComiXZonE commented 6 years ago

@wesleywesley

I give my permission for tagging, the info you asked for can be found on my profile screen.

wesleywesley commented 6 years ago

@ComiXZonE thx.