Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6874291ybc; Thu, 28 Nov 2019 06:59:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyYyD58iQmHF6S6qkdXZJ4BongpGcoOsXytsUrsa8q69dTded0dlT98ZBy0qY7l1fTibFgF X-Received: by 2002:a05:6402:3cf:: with SMTP id t15mr38379711edw.21.1574953197624; Thu, 28 Nov 2019 06:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953197; cv=none; d=google.com; s=arc-20160816; b=PjbIB9SurFsi55Ge6IA7b9BuDdrQZMlklfK89HHMQGgdzzydO2CX98N/tyd+eWdD7q L24vVKkFXKkGd5MJTzB3eAtW3tyAkPx4N36Xls4ymolDZf8S90thVZ1cu+AIhjqTkLWc hUS0eqwOaa2dYWBkpKwarM61vCm3BlC2wYj5CmS1T2P9FWLD0qsNmL+CaHTGMv5IrADs uyUXIq2UtEpQ6I+BBOX1XgQV5Cm2dCP1sdKxRTLo87OL/8dDIr6vqa7cfjVTF8YbrLop mb9c2Pkf+Rj40hwmKru5af4nUsh4MYSjkHx+JZxb/6Z6G4Sk8Dz6ntyqIe/9msEZFp14 Spnw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QBhz5rvCw4g2Ox9AwtLP/2ydNw3vwlfo4gXSav3FB44=; b=DDSCmUJLJx8Cj4+PtABGDynW5vDv/UzhOI6gEsa8lx0iO/jYJIeCykjNCT6SZ50RZ/ 8Fiqrw739yBe605XPfzNYuq7yLaW5GEl6y6hkB7YkmxygJqeBjn0ez3v+FdTO3opQqfx wg6DI+VjPZJs9WUKJ1CgCJCZzFOJcdO2l2dHerPSUVEnziozSRHQCCcg8xbN5M/4i+U6 lw/mzKAf8m2vTnUIoRqv6FFPL4uUVRdQXXTiFWLGclyBHy6h8juo394fLOqrr7daoiYC RIAO89hoKuPNrQ/kma181MQu/EFAqewqqnxcRcLpudSt1+Mh5Sqk36IkDAbDXPGIEkPI G3rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="Fs4SgS4/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si13219599edf.32.2019.11.28.06.59.33; Thu, 28 Nov 2019 06:59:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="Fs4SgS4/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727503AbfK1O5x (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:53 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34251 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727482AbfK1O5v (ORCPT ); Thu, 28 Nov 2019 09:57:51 -0500 Received: by mail-lj1-f195.google.com with SMTP id m6so21459888ljc.1 for ; Thu, 28 Nov 2019 06:57:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QBhz5rvCw4g2Ox9AwtLP/2ydNw3vwlfo4gXSav3FB44=; b=Fs4SgS4/1psPKfkuhI4Ny+x/2oJrTK7HBfKE4/RCaNwwy+uA8dMiNwd3beo5/zLTHw 62oVxo+n4p+sA9/H9nbzmMU2pfSe0i3IY9PDEKXtA5Y16gW6pwQTd4R0Uiu6nNqFDpUH SzXhTou8vQGjVBBwFvDic+ydbfn1zpUpRjhKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QBhz5rvCw4g2Ox9AwtLP/2ydNw3vwlfo4gXSav3FB44=; b=L1l48ZqkPTy1katdprycsTr9CtZoqYQkcGWRzC+fN0OkTb+llSQJWAGV1X+XdmnGSd RC0CxbrzzuK6m7yj538Jj1txA7CFDZwt5gS6CmvBmIxqPhtC9n6q5nCeHRI9vlsu3OpI LlfVUs0O+95dFkxZ4DKGtZ4dFAGYzE1+eSgNtFOi+O2RMEBOqilaNuvkqWwkY2UUvPeG uGqbBU5OCWvUBNqBOJgWwqOqe5dfSUuxjWiBKUbzKHy3fmH4WLyD1BxRBN/ZUPHemZgQ dVc09PihAn6eKgt9viZlNulYPeS1mfMxRduhKdqXGfCudg+WNeGTERUAltL5GWJeesxn CunA== X-Gm-Message-State: APjAAAXLvoaNf+BejIp1Pi18fbY8GpxYmghSRG5wC/eD206Vijc9W35i xOutnUkffPC02QkAMfT96+ujDA== X-Received: by 2002:a2e:888b:: with SMTP id k11mr10315128lji.87.1574953068992; Thu, 28 Nov 2019 06:57:48 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:48 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Timur Tabi , Rasmus Villemoes , linux-serial@vger.kernel.org Subject: [PATCH v6 33/49] serial: ucc_uart: limit brg-frequency workaround to PPC32 Date: Thu, 28 Nov 2019 15:55:38 +0100 Message-Id: <20191128145554.1297-34-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to Timur Tabi This bug in older U-Boots is definitely PowerPC-specific So before allowing this driver to be built for platforms other than PPC32, make sure that we don't accept malformed device trees on those other platforms. Suggested-by: Timur Tabi Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index c055abf4c919..9436b93d5cfa 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1392,6 +1392,13 @@ static int ucc_uart_probe(struct platform_device *ofdev) if (val) qe_port->port.uartclk = val; else { + if (!IS_ENABLED(CONFIG_PPC32)) { + dev_err(&ofdev->dev, + "invalid brg-frequency in device tree\n"); + ret = -EINVAL; + goto out_np; + } + /* * Older versions of U-Boot do not initialize the brg-frequency * property, so in this case we assume the BRG frequency is -- 2.23.0