mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: martin@dalecki.de
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org
Subject: Re: cli/sti removal from linux-2.5.29/drivers/ide?
Date: Tue, 30 Jul 2002 11:35:27 -0700	[thread overview]
Message-ID: <200207301835.LAA02863@baldur.yggdrasil.com> (raw)

>Please just send me a single diff against 2.5.29 + 108 + 109 just
>posted. This would make me happy. Thanks.

	Here is a patch against 108+109, but without Alan and Andre's
cmd640 changes, because of the questions that I just emailed about
that patch.  I can make a patch for that one later.

	I am also holding off on submitting the patch to have
ide/probe.c disable interrupts before calling ch->tuneproc, as
I do not think anything else will touch the IO ports in question
and I haven't gotten an answer on whether an unrelated interrupt
could cause a problem with the tuning just on account of timing
and unrelated bus activity.

	Anyhow, this patch includes the following changes:

	1. Alan Cox's cs5530 patches, plus I deleted two variables that
	   are no longer used as a result of Alan's changes.

	2. umc8672.c cli/sti removal.  I must have missed this file before.

	3. qd65xx.c cil/sti removal.  I changed cli/sti to
	   local_irq_{save,restore} in what appears to be a
	   probably obselete sanity check routine.  It does not
	   cause any additional detections of problems, although it
	   could fail to discover a problem in a very improbable
	   situation on a multiprocesor.  However, the detection was not
	   perfect to begin with anyhow.

	I plan to submit the cmd640 and probe.c changes, but I thought
I ought not delay the cs5530 and umc8672 changes in the meantime.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

diff -u linux-2.5.29-ide109/drivers/ide/cs5530.c linux/drivers/ide/cs5530.c
--- linux-2.5.29-ide109/drivers/ide/cs5530.c	2002-07-30 07:27:09.000000000 -0700
+++ linux/drivers/ide/cs5530.c	2002-07-30 08:39:29.000000000 -0700
@@ -203,8 +203,6 @@
 static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
 {
 	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
-	unsigned short pcicmd = 0;
-	unsigned long flags;
 
 	pci_for_each_dev(dev) {
 		if (dev->vendor == PCI_VENDOR_ID_CYRIX) {
@@ -218,6 +216,7 @@
 			}
 		}
 	}
+
 	if (!master_0) {
 		printk("%s: unable to locate PCI MASTER function\n", dev->name);
 		return 0;
@@ -227,15 +226,11 @@
 		return 0;
 	}
 
-	local_irq_save(flags); /* There should only be one CPU with this
-				  chipset. */
-
 	/*
 	 * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:
-	 * -->  OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530
 	 */
-	pci_read_config_word (cs5530_0, PCI_COMMAND, &pcicmd);
-	pci_write_config_word(cs5530_0, PCI_COMMAND, pcicmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
+	pci_set_master(cs5530_0);
+	pci_set_mwi(cs5530_0);
 
 	/*
 	 * Set PCI CacheLineSize to 16-bytes:
@@ -274,8 +269,6 @@
 	pci_write_config_byte(master_0, 0x42, 0x00);
 	pci_write_config_byte(master_0, 0x43, 0xc1);
 
-	local_irq_restore(flags);
-
 	return 0;
 }
 
diff -u linux-2.5.29-ide109/drivers/ide/qd65xx.c linux/drivers/ide/qd65xx.c
--- linux-2.5.29-ide109/drivers/ide/qd65xx.c	2002-07-30 07:27:09.000000000 -0700
+++ linux/drivers/ide/qd65xx.c	2002-07-30 08:43:30.000000000 -0700
@@ -264,14 +264,18 @@
 	u8 readreg;
 	unsigned long flags;
 
-	save_flags(flags);	/* all CPUs */
-	cli();			/* all CPUs */
+	/* As of 2.5.29, we no longer have cli(), and there is no lock that
+	   we can take on all IO ports, so we can only lock out local
+	   interrupts.  This routine is an unreliable debugging aid that
+	   has served its purpose and should probably be removed anyhow.
+	   -Adam J. Richter, 2002.07.30 */
+	local_irq_save(flags);
 	savereg = inb_p(port);
 	outb_p(QD_TESTVAL, port);	/* safe value */
 	readreg = inb_p(port);
 	outb(savereg, port);
-	restore_flags(flags);	/* all CPUs */
+	local_irq_restore(flags);
 
 	if (savereg == QD_TESTVAL) {
 		printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n");
diff -u linux-2.5.29-ide109/drivers/ide/umc8672.c linux/drivers/ide/umc8672.c
--- linux-2.5.29-ide109/drivers/ide/umc8672.c	2002-07-28 08:24:39.000000000 -0700
+++ linux/drivers/ide/umc8672.c	2002-07-30 07:50:08.000000000 -0700
@@ -108,19 +108,14 @@
 
 static void tune_umc(struct ata_device *drive, u8 pio)
 {
-	unsigned long flags;
-
 	if (pio == 255)
 		pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
 	else
 		pio = min_t(u8, pio, 4);
 
 	printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
-	save_flags(flags);	/* all CPUs */
-	cli();			/* all CPUs */
 	current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
 	umc_set_speeds (current_speeds);
-	restore_flags(flags);	/* all CPUs */
 }
 
 void __init init_umc8672(void)	/* called from ide.c */

             reply	other threads:[~2002-07-30 18:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-30 18:35 Adam J. Richter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-07-31  7:46 Adam J. Richter
2002-07-31 20:43 ` Marcin Dalecki
2002-07-30 20:10 Adam J. Richter
2002-07-31 20:12 ` Marcin Dalecki
2002-07-29 20:18 Adam J. Richter
2002-07-30  9:17 ` Marcin Dalecki
2002-07-29 15:49 Adam J. Richter
2002-07-29 17:51 ` Alan Cox
2002-07-29  0:26 Adam J. Richter
2002-07-29 11:56 ` Alan Cox
2002-07-29 11:07   ` Marcin Dalecki
2002-07-29 12:59     ` Alan Cox

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=200207301835.LAA02863@baldur.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@dalecki.de \
    /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®