linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Joseph P. Garcia" <jpgarcia@execpc.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: pmac_ide_init_hwif_ports duplicate
Date: Mon, 27 Aug 2001 00:16:36 -0500	[thread overview]
Message-ID: <20010827001636.16d6719c.jpgarcia@execpc.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

pmac_ide_init_hwif_ports exists in two forms in the latest benh kernel.  a generic coding in pmac_setup.c for pci chips (pcmcia iirc), and a coding in ide-pmac.c for pmac specific applications.  On boot, the ide-pmac.c coding is used, but since the pmac_setup.c coding is used in the ppc function structure setup, the pmac_setup.c code is used everywhere else.  One consequence is that mediabays are no longer hot swappable.

I wonder if the pmac_setup.c coding is needed.  If it is, where?  If the only places that need the ide-pmac.c coding are ide-pmac.c and mediabay.c, then the attached patch should be a good fix.  It works by explicitly calling the ide-pmac.c coding, then calling ide_register_hw instead of ide_register.  The more generic pmac_setup.c coding is left as default for any other hot swappable ata subsystem.

Is this code going in the correct direction?  (ide_register is kinda hinted as being legacy)

Thanks.

--
Joseph P. Garcia
http://www.lycestra.com/

[-- Attachment #2: pmac_cdbay.patch --]
[-- Type: application/octet-stream, Size: 1978 bytes --]

--- linux-2.4.9-benh0-benh20010819-JPG1/drivers/macintosh/mediabay.c	Tue Aug  7 07:48:53 2001
+++ linux-2.4.9-benh0-benh20010819-JPG3/drivers/macintosh/mediabay.c	Sun Aug 26 02:26:51 2001
@@ -105,6 +105,9 @@
    (assumes the media-bay contains an ide device) */
 //#define MB_IDE_READY(i)	((inb(media_bays[i].cd_base + 0x70) & 0xc0) == 0x40)
 #define MB_IDE_READY(i)	((inb(media_bays[i].cd_base + 0x70) & 0x80) == 0)
+#include <linux/ide.h>
+void pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+										 ide_ioreg_t ctrl_port, int *irq);
 #endif
 
 /* Note: All delays are not in milliseconds and converted to HZ relative
@@ -473,8 +476,11 @@
 			bay->timer = 0;
 			bay->state = mb_up;
 			if (bay->cd_index < 0) {
+				hw_regs_t hw;
 				pmu_suspend();
-				bay->cd_index = ide_register(bay->cd_base, 0, bay->cd_irq);
+				pmac_ide_init_hwif_ports(&hw, (ide_ioreg_t) bay->cd_base, 0, NULL);
+				hw.irq = bay->cd_irq;
+				bay->cd_index = ide_register_hw(&hw, NULL);
 				pmu_resume();
 			}
 			if (bay->cd_index == -1) {
--- linux-2.4.9-benh0-benh20010819-JPG1/arch/ppc/kernel/pmac_setup.c	Sun Aug 19 14:01:33 2001
+++ linux-2.4.9-benh0-benh20010819-JPG3/arch/ppc/kernel/pmac_setup.c	Sun Aug 26 02:09:42 2001
@@ -617,7 +617,7 @@
  * for the IDE controller in the ohare/paddington/heathrow/keylargo.
  */
 static void __pmac
-pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+pmac_pci_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
 		ide_ioreg_t ctrl_port, int *irq)
 {
 	ide_ioreg_t reg = data_port;
@@ -795,7 +795,7 @@
         ppc_ide_md.ide_check_region	= pmac_ide_check_region;
         ppc_ide_md.ide_request_region	= pmac_ide_request_region;
         ppc_ide_md.ide_release_region	= pmac_ide_release_region;
-        ppc_ide_md.ide_init_hwif	= pmac_ide_init_hwif_ports;
+        ppc_ide_md.ide_init_hwif	= pmac_pci_ide_init_hwif_ports;
 #endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
 
 #ifdef CONFIG_BOOTX_TEXT

                 reply	other threads:[~2001-08-27  5:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010827001636.16d6719c.jpgarcia@execpc.com \
    --to=jpgarcia@execpc.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).