Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2574040rdb; Fri, 8 Dec 2023 12:04:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFszpFYIO/b/tze2KtCxGbFXr4l8Tec5Ul87lkR9zC8G89BpSV/H3bs7CQQHqExagAdFFrP X-Received: by 2002:a17:902:b706:b0:1d0:737d:2ae5 with SMTP id d6-20020a170902b70600b001d0737d2ae5mr537915pls.87.1702065885529; Fri, 08 Dec 2023 12:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702065885; cv=none; d=google.com; s=arc-20160816; b=rcv82cy9mgpucqhgRK326WSV6YnZJDNtzFNFTUuqp9k2iVVBVDUsl8lHN1RBgUX+80 YTLv4C+XofDDRHbwyrUYJkEgA9PX+nTM0Q2Fd6LPBimSAN2dZDJbWgRFVDixS1JMWSS3 pqDRSNyxFgCyftF8Au9A+UrsOYX6aAQgzciTO6oKXkyBNbnHp9+JYcKV90dx6t9W/DBm 82dagfJU9bgvnC79Nw0kojoK6angVe96NJZY2vk9TV4cWL+ngpPBk5yNyBW0lDIc4xoz pkuiTm+f2SpBu83TU/cmDfbTfTPb45b57vPW7I5NgBF1MobHnwqt8Ie3XPqIKyv0sWbe VwZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cX5Vg9a0IkVW3BjGrXENCr+eL35XN1Nr2QqLalPjMt4=; fh=5gVA+MNJeXu4BIHsY7bOpCEL+Di29JpfL36gk0sTJkg=; b=0nX/77ae+LJ6ihpcdlECPneGZ4kIuSfQuDkRSQSRn+x6+GcDkzvngn+Uvn/xvq1fIm BAFT3UcWdpeOIjPocyZGZSvBCncxUZola0JNVfUDAXF68a+6rLcrF7Dvm9VvRhbdLkH9 15tbe/0PR4djvRbjSsYVjPD2pLobvsTBfJeT8Xu67Uzn7KGzo2hA/wIMz9aV5ZuJslWp /hGp87ez4k3URppZpvoQ4DlxPcCQl0h9NXfcL1bvOu+9qdS3x0kvcUDaP23hx4rzQeMy 8Kg1FcjfMxdyrsQ6cA5BuO3M81D8kCXZKbqHGp4QeR1HVUtC828zuGqXqCMHrYCzvv3U H5cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOVNZuLt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a22-20020a631a56000000b005be1ee5b99fsi1940521pgm.526.2023.12.08.12.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 12:04:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOVNZuLt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 969EE8076D2B; Fri, 8 Dec 2023 12:04:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233996AbjLHUE0 (ORCPT + 99 others); Fri, 8 Dec 2023 15:04:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbjLHUEZ (ORCPT ); Fri, 8 Dec 2023 15:04:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E980B173B for ; Fri, 8 Dec 2023 12:04:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4782C433C7; Fri, 8 Dec 2023 20:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702065871; bh=dAzTKis/A168Bq4izb0pTdVXcvwbLPWwjZhbjyGsfuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WOVNZuLtre13kBHgee4m2/HCdLbvfRd1C1jVy8YMKKwP7MMWca0oI/drSpeiVxYA6 d0LAbuKH3mFEpct4nl2L0b8av5Ow5koo0UDmh9UgFhOP+DVBfG2nP5N0tR8sboReaY mzPU/LM0PrPw8axcAzodwT5pjvtKfDrMYWlGUBYSWQLYWfmgVt3ZKEA8N2qkajdR9q sEQa6D0oUosCDitw3268nUaQTbX7ppmAr5dK1heV605xNr9bhdO8OWsNcjjTOqoch6 yy41038aEt2+gqOQs7YShU9VmIUGDCI8cZSLrdW5cLADPB2qVeTN4okZyp0VFvMsVM lAVXGb7aruChg== Date: Fri, 8 Dec 2023 21:04:25 +0100 From: Andi Shyti To: Alain Volmat Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Pierre-Yves MORDRET , Conor Dooley , Rob Herring , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/7] i2c: stm32f7: perform most of irq job in threaded handler Message-ID: <20231208200425.zli2j6b4lt4shasn@zenone.zhora.eu> References: <20231208164719.3584028-1-alain.volmat@foss.st.com> <20231208164719.3584028-2-alain.volmat@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208164719.3584028-2-alain.volmat@foss.st.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 12:04:43 -0800 (PST) Hi Alain, On Fri, Dec 08, 2023 at 05:47:10PM +0100, Alain Volmat wrote: > The irq handling is currently split between the irq handler > and the threaded irq handler. Some of the handling (such as > dma related stuffs) done within the irq handler might sleep or > take some time leading to issues if the kernel is built with > realtime constraints. In order to fix that, perform an overall > rework to perform most of the job within the threaded handler > and only keep fifo access in the non threaded handler. > > Signed-off-by: Alain Volmat quite a difficult review because this git diff algorithm makes it difficult to read throuhg. But it looks like just a copy paste from to stm32f7_i2c_isr_event() to stm32f7_i2c_isr_event_thread() of the STM32F7_I2C_ISR_NACKF, STM32F7_I2C_ISR_STOPF, STM32F7_I2C_ISR_TC and STM32F7_I2C_ISR_TCR. [...] > +static irqreturn_t stm32f7_i2c_isr_event_thread(int irq, void *data) > +{ > + struct stm32f7_i2c_dev *i2c_dev = data; > + struct stm32f7_i2c_msg *f7_msg = &i2c_dev->f7_msg; > + struct stm32_i2c_dma *dma = i2c_dev->dma; > + void __iomem *base = i2c_dev->base; > + u32 status, mask; > + int ret; > + > + if (!i2c_dev->master_mode) > + return stm32f7_i2c_slave_isr_event(i2c_dev); > + > + status = readl_relaxed(i2c_dev->base + STM32F7_I2C_ISR); looks to me like this readl_relaxed is read too many times during the whole irq handling. Reviewed-by: Andi Shyti Thanks, Andi