Skip to content

Commit

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

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [libata] sata_sis: use correct S/G table size
  pata_cs5536: MWDMA fix
  sata_sis: fix SCR read breakage
  libata: fix kernel-doc param name
  • Loading branch information
Linus Torvalds committed Oct 20, 2007
2 parents b35e704 + 96af154 commit b3d9d6b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ static void ata_qc_complete_internal(struct ata_queued_cmd *qc)
* @tf: Taskfile registers for the command and the result
* @cdb: CDB for packet command
* @dma_dir: Data tranfer direction of the command
* @sg: sg list for the data buffer of the command
* @sgl: sg list for the data buffer of the command
* @n_elem: Number of sg entries
* @timeout: Timeout in msecs (0 for default)
*
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/pata_cs5536.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/msr.h>

#define DRV_NAME "pata_cs5536"
#define DRV_VERSION "0.0.5"
#define DRV_VERSION "0.0.6"

enum {
CFG = 0,
Expand Down Expand Up @@ -214,7 +214,7 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct ata_device *adev)
cs5536_read(pdev, DTC, &dtc);

dtc &= ~(IDE_DRV_MASK << dshift);
dtc |= mwdma_timings[mode] << dshift;
dtc |= mwdma_timings[mode - XFER_MW_DMA_0] << dshift;

cs5536_write(pdev, DTC, dtc);
}
Expand Down
15 changes: 9 additions & 6 deletions drivers/ata/sata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static struct scsi_host_template sis_sht = {
.queuecommand = ata_scsi_queuecmd,
.can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD,
.sg_tablesize = LIBATA_MAX_PRD,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED,
.use_clustering = ATA_SHT_USE_CLUSTERING,
Expand Down Expand Up @@ -166,25 +166,28 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
return addr;
}

static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
u32 val, val2 = 0;
u32 val2 = 0;
u8 pmr;

if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
return 0xffffffff;

pci_read_config_byte(pdev, SIS_PMR, &pmr);

pci_read_config_dword(pdev, cfg_addr, &val);
pci_read_config_dword(pdev, cfg_addr, val);

if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
(pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
pci_read_config_dword(pdev, cfg_addr+0x10, &val2);

return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */
*val |= val2;
*val &= 0xfffffffb; /* avoid problems with powerdowned ports */

return 0;
}

static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
Expand Down Expand Up @@ -214,7 +217,7 @@ static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
return -EINVAL;

if (ap->flags & SIS_FLAG_CFGSCR)
return sis_scr_cfg_read(ap, sc_reg);
return sis_scr_cfg_read(ap, sc_reg, val);

pci_read_config_byte(pdev, SIS_PMR, &pmr);

Expand Down

0 comments on commit b3d9d6b

Please sign in to comment.