Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4888983pjb; Mon, 27 Jul 2020 07:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqCuQxJFYrPl7YCXzSzq4LdiNkZJTJvT4cz7gaf57eFHlCTSTNmi1c+aRPSdRKvJ58nQqm X-Received: by 2002:aa7:da8d:: with SMTP id q13mr21679031eds.339.1595860814088; Mon, 27 Jul 2020 07:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860814; cv=none; d=google.com; s=arc-20160816; b=l9XNEbITXog5TI2UOV17gL/6qfut6hplaSuhU9m0VoUrOA5xCmnb5DlRnE46ywG97H L+ZlEHrpWbE0wxnc/P2hqfnQg5pNUReLXSGnA45OWAZOpij3XBMfFasoR+fZnGMbrboe AdJJiRtTBTXESvduhwrE5fVpQRX5ixFRCI/0ofDxO3VgJVTEpVcdadxIO/D7kZL87sZH nPG7x35jNeiiJMVpFFzeW2aD58qCf6mzBcYIWF3xyh+etySxQtYEVtRpmAIPQBqAGjbI hk+McMNDB3xEsFn0zivVWkE6qWrT3bvgZENZTNfQn6mBn4Ch+L2I3fszNdYTrJgRfCYH 9M6g== 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=5ixud66soNHK9z00Jq4ci15THnqfi/hmFGtvQ/O7If0=; b=HjiNzcvnlFNeEH7rPfqERM3NPqM7uhWrD/Sd5mc9ssbR3FADfv+GQgFAAtKKye6vgh rwi5JoRd0e84OpNAcQHI3Ri6D01s5/B+mJ3BhyKrV0UREJHzLt43pLJ6dfRhRYzOUSIW 8bwnrv7cNG8pKQCSqMEGFm/8xRKQZMoECF4r5gTUKPIIVdbzdvcJxYCVB8ecNkkgIpiZ mzRLz+shtq3j07H3AAPXabAuhYh6yqMT+/sy1YlV3qcklXj2l/Y1gaMm6p50Kfs/wmmE chZGcs5A3qd8yGWIDflC3snRoPYRqvK8hdzIddsXTAYcdIeAFgYZtOdGrrI+T4TT/vI3 ycDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CjRlB7/i"; 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 i12si5760020edx.430.2020.07.27.07.39.51; Mon, 27 Jul 2020 07:40:14 -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="CjRlB7/i"; 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 S1732961AbgG0Oil (ORCPT + 99 others); Mon, 27 Jul 2020 10:38:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:33368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729382AbgG0OKa (ORCPT ); Mon, 27 Jul 2020 10:10:30 -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 53FFF21744; Mon, 27 Jul 2020 14:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859029; bh=PNYpTtFi30Z3+cG4WR/Y1XCxwls4tNt9213U061rBew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjRlB7/iVO6QreSFnlxVxpJbGCZ2F1WbE3lPdPSCod/5bErCuE0AlG9riEqO6ioyl YjIa4UJrdVjlG4p7LnxrL1JLpMLAHIT04lJ4XmUaGt5ZnlDJaXh6D7a92XXqspSkT3 9+mrqYNuLOaijrslCM66yOy+Pu+xeGeTWoCMeyjs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Howell , Sasha Levin Subject: [PATCH 4.19 40/86] serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X Date: Mon, 27 Jul 2020 16:04:14 +0200 Message-Id: <20200727134916.453952976@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134914.312934924@linuxfoundation.org> References: <20200727134914.312934924@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 8707357764375..d39162e71f59d 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -227,7 +227,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