mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* re: block: Add driver for Micron RealSSD pcie flash cards
@ 2012-10-08  7:13 Dan Carpenter
  2012-10-08 16:17 ` Sam Bradshaw (sbradshaw)
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-08  7:13 UTC (permalink / raw)
  To: sbradshaw; +Cc: Jens Axboe, linux-kernel

Hello Sam Bradshaw,

The patch 88523a61558a: "block: Add driver for Micron RealSSD pcie 
flash cards" from Aug 30, 2011, creates an endian bug:
drivers/block/mtip32xx/mtip32xx.c:2468 mtip_hw_submit_io()

drivers/block/mtip32xx/mtip32xx.c
  2465          fis->opts        = 1 << 7;
  2466          fis->command     =
  2467                  (dir == READ ? ATA_CMD_FPDMA_READ : ATA_CMD_FPDMA_WRITE);
  2468          *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF);
                                    ^^^^^^^^^^^^
  2469          *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF);
                                    ^^^^^^^^^^^^^^^

These addresses point to a series of four unions inside the
host_to_dev_fis struct.  The unions will be set to different values
depending on if the CPU is big or little endian.

If you knew which endianness this works on, then you could probably add
a cpu_to_be32() or cpu_to_le32().

  2470          fis->device      = 1 << 6;
  2471          fis->features    = nsect & 0xFF;

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: block: Add driver for Micron RealSSD pcie flash cards
  2012-10-08  7:13 block: Add driver for Micron RealSSD pcie flash cards Dan Carpenter
@ 2012-10-08 16:17 ` Sam Bradshaw (sbradshaw)
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Bradshaw (sbradshaw) @ 2012-10-08 16:17 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Jens Axboe, linux-kernel

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Monday, October 08, 2012 12:13 AM
> To: Sam Bradshaw (sbradshaw)
> Cc: Jens Axboe; linux-kernel@vger.kernel.org
> Subject: re: block: Add driver for Micron RealSSD pcie flash cards
> 
> Hello Sam Bradshaw,
> 
> The patch 88523a61558a: "block: Add driver for Micron RealSSD pcie
> flash cards" from Aug 30, 2011, creates an endian bug:
> drivers/block/mtip32xx/mtip32xx.c:2468 mtip_hw_submit_io()
> 
> drivers/block/mtip32xx/mtip32xx.c
>   2465          fis->opts        = 1 << 7;
>   2466          fis->command     =
>   2467                  (dir == READ ? ATA_CMD_FPDMA_READ : ATA_CMD_FPDMA_WRITE);
>   2468          *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF);
>                                     ^^^^^^^^^^^^
>   2469          *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF);
>                                     ^^^^^^^^^^^^^^^
> 
> These addresses point to a series of four unions inside the
> host_to_dev_fis struct.  The unions will be set to different values
> depending on if the CPU is big or little endian.
> 
> If you knew which endianness this works on, then you could probably add
> a cpu_to_be32() or cpu_to_le32().

Thanks for the notification; we'll get a patch out asap.

-Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-08 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08  7:13 block: Add driver for Micron RealSSD pcie flash cards Dan Carpenter
2012-10-08 16:17 ` Sam Bradshaw (sbradshaw)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®