Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7270647rwb; Tue, 15 Nov 2022 09:47:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf44S9RusfoQnDFvBOYH+yC79QTfuiDxEFd5b6FO/mPus/2l06QiaUX9MSvhLnf5ZrqLRaKX X-Received: by 2002:a63:5c46:0:b0:43c:a5cb:5d1b with SMTP id n6-20020a635c46000000b0043ca5cb5d1bmr17419500pgm.134.1668534474152; Tue, 15 Nov 2022 09:47:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668534474; cv=pass; d=google.com; s=arc-20160816; b=U6atdZ6BvNwQ6pper7SdxHxwdC4Nsd3HZU3gMDDoGcme7RD+45PDy3SfSpNar6fYw/ KvH0+1GsDsITYtvJr3lHvbx4GygBzbTX/9DMY+ws96YoSs/vfuTRR+yLcJjP7UA7AJFX E0MGAQ1QtzdFyoTbK89Ti6jfPaRsHg84Y43t+HfEXGc1EkY8Bwhvts2vIQPUFEWk14FQ Y8XtKNgpUGcVhQR2ARq5eZwls0fcUY05vXf9RuFyPiL9CZZJ3XquXFYE5MYw134BcrcR zJBo3Artr0Ad1E7zO0JnPDDrG1hZH4A9V34XE5JShdWpNB3IxKqEJgZX3kqRblg+jkfk Y5Lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=+JLxNMulTW1c/B9J/1LLMjJHEIYS/WVkcry59E7cI0M=; b=pJZW9dRYbDlw7UnL33+TG/nHWxWK1mT7gWNg1RRGDOWrQYmIkH5COFL3w0XWzO0rdE Bqsr0ljMYtWdqtx1beeOxEuzmtLnrdy0AA8x3IipPKiL5gkZcxvrGASBSzg//vbbjnNO Vi1OcuiLoSETMvuSg6KRF5cRyg9an5EyWRLzOiEmlrQlb8BIcvXyzGhM/A3g4I9NRNfD hBMKBgeKFN5bV+NvL+KpXLOnW1m8k7sSsDb6ooVaDb1vkvHLzBRQjRp0IPcywlbupWTZ UQ0XSollhqZ1+DtFP1o95l08z1p+07osuJ45j0o8OsWm6IIXI+H488csqCgFWnTU+BFf Eaow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=ZqdBFRZa; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a056a00180300b0056d3b0b4cdbsi14998594pfa.13.2022.11.15.09.47.40; Tue, 15 Nov 2022 09:47:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=ZqdBFRZa; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbiKOROr (ORCPT + 90 others); Tue, 15 Nov 2022 12:14:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbiKOROp (ORCPT ); Tue, 15 Nov 2022 12:14:45 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2114.outbound.protection.outlook.com [40.107.22.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3096513D3E; Tue, 15 Nov 2022 09:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+pY7dk/J1IJQLTOfVTvMKou+bcxyQsTobQVlF4cYvSOYNfr9f8D7iz3ZrpQvYona5xZGS46hbwSgJUfi1rQg5L7QonUQlzFamW5L4iH0AxseLTwdXQxkwYdKL5H7y0wVPebOA/kBSslJ/Fv4r0CPPTBhLK6y/CIMMGSbzWm0KO9N2Y0eMDtFlePBF5Cm0OnoBNtpbL1dYV2yB4fzqb1JyaKQP85UPSYlJ/x5G/4K8hRNomWe1AilTL4o4VZ3G0Oxg/lNIk2pZyGkHC06npMBpjcq2y0HoWHouXdhRzA3QWnl8SX9vM8hc7tvnNWXuSwDWaR9RIv4cS2aQF6LL1aEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+JLxNMulTW1c/B9J/1LLMjJHEIYS/WVkcry59E7cI0M=; b=GFXIE5i14fIJMYQyYFwgZTNpoXKR3e1qDnV3gT7CAHgbaseqN9zzWAKDaDCh2j1/dYulNhVVgh+IjmMXalyS/H9MWSeuihWXbGpqWIXToaeTyVttV1tnAOuUAvjUh+v6xqBWoqHHcsK089htvdJ/H9amCpUcp8mrOZK9auyG6Rbvm3DzaK/78BQLoYC5xAOR8QKrx7VeNDLauTNE3E6MXUXFAd9av7j1nArNLwOBWpNM2+MZF6y5fYUg1KmyjlDoV04fNjpGhSBrjyULII8ymZoJfd6Uiml6qfG14TnamAdcB/r0RkUP9uGyvfEPfDSYBn8RpSScXL7TSCeo9+1LZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kontron.de; dmarc=pass action=none header.from=kontron.de; dkim=pass header.d=kontron.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mysnt.onmicrosoft.com; s=selector2-mysnt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+JLxNMulTW1c/B9J/1LLMjJHEIYS/WVkcry59E7cI0M=; b=ZqdBFRZarA6CP7Pbz0uiU/yNFYjuxVI7weOtPq6l6FhJ5VSNhnh9JnWFNL8BekQ8iuhA4mcWqDqL1QEYS6geQyADbFw9pDNQAjYqIo3rGeL90u1BqM87GMPNBG7AJ8T79E3E7VDCBDe03ZvPlhw1taQT87ngAnckIR4rpMrXOr8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kontron.de; Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) by AS8PR10MB6868.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5b5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18; Tue, 15 Nov 2022 17:14:41 +0000 Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::f209:bc86:3574:2ae6]) by PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::f209:bc86:3574:2ae6%5]) with mapi id 15.20.5813.017; Tue, 15 Nov 2022 17:14:41 +0000 Message-ID: <06f8339c-4be1-159f-9374-ef8e6031da1e@kontron.de> Date: Tue, 15 Nov 2022 18:14:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2] spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock Content-Language: en-US To: Marc Kleine-Budde , Frieder Schrempf Cc: David Jander , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown , Sascha Hauer , Shawn Guo , Marek Vasut , NXP Linux Team , stable@vger.kernel.org, Pengutronix Kernel Team , Baruch Siach , Fabio Estevam , Minghao Chi References: <20221115162654.2016820-1-frieder@fris.de> <20221115165413.4tvmhiv64gdmctml@pengutronix.de> From: Frieder Schrempf In-Reply-To: <20221115165413.4tvmhiv64gdmctml@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BE0P281CA0021.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:14::8) To PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5681:EE_|AS8PR10MB6868:EE_ X-MS-Office365-Filtering-Correlation-Id: 8810e158-1eac-41fa-a30d-08dac72ce1df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZNncG6ZPimCTAIh3e8XcCwPIv4OLZT1BGnj9sbiijZxeFdgtzAt3vK4FywsWI016E0tdyzHcyyshfzem+maZL+4VZ9eVkCgtJ8t2oRrfWmZrFvcL3pT/ksk+xwFo51irSNHmrPm2/z4uHKLtEWfAw/j3hxpmQNvTwZfWk8qGzTsZbwJeRfcLgucni/ecfmY1iSCl1mmw7IZV4F4NYzP2HOhhvXiV0Tp+VQloGcuTFJHxGO2J1e2fixMpOlFeatO6n4jr4pNDUJSgDEA8SPDQvJytxvlcHwvRH620v6gHbaeEWMQF8Y9r01+0bhy45Xdg7wpqJsql8regrkJCVC88xOZRvt9BH1eOqpTWyfyvvXO8owcxiAdqYRm1+DST9jzCyI0Z4iMEEzp/VEj3OI8qsYOkDbcMJBi1EWxFCotn69P5d1jMB5Jx78U6SVD0m9Cw/sRBghoeuXmpEnbsJirV/FEURa4wSKDeFZy+WEOt9tLBcOGenoMXjnj4Lzbniavr4loRnq2ZAasDMc6EARoPJ3sGnKgBOMi0jtoQE1B/EM5H48+6pftKyi555ZJ75soogfnDvrM7rqD7FzGLxUmOuXGDzWNhTQ2nFiUawnYF4POQRnWc8DnUYoAUvUwsxTvfFjybF/PDE5z1engwLoK7rhQXKZFXhS/ynGWCFV8UmsWkXlNfZf9/2/MSmDmaV4d+N0Z8W/W642ZwqNTi3FWKo8bSXYSvUuve/tQ4KMXRz6F24QLDNdEc/cgTQEfqmzJZLPAHfnDBuxN/R9sebNqbRIjAFnq5c/CJ5ABPinflO8w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(39860400002)(376002)(366004)(136003)(451199015)(86362001)(31696002)(6512007)(38100700002)(316002)(53546011)(66476007)(44832011)(83380400001)(41300700001)(2906002)(8676002)(66946007)(4326008)(66556008)(186003)(8936002)(36756003)(5660300002)(7416002)(2616005)(478600001)(31686004)(6486002)(6506007)(110136005)(6666004)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TzUrU0FtVnowdmRtRm1MZEpXRkZCM2pVbmt3SDlpT0NZQ1pGY0VmclhkSkYw?= =?utf-8?B?SUFWMFl5cnNybXhEQUZ1clhRYjB1SnNyT3ZtOGdhWU5RNGtoc3l2UWsyVGVY?= =?utf-8?B?d0hGM1l3ZldqbnpSVWNZZlhha3BqMHovcHA0NU5IOXI3a0tlZ1l1T2xvaHJT?= =?utf-8?B?NG9lRmdTN2xrR3Y2QW5BZkpQN2wyRzNuYlRVMDFWQVNRaW44Nmp0a0xVYXg0?= =?utf-8?B?SmphRkNwUCtnQUNRNE1PaWYvNEhNMXh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f-8?B?N1RjeitiMm1ueUxCWHEvSHRSemV6dkFiT0NzSjFWajEzbTR0V3dhWFo5QVQ0?= =?utf-8?B?eTArQTVGZmZDL0x2RUx3Y2Z6UUVScjdTb3Fqa1dBR1pLNDBUY1BuMTZ5THJw?= =?utf-8?Q?RGbMYSMnKyFOg1+WPeLahYHu0mOYkWtjSz23A9B1QvjL?= X-OriginatorOrg: kontron.de X-MS-Exchange-CrossTenant-Network-Message-Id: 8810e158-1eac-41fa-a30d-08dac72ce1df X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 17:14:40.9301 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c9d3c97-3fd9-41c8-a2b1-646f3942daf1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cCXQHb7qmY8xyR/zBCgjTXkbx6Gd2qb6NY6AFdPnfrPnbtKY+pyvVSlsyL7IdV8StYleobI6I761oRNOko4OqjIj+f0rv4S1WXq/HUxVSJY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB6868 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.11.22 17:54, Marc Kleine-Budde wrote: > On 15.11.2022 17:26:53, Frieder Schrempf wrote: >> From: Frieder Schrempf >> >> In case the requested bus clock is higher than the input clock, the correct >> dividers (pre = 0, post = 0) are returned from mx51_ecspi_clkdiv(), but >> *fres is left uninitialized and therefore contains an arbitrary value. >> >> This causes trouble for the recently introduced PIO polling feature as the >> value in spi_imx->spi_bus_clk is used there to calculate for which >> transfers to enable PIO polling. >> >> Fix this by setting *fres even if no clock dividers are in use. >> >> This issue was observed on Kontron BL i.MX8MM with an SPI peripheral clock set >> to 50 MHz by default and a requested SPI bus clock of 80 MHz for the SPI NOR >> flash. >> >> With the fix applied the debug message from mx51_ecspi_clkdiv() now prints the >> following: >> >> spi_imx 30820000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 50000000, >> post: 0, pre: 0 >> >> Fixes: 07e759387788 ("spi: spi-imx: add PIO polling support") You want me to remove this tag? > The *fres parameter was introduced in: > > | Fixes: 6fd8b8503a0d ("spi: spi-imx: Fix out-of-order CS/SCLK operation at low speeds") and instead add back this tag? I wasn't really sure about that. > > The exiting code: > > | if (unlikely(fspi > fin)) > | return 0; > > was not sufficient any more and should be fixed. You want me to add this in the description? Or is this just the explanation for why 6fd8b8503a0d should be in the Fixes tag?