From owner-freebsd-wireless@freebsd.org Sun Jan 20 07:06:32 2019 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D02214A86F9 for ; Sun, 20 Jan 2019 07:06:32 +0000 (UTC) (envelope-from blockk2000@gmail.com) Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73F0489CC9 for ; Sun, 20 Jan 2019 07:06:31 +0000 (UTC) (envelope-from blockk2000@gmail.com) Received: by mail-ot1-x335.google.com with SMTP id n8so18011237otl.6 for ; Sat, 19 Jan 2019 23:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=t8RhYnlQ4cgfc66w4xwoi6CuzuIbmyEhq4iHdhNodVc=; b=EcwtQLVlhrq1WT8UR3RM5M6YavuJYjAZpm47jalMi1tnICSwauZtTa5CrCC5qZgkuu UkOEsQbVb1Au/n7ut+Hq+5EbY6RGlZ26Zt7rxqE1W6IUCovSlicQHmQJLcl2iDB8Lpl4 Va1DZhQMOwlbD3ziNmz7aN1F9dttTDLWcjeR3+h2I4YJnoCEowTxmhrP/+I5rmAMG6Aa estb++01YbJ75cUvBhMR5ZxFxZRHkIAHPYvbIrAkYI8m1gJ0YlKGAXhKVWpoPNxBCdY1 AG5yDAGGP+fc7jiEpq6A/HnSRZ7PE3ltQtZr/6aHDBccrAm6S0iyPXhtX/uAW758YzEx onLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=t8RhYnlQ4cgfc66w4xwoi6CuzuIbmyEhq4iHdhNodVc=; b=fURCPNUIkihgxJf57DpjPOhIHabHz6XQbeTXlEfbKgOkh590llDlaeC8K/TjFhM2XW fo+7yB4x1yw5k5Z3FkkZQtgAps59P+3pvbVWioibpYIKo3nRLushVmkonH9ruV6cae9L 1gLUhil8OLGy6CNo9uPH4SzhAAIZ8kPsI9LJZfOZ1t5tRFxUf0vksJQpXx/xLwffNh0b rGY6v5HsEgkRmBJskxl+B8xeA7iX9tni2HhQ71lp4VUNzSPvQWrAx6SVUS9giJPxhLXv CZvh1asA23g/MFkaT0R2LVJ+j0CVKxQ16v4XEv/C45MLspRINTukk2lQxeelLMUNJ8R/ 7xHQ== X-Gm-Message-State: AJcUukcIs9Rrakb/CiKg3jWw/j+OV/sVovzEQ6wlH6Ufi/nXocTHKt7s DTqsRHA5yCWBAS2fWak/ccSAmDC7rG4IRRciutigO7Zq X-Google-Smtp-Source: ALg8bN56xr0Cq5hhdsEJ7FAFxP5DFmS2zZAyK3WK14uUHXS8Zq23Q1KByVPucxM832dzSxJgMvOkFukHGXuVNX0sdzM= X-Received: by 2002:a9d:2aea:: with SMTP id e97mr16695708otb.206.1547967989965; Sat, 19 Jan 2019 23:06:29 -0800 (PST) MIME-Version: 1.0 From: Wen-Chun KUO Date: Sun, 20 Jan 2019 15:06:18 +0800 Message-ID: Subject: failed to initialize Intel 9560 wifi driver To: freebsd-wireless@freebsd.org X-Rspamd-Queue-Id: 73F0489CC9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=EcwtQLVl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of blockk2000@gmail.com designates 2607:f8b0:4864:20::335 as permitted sender) smtp.mailfrom=blockk2000@gmail.com X-Spamd-Result: default: False [-4.96 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.51)[-0.508,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.44)[ip: (-7.91), ipnet: 2607:f8b0::/32(-2.39), asn: 15169(-1.84), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[5.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 07:06:32 -0000 lwhsu and I are trying to add intel 9560 to iwm(4), the preliminary patch adds 9000 series firmware module and skeleton is here: See the raw diff file : https://gist.github.com/lwhsu/ d741b6d5aad582375b1c469753d28c14#file-iwm-9560-diff But, the driver seems not working. The first error message we saw is: `api flags index 1 larger than supported by driver` We thought that is just a version problem so we bumped the version to avoid to hit the case. Still, there are other error messages: ``` iwm0: mem 0x604c110000-0x604c113fff at device 20.3 on pci0 iwm0: timeout waiting for clock stabilization iwm0: apm init error 60 iwm0: could not initialize hardware ``` Tracing the code, it means the driver doesn's receive interrupts to set "wait_entry->triggered = 1", so the driver fails due to time out. We checked IRQ and found the IRQ information does not display "iwm0" Intel 9560: % vmstat -i interrupt total rate irq9: acpi0 1 0 cpu0:timer 3314518 12 cpu1:timer 1617788 6 cpu2:timer 1560000 6 cpu3:timer 1539914 6 cpu4:timer 1560190 6 cpu5:timer 1548846 6 cpu6:timer 1602733 6 cpu7:timer 1693147 6 irq128: xhci0 91387 0 irq129: ahci0 306623 1 irq133: hdac0 36 0 irq134: em0:irq0 557434 2 Total 15392617 5 Comparing to Intel 8265 (good example): > vmstat -i interrupt total rate irq1: atkbd0 49983 2 irq9: acpi0 50686 2 irq12: psm0 227864 11 irq16: vgapci0 743067 36 cpu0:timer 2052123 101 cpu1:timer 1431203 70 cpu2:timer 1482806 73 cpu3:timer 1450326 71 cpu4:timer 1493074 73 cpu5:timer 1451673 71 cpu6:timer 1548006 76 cpu7:timer 1439006 71 irq128: xhci0 37743 2 irq129: iwm0 451303 22 <---- successfully registered irq130: nvme0 44 0 irq131: nvme0 130357 6 irq132: nvme0 125464 6 irq133: nvme0 128783 6 irq134: nvme0 124244 6 irq135: nvme0 129532 6 irq136: nvme0 126176 6 irq137: nvme0 130928 6 irq138: nvme0 127506 6 irq143: hdac0 17308 1 irq144: em0:irq0 49017 2 Total 14998222 735 Some items we want to clear first 1. We suspect the problem is related to the IRQ that not properly shared between PCI driver and Intel wireless driver However, it works in Intel wireless 8265 with similar code. This idea is still questionable. 2. The Intel wireless contains 2 kernel modules: "iwm9000fw" and "iwm". "iwm9000fw" is a binary release from Intel and "iwm" is an interface driver, which registers the IRQ. We are not sure how they co-work. Maybe the binary iwm9080fw is not correctly installed so the interrupt handler is not triggered? (The weird thing is the IRQ registering doesn't complain, but the IRQ information doesn't show the driver) Another question is, if 2 drivers share an IRQ, what would "vmstat -i" look like? These drivers would use the same IRQ value? 3. We are looking at the difference between 8000 and 9000 firmware initialization in Linux. We also curious about the precedence in "irq register" and "firmware"