Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E657BC433E0 for ; Wed, 24 Mar 2021 17:01:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9ED5619E0 for ; Wed, 24 Mar 2021 17:01:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9ED5619E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.101126.193193 (Exim 4.92) (envelope-from ) id 1lP6sq-0003qZ-Ll; Wed, 24 Mar 2021 17:01:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 101126.193193; Wed, 24 Mar 2021 17:01:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lP6sq-0003qS-IB; Wed, 24 Mar 2021 17:01:28 +0000 Received: by outflank-mailman (input) for mailman id 101126; Wed, 24 Mar 2021 17:01:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lP6sp-0003qN-AL for xen-devel@lists.xenproject.org; Wed, 24 Mar 2021 17:01:27 +0000 Received: from mga07.intel.com (unknown [134.134.136.100]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3e150299-78f0-4e67-9cc8-4fc86a8b106a; Wed, 24 Mar 2021 17:01:25 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 10:01:23 -0700 Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 10:01:21 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lP6sg-00FkPI-Q7; Wed, 24 Mar 2021 19:01:18 +0200 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3e150299-78f0-4e67-9cc8-4fc86a8b106a IronPort-SDR: Oqvc8fhRgYZUdULYs2l02oN6aa6f9Q4yV3/sTgCy3TfEcTkN8uCWcSxAdK/82gFErvro2dldGO ZEVrj9oGXKAA== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="254740612" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="254740612" IronPort-SDR: XQJvaVJDJLanABcFoLCrP6nuFfR3RkzdfB4eAQ2LOIAMNxO8Su8pduY5YDmdjv1hRKJXndE44j dJugPKiNHHjA== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="442320806" Date: Wed, 24 Mar 2021 19:01:18 +0200 From: Andy Shevchenko To: Roger Pau Monne Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Andy Shevchenko , Mika Westerberg , Linus Walleij , linux-gpio@vger.kernel.org Subject: Re: [PATCH v2 1/2] intel/pinctrl: check REVID register value for device presence Message-ID: References: <20210324154312.61878-1-roger.pau@citrix.com> <20210324154312.61878-2-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210324154312.61878-2-roger.pau@citrix.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Mar 24, 2021 at 04:43:11PM +0100, Roger Pau Monne wrote: Thanks for a fix! My comments below. > Use the value read from the REVID register in order to check for the > presence of the device. A read of all ones is treated as if the device > is not present, and hence probing is ended. > > This fixes an issue when running as a Xen PVH dom0, where the ACPI > DSDT table is provided unmodified to dom0 and hence contains the > pinctrl devices, but the MMIO region(s) containing the device > registers might not be mapped in the guest physical memory map if such > region(s) are not exposed on a PCI device BAR or marked as reserved in > the host memory map. Any particular point that we can use in the Fixes tag? ... > Suggested-by: Andy Shevchenko Hmm... was it that address I have used? In any case I think my @linux.intel.com is better. ... > /* Determine community features based on the revision */ > value = readl(regs + REVID); > + if (value == ~0u) > + return -ENODATA; I think -ENODEV is more appropriate here. Also comment above should be adjusted to explain this check. -- With Best Regards, Andy Shevchenko