From owner-freebsd-drivers@FreeBSD.ORG Wed Apr 1 18:32:38 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC806A5B for ; Wed, 1 Apr 2015 18:32:37 +0000 (UTC) Received: from bronze.cs.yorku.ca (bronze.cs.yorku.ca [130.63.95.34]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6BA7B1 for ; Wed, 1 Apr 2015 18:32:37 +0000 (UTC) Received: from [130.63.97.125] (ident=jas) by bronze.cs.yorku.ca with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1YdNRL-00041N-ER for freebsd-drivers@freebsd.org; Wed, 01 Apr 2015 14:32:35 -0400 Message-ID: <551C39C3.10309@cse.yorku.ca> Date: Wed, 01 Apr 2015 14:32:35 -0400 From: Jason Keltz User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Subject: issue with hot swap and mps driver Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 X-Spam-Level: - X-Spam-Report: Content preview: I have an LSI 9205-8e card in a system running FreeBSD 10.1-RELEASE-p5. > mps0: port 0x4000-0x40ff mem > 0xc1440000-0xc144ffff, 0xc1400000-0xc143ffff irq 16 at device 0.0 on pci1 > mps0: Firmware: 20.00.02.00, Driver: 19.00.00.00-fbsd > mps0: IOCCapabilities: > 5285c The card is connected to an AIC 24 disk JBOD (AIC SSG-JBSA21-4243-A1 SAS 6G) with hot swap capability. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SHORTCIRCUIT Not all rules were run, due to a shortcircuited rule -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 18:32:38 -0000 I have an LSI 9205-8e card in a system running FreeBSD 10.1-RELEASE-p5. > mps0: port 0x4000-0x40ff mem > 0xc1440000-0xc144ffff,0xc1400000-0xc143ffff irq 16 at device 0.0 on pci1 > mps0: Firmware: 20.00.02.00, Driver: 19.00.00.00-fbsd > mps0: IOCCapabilities: > 5285c The card is connected to an AIC 24 disk JBOD (AIC SSG-JBSA21-4243-A1 SAS 6G) with hot swap capability. I'm having some interesting hot swap issues under mps with 2 TB Western Digital SATA disks. 1) If I hot swap an older Western Digital disk, model WD2002FAEX-007BA0 with firmware 1D05, the disk hot swaps perfectly under FreeBSD. That is, when I remove the disk, the device entry in /dev is removed, and when I re-insert the disk, it returns. This is the behaviour I expect. > (da21:mps0:0:31:0): Periph destroyed > da21 at mps0 bus 0 scbus0 target 31 lun 0 > da21: Fixed Direct Access SCSI-6 device > da21: Serial Number WD-XXXXXXXXXXXXX > da21: 600.000MB/s transfers > da21: Command Queueing enabled > da21: 1907729MB (3907029168 512 byte sectors: 255H 63S/T 243201C) 2) If I hot swap a slightly newer Western Digital disk, model WD2002FAEX-00MJRA0 with firmware 1L01, then when I re-insert the disk, the device entry does not return, and I instead see this: > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus = 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus = 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus = 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus = 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus = 0x47 > _mapping_get_dev_info: failed to compute the hashed SAS Address for > SATA device with handle 0x0019 > failure at /usr/src/sys/dev/mps/mps_sas_lsi.c:670/mpssas_add_device()! > Could not get ID for device with handle 0x0019 > mpssas_fw_work: failed to add device with handle 0x19 3) If I hot swap a much newer RE disk, WD2000FYYZ-0 with 1K03 firmware, the problem is the same as 2). Worse, if I run an "sas2ircu 0 display" command to list the enclosure after the above error occurs, the kernel dumps. I needed to resolve this issue under both Red Hat Enterprise Linux, and FreeBSD because I am using one set of these disks in each system. Now, I've been in contact with AIC, Western Digital, LSI/Avago, and Red Hat and spent countless hours sending debugging details, etc. Through RHEL, I was able to get a patch indirectly through Avago which "solves" the driver problem for RHEL. ("In this patch driver won't block the device if the device state is "SDEV_CREATED" (i.e. driver won't block the drive when drive is still in the device add process at SCSI MID Layer). So that SCSI MID Layer can send the Inquiry commands.". The patch is slated for internal review at LSI. It would be nice to see a similar patch on the FreeBSD version of the mps driver which prevents the driver from hanging when the disk is inserted. There's no question that the disks take a little bit of extra time to respond. It's not really clear why it can't have a wee bit extra time to respond. However, in discussing the issue with other people, I'm told that this problem occurs on other vendor hard disks as well. Jason. ps: While I'm running with Firmware: 20.00.02.00, and Driver: 19.00.00.00-fbsd, I've tested with firmware 19 as well, and this doesn't change anything. From owner-freebsd-drivers@FreeBSD.ORG Wed Apr 1 19:19:01 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23214DD0; Wed, 1 Apr 2015 19:19:01 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A73BCC9E; Wed, 1 Apr 2015 19:19:00 +0000 (UTC) Received: by wgra20 with SMTP id a20so63776195wgr.3; Wed, 01 Apr 2015 12:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3V1fTjJ5H9oJtVEWpOG9rZQYIg9b4MSgUD/1AKniSwU=; b=eqDMxcM/UmYOi0seagGVoLb1t4BZk0VqsIC1sTxW1X4AxyMNOuFpALXS0tck1+3D3f nuYEmYeboNnoewGVC4F7aoOJkxolYrYJxAy5aqW0H/MpbBRD4c0qXs/nQhYMLy7eq/RG Y8hVi/0uuxF0F/0AAmNsYWKqSmqhhjTdh5X8Dz4KX9OLjlmb989AcI5TKdMJPyLbDdTy 9jzddOV/1+xqpF1HVq1GbYgEy9EA5eFf9XAq75yaVGXfYS++Tn32NQl0iwNTPMXmjfAX SKglwc9o08efwUXOMvqmonUtxtRbxLS+xwSbWKIYi1D+I73/Yqyd73HhnCpyvC7q5xj5 N8yA== MIME-Version: 1.0 X-Received: by 10.180.104.35 with SMTP id gb3mr17905363wib.60.1427915938294; Wed, 01 Apr 2015 12:18:58 -0700 (PDT) Received: by 10.27.219.3 with HTTP; Wed, 1 Apr 2015 12:18:58 -0700 (PDT) In-Reply-To: <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com> References: <5070289.9Ox4kP5ZdP@ralph.baldwin.cx> <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com> Date: Wed, 1 Apr 2015 16:18:58 -0300 Message-ID: Subject: Re: load a driver during autoconfiguration From: =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 19:19:01 -0000 2015-03-09 15:03 GMT-03:00 Warner Losh : > > > On Mar 9, 2015, at 10:01 AM, John Baldwin wrote: > > > (trimming a little) > > One option is to always load the driver using an entry in loader.conf o= r > in > > the kld_list variable in /etc/rc.conf. Another option to do on-demand > loading > > is to write a custom devd handler. You can find some examples in > > /etc/devd/usb.conf (note that that file is auto-generated). I'm not > sure what > > is output for a nomatch entry for an fdt bus. For devices that appear = at > > runtime you can run 'cat /var/run/devd.pipe' in a window to see event > details > > to use to write your match rule. However, for boot time events I think > you > > will need to resort to looking at the code to decipher what variables a= re > > passed that you want to match on. > > devinfo -v will tell you the pnp info, which is what you=E2=80=99ll need = to match > the > device. This will load the driver after boot. It=E2=80=99s almost always = easier, > however, > to just add the driver to your /boot/loader.conf file. > > Sometime before BSDcan this year, there will be the option to > automatically load > drivers based on PNP information from the parent bus coupled with the > tables > compiled into the .ko files, but that=E2=80=99s not possible today. Warner > > Hello. Thank you and sorry for the delay. I tried using the kld_list variable of /etc/rc.conf and it worked just fine: my driver gets loaded on boot time. On the other hand I couldn't get the loader.conf alternative to work: I created a loader.conf file in /boot (since there wasn't one) with only one line in it: myDriver_load=3D"YES" The driver is not loaded after boot and dmesg doesn't shows any message about my driver. I suspect that loader doesn't reads my file, because I also tried to change the autoboot delay of loader by overriding on my file, the autoboot_delay variable that's defined in /boot/defaults/loader.conf : # cat /boot/loader.conf loader_delay=3D"1" autoboot_delay=3D"1" myDriver_load=3D"YES" But loader still waits 10 seconds before booting: ... - /boot/kernel/kernel data=3D0x4b3fc8+0x2c038 syms=3D[0x4+0x78c40+0x4+0x4b17f= ] Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel] in 9 seconds ... ... Do you think that loader is reading my file or not? If there is more information that I can provide, just tell me! Regards, Matias.- From owner-freebsd-drivers@FreeBSD.ORG Wed Apr 1 19:21:15 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 754B5F07 for ; Wed, 1 Apr 2015 19:21:15 +0000 (UTC) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E327D50 for ; Wed, 1 Apr 2015 19:21:14 +0000 (UTC) Received: by pddn5 with SMTP id n5so64293744pdd.2 for ; Wed, 01 Apr 2015 12:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=obSZU0VE1BIy+ZnJqvvLzCfeAU/Bwy/Uz5XQOdOG9h8=; b=jpFW/J//L71ABRnuxaa6NfdTh4xhTHtAKURAnQcy5/5tyEJJI+uXf/SJdxW1/Qq/aJ XSaQH1yI/+KBk2FBijHhK6yY7lx8eSeIGwX2q2ty+QhG+0Uu+icmRH5Es0CV30Tn4Q1u 9QxMiVhFEHSV5ThNqkguA1T0EqiXpTVmKn+ea4RUBC4Iw1cYUN4UzJbItKnzb7ZmB9WW /MKUhElaNHKLywyOSP2Lay1uSipKdxfN+GKOKfgx3byNKxUR7fzRSyGhYqVGx/tx/3v4 4PAFbUfCZN0Ch/aFyOZAjsmWfhblEv6NXV65G11xjlSR9DNEBdj8z//JAFS9JIPYs6u4 fW8Q== X-Gm-Message-State: ALoCoQmha45YYoKSkMP0tCtRGc9L846EQQcufE/7HRiEAK0CL3uIc2ud/sLAnISZYJiC82GFkwI5 X-Received: by 10.66.216.67 with SMTP id oo3mr78522691pac.133.1427916074193; Wed, 01 Apr 2015 12:21:14 -0700 (PDT) Received: from [10.64.24.18] ([69.53.236.236]) by mx.google.com with ESMTPSA id z4sm2892161pdo.84.2015.04.01.12.21.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Apr 2015 12:21:13 -0700 (PDT) Sender: Warner Losh Subject: Re: load a driver during autoconfiguration Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_39351C87-653F-4C4F-A5DD-4AA931285414"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: Date: Wed, 1 Apr 2015 12:21:09 -0700 Message-Id: <9E10CA7A-7216-45A1-87D3-DCFF52881298@bsdimp.com> References: <5070289.9Ox4kP5ZdP@ralph.baldwin.cx> <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com> To: =?utf-8?Q?Mat=C3=ADas_Perret_Cantoni?= X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 19:21:15 -0000 --Apple-Mail=_39351C87-653F-4C4F-A5DD-4AA931285414 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 1, 2015, at 12:18 PM, Mat=C3=ADas Perret Cantoni = wrote: >=20 >=20 >=20 > 2015-03-09 15:03 GMT-03:00 Warner Losh : >=20 > > On Mar 9, 2015, at 10:01 AM, John Baldwin wrote: > > > (trimming a little) > > One option is to always load the driver using an entry in = loader.conf or in > > the kld_list variable in /etc/rc.conf. Another option to do = on-demand loading > > is to write a custom devd handler. You can find some examples in > > /etc/devd/usb.conf (note that that file is auto-generated). I'm not = sure what > > is output for a nomatch entry for an fdt bus. For devices that = appear at > > runtime you can run 'cat /var/run/devd.pipe' in a window to see = event details > > to use to write your match rule. However, for boot time events I = think you > > will need to resort to looking at the code to decipher what = variables are > > passed that you want to match on. >=20 > devinfo -v will tell you the pnp info, which is what you=E2=80=99ll = need to match the > device. This will load the driver after boot. It=E2=80=99s almost = always easier, however, > to just add the driver to your /boot/loader.conf file. >=20 > Sometime before BSDcan this year, there will be the option to = automatically load > drivers based on PNP information from the parent bus coupled with the = tables > compiled into the .ko files, but that=E2=80=99s not possible today. > Warner >=20 > Hello. Thank you and sorry for the delay. >=20 > I tried using the kld_list variable of /etc/rc.conf and it worked just = fine: my driver gets loaded on boot time. >=20 > On the other hand I couldn't get the loader.conf alternative to work: = I created a loader.conf file in /boot (since there wasn't one) with only = one line in it: >=20 > myDriver_load=3D"YES" >=20 > The driver is not loaded after boot and dmesg doesn't shows any = message about my driver. Is there a myDriver.ko in your load path? > I suspect that loader doesn't reads my file, because I also tried to = change the autoboot delay of loader by overriding on my file, the = autoboot_delay variable that's defined in /boot/defaults/loader.conf : >=20 > # cat /boot/loader.conf > loader_delay=3D"1" > autoboot_delay=3D"1" > myDriver_load=3D"YES" >=20 > But loader still waits 10 seconds before booting: > ... > - > /boot/kernel/kernel data=3D0x4b3fc8+0x2c038 = syms=3D[0x4+0x78c40+0x4+0x4b17f] > Hit [Enter] to boot immediately, or any other key for command prompt. > Booting [/boot/kernel/kernel] in 9 seconds ... > ... >=20 >=20 > Do you think that loader is reading my file or not? If there is more = information that I can provide, just tell me! I think that you=E2=80=99re not doing the interface quite right. Warner --Apple-Mail=_39351C87-653F-4C4F-A5DD-4AA931285414 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVHEUlAAoJEGwc0Sh9sBEAq7cP/jUfmbm6G4W4Ne/7d+FVpNRb yvqYAuEk7SQVlNaOb4HtAJTKqXzCTDHNyQUOxX35euv0BlR2oIF3Iv45V/cv4kY9 TqtK3AFiH4c8FugudJTOZHC8PKWQHIJ8jKjHYesuzGdInzUSrdr5pNvJuZn74YEy Ki8FOTqh6YNkbEK1ZD6zqHBqHLhw4GWZTIVSbGcjY2PfQ+8nmXCMit6DV850b5VI FwrfzILty7RyAiMMse7Qd+OpiaX4rtI4NI5jcWpLjUvT4+k+hByBV35ufE7AEi5n BzTssCV1b5UU0ult3VnHVpND77220xl6xc0WssipDIvvL1qznYn3MEwncw66MNTI ri85ak+Vd8zvR40+9XHR2/tMzNsQkDRHCiPypsZqtbhrNnammiQMVAxXxRMm/58Q 6Fk+G7bPUqL8AfRn3TFwaJTIgbfkCC6CT//e/WhW5NBDde67Q/sousIOlFg6UGW2 XBvbvQELvPQrJi/PfTkDv9ZpeD0N0uQFRdmFlAQTlELFfNlpyj9Ha1uut39YCrTZ l0u2YPWI1BKjLWORXLCQ1bnn4CrgNQPrbTvs9JpLxovNUlhfoz/036aoEkvkMQGz PhS53ApJU36+JbxJXrz+ez3NvROn/BAskoYMrP9aEOrHyYHTQzMZL+AXDivdrJnp mZ951gXIAUKJQDq+YKIB =Gdln -----END PGP SIGNATURE----- --Apple-Mail=_39351C87-653F-4C4F-A5DD-4AA931285414-- From owner-freebsd-drivers@FreeBSD.ORG Wed Apr 1 19:42:11 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46D49433; Wed, 1 Apr 2015 19:42:11 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9566F54; Wed, 1 Apr 2015 19:42:10 +0000 (UTC) Received: by wgbdm7 with SMTP id dm7so64508858wgb.1; Wed, 01 Apr 2015 12:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DfgEYJwadesucNNU5U/Zq9z2KdsERgngQBMQ39JXVEM=; b=NwcSnuSglL5CELwt/3hKQ9ddnZc8faN3KR7jgoMSUmw1UTaQyEN+3Bta2H1Jw6AbJu IJjX5E5UFXBhP/PUs3r1lknFDj2YT4xB5SpRkY+lYpO6+PflqkyhIJvknQruCwIxF5af Xq3146Z/cHoIvxgeWRFoX08E2C2pA3XMfhRk9g5qiBAk/sBplzf2f+rsg31KUjsV9po1 Wk//GXVkvTwnH/i++QdmJk6NfwdyGRUuL8dp2+MNJFF8lGVBdRpdFgLYwR0WVy/5/XQ5 /DSPvuKUl0wzD6OtlIqNacGLSIZInhiP/oaOnQHRW1iQNZryzyM/J07CTd8eP8oIGaaD Lqrg== MIME-Version: 1.0 X-Received: by 10.194.80.193 with SMTP id t1mr88960414wjx.8.1427917329300; Wed, 01 Apr 2015 12:42:09 -0700 (PDT) Received: by 10.27.219.3 with HTTP; Wed, 1 Apr 2015 12:42:09 -0700 (PDT) In-Reply-To: <9E10CA7A-7216-45A1-87D3-DCFF52881298@bsdimp.com> References: <5070289.9Ox4kP5ZdP@ralph.baldwin.cx> <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com> <9E10CA7A-7216-45A1-87D3-DCFF52881298@bsdimp.com> Date: Wed, 1 Apr 2015 16:42:09 -0300 Message-ID: Subject: Re: load a driver during autoconfiguration From: =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 19:42:11 -0000 2015-04-01 16:21 GMT-03:00 Warner Losh : > > > On Apr 1, 2015, at 12:18 PM, Mat=C3=ADas Perret Cantoni < > perretcantonim@gmail.com> wrote: > > > > > > > > 2015-03-09 15:03 GMT-03:00 Warner Losh : > > > > > On Mar 9, 2015, at 10:01 AM, John Baldwin wrote: > > > > > (trimming a little) > > > One option is to always load the driver using an entry in loader.conf > or in > > > the kld_list variable in /etc/rc.conf. Another option to do on-deman= d > loading > > > is to write a custom devd handler. You can find some examples in > > > /etc/devd/usb.conf (note that that file is auto-generated). I'm not > sure what > > > is output for a nomatch entry for an fdt bus. For devices that appea= r > at > > > runtime you can run 'cat /var/run/devd.pipe' in a window to see event > details > > > to use to write your match rule. However, for boot time events I > think you > > > will need to resort to looking at the code to decipher what variables > are > > > passed that you want to match on. > > > > devinfo -v will tell you the pnp info, which is what you=E2=80=99ll nee= d to > match the > > device. This will load the driver after boot. It=E2=80=99s almost alway= s easier, > however, > > to just add the driver to your /boot/loader.conf file. > > > > Sometime before BSDcan this year, there will be the option to > automatically load > > drivers based on PNP information from the parent bus coupled with the > tables > > compiled into the .ko files, but that=E2=80=99s not possible today. > > Warner > > > > Hello. Thank you and sorry for the delay. > > > > I tried using the kld_list variable of /etc/rc.conf and it worked just > fine: my driver gets loaded on boot time. > > > > On the other hand I couldn't get the loader.conf alternative to work: I > created a loader.conf file in /boot (since there wasn't one) with only on= e > line in it: > > > > myDriver_load=3D"YES" > > > > The driver is not loaded after boot and dmesg doesn't shows any message > about my driver. > > Is there a myDriver.ko in your load path? > Yes, it is in /boot/modules, which is what sysctl kern.module_path shows me. > > I suspect that loader doesn't reads my file, because I also tried to > change the autoboot delay of loader by overriding on my file, the > autoboot_delay variable that's defined in /boot/defaults/loader.conf : > > > > # cat /boot/loader.conf > > loader_delay=3D"1" > > autoboot_delay=3D"1" > > myDriver_load=3D"YES" > > > > But loader still waits 10 seconds before booting: > > ... > > - > > /boot/kernel/kernel data=3D0x4b3fc8+0x2c038 syms=3D[0x4+0x78c40+0x4+0x4= b17f] > > Hit [Enter] to boot immediately, or any other key for command prompt. > > Booting [/boot/kernel/kernel] in 9 seconds ... > > ... > > > > > > Do you think that loader is reading my file or not? If there is more > information that I can provide, just tell me! > > I think that you=E2=80=99re not doing the interface quite right. > I'm sorry, which interface you refer to? > > Warner > > Matias. From owner-freebsd-drivers@FreeBSD.ORG Wed Apr 1 20:23:49 2015 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57758688 for ; Wed, 1 Apr 2015 20:23:49 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0123.outbound.protection.outlook.com [207.46.100.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04DE25E0 for ; Wed, 1 Apr 2015 20:23:48 +0000 (UTC) Received: from BL2PR05MB146.namprd05.prod.outlook.com (10.242.198.21) by BL2PR05MB145.namprd05.prod.outlook.com (10.242.198.17) with Microsoft SMTP Server (TLS) id 15.1.118.21; Wed, 1 Apr 2015 20:23:41 +0000 Received: from BL2PR05MB146.namprd05.prod.outlook.com ([169.254.5.196]) by BL2PR05MB146.namprd05.prod.outlook.com ([169.254.5.196]) with mapi id 15.01.0125.002; Wed, 1 Apr 2015 20:23:41 +0000 From: Kristofer Persson To: Jason Keltz , "freebsd-drivers@freebsd.org" Subject: RE: issue with hot swap and mps driver Thread-Topic: issue with hot swap and mps driver Thread-Index: AQHQbKo/hyB/BPvpK0iPoHnqNx8I1504meRA Date: Wed, 1 Apr 2015 20:23:40 +0000 Message-ID: References: <551C39C3.10309@cse.yorku.ca> In-Reply-To: <551C39C3.10309@cse.yorku.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [50.206.28.188] authentication-results: cse.yorku.ca; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR05MB145; x-forefront-antispam-report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(377454003)(13464003)(40224003)(66066001)(2900100001)(33656002)(62966003)(92566002)(77156002)(76576001)(1720100001)(40100003)(76176999)(50986999)(122556002)(99936001)(2950100001)(99286002)(87936001)(54356999)(2501003)(2656002)(102836002)(19580395003)(15975445007)(74316001)(46102003)(107886001)(86362001)(19580405001)(106116001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR05MB145; H:BL2PR05MB146.namprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:BL2PR05MB145; BCL:0; PCL:0; RULEID:; SRVR:BL2PR05MB145; x-forefront-prvs: 053315510E MIME-Version: 1.0 X-OriginatorOrg: clarkebroadcasting.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2015 20:23:40.6891 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6eaea2f8-92fb-4e6a-b5ee-1b4d9594b144 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR05MB145 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 20:23:49 -0000 I would check the jumpers on the new drive, make sure they are all running = the same transfer speed for the drive, 1.5, 3, or 6gbps, I have seen this c= ause problems. Kris -----Original Message----- From: owner-freebsd-drivers@freebsd.org [mailto:owner-freebsd-drivers@freeb= sd.org] On Behalf Of Jason Keltz Sent: Wednesday, April 01, 2015 11:33 AM To: freebsd-drivers@freebsd.org Subject: issue with hot swap and mps driver I have an LSI 9205-8e card in a system running FreeBSD 10.1-RELEASE-p5. > mps0: port 0x4000-0x40ff mem=20 > 0xc1440000-0xc144ffff,0xc1400000-0xc143ffff irq 16 at device 0.0 on=20 > pci1 > mps0: Firmware: 20.00.02.00, Driver: 19.00.00.00-fbsd > mps0: IOCCapabilities:=20 > 5285c isc> The card is connected to an AIC 24 disk JBOD (AIC SSG-JBSA21-4243-A1 SAS 6G) with hot swap capability. I'm having some interesting hot swap issues under mps with 2 TB Western Dig= ital SATA disks. 1) If I hot swap an older Western Digital disk, model WD2002FAEX-007BA0 wit= h firmware 1D05, the disk hot swaps perfectly under FreeBSD. That is, when= I remove the disk, the device entry in /dev is removed, and when I re-inse= rt the disk, it returns. This is the behaviour I expect. > (da21:mps0:0:31:0): Periph destroyed > da21 at mps0 bus 0 scbus0 target 31 lun 0 > da21: Fixed Direct Access SCSI-6 device > da21: Serial Number WD-XXXXXXXXXXXXX > da21: 600.000MB/s transfers > da21: Command Queueing enabled > da21: 1907729MB (3907029168 512 byte sectors: 255H 63S/T 243201C) 2) If I hot swap a slightly newer Western Digital disk, model WD2002FAEX-00MJRA0 with firmware 1L01, then when I re-insert the disk, the = device entry does not return, and I instead see this: > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus =3D=20 > 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus =3D=20 > 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus =3D=20 > 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus =3D=20 > 0x47 > mpssas_get_sata_identify: error reading SATA PASSTHRU; iocstatus =3D=20 > 0x47 > _mapping_get_dev_info: failed to compute the hashed SAS Address for=20 > SATA device with handle 0x0019 failure at=20 > /usr/src/sys/dev/mps/mps_sas_lsi.c:670/mpssas_add_device()! > Could not get ID for device with handle 0x0019 > mpssas_fw_work: failed to add device with handle 0x19 3) If I hot swap a much newer RE disk, WD2000FYYZ-0 with 1K03 firmware, the= problem is the same as 2). Worse, if I run an "sas2ircu 0 display" command to list the enclosure after= the above error occurs, the kernel dumps. I needed to resolve this issue under both Red Hat Enterprise Linux, and Fre= eBSD because I am using one set of these disks in each system. Now, I've b= een in contact with AIC, Western Digital, LSI/Avago, and Red Hat and spent = countless hours sending debugging details, etc. Through RHEL, I was able t= o get a patch indirectly through Avago which "solves" the driver problem fo= r RHEL. ("In this patch driver won't block the device if the device state = is "SDEV_CREATED" (i.e. driver won't block the drive when drive is still in= the device add process at SCSI MID Layer). So that SCSI MID Layer can send= the Inquiry commands.". The patch is slated for internal review at LSI. It would be nice to see a similar patch on the FreeBSD version of the mps d= river which prevents the driver from hanging when the disk is inserted. Th= ere's no question that the disks take a little bit of extra time to respond= . It's not really clear why it can't have a wee bit extra time to respond.= However, in discussing the issue with other people, I'm told that this pr= oblem occurs on other vendor hard disks as well. Jason. ps: While I'm running with Firmware: 20.00.02.00, and Driver:=20 19.00.00.00-fbsd, I've tested with firmware 19 as well, and this doesn't ch= ange anything. _______________________________________________ freebsd-drivers@freebsd.org mailing list http://lists.freebsd.org/mailman/l= istinfo/freebsd-drivers To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org"