Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4877236pjb; Mon, 27 Jul 2020 07:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoxXbDYk7TMYLM8tDsR/NSUg2m6xIK03NcSHrzStclWAkP6DAswNeG2JqXwFqpT6pU7Zzk X-Received: by 2002:a17:906:af51:: with SMTP id ly17mr9315469ejb.81.1595859865754; Mon, 27 Jul 2020 07:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859865; cv=none; d=google.com; s=arc-20160816; b=JEwcsNwq4IHKIxf5GBEyNzvOk9I9g81ipA1dlXp2nPPP/noZu2ED+iX6PVba1B7ASr JJxs0DTUDtnnDklV4+uC1Hl/LfJrX5qndT+WOmgopKGL+vs/8d6No5OjZ0FrdO4oAYT5 AbTY/ytaRjolh6AEo79Z0ouu01/5KW9dhA9KTUJAAA+43O8y1ebFUy2DkC/I0zG6Bmpu 7cPYQnEhukYmJq0ACSaJp4ty9+COX5KWVeb1BBeDo+JyvSeXHZrLoUXHfFZhSWSMlukI VSVy90PZ9oDOK4ln1HZdmsvxPwJ4+ao2rC9zk5sfqjHfpQsrp6YKoIoCw7kIZAMqH9rc Mo6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IXfFsMRfQNLYsZYO+GAWFy9gVYyJzV+vnLs90NrzEvs=; b=pTBCOyI9TwdQWSOwgSsyM8oRdRM9EzQNfz8idesfA0mPohgdF8DBTF8yK4Ra2Fq7me H0HHrWBETDgaocwjBa+HC5dKO3qEdXduE02aloz6lyu87LHsXLboPNpq5+oZ/TaEbmmQ 3nldUYaE/WsnC1xzGos46/3wfk4O+JB2n/WDoLJpAnVAKJAQPafkjc7WHYIdDXU1x6Z5 HRKdJeo9wSge0+AoTp8PMjtk7yGESQU3FQ+ZNvBS7wmZraSh0gTnBr1X2hUgPGbxkNVa +o6wGVOvJ1WpLGv3962UUfN2lXud1b63Pr1BypMlYmIn5wuhXu469VRLHFDDaZlcfkBu 5kIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q1p/XtQb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si5460622eja.112.2020.07.27.07.24.03; Mon, 27 Jul 2020 07:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q1p/XtQb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731927AbgG0OWn (ORCPT + 99 others); Mon, 27 Jul 2020 10:22:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:51670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731047AbgG0OWm (ORCPT ); Mon, 27 Jul 2020 10:22:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1442B2070B; Mon, 27 Jul 2020 14:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859760; bh=zJ6iDxmgPMyeACGKiEcG9JS+5pkhHpQ/PRhePC2Mmdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q1p/XtQb9B7ln4gtglNlMCTi7ZpkDaUlAfS1DwN+WKojqYonNWLtZJ7UMeMeFscLb TkaceOI7BHJ9Qd4xg/axBkZEpixJKpzPo76mznH5QNrK5c2CA5Mjof+FcHzfNmmGDS GO4LhBYcGv1y1qJ2UMzt3+VU1cimJ4Yoi/KjFC/U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Howell , Sasha Levin Subject: [PATCH 5.7 095/179] serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X Date: Mon, 27 Jul 2020 16:04:30 +0200 Message-Id: <20200727134937.294102349@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Howell [ Upstream commit 5fdbe136ae19ab751daaa4d08d9a42f3e30d17f9 ] Sealevel XR17V35X based devices are inoperable on kernel versions 4.11 and above due to a change in the GPIO preconfiguration introduced in commit 7dea8165f1d. This patch fixes this by preconfiguring the GPIO on Sealevel cards to the value (0x00) used prior to commit 7dea8165f1d With GPIOs preconfigured as per commit 7dea8165f1d all ports on Sealevel XR17V35X based devices become stuck in high impedance mode, regardless of dip-switch or software configuration. This causes the device to become effectively unusable. This patch (in various forms) has been distributed to our customers and no issues related to it have been reported. Fixes: 7dea8165f1d6 ("serial: exar: Preconfigure xr17v35x MPIOs as output") Signed-off-by: Matthew Howell Link: https://lore.kernel.org/r/alpine.DEB.2.21.2007221605270.13247@tstest-VirtualBox Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_exar.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 59449b6500cd6..9b5da1d43332f 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -326,7 +326,17 @@ static void setup_gpio(struct pci_dev *pcidev, u8 __iomem *p) * devices will export them as GPIOs, so we pre-configure them safely * as inputs. */ - u8 dir = pcidev->vendor == PCI_VENDOR_ID_EXAR ? 0xff : 0x00; + + u8 dir = 0x00; + + if ((pcidev->vendor == PCI_VENDOR_ID_EXAR) && + (pcidev->subsystem_vendor != PCI_VENDOR_ID_SEALEVEL)) { + // Configure GPIO as inputs for Commtech adapters + dir = 0xff; + } else { + // Configure GPIO as outputs for SeaLevel adapters + dir = 0x00; + } writeb(0x00, p + UART_EXAR_MPIOINT_7_0); writeb(0x00, p + UART_EXAR_MPIOLVL_7_0); -- 2.25.1