linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Diego M. Vadell" <dvadell@lantech.com.ar>
To: Jeff Garzik <jgarzik@pobox.com>, linux-raid@vger.kernel.org
Subject: Re: sata_nv and RAID1
Date: Mon, 13 Jun 2005 18:00:31 -0300	[thread overview]
Message-ID: <200506131800.31956.dvadell@lantech.com.ar> (raw)
In-Reply-To: <42ADC98C.6060808@pobox.com>

On Monday 13 June 2005 14:59, you wrote:
>
> The task is to update sata_nv to notify libata-core that a device has
> disappeared.  libata-core then notifies the SCSI layer of this.  No new
> ioctls need to be supported.
>
> 	Jeff

Hi Jeff,
   Thank you for your answers. Reading a little of 
http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/libata.pdf and 
drivers/scsi/sata_nv.c , it seems to me that I have to add a call to 
ata_port_disable() into sata_nv.c:nv_check_hotplug(). 
   In sata_nv.c , nv_check_hotplug() is called from nv_interrupt() , which 
seems to be the interrupt handler. I add the call to ata_port_disable(ap) , 
taking ap from the ata_host_set structure, but that structure seems to be 
able to have many ap ports (its an array). 
   Question: is it ok to set ap as host_set->ports[0] or should I have to see 
what ata_port is the one that has been unplugged?

The only change so far looks like this. It does compile cleanly, but I will 
have the hardware to test it tomorrow.

static void nv_check_hotplug(struct ata_host_set *host_set)
{
        u8 intr_status;
	struct ata_port *ap;

	// Get the ATA Port to be disabled if hot-removed
	ap = host_set->ports[0];  

        intr_status = inb(host_set->ports[0]->ioaddr.scr_addr + 
NV_INT_STATUS);

        // Clear interrupt status.
        outb(0xff, host_set->ports[0]->ioaddr.scr_addr + NV_INT_STATUS);

        if (intr_status & NV_INT_STATUS_HOTPLUG) {
                if (intr_status & NV_INT_STATUS_PDEV_ADDED)
                        printk(KERN_WARNING "nv_sata: "
                                "Primary device added\n");

                if (intr_status & NV_INT_STATUS_PDEV_REMOVED) {
                        printk(KERN_WARNING "nv_sata: "
                                "Primary device removed\n");
			ata_port_disable(ap);
		}

                if (intr_status & NV_INT_STATUS_SDEV_ADDED)
                        printk(KERN_WARNING "nv_sata: "
                                "Secondary device added\n");

                if (intr_status & NV_INT_STATUS_SDEV_REMOVED) {
                        printk(KERN_WARNING "nv_sata: "
                                "Secondary device removed\n");
			ata_port_disable(ap);
		}
        }
}

Thanks in advance,
 -- Diego.

  reply	other threads:[~2005-06-13 21:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-11 16:13 sata_nv and RAID1 Diego M. Vadell
2005-06-11 19:26 ` Jeff Garzik
2005-06-11 20:29   ` Michael Tokarev
2005-06-13  3:15     ` Diego M. Vadell
2005-06-13  6:45     ` Jeff Garzik
2005-06-13 11:57       ` Michael Tokarev
2005-06-13 12:27         ` Peter T. Breuer
2005-06-13 14:40           ` Diego M. Vadell
2005-06-13 16:07             ` Peter T. Breuer
2005-06-13 16:51               ` Diego M. Vadell
2005-06-13 17:59                 ` Jeff Garzik
2005-06-13 21:00                   ` Diego M. Vadell [this message]
2005-06-13 21:20                     ` Jeff Garzik
2005-06-13 21:41                       ` Diego M. Vadell
     [not found]                         ` <1118818568.3089.5.camel@raz-laptop>
     [not found]                           ` <200506151427.09114.dvadell@lantech.com.ar>
2005-06-16  6:43                             ` raz ben jehuda
2005-06-14 21:11                       ` Molle Bestefich
2005-06-13 19:00                 ` Peter T. Breuer
2005-06-13 20:41                   ` Raz Ben-Jehuda(caro)
2005-06-13 21:16                   ` Diego M. Vadell
2005-06-14 21:11         ` Molle Bestefich
2005-06-14 21:37           ` Michael Tokarev
2005-06-14 22:10             ` Diego M. Vadell
2005-06-14 22:17               ` Michael Tokarev
2005-06-15  0:08               ` Jeff Garzik
2005-06-14 22:26             ` Molle Bestefich
2005-06-14 23:07               ` Bill Davidsen
2005-06-14 23:18                 ` Molle Bestefich
2005-06-15  0:12                   ` Jeff Garzik
2005-06-15  0:19                     ` Molle Bestefich
2005-06-14 23:46                 ` Mike Hardy
2005-06-15  0:11               ` Jeff Garzik
2005-06-15  0:34                 ` Guy
2005-06-14 21:53           ` David Greaves
2005-06-14 22:30             ` Molle Bestefich
2005-06-15 19:17               ` Mark Hahn
2005-06-15 19:32                 ` Molle Bestefich
2005-06-15 19:34                   ` Molle Bestefich

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=200506131800.31956.dvadell@lantech.com.ar \
    --to=dvadell@lantech.com.ar \
    --cc=jgarzik@pobox.com \
    --cc=linux-raid@vger.kernel.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).