linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kronos <kronos@kronoz.cjb.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jon Smirl <jonsmirl@yahoo.com>,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: New radeonfb, mostly untested
Date: Sun, 7 Sep 2003 19:48:02 +0200	[thread overview]
Message-ID: <20030907174802.GA5945@dreamland.darkstar.lan> (raw)
In-Reply-To: <1062952639.655.6.camel@gaston>

Il Sun, Sep 07, 2003 at 06:37:20PM +0200, Benjamin Herrenschmidt ha scritto: 
> Ok, enough for today, my head hurts, it builds, it detects my
> PowerBook's internal panel properly, I didn't test anything else
> yet nor x86, let me know what you think...


+unmap_rom:	
+	if (rinfo->mon1_EDID)
+	    kfree(rinfo->mon1_EDID);
+	if (rinfo->mon2_EDID)
+	    kfree(rinfo->mon2_EDID);
+	if (rinfo->mon1_modedb)
+		fb_destroy_modedb(rinfo->mon1_modedb);
+	radeon_delete_i2c_busses(rinfo);
+	if (rinfo->bios_seg)
+		radeon_unmap_ROM(rinfo, pdev);
+	iounmap ((void*)rinfo->mmio_base);
+release_mmio:
+	release_mem_region (rinfo->mmio_base_phys,
+			    pci_resource_len(pdev, 2));
+release_fb:	
+	release_mem_region (rinfo->fb_base_phys,
+			    pci_resource_len(pdev, 0));
+free_rinfo:	
+	kfree (rinfo);
+	return -ENODEV;
+}
+
+
+
+static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev)
+{
+        struct radeonfb_info *rinfo = pci_get_drvdata(pdev);
+ 
+        if (!rinfo)
+                return;
+ 
+	/* restore original state
+	 * 
+	 * Doesn't quite work yet, possibly because of the PPC hacking
+	 * I do on startup, disable for now. --BenH
+	 */
+        radeon_write_mode (rinfo, &rinfo->init_state);
+ 
+#ifdef CONFIG_MTRR
+	if (rinfo->mtrr_hdl >= 0)
+		mtrr_del(rinfo->mtrr_hdl, 0, 0);
+#endif
+
+        unregister_framebuffer ((struct fb_info *) rinfo);
+
+        iounmap ((void*)rinfo->mmio_base);
+        iounmap ((void*)rinfo->fb_base);
+ 
+	release_mem_region (rinfo->mmio_base_phys,
+			    pci_resource_len(pdev, 2));
+	release_mem_region (rinfo->fb_base_phys,
+			    pci_resource_len(pdev, 0));
+
+	if (rinfo->mon1_EDID)
+		kfree(rinfo->mon1_EDID);
+	if (rinfo->mon2_EDID)
+		kfree(rinfo->mon2_EDID);
+	if (rinfo->mon1_modedb)
+		fb_destroy_modedb(rinfo->mon1_modedb);
+	radeon_delete_i2c_busses(rinfo);
+        
+        kfree (rinfo);
+}
 
There's a problem here: sysfs attributes are unregistered after
radeonfb_pci_unregister returns, so we have a small windows where
mon1_EDID and mon2_EDID are invalid and edid1 and edid2 are still
there in sysfs. Ditto for pci_register.

Oh, you didn't update aty/Makefile ;)

obj-$(CONFIG_FB_RADEON) += radeonfb.o
radeonfb-y += radeon_base.o radeon_monitor.o radeon_pm.o
radeonfb-$(CONFIG_FB_RADEON_I2C) += radeon_i2c.o

Luca
-- 
Reply-To: kronos@kronoz.cjb.net
Home: http://kronoz.cjb.net
Software is like sex; it's better when it's free.
Linus Torvalds


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  reply	other threads:[~2003-09-07 17:49 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-07 16:37 New radeonfb, mostly untested Benjamin Herrenschmidt
2003-09-07 17:48 ` Kronos [this message]
2003-09-07 18:23   ` Benjamin Herrenschmidt
2003-09-07 18:43     ` Kronos
2003-09-07 18:49       ` Benjamin Herrenschmidt
2003-09-09 17:18         ` James Simmons
2003-09-09 17:54           ` Kronos
2003-09-09 18:13             ` Benjamin Herrenschmidt
2003-09-09 19:24               ` Kronos
2003-09-09 19:37                 ` Benjamin Herrenschmidt
2003-09-09 20:45                   ` Kronos
2003-09-09 21:07                     ` Benjamin Herrenschmidt
2003-09-09 21:52                       ` Kronos
2003-09-09 22:08                         ` Kronos
2003-09-12 17:44                           ` James Simmons
2003-09-12 17:48                     ` James Simmons
2003-09-12 22:47                       ` Kronos
2003-09-09 20:59                   ` Geert Uytterhoeven
2003-09-12 17:46                     ` James Simmons
2003-09-07 23:03 ` Kronos
2003-09-08  6:06   ` Benjamin Herrenschmidt
2003-09-08 19:05     ` Kronos
2003-09-10 16:41       ` Kronos
2003-09-10 16:48         ` Benjamin Herrenschmidt
2003-09-10 17:46           ` Kronos
2003-09-10 17:50             ` Benjamin Herrenschmidt
2003-09-10 18:41               ` Kronos
2003-09-10 21:27               ` Kronos
2003-09-10 21:32                 ` Benjamin Herrenschmidt
2003-09-12 17:43                   ` James Simmons
2003-09-12 19:36                     ` Kronos
2003-09-12 22:20                       ` James Simmons
2003-09-12 22:45                         ` Kronos
2003-09-14 17:31                         ` Kronos
2003-09-14 17:46                           ` Benjamin Herrenschmidt
2003-09-14 18:59                             ` Kronos
2003-09-15  0:56                           ` Tony
2003-09-15 16:00                             ` Kronos
2003-09-14 23:59                 ` Tony
2003-09-15 15:55                   ` Kronos
2003-09-11  6:03           ` Geert Uytterhoeven
2003-09-11  6:38             ` Benjamin Herrenschmidt
2003-09-11  6:55               ` Geert Uytterhoeven
2003-09-11  7:05                 ` Benjamin Herrenschmidt
2003-09-12 17:25                   ` James Simmons

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=20030907174802.GA5945@dreamland.darkstar.lan \
    --to=kronos@kronoz.cjb.net \
    --cc=benh@kernel.crashing.org \
    --cc=jonsmirl@yahoo.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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).