From patchwork Tue Oct 30 06:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10660477 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA2C913A4 for ; Tue, 30 Oct 2018 06:15:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5F8428904 for ; Tue, 30 Oct 2018 06:15:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6C4429B83; Tue, 30 Oct 2018 06:15:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E31D428904 for ; Tue, 30 Oct 2018 06:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbeJ3PIB (ORCPT ); Tue, 30 Oct 2018 11:08:01 -0400 Received: from mail-os2jpn01on0122.outbound.protection.outlook.com ([104.47.92.122]:13185 "EHLO JPN01-OS2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726493AbeJ3PIB (ORCPT ); Tue, 30 Oct 2018 11:08:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TDN2q09SE4XYTPTAZBld2YMrxjQUGMPrQ1HwQm0fh3k=; b=dXpFQWs5W6PmzkLI41GCB/l/0+/b9J3xCkosZhYzlqiMmh/w/TTB65z1uxyBmxCvbRyv+Wi0jq53dnOiN8iRsQ8xXWM15UY0l2k6htDamcYFM8yJURWzgxD/bhUMcgtAqEZDKQKa4R+w2YFxECXwdPVEZ4jQN8CiPnD1qXtlvzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by OSBPR01MB2293.jpnprd01.prod.outlook.com (2603:1096:603:26::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.20; Tue, 30 Oct 2018 06:15:47 +0000 From: Yoshihiro Shimoda To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, stable@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout Date: Tue, 30 Oct 2018 15:13:35 +0900 Message-Id: <1540880015-11877-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:404:56::22) To OSBPR01MB2293.jpnprd01.prod.outlook.com (2603:1096:603:26::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74e35b2e-d461-42e5-3576-08d63e2f2214 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(8559020)(8990200)(2017052603328)(7153060)(7193020);SRVR:OSBPR01MB2293; X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;3:UGUvI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t+Cj21zwxdJbjypDLV+cWZZhGl8cNm7cvaUM8Gvd1VPLt4f8dQTAgC9Av5kWq1XoR+FXR9s45JIeHXE+guCsTVd9pQKpjGFHoLtIx0chYMGvtfx4ndHwhmQifuhKYGNTy451RKSGr1mLjYQQjXrmsCM5UOe7Ee5wRsPWTpzjLy7cBnBkTdjdfmAQW+dOJAwyg8PyK0QxzYe11QkA71vy0A50VkcFOrvms8QcNv4++YcLo68kA1N2tYHgaqfskDEqFfaxGvEGvj8ZjOUDvUyB/aJWZ4+5l82ErxO9QsrkeLxfA8MeSOfw0W1NsHrniGbrVlscyfN1RMf4h5f+WF7Eq;4:P9JCPyTU4FHZdkRiZkQ1Jfe5QTtGHVWqsY9Kpz4ntNcLQ2ASPWKGTszeFN8LGjZcf/1nWZnGcIz62LHcpodSft5H7prrsNpnFNn7Z5DtgZIW0uR99deuoY47nrFTPlKQl394Iy/NNKMrA1IpwqBRxi6Y8FCj+cCKYAh//hlMGq2H60TjoUfDuzTdKnK4kYF2/ZibhhSONURHzp5vaBeS3s1bMoPMN11BYcHQdTdTsYwIoggxZe9iKncJRwMkg8Vc7bTg2hMUwg/4cMpkI0YivKfyHU06SKljrEeik845XV5t1XTgCw/YWSAvaQlmjr6B X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(201708071742011)(7699051)(76991095);SRVR:OSBPR01MB2293;BCL:0;PCL:0;RULEID:;SRVR:OSBPR01MB2293; X-Forefront-PRVS: 08417837C5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(346002)(39860400002)(376002)(136003)(396003)(199004)(189003)(316002)(16526019)(3846002)(78352004)(26005)(42882007)(8676002)(69590400006)(6666004)(107886003)(81166006)(51416003)(105586002)(2906002)(52116002)(8936002)(4326008)(498600001)(53936002)(81156014)(6512007)(106356001)(7736002)(386003)(6506007)(2616005)(956004)(47776003)(486006)(97736004)(68736007)(5660300001)(25786009)(6116002)(305945005)(66066001)(1857600001)(36756003)(50226002)(476003)(48376002)(50466002)(6486002)(16586007)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:OSBPR01MB2293;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;23:BTrkKhT2HucXIoONK2zYjV2NAChy1oltDE8jKqhptPkEMBYJ/Lgj+Us9C8CYqge/6kDPdzGKx9VIBrXtvx7xay8+cqHkA5gK5Oh3Iv7u4nbbYXuhI9WexEOX6EsX/cVpGbLZcq8r7PHpmemIIDzLsmu15UqUphvEpj72j9asJjUFNdgmBCgNdtB3al4CjUhArnscz5LA1PSVm1Bi+ot9q4DUvpm+q3vUghfs//EdR0HTfuNVXwGYkvYlpf2D9+Po1uguklwqoA7RnHj5aQgME0oQBoZMyg6jywvdpGMYA31x9yC6J6zvb2jafA44pLzG9jDyHV78GLVEAd7B+oG9yyl517NJbAjg4RD32tAhvfTwXArRBO4GzXQARSC5mwLDJ7dAEG5dP2QdX5fKfquLXXJS3iCB2f0qTGZUCcLLmLF9qBBmLMoeOS3Nf9zdUOLgw3AOo2AzsVHHmuibl3D3WbS0BALYiacg74tWRJ1L4dp/tXxG0uLv2K/FvuPRlam4IHoUY3+Q06XTz0QtREBJoxrr1rDG1BxGRzIluileFtG3xBRe8upIzhD2rrHYKdeoh5KKSSBAfFHk8oGbgHmp8aC0+DI24GTK56yYb69/2lCFSBVTBEjxZTbivnZyLx4Ry/dxlgWlm0WfjE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zj/W2kBU5TSqY6jd/7wIcRNV7gtuuCzv1SkiDm2PPx632TbSQE1tkbtuO3A/uQi1KfYJ7qyfaiL2nQpnDTfrzc0sBe4I7uYRWFU+l7f5cDgFw9tJN7r82CAYUTDnVwR/MwOOfK2AdaDAQPiuGE087BrYgdIQypnaqFAUnTiu7KkwuoCnsa0ugaU24wbn7pyzXndB+nK7+ZjbpP/mjmpuff8srfjWi8eKpr1Qviuy7rweMx7CRHtPbWFA0/7H0r1PJYn+YJPo4yKAMOKrNRoAz5LpJIEfUgPAnqSU87pOJiWDv13f/HT/vZbKC0TUKNGiKKZM+ZtObGeCVrTm+vwPpdl7677ORnmQQUtS1uyIi7lCq6o6JoyiwvBe0gzqtG/GhhTi2oAcIw==;5:IRwGTOfHXIzVG3U8tzGRSX8cDhnKkUYst8g9XLORsDokmOyom3k3//Da/eaQb2mit5OGS9NRpOBQ5rqTZd1p9LJmzSmmCkBwsr7cG3bDhsBN7Df1IneXGN+cFJjZKtuI6fNxctYxLv0gQ1Hm2GbHwlXawNLANPa/UU5fP1GGPEY=;7:RMLissn3pIPF5El1kh2f96K1cqPu+TkFaxTKonP5jdEX6aH/ibOpFZJS1p7QazTBKUMAIUvqsG0Vy4QaTW5OBVEzyQQHnGPX5cHt2dU/KBMD8ykCh6+Zm0f9JtX2mgzgVRi+BH2hh0ZRZXlrlBzmOg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;20:4df5dSCpfhDDyQR82wqAGn3bn1F5J1B2rDa5DUptzf9z9Cc07rJ8IZcvbLxRX8eprTw2038AzaWEsCZmAOXMChP2coNP1kslQmssDGPz1GHEdhpJo7Jczh7dY8s4AUq952z5Zn3nZTbisIiCpeFd0Sh/9p8qh/ApLx7dIYTPBiI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2018 06:15:47.4207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74e35b2e-d461-42e5-3576-08d63e2f2214 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2293 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes an issue that the sci_remove() could not remove dev_attr_rx_fifo_timeout because uart_remove_one_port() set the port->port.type to PORT_UNKNOWN. Reported-by: Hiromitsu Yamasaki Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs") Cc: # v4.11+ Signed-off-by: Yoshihiro Shimoda Reviewed-by: Ulrich Hecht --- drivers/tty/serial/sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index ab3f6e91..3649b83 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3102,6 +3102,7 @@ static inline int sci_probe_earlyprintk(struct platform_device *pdev) static int sci_remove(struct platform_device *dev) { struct sci_port *port = platform_get_drvdata(dev); + unsigned int type = port->port.type; /* uart_remove_... clears it */ sci_ports_in_use &= ~BIT(port->port.line); uart_remove_one_port(&sci_uart_driver, &port->port); @@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev) sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_trigger.attr); } - if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB || - port->port.type == PORT_HSCIF) { + if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) { sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_timeout.attr); }