Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2007 22:02:53 +0100
From:      Jean-Yves Lefort <jylefort@FreeBSD.org>
To:        Michael Nottebrock <lofi@freebsd.org>
Cc:        gnome@freebsd.org
Subject:   Re: HAL on FreeBSD 5.5 redux
Message-ID:  <20070209220253.9f6b6d28.jylefort@FreeBSD.org>
In-Reply-To: <200702090952.27005.lofi@freebsd.org>
References:  <200702090634.56455.lofi@freebsd.org> <200702090758.18317.lofi@freebsd.org> <1171007171.67014.28.camel@shumai.marcuscom.com> <200702090952.27005.lofi@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Fri__9_Feb_2007_22_02_53_+0100_l.C3AOdIH3E782SG
Content-Type: multipart/mixed;
	boundary="Multipart=_Fri__9_Feb_2007_22_02_53_+0100_cneT6LJJIS8tB+n_"


--Multipart=_Fri__9_Feb_2007_22_02_53_+0100_cneT6LJJIS8tB+n_
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Fri, 9 Feb 2007 09:52:18 +0100
Michael Nottebrock <lofi@freebsd.org> wrote:

> On Friday, 9. February 2007 08:46, Joe Marcus Clarke wrote:
> > On Fri, 2007-02-09 at 07:58 +0100, Michael Nottebrock wrote:
> > > On Friday, 9. February 2007 06:52, Joe Marcus Clarke wrote:
> > > > There was a recent change that went into HAL to favor atapicam
> > > > installations over those without.  I wonder if this could be causing
> > > > problems.  Please provide an lshal.
> > >
> > > Oh, and I really should mention this, the atapicam devices work fine with
> > > the current HAL, the problems are just with the atapicd devices (i.e.
> > > with atapicam turned off, that was the regression testing I did).
> >
> > Something just occurred to me.  Give this patch a try, and see if it
> > helps.
>
> That patch fixes the probing of the atapicd devices. Excellent!
>
> It uncovers a different problem though: HAL appears to only hide/ignore acd0
> if both atapicam and atapicd are enabled - when I boot with a cdrom loaded
> into my second drive, the volume shows up in the media manager twice, for cd1
> *and* acd1. The volume on acd1 disappears though when I eject and reload the
> disc.
>
> There is also an hald-addon-storage process of acd1:
>
> [lofi@kiste]:0:~ > ps auxwww | grep hald-addon
> root         942  0,0  0,1  2776  1468  ??  S     9:40am   0:00,16
> hald-addon-storage: /dev/cd0 (hald-addon-storage)
> root         947  0,0  0,1  2780  1476  ??  S     9:40am   0:00,15
> hald-addon-storage: /dev/cd1 (hald-addon-storage)
> root         969  0,0  0,1  2776  1472  ??  S     9:40am   0:00,21
> hald-addon-storage: /dev/acd1 (hald-addon-storage)

I think I should map atapicam devices to SCSI devices by target ID,
not by target LUN. Please test the attached patch.

--
Jean-Yves Lefort

jylefort@FreeBSD.org
http://lefort.be.eu.org/

--Multipart=_Fri__9_Feb_2007_22_02_53_+0100_cneT6LJJIS8tB+n_
Content-Type: text/plain;
 name="hal-scsi.diff"
Content-Disposition: attachment;
 filename="hal-scsi.diff"
Content-Transfer-Encoding: quoted-printable

Index: hf-scsi.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /space/cvs/marcuscom-cvs/hal/hald/freebsd/hf-scsi.c,v
retrieving revision 1.28
diff -u -r1.28 hf-scsi.c
--- hf-scsi.c	1 Jan 2007 22:43:23 -0000	1.28
+++ hf-scsi.c	9 Feb 2007 21:00:45 -0000
@@ -271,13 +271,13 @@
 }
=20
 static HalDevice *
-hf_scsi_get_atapi_device (HalDevice *ata_channel, int lun)
+hf_scsi_get_atapi_device (HalDevice *ata_channel, int target_id)
 {
   HalDevice *device =3D NULL;
   GList *l;
=20
   g_return_val_if_fail(HAL_IS_DEVICE(ata_channel), NULL);
-  g_return_val_if_fail(lun =3D=3D 0 || lun =3D=3D 1, NULL); /* ATA master =
or slave*/
+  g_return_val_if_fail(target_id =3D=3D 0 || target_id =3D=3D 1, NULL); /*=
 ATA master or slave */
=20
   /*
    * If there's an ATAPI device it will be in hf_ata_pending_devices,
@@ -294,7 +294,7 @@
       if (driver && (! strcmp(driver, "acd") || ! strcmp(driver, "ast") ||=
 ! strcmp(driver, "afd")))
 	{
 	  device =3D child;
-	  if (lun =3D=3D 0)
+	  if (target_id =3D=3D 0)
 	    break;		/* we wanted the first device, done */
 	}
     }
@@ -334,7 +334,7 @@
 	      ata_channel =3D hf_scsi_get_ata_channel(parent);
 	      if (ata_channel)
 		{
-		  atapi_device =3D hf_scsi_get_atapi_device(ata_channel, (*match)->targe=
t_lun);
+		  atapi_device =3D hf_scsi_get_atapi_device(ata_channel, (*match)->targe=
t_id);
 		  if (atapi_device)
                     {
 		      char *cam_devname;

--Multipart=_Fri__9_Feb_2007_22_02_53_+0100_cneT6LJJIS8tB+n_--

--Signature=_Fri__9_Feb_2007_22_02_53_+0100_l.C3AOdIH3E782SG
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFFzOGNyzD7UaO4AGoRAnffAJ9rYFEuXUso4pnhdCi3FdOWoTBE1wCcDDYI
Q7gcEoQ2JzlWo/pbXIWptXA=
=h8OW
-----END PGP SIGNATURE-----

--Signature=_Fri__9_Feb_2007_22_02_53_+0100_l.C3AOdIH3E782SG--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070209220253.9f6b6d28.jylefort>