From owner-freebsd-current@freebsd.org Thu Dec 31 22:40:29 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5B8D4D2455; Thu, 31 Dec 2020 22:40:29 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6NQj15thz4Sct; Thu, 31 Dec 2020 22:40:28 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-yb1-xb36.google.com with SMTP id b64so18406989ybg.7; Thu, 31 Dec 2020 14:40:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dENlIFGyCC204O2QpCq/NI6BSlYfb37z4S24W0PmJFY=; b=tP6Fvpj4eHyaTmyBYI4hx4uRAo6IxLbGZxl+h+4BDgYOZA9OlLxXgtTs7iFOp9IqkE e1f/sldKfkIGkAqIyUN8LsOLdF5fNe5MI4rgSynw2QRJPjDZ4LvNbpX1ypiPcvwSYveP RoXbhloDXbzLegUy04vFdlI6d/2iO1/q3/EeytiXtZTRirlndP6ErqRApg7dYe7wi/Oq njb+FH6SU6SlAdFc2Oi2GXSHsVfaeD+G0u9bi9L4oOI2K5r1paWhYDioHYGe+3Yz6Pyy 5QOYMFzlmirxR2PQXXpNOEyIZPbSNAK7gf7LRnE7DsxFhZkzs8K3K388yMJGne2hUtIK SOIw== X-Gm-Message-State: AOAM531GkJ9sSyeRsZF/sH0FZLoEQRnCsT/n8rcA6hEU9EldBSpOItJI gXe/KaL3H4pc9XEXl5w8e3wtTraWUNd15U/xw6I= X-Google-Smtp-Source: ABdhPJzaa+hKIL7m7iWyj3vymBykV6oLfpyJq2iqTpz7ZPWfwEhcvs9Fs1w/tOQjGjSG8OC0q8+NqvCfukwa515Z0Gs= X-Received: by 2002:a25:9906:: with SMTP id z6mr55855559ybn.238.1609454428055; Thu, 31 Dec 2020 14:40:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Chuck Tuffli Date: Thu, 31 Dec 2020 14:40:17 -0800 Message-ID: Subject: Re: Intel TigerLake NVMe vmd: Adding Support & Debugging a Patch To: Neel Chauhan Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D6NQj15thz4Sct X-Spamd-Bar: / X-Spamd-Result: default: False [0.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(1.00)[1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::b36:from]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::b36:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b36:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers,freebsd-current]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2020 22:40:29 -0000 On Wed, Dec 30, 2020 at 4:38 PM Neel Chauhan wrote: > > Hi Chuck, > > On 2020-12-30 10:04, Chuck Tuffli wrote: > > What is the output from > > # pciconf -rb pci0:0:14:0 0x40:0x48 > > The output is: > > 01 00 00 00 01 2e 68 02 00 Perfect. The Linux driver says the 8086:9a0b device you have "... may provide root port configuration information which limits bus numbering" which causes the code to read the VM Capability register (0x40) and the VM Configuration register (0x44). Here, VMCAP = 0x0001 where bit 0 set appears to mean the config register has starting bus number information. VMCFG = 0x2e01 where bits 5:4 give the coded start number of bus 224 or 0xe0 which matches the PCI bridge shown in the lspci output (i.e. 10000:e0:06.0). I wonder if mirroring the logic in [1] and setting bus->rman.rm_start = 224; in vmd_attach() might help. > I was also able to stop kernel panics by adding: > > rman_fini(&sc->vmd_bus.rman); > > In the fail: statement in vmd_attach(). > > But I still cannot detect the SSD. [1] https://github.com/torvalds/linux/blob/master/drivers/pci/controller/vmd.c#L507 --chuck