From owner-freebsd-acpi@freebsd.org Fri Nov 16 05:15:53 2018 Return-Path: Delivered-To: freebsd-acpi@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 EE99A1126FDE; Fri, 16 Nov 2018 05:15:52 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 313447164E; Fri, 16 Nov 2018 05:15:52 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id r10so5978878wrs.10; Thu, 15 Nov 2018 21:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=hE7Sx55WK00Rb8ivDBuw4X90MwgdBCU0BVTv/D8lXQ4=; b=hTQxTEg43N3DhgteZFVuQG9d/0JmynqIZOGXFHbnbjSqJa3GQFWSPqGRI1JopRLtLo nd7YP1nY3UJQAyxURljNSv2OfPViDQMZ4580WRY1FfRrIiTpHSWxGN3NJ8Td8GNtZgMs XtYPvfvoqiuAF+dvzLSnltjfmUJDD76Yy8ow/3cS7UOCtzj18d3uGbkTe87vSR7AqUMy R7jh0f5Buxdw4b+rK1UHeONjswGcxtBC2EaVVc8eaQxBwUWNlJQQdNnOo5oA/JcdnPuc 5BpnlbrK9VsU6831klHJ4oRnDZ66Te/9ko5v3b5aok2+Qg1Fsu7vXq4L289aosG6ZEmw Nljg== 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; bh=hE7Sx55WK00Rb8ivDBuw4X90MwgdBCU0BVTv/D8lXQ4=; b=h5mqU3L9y3QoY+PWeDrMCMjkuikYZ0bR8wM2l+/TYWylX56H7Uzis6AZmWHZvEJ8zf NYoA074U8fTsAiffEHG0c1VRqubvkqiaI64nEsjDrbFisez5X64PkiXuPIs+X0NjamEY MTYaDx5TaTjpeLWpxZss9X7zRZLr9aUSJYqWpa4UGis9voolcrrNKXLTEzDeZpsMMrut ciltFHCBFbl+dqL5mk4o1VA4PwR2EJkGeo80MIqHwlh+tUNq/fAp7F3vZx2oGvTxdF79 jXFGiOtN+PYnX4jyrtgXqz2+MwGpyc/KIEJFk3/B/jVZM+caJaG4DjOJuSJzIVHPwKq9 iSxw== X-Gm-Message-State: AA+aEWbS42kI7h04dok/dZzY4ai7NV0m0y46o335GY4RRAHx2XRY/hcF +Vh0Rjh43ZHjG2138KxDEPd8F/ZMqJsleypOQGxT6w== X-Google-Smtp-Source: AFSGD/XAqk1/aoZsDy+L32I9JPhpxLr36i+m75vVYGYMC4VriI/Pdunlw0rmJwTmmae9n240IXnpMkAjbGrz07WNpYM= X-Received: by 2002:adf:ff09:: with SMTP id k9mr1462299wrr.97.1542345350727; Thu, 15 Nov 2018 21:15:50 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Fri, 16 Nov 2018 10:45:39 +0530 Message-ID: Subject: Re: Enabling a ACPI eMMC device is causing kernel reboots with FreeBSD 11.2 To: freebsd-amd64@freebsd.org, freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 313447164E X-Spamd-Result: default: False [-5.26 / 40.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-1.28)[ip: (-2.61), ipnet: 2a00:1450::/32(-1.87), asn: 15169(-1.81), country: US(-0.10)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 05:15:53 -0000 Hi, I did some study on this. During acpi_attach, if MCFG table is present, FreeBSD tries to use it (That is to map the PCI Base address to virtual address space). Setting hw.pci.mcfg=0, disables that mapping and lets the system use the type 1 config access (which is IO port based access). So, this is what hw.pci.mcfg does. In our case, we are enabling a device on the ACPI bus and made sure no other ACPI device collides with the address range for PCI (which mcfg says). So, why enabling a device on ACPI, is causing the memory mapped PCI access go bad to panic/reboot the kernel? I tried to collect more info enabling INVARIANTS, but in that case kernel panics much before in the boot process. So, how could I proceed in debugging this issue? Any suggestions? On Thu, Nov 8, 2018 at 4:14 PM Rajesh Kumar wrote: > Hi, > > I have amd64 board, which has a eMMC device on the ACPI bus. When I try > booting FreeBSD 11.2 on this board, with eMMC device disabled in BIOS, it > boots without any issues. But, when eMMC device is enabled in BIOS, > FreeBSD 11.2 continuously reboots. > > When I have the following tunable set, FreeBSD 11.2 boots without any > issues with eMMC enabled. > hw.pci.mcfg=0 > > Observations : > a) We have verified the ACPI device addresses (from DSDT table) doesn't > conflict with the PCI address base (configured in MCFG table). > b) The PCI address base from MCFG table is read correctly by kernel > (Verbose boot prints that address). So, I don't think MCFG table pointer is > corrupted and getting read properly. > > Questions : > a) What does hw.pci.mcfg=0 actually do to get the reboot issue resolved? > b) Why enabling a device on ACPI bus needs hw.pci.mcfg (PCI specific) to > boot? > > Looks like the system reboots when the ACPI and PCI devices enumeration > starts during the boot. So, seems ACPI (or) PCI devices aren't getting > enough resources and so reboots. > > Thanks, > Rajesh. >