Re: [PATCH] PCI: endpoint: pci-epf-test: Handle endianness properly

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

 



On Mon, Jan 27, 2025 at 11:56:47AM +0530, Manivannan Sadhasivam wrote:
> On Mon, Jan 20, 2025 at 12:50:10PM +0100, Niklas Cassel wrote:
> > The struct pci_epf_test_reg is the actual data in pci-epf-test's test_reg
> > BAR (usually BAR0), which the host uses to send commands (etc.), and which
> > pci-epf-test uses to send back status codes.
> > 
> > pci-epf-test currently reads and writes this data without any endianness
> > conversion functions, which means that pci-epf-test is completely broken
> > on big-endian systems.
> 
> Not a big deal, but I'd like to mention 'big-endian endpoint systems' to clarify
> the fact that the endianess issue is with the endpoint systems.
> 
> > 
> > PCI devices are inherently little-endian, and the data stored in the PCI
> > BARs should be in little-endian.
> > 
> > Use endianness conversion functions when reading and writing data to
> > struct pci_epf_test_reg so that pci-epf-test will behave correctly on
> > big-endian systems.
> > 
> 
> Same here.
> 
> > Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx>
> 
> Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> 
> No need to respin, these can be ammended while applying.

Thank you for the review and review comments.

I'll send a V2 regardless, to make the life easier for the PCI maintainers.
(And update V1 as superseeded in patchwork.)


Kind regards,
Niklas




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux