Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 2014 18:08:04 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        freebsd-current@freebsd.org, scsi@freebsd.org
Subject:   Re: Instant panic CAM or USB subsystem
Message-ID:  <20140205020804.GA54095@troutmask.apl.washington.edu>
In-Reply-To: <52F09914.5040202@FreeBSD.org>
References:  <20140125172106.GA67590@troutmask.apl.washington.edu> <201401281232.21958.jhb@freebsd.org> <20140128195842.GA83173@troutmask.apl.washington.edu> <52F09914.5040202@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 04, 2014 at 09:39:00AM +0200, Alexander Motin wrote:
> 
> I guess problem may be not that phone is reported as CD, but that it is 
> reported as several CDs on one target. Note that you already see cd1 
> reported, but another one was still trying to allocate when system panicked.

Good guess see below.

> I think that CAM CD driver incorrectly assumes that your device is CD 
> changer. I've pulled real 5-disk SCSI CD changer from my depths of my 
> table and got panic very much like yours just on boot. It seems that 
> respective changer code was not properly re-locked during recent CAM 
> locking project.

If you come up with a patch, I can test it for you.

> I am going to analyze this case deeper to fix in properly, while for 
> your case I can propose such quick quirk:
> 
> --- scsi_cd.c   (revision 261448)
> +++ scsi_cd.c   (working copy)
> @@ -223,6 +223,10 @@ static struct cd_quirk_entry cd_quirk_table[] =
>          {
>                  { T_CDROM, SIP_MEDIA_REMOVABLE, "CHINON", "CD-ROM 
> CDS-535","*"},
>                  /* quirks */ CD_Q_BCD_TRACKS
> +       },
> +       {
> +               { T_CDROM, SIP_MEDIA_REMOVABLE, "SAMSUNG", "CD-ROM","1.00"},
> +               /* quirks */ CD_Q_NO_CHANGER
>          }
>   };
> 

With your quirk, the laptop booted and plugging in the cellphone
does not cause a panic.  :-)  

dmesg shows

ugen3.2: <Qualcomm, Incorporated> at usbus3
umass1: <Qualcomm, Incorporated USB MMC Storage, class 0/0, rev 1.10/0.00,\
         addr 2> on usbus3
cd1 at umass-sim1 bus 1 scbus5 target 0 lun 0
cd1: <SAMSUNG CD-ROM 1.00> Removable CD-ROM SCSI-2 device 
cd1: Serial Number 000000000002
cd1: 1.000MB/s transfers
cd1: cd present [3840000 x 512 byte records]
cd1: quirks=0x14<NO_CHANGER,10_BYTE_ONLY>
cd2 at umass-sim1 bus 1 scbus5 target 0 lun 1
cd2: <SAMSUNG CD-ROM 1.00> Removable CD-ROM SCSI-2 device 
cd2: Serial Number 000000000002
cd2: 1.000MB/s transfers
cd2: cd present [1084 x 512 byte records]
cd2: quirks=0x14<NO_CHANGER,10_BYTE_ONLY>

After a few seconds, the cellphone display shows

> Sync Music to Phone
> Sync Music to Card
> Copy/Move Files

and the following appears in dmesg

ugen3.2: <Qualcomm, Incorporated> at usbus3 (disconnected)
umass1: at uhub3, port 2, addr 2 (disconnected)
cd1 at umass-sim1 bus 1 scbus5 target 0 lun 0
cd1: <SAMSUNG CD-ROM 1.00> s/n 000000000002 detached
cd2 at umass-sim1 bus 1 scbus5 target 0 lun 1
cd2: <SAMSUNG CD-ROM 1.00> s/n 000000000002 detached
(cd2:umass-sim1:1:0:1): Periph destroyed
(cd1:umass-sim1:1:0:0): Periph destroyed
ugen3.2: <SAMSUNG Electronics Bo.,Ltd.> at usbus3

This is fine with me as I only use the laptop as a charging station.

-- 
Steve



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