Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc791d47 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: fix double-completion on error
  [PATCH] pata_artop: fix "& (1 >>" typo
  [PATCH] hpt37x: Check the enablebits
parents cd2579d7 253b92ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1612,9 +1612,9 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,


err_did:
err_did:
	ata_qc_free(qc);
	ata_qc_free(qc);
err_mem:
	cmd->result = (DID_ERROR << 16);
	cmd->result = (DID_ERROR << 16);
	done(cmd);
	done(cmd);
err_mem:
	DPRINTK("EXIT - internal\n");
	DPRINTK("EXIT - internal\n");
	return 0;
	return 0;


+1 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,7 @@ static int artop6260_pre_reset(struct ata_port *ap)
		return -ENOENT;
		return -ENOENT;


	pci_read_config_byte(pdev, 0x49, &tmp);
	pci_read_config_byte(pdev, 0x49, &tmp);
	if (tmp & (1 >> ap->port_no))
	if (tmp & (1 << ap->port_no))
		ap->cbl = ATA_CBL_PATA40;
		ap->cbl = ATA_CBL_PATA40;
	else
	else
		ap->cbl = ATA_CBL_PATA80;
		ap->cbl = ATA_CBL_PATA80;
+16 −3
Original line number Original line Diff line number Diff line
@@ -25,7 +25,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt37x"
#define DRV_NAME	"pata_hpt37x"
#define DRV_VERSION	"0.5"
#define DRV_VERSION	"0.5.1"


struct hpt_clock {
struct hpt_clock {
	u8	xfer_speed;
	u8	xfer_speed;
@@ -453,6 +453,12 @@ static int hpt37x_pre_reset(struct ata_port *ap)
{
{
	u8 scr2, ata66;
	u8 scr2, ata66;
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	static const struct pci_bits hpt37x_enable_bits[] = {
		{ 0x50, 1, 0x04, 0x04 },
		{ 0x54, 1, 0x04, 0x04 }
	};
	if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
		return -ENOENT;
		
		
	pci_read_config_byte(pdev, 0x5B, &scr2);
	pci_read_config_byte(pdev, 0x5B, &scr2);
	pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
	pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
@@ -488,10 +494,17 @@ static void hpt37x_error_handler(struct ata_port *ap)


static int hpt374_pre_reset(struct ata_port *ap)
static int hpt374_pre_reset(struct ata_port *ap)
{
{
	static const struct pci_bits hpt37x_enable_bits[] = {
		{ 0x50, 1, 0x04, 0x04 },
		{ 0x54, 1, 0x04, 0x04 }
	};
	u16 mcr3, mcr6;
	u16 mcr3, mcr6;
	u8 ata66;
	u8 ata66;

	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);

	if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
		return -ENOENT;
		
	/* Do the extra channel work */
	/* Do the extra channel work */
	pci_read_config_word(pdev, 0x52, &mcr3);
	pci_read_config_word(pdev, 0x52, &mcr3);
	pci_read_config_word(pdev, 0x56, &mcr6);
	pci_read_config_word(pdev, 0x56, &mcr6);