From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 742BBC433E0 for ; Wed, 24 Mar 2021 16:58:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C76161A12 for ; Wed, 24 Mar 2021 16:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236471AbhCXQ5r (ORCPT ); Wed, 24 Mar 2021 12:57:47 -0400 Received: from mga14.intel.com ([192.55.52.115]:44053 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236982AbhCXQ5R (ORCPT ); Wed, 24 Mar 2021 12:57:17 -0400 IronPort-SDR: iYSZMcyADuxsk7Dbf+IXnW+ZZKOeUzhSAYh/o5kc513cpsg2n+ji4LD4eDBbTFGWOodbtBdhAN NGl1w2f15QvQ== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="190166824" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="190166824" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 09:57:16 -0700 IronPort-SDR: QKHVSokjMFkLoV94H026lGKVi1Fl0S26xj/UiQdOE2PzfOoA4B0gBo9rxridMTsB28m0wXFHZm i4mYWeorV4kw== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="442319110" 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 09:57:15 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lP6oi-00FkMQ-KG; Wed, 24 Mar 2021 18:57:12 +0200 Date: Wed, 24 Mar 2021 18:57:12 +0200 From: Andy Shevchenko To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Mika Westerberg , Linus Walleij , linux-gpio@vger.kernel.org Subject: Re: [PATCH RESEND] intel/pinctrl: check capability offset is between MMIO region Message-ID: References: <20210324123118.58865-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 24, 2021 at 04:13:59PM +0100, Roger Pau Monné wrote: > On Wed, Mar 24, 2021 at 04:22:44PM +0200, Andy Shevchenko wrote: > > On Wed, Mar 24, 2021 at 02:55:15PM +0100, Roger Pau Monné wrote: > > > On Wed, Mar 24, 2021 at 02:58:07PM +0200, Andy Shevchenko wrote: > > > > On Wed, Mar 24, 2021 at 01:31:18PM +0100, Roger Pau Monne wrote: > > > > Moreover, it seems you are bailing out and basically denying driver to load. > > > > This does look that capability is simply the first register that blows the setup. > > > > I think you have to fix something into Xen to avoid loading these drivers or > > > > check with something like pci_device_is_present() approach. > > > > > > Is there a backing PCI device BAR for those MMIO regions that the > > > pinctrl driver is trying to access? AFAICT those regions are only > > > reported in the ACPI DSDT table on the _CRS method of the object (at > > > least on my system). > > > > Unfortunately it does not expose PCI configuration space. > > Are those regions supposed to be marked as reserved in the memory map, > or that's left to the discretion of the hardware vendor? I didn't get. The OS doesn't see them and an internal backbone simply drops any IO access to that region. > > > Doing something like pci_device_is_present would require a register > > > that we know will never return ~0 unless the device is not present. As > > > said above, maybe we could use REVID to that end? > > > > Yes, that's good, see above. > > > > WRT capabilities, if we crash we will see the report immediately on the > > hardware which has such an issue. (It's quite unlikely we will ever have one, > > that's why I consider it's not critical) > > I would rather prefer to not crash, because I think the kernel should > only resort to crashing when there's no alternative, and here it's > perfectly fine to just print an error message and don't load the > driver. Are we speaking about real hardware that has an issue? I eagerly want to know what is that beast. > IMO I would rather boot without pinctrl than get a panic if > it turns out pinctrl capabilities list is somehow corrupted. Again, do you have a hardware that does this? > It's a > long shot, but the check added in order to prevent this scenario is > minimal. > In any case I will send a new version with the REVID check and this > current patch. Okay, let's continue there, but I'm pessimistic about accepting this patch. -- With Best Regards, Andy Shevchenko