From owner-freebsd-amd64@freebsd.org Mon Jan 28 18:15:40 2019 Return-Path: Delivered-To: freebsd-amd64@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 A63C214BAE67; Mon, 28 Jan 2019 18:15:40 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 B1ACE70E54; Mon, 28 Jan 2019 18:15:39 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id l9so19104340wrt.13; Mon, 28 Jan 2019 10:15:39 -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=LISVyrTvtCvIBfaTEbL4j//rYYfEHTysIfN8DCXgr9A=; b=FwtdMr2oyR1Gk09kI2wGHysdi0PfypXSVWckNRxTnh2iZd9pap7/BuOGqIR+5fYls8 sjMvSuG6mqrLlUV8XfEtp9hziZ8NooFUJfZwB1N0N7c8MLqL7fmOvzq22G4BNWMWLtXG 5M90t8bEa0Qtl/kaBnuWfpMjfjDJDn2Vr+0x8XAmRDE7iojGVwpeNC8p1o3SqixD3RL9 89r+P8j25BjKvtNf7z+VcBHWhtTnPx/44vSFNKhRAtu9lzGipIqnI35IXbfPVVe2E4+a WrEH8r2vcnfyWDufXiz7ucu1NE42FaCkVPmFXciBWi9Hec9erPsbuLrP8Pd1ryFAWxyl Y20g== 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=LISVyrTvtCvIBfaTEbL4j//rYYfEHTysIfN8DCXgr9A=; b=pZblC7k+E8Yb9uB9RU3i/Xp1PqBJneRrLYqCYCKJveHNKMWlTxQf8kK5BnYqcjkKDw 41N+bVRxDihP2UuMYQc/TsnF9cFnuYxhX60OqCPNbaaGsvrYfB/cYRUMX6Ut+cuwjHb3 rj9hZV4LQKceT/3EykBLurhzClLc4uq25fyLQg7MSRJotMXZOjLv4a+7umtqHlav062F YJ7RSIRFOf2ULwwFOzFA+52YoxDs4tX+TK+5uhcUvSYx7U4zVg9VXWXXK3pUgf5kSf5N 86kJeVCpwOA3Iwn8X323Ttm64+e3uDr6kaA8QNTpEbFgu83cP8elSDBtg3MU2kEejiTF VCaA== X-Gm-Message-State: AJcUukcUkUUtCctglawPxsuyjP0jJu6KbWaz9KQZ9vQwP1/AIP3eD/sl a0zI1L6KfoR1+n2yBcmxZPjVn7AYlbcfUyepOZUhbqF3MeY= X-Google-Smtp-Source: ALg8bN4GsQxdJ1po27drFBOmL4/qCZCFUPH2cW1ErYCXfW3HFQG4BEXCRBEpIeyVxjuicAUCMNyHhtEmQDZO2VP2v68= X-Received: by 2002:adf:ff09:: with SMTP id k9mr21782198wrr.97.1548699338013; Mon, 28 Jan 2019 10:15:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Mon, 28 Jan 2019 23:45:26 +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 X-Rspamd-Queue-Id: B1ACE70E54 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FwtdMr2o; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rajfbsd@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=rajfbsd@gmail.com X-Spamd-Result: default: False [-4.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; 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_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.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]; IP_SCORE(-0.53)[ip: (1.58), ipnet: 2a00:1450::/32(-2.25), asn: 15169(-1.92), country: US(-0.08)]; NEURAL_HAM_SHORT(-0.58)[-0.583,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 18:15:40 -0000 Hi, I tried my luck with the FreeBSD 12.0 as well as the -CURRENT branch as of date. I am still seeing the issue. Looks like, I missed the earlier response from Kib (in link below) to this thread (may be landed in my spam). Is there anything else I could try debugging here? http://freebsd.1045724.x6.nabble.com/Enabling-a-ACPI-eMMC-device-is-causing-kernel-reboots-with-FreeBSD-11-2-td6293375.html Thanks, Rajesh. On Fri, Nov 16, 2018 at 10:45 AM Rajesh Kumar wrote: > 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. >> >