mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: sbradshaw@micron.com
Cc: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Subject: re: block: Add driver for Micron RealSSD pcie flash cards
Date: Mon, 8 Oct 2012 10:13:03 +0300	[thread overview]
Message-ID: <20121008071303.GB17400@elgon.mountain> (raw)

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


             reply	other threads:[~2012-10-08  7:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08  7:13 Dan Carpenter [this message]
2012-10-08 16:17 ` Sam Bradshaw (sbradshaw)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121008071303.GB17400@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sbradshaw@micron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®