Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  pata_it821x: Update RDC UDMA handling
  ata: fix wrong WARN_ON_ONCE
  • Loading branch information
Linus Torvalds committed Jan 13, 2009
2 parents 288e487 + 4a99d95 commit 51eb9ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
9 changes: 6 additions & 3 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,12 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
qc->cursg_ofs = 0;
}

/* consumed can be larger than count only for the last transfer */
WARN_ON_ONCE(qc->cursg && count != consumed);

/*
* There used to be a WARN_ON_ONCE(qc->cursg && count != consumed);
* Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN
* check correctly as it doesn't know if it is the last request being
* made. Somebody should implement a proper sanity check.
*/
if (bytes)
goto next_sg;
return 0;
Expand Down
17 changes: 13 additions & 4 deletions drivers/ata/pata_it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@


#define DRV_NAME "pata_it821x"
#define DRV_VERSION "0.4.0"
#define DRV_VERSION "0.4.2"

struct it821x_dev
{
Expand Down Expand Up @@ -494,8 +494,6 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
* special. In our case we need to lock the sector count to avoid
* blowing the brains out of the firmware with large LBA48 requests
*
* FIXME: When FUA appears we need to block FUA too. And SMART and
* basically we need to filter commands for this chip.
*/

static void it821x_dev_config(struct ata_device *adev)
Expand Down Expand Up @@ -887,6 +885,13 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
.port_ops = &it821x_passthru_port_ops
};
static const struct ata_port_info info_rdc = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,
.udma_mask = ATA_UDMA6,
.port_ops = &it821x_rdc_port_ops
};
static const struct ata_port_info info_rdc_11 = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,
Expand All @@ -903,7 +908,11 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
return rc;

if (pdev->vendor == PCI_VENDOR_ID_RDC) {
ppi[0] = &info_rdc;
/* Deal with Vortex86SX */
if (pdev->revision == 0x11)
ppi[0] = &info_rdc_11;
else
ppi[0] = &info_rdc;
} else {
/* Force the card into bypass mode if so requested */
if (it8212_noraid) {
Expand Down

0 comments on commit 51eb9ab

Please sign in to comment.