From owner-freebsd-acpi@freebsd.org Tue Nov 21 09:47:51 2017 Return-Path: Delivered-To: freebsd-acpi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA85DE919E for ; Tue, 21 Nov 2017 09:47:51 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (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 B68FE6707F; Tue, 21 Nov 2017 09:47:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f53.google.com with SMTP id g35so13320309lfi.13; Tue, 21 Nov 2017 01:47:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xBFq2jjkXVFsYTEoXFJbRsJ1OAonu2eB3075Z/tuV2E=; b=iIthJp8uvC9TmEOraws96uXh8Jy8RZr8pAWCeKguN2TqSV3nhJ54NYM4xzwriNC/pO cifQrFIO1CqzqnheXqfm1BGnmTj5AOrAg6E6Pt81IMcgXEbzAJRBtKXW3UKFrCcmdj6V Gt8EAgtvs7vJiS9PGyIS+q7p8b4nSc21Lwkm0HI9yVnZBRRTGUrliRjYxYS/6K9ofN59 x6afd3QEYBA1ospuOgblt+8bbWYwTPvHLmVu4zJ1QCDXCkwYj0+kV5vES2y2n0zppc9Z E9bgGH+oZfLcx4bLszNJRMh7QQC7beland4IyupVt/vbk2BDSdFEEhMTClR2UGG8gAmO ToXw== X-Gm-Message-State: AJaThX6topDfsKFsC/UH4rMfPUfBECbmYuu8+C0t+GJVflSLzSwVchKJ sAxm0gCUolr8OnvMoWD2VbYzSBhigc8= X-Google-Smtp-Source: AGs4zMYeFn4oHqsmL+vyq1wGCmwozrBeUoFq+S+yotoCFJoXhL5Q5+igXWqdpw/htgGFDYmLt0qOEA== X-Received: by 10.25.90.146 with SMTP id y18mr4506128lfk.212.1511257666550; Tue, 21 Nov 2017 01:47:46 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 86sm2298500lft.13.2017.11.21.01.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 01:47:45 -0800 (PST) Subject: Fwd: ACPICA missing support for device I/O port ranges References: To: "freebsd-acpi@freebsd.org" From: Andriy Gapon X-Forwarded-Message-Id: Message-ID: Date: Tue, 21 Nov 2017 11:47:44 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 09:47:51 -0000 Perhaps you would be interested in this message on hackers@. -------- Forwarded Message -------- Subject: ACPICA missing support for device I/O port ranges Date: Sat, 18 Nov 2017 18:52:54 +0100 From: Harald Böhm To: 'freebsd-hackers@freebsd.org' Hi all, I've been working on a device driver lately and was having trouble allocating its resources using bus_alloc_resource_any(), although its I/O ports can be read from its _CRS. This is the output of acpidump -td: Device (GMUX) { ... Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0700, // Range Minimum 0x07FF, // Range Maximum 0x01, // Alignment 0xFF, // Length ) }) ... } After digging into the code in /sys/dev/acpica/acpi_resources.c I was able to find the problem. The function acpi_res_set_iorange(), which seems to be responsible for calling bus_set_resource() is just a function stub that prints a message that I/O ranges are not supported. static void acpi_res_set_iorange(device_t dev, void *context, uint64_t low, uint64_t high, uint64_t length, uint64_t align) { struct acpi_res_context *cp = (struct acpi_res_context *)context; if (cp == NULL) return; device_printf(dev, "I/O range not supported\n"); } After adding a call to bus_set_resource() to that function, I was able to allocate the device's resources. Does anyone know, why the function has not been implemented or why I/O ranges are not supported? Thanks, Harald _______________________________________________