[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 1/2] intel/pinctrl: check REVID register value for device presence


  • To: <linux-kernel@xxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 24 Mar 2021 16:43:11 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qq4b7bnXXGYqfMK4UXF62lbfQFGPIykj3uOrnpw+JOE=; b=JfJ/uPyyGwDcX/gNbMlQL0UCiW9Ss6ZEQeI8OpIDf2pxhA9sdpBiiRVFENGuZeyj1swPI+uPxv32erZ738vQH/3kABIMZ24r6HAtPePe807xm+8szQk+CpxK2lkmCTIh+OFpOKRG3ZibziRDszt+DTIlHB3ttH8eicT2VNZX/WoJ6ea++mlD0Ku41ZaI3+g0fL8c7ER51cjKjkKuxov/pg10qnC4Rb2CjafgOzAVx97giNt2c27ivhX9VzOi9ble5A0uso6cwWpZ3oEAzsxvTZMdHOcVahfGMxmqPtqEDYtmO/L5P8or8+S7DIDfrzHmOM5rE3V7UYRHpSlWJ6GMWg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9i5+MptozR2K/iNrgQlUaxg/DBa8/q1xPiPc9xKchkfU0HnBE5NjTbafp3MfQqF27W1RZQQlbDoh8wrujc1jJK7785UOped0IP0LHGgv/HEDCVCnJuYWdyRcsHm5U2w2PgfwYD0A59ocvxTVe+69WbLu3ka19YIeIVeymLkeqEA5sScinxxdwL2eMUKg1ottElO9PzQD5Wh57YdTDfuTfWue9L7oqSEmL2oKe2NwHzOFMOU47W51UfBChsdL8uFOLH0ADf6KGHSANoBYgeqlGlv3EJaiEWU68IHz4QkhMCIIApP1m0hmZ1dfXabagYExrG+W9zM70bTr4LY0JuKEQ==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andy Shevchenko <andy@xxxxxxxxxx>, Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>, Linus Walleij <linus.walleij@xxxxxxxxxx>, <linux-gpio@xxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Mar 2021 15:43:47 +0000
  • Ironport-hdrordr: A9a23:f2hnHqskKeAC8OSM/cIRMxB57skC8YYji2hD6mlwRA09T+WxrO rrtOgH1BPylTYaUGwhn9fFA6WbXXbA7/dOj7U5FYyJGC3ronGhIo0n14vtxDX8Bzbzn9Qz6Y 5JSII7MtH5CDFB4frSyBWkEtom3dmM+L2pg+Cb9Ht2UQR2cchbjztRICzzKDwQeCBtA50lGJ 2Aovddrz27dngNKui9DH8JX+/Mzue7667OSxgAGhIh9U2ynSqlgYSKbySw8zU/d3d0wbkk+X XYiACR3MSemtyy1xO07R6r0714g93ko+EzYfCkqs9QETn0jxbtWYIJYcz5gBkQgMWCrGkni8 PNpRBIBbUB11r0cnuuqRXgnynMuQxek0PK8lOTjXv9rcGRfltTYKAt9OEpEGqt12MasN5xy6 5N1W6C3qAncC/opyjh+8POEyhji0vcmwtTrccok3ddXYECAYUhy7A3wUU9KuZlIAvKrKojEO VoEfjG4udXfV6wfxnizxhS6e3pcXIpEhicRE8e/uSTzjhNhXh8i3AV3coFgx47hd0AYqgBw9 6BHrVjlblIQMNTRaVhBN0ZSc/yLmDWWxrDPE+bPFyPLtBIB1v977rMpJkl7uCjf5IFiLEono 7abV9evWkuP2rzFMynxvRwg1PwaVT4eQ6o5tBV5pB/tLG5bqHsKze/RFcnlNbli+kDA/fcR+ 24NPttcr/eBFqrPbwM8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r76 yJNDxxyNjGRLDlh8ETK9Xy/InOF7mI0GZ+WF6rPabEGsT3//uIk9S19YUh/l40Gs8Q6KcK+CpH 9xK2Ara4SVYKvGxBbk/UTGburYl5uVMmO/jbQEKwe21k/J8NmoUTcP7hsSVAjnWmTs5CAi0b/c BYej6vYJeWlj5QaaoGAPfUBZ2wXXkt9vFA2QBdyRgQ/2EYZwXGCt20+6s1buOSnYTCWFIaJ0dy Wes=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Suggested-by: Andy Shevchenko <andy@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v1:
 - New in this version.
---
Cc: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
Cc: Andy Shevchenko <andy@xxxxxxxxxx>
Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
Cc: linux-gpio@xxxxxxxxxxxxxxx
---
 drivers/pinctrl/intel/pinctrl-intel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c 
b/drivers/pinctrl/intel/pinctrl-intel.c
index 8085782cd8f9..59d13342caf6 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1493,6 +1493,8 @@ static int intel_pinctrl_probe(struct platform_device 
*pdev,
 
                /* Determine community features based on the revision */
                value = readl(regs + REVID);
+               if (value == ~0u)
+                       return -ENODATA;
                if (((value & REVID_MASK) >> REVID_SHIFT) >= 0x94) {
                        community->features |= PINCTRL_FEATURE_DEBOUNCE;
                        community->features |= PINCTRL_FEATURE_1K_PD;
-- 
2.30.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.