Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4162755imb; Wed, 6 Mar 2019 06:53:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyBInb3YeVd7EIDqAGCDciTYDuJusdCOczS8FBAw+otwSbLVfJkoaG6mNxKty5Nq7jgCyBE X-Received: by 2002:a65:5181:: with SMTP id h1mr6641157pgq.422.1551883993360; Wed, 06 Mar 2019 06:53:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551883993; cv=none; d=google.com; s=arc-20160816; b=y2n3CowvmNJsLRqhGhXSkyH755naySCZ8ljc8rJHtbqZI5LhsRxoHIZyP6jPMmfJm2 81j+ZCN+tJtQw7pMyjXmyaWPAOROjMoaSXlaK/2Is84eGrBicbkTYGtnZaedgtHXz6nH gMo47bliypsKOCTH3+PUleigbEISCZRlZGxwGLZ9OkgAoVMeRO5S0ClIJX3muQJ0MKdH VT/SoxQU4f5VUKaPGJRiRbAqP4CPtoNnhdPWo1+qeGmf4+hifelkEHzxRFXVeOqhVDNx FAUYfnmudx6/wmqoQB3IZoB9pVT9fvP4GqtvCNP4jbJzBx6NncMonmtU76hbXvuvBktX xbCg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2ANdLjgbEmfxgy5jGrjDSJW7Ka76GREtBBb+YcWK5ZY=; b=JcxNFqd5h3biarjfTsr2PhiF7GFULjb3o3wr5O0Kg6gqT9o39HZ9qxAhOUlcn+bzBY q8KgBRFydwFZow/fBmlGuVSp9sMXm64tHVXvLyckzG7OnmazGnSBILD0IUUgS6ttWCgO P6sFoNhSlzUaNfK1kGrVcHnh4qrRIKR2AMtfr+mjh1adyh5QC3NHHqUOB9JyZH3zpV21 tky7JU2+6EDkyDl91fR2v31p1H5Ctgtg2Wj238I9yhN2KSLdWVkfqfpVumwRwHN/GpEG XUSinrJcFgRUxLZzxstuovD5AssylI/lkOsy8FF5euyLNr5ks9I2hbMaSNSLgY3HOcR+ M2AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=nfEmlKKw; 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 y6si1611430plk.126.2019.03.06.06.52.56; Wed, 06 Mar 2019 06:53:13 -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=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=nfEmlKKw; 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 S1730113AbfCFMfK (ORCPT + 99 others); Wed, 6 Mar 2019 07:35:10 -0500 Received: from mail-eopbgr680064.outbound.protection.outlook.com ([40.107.68.64]:24919 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729247AbfCFMfJ (ORCPT ); Wed, 6 Mar 2019 07:35:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2ANdLjgbEmfxgy5jGrjDSJW7Ka76GREtBBb+YcWK5ZY=; b=nfEmlKKwdwTZFesiiFkk0kvWjRGyJQTEp07A6V/ct/mNAokZpzNELj10lrSThOvOllYC38iM+iMljxfNSRKVLGZruRpVA3ypYpdXZl9KIpZgOHQpW0yfc2YpveyC05pA0UXJHirZtFcy4GFY00aLNTqcxmtemA9LZOOOHq8PjqM= Received: from MWHPR0201CA0063.namprd02.prod.outlook.com (2603:10b6:301:73::40) by BY2PR0201MB0774.namprd02.prod.outlook.com (2a01:111:e400:2c8c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.18; Wed, 6 Mar 2019 12:35:03 +0000 Received: from SN1NAM02FT017.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by MWHPR0201CA0063.outlook.office365.com (2603:10b6:301:73::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.18 via Frontend Transport; Wed, 6 Mar 2019 12:35:03 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT017.mail.protection.outlook.com (10.152.72.115) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1643.11 via Frontend Transport; Wed, 6 Mar 2019 12:35:02 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1h1VlG-0006I2-Dw; Wed, 06 Mar 2019 04:35:02 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1h1VlB-0004FE-Bs; Wed, 06 Mar 2019 04:34:57 -0800 Received: from [172.30.17.111] by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1h1Vl3-0004Dc-99; Wed, 06 Mar 2019 04:34:49 -0800 Subject: Re: [PATCH v2] tty: xilinx_uartps: Correct return value in probe To: Rajan Vaja , , CC: , , , , References: <1543927882-15091-1-git-send-email-rajan.vaja@xilinx.com> <1551433028-25207-1-git-send-email-rajan.vaja@xilinx.com> From: Michal Simek Message-ID: <0755f963-5f02-d5c7-57e8-d19e3dd2be7f@xilinx.com> Date: Wed, 6 Mar 2019 13:34:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1551433028-25207-1-git-send-email-rajan.vaja@xilinx.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(39850400004)(396003)(2980300002)(189003)(199004)(14444005)(76176011)(186003)(31696002)(26005)(23676004)(2486003)(36756003)(316002)(110136005)(229853002)(6666004)(8936002)(478600001)(9786002)(77096007)(64126003)(106002)(54906003)(50466002)(58126008)(44832011)(486006)(426003)(446003)(230700001)(11346002)(36386004)(126002)(2616005)(106466001)(2906002)(305945005)(4326008)(5660300002)(476003)(65806001)(47776003)(2201001)(356004)(81166006)(63266004)(6246003)(31686004)(336012)(8676002)(65826007)(65956001)(81156014)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR0201MB0774;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0bffb1f-eac6-4339-858e-08d6a23027e7 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060);SRVR:BY2PR0201MB0774; X-MS-TrafficTypeDiagnostic: BY2PR0201MB0774: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB0774;20:1D/2ppR9pfHChfpZsfEau5KA7fQNDqVxgGIEnpyqp2LJ2SUxscMd2fyCjpua/b/eEfOjkJ8FU80n/rzqZYlx1v6hmzBrjUkytHUl4/dhqHHkuCqYdV8Njeac+cyTZ5yMUnMKb4ReWzJhuRTHwnTWVgn3ZdC8GDAaLoIR3e8yiX/LzHQGameh20cicXGKuOROyRwR3NR21QRLm5NicKvp/hQKXLKbDy8vofuUqD+bznmu5XfiB/3D1TtZDktO0PZKGVybA8YE333rmavPdk9CTC41TjZLE8MuNPoBnxOACjO8/Izm+Hl+VNKre/a5imFuhz9nKoXJEUJyQRRCDfseg4eZ+zJgbfxzZPELxTQtFHNnhYo1ICDki4CFsDOzVvynnSQu/VESFCNQxrDHRXaCUgfOrl7slrQButwumTiDKNQXlere2oLwgJZE+N0F4EM0KnejMpqtkK41jxC8q7jls37Rm0XCIcTNLO3mE7YPEuZXN9D18oQj188m3h6wKhG0 X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0968D37274 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyMDFNQjA3NzQ7MjM6ZGI5T3k0SzF6YkM2V1dZQm92Y1RxOVB5?= =?utf-8?B?ZEdua3I2S3RoNTNlM0lMeDhnTUNJb1VraTM4c1ZqVHJkZjIvbWlqTVFnMFF4?= =?utf-8?B?K25JekVQVTVPcTFhL1d5NE51UDk2VXI4V25CVnNXNVVDWFhOT3RGMlZiUno5?= =?utf-8?B?UVpFSG53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UhRII5JV1sZmhEw1hqydyGWXmC3d704UQ7qmn2BI0L8spVditdsziVwSIP8R9+w8tmVBsjqWtvSZiaiYRoNEY/sGPuTYv7BF4cFNRWpcAUBxkgbpeqgwko5JWNRQyKHH4WL15/OD9+ZO+edNBT0yRTPvaE3krzBOAD5sks= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2019 12:35:02.8305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0bffb1f-eac6-4339-858e-08d6a23027e7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB0774 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01. 03. 19 10:37, Rajan Vaja wrote: > Existing driver checks for alternate clock if devm_clk_get() fails > and returns error code for last clock failure. If xilinx_uartps is > called before clock driver, devm_clk_get() returns -EPROBE_DEFER. > In this case, probe should not check for alternate clock as main > clock is already present in DTS and return -EPROBE_DEFER only. > > This patch fixes it by not checking for alternate clock when main > clock get returns -EPROBE_DEFER. > > Signed-off-by: Rajan Vaja > --- > Changes in v2: > * Handle dynamic port allocation error cases > --- > drivers/tty/serial/xilinx_uartps.c | 32 +++++++++++++++++++------------- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c > index 094f295..f7ae73e 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -1547,27 +1547,33 @@ static int cdns_uart_probe(struct platform_device *pdev) > } > > cdns_uart_data->pclk = devm_clk_get(&pdev->dev, "pclk"); > + if (PTR_ERR(cdns_uart_data->pclk) == -EPROBE_DEFER) { > + rc = PTR_ERR(cdns_uart_data->pclk); > + goto err_out_unregister_driver; > + } > + > if (IS_ERR(cdns_uart_data->pclk)) { > cdns_uart_data->pclk = devm_clk_get(&pdev->dev, "aper_clk"); > - if (!IS_ERR(cdns_uart_data->pclk)) > - dev_err(&pdev->dev, "clock name 'aper_clk' is deprecated.\n"); > + if (IS_ERR(cdns_uart_data->pclk)) { > + rc = PTR_ERR(cdns_uart_data->pclk); > + goto err_out_unregister_driver; > + } > + dev_err(&pdev->dev, "clock name 'aper_clk' is deprecated.\n"); > } > - if (IS_ERR(cdns_uart_data->pclk)) { > - dev_err(&pdev->dev, "pclk clock not found.\n"); > - rc = PTR_ERR(cdns_uart_data->pclk); > + > + cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "uart_clk"); > + if (PTR_ERR(cdns_uart_data->uartclk) == -EPROBE_DEFER) { > + rc = PTR_ERR(cdns_uart_data->uartclk); > goto err_out_unregister_driver; > } > > - cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "uart_clk"); > if (IS_ERR(cdns_uart_data->uartclk)) { > cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "ref_clk"); > - if (!IS_ERR(cdns_uart_data->uartclk)) > - dev_err(&pdev->dev, "clock name 'ref_clk' is deprecated.\n"); > - } > - if (IS_ERR(cdns_uart_data->uartclk)) { > - dev_err(&pdev->dev, "uart_clk clock not found.\n"); > - rc = PTR_ERR(cdns_uart_data->uartclk); > - goto err_out_unregister_driver; > + if (IS_ERR(cdns_uart_data->uartclk)) { > + rc = PTR_ERR(cdns_uart_data->uartclk); > + goto err_out_unregister_driver; > + } > + dev_err(&pdev->dev, "clock name 'ref_clk' is deprecated.\n"); > } > > rc = clk_prepare_enable(cdns_uart_data->pclk); > Reviewed-by: Michal Simek Thanks, Michal