From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8895CC41513 for ; Thu, 27 Jul 2023 20:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231172AbjG0Uns (ORCPT ); Thu, 27 Jul 2023 16:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjG0Unp (ORCPT ); Thu, 27 Jul 2023 16:43:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A25E22D5B; Thu, 27 Jul 2023 13:43:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3F54F61F44; Thu, 27 Jul 2023 20:43:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C880AC433C8; Thu, 27 Jul 2023 20:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690490623; bh=QlIHP8dhX5OJKYng0fljwWznF8dNsUY8Bn/VfqY1drk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dZyI1Xl51voxYvqt1b7E85tntZQ5XlSa5Ls6CckQJLCdMgznvnKbraiKe8MCHhYVf DrFwWDUwwoZ9KNsfdjh4jNrM/UkjjT4chmd64CdvouO15NN6LgcuRJ+cEgjG/UWkA3 0dKQm1OYI3mxScCV8kGX0g4SvK5S4t0FEUTqhArHzrugieUdAx36AXcoboDy6v364m T2mQ/Ei6DCnpT3TC+a0WyOKPRg+4BTbKs+ejkeSCI0qWD1OP2BSmT1+g3VuIgZJc0g PKNEKGfAxViz2VIsXv60rn6c0AEPlnT7t2Ii7UMCy4PP/SWbPFI+0T4mBTn+Cw77LJ 0WRtMZ0GcA+bw== Date: Thu, 27 Jul 2023 22:43:40 +0200 From: Andi Shyti To: Chengfeng Ye Cc: rjui@broadcom.com, sbranden@broadcom.com, wsa@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue Message-ID: <20230727204340.454cmkli5gotipmb@intel.intel> References: <20230707084941.28964-1-dg573847474@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230707084941.28964-1-dg573847474@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chengfeng, On Fri, Jul 07, 2023 at 08:49:41AM +0000, Chengfeng Ye wrote: > iproc_i2c_rd_reg() and iproc_i2c_wr_reg() are called from both > interrupt context (e.g. bcm_iproc_i2c_isr) and process context > (e.g. bcm_iproc_i2c_suspend). Therefore, interrupts should be > disabled to avoid potential deadlock. To prevent this scenario, > use spin_lock_irqsave(). > > Fixes: 9a1038728037 ("i2c: iproc: add NIC I2C support") > Signed-off-by: Chengfeng Ye Reviewed-by: Andi Shyti Thanks, Andi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EEE2EB64DD for ; Thu, 27 Jul 2023 20:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/zYFZlvIq+0UO6oqJYE9Kk54/hHpXq39NaDkVWl0Uxo=; b=bDwzgbeZ64IIxA WiX7bZJeTs0zttbr2V6BF20jaW1Qhb6l5i7x1I2YCmK7vmcygZW9jyJ9kgCLz69mPXlkwgxZ01zKc +GTl+oliIEvCxKJG7elZCfvWpbExUPhGb4lUt8Xr60CuEZyDoz9pT2rHk8hdLFh8Feeyf3JpDbRpI cpweC7vOMvc3HwkHlJF8484CU+kZCN0lpiGZytpreH3CnAiuEJoqJtaenjCXzjTRPADFKZSsoc2NY p3Jeq6PrdH1R4XjdtwVPMlBsAZRO9nnHPlQ31UrPLDgTQ/8hhYTqpLefDPL0E2EhZXoTkxLp9JT4Z 3TeNJXVk7cfbk3bdmkPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP7pr-000V7i-2g; Thu, 27 Jul 2023 20:43:47 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP7po-000V7L-34 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 20:43:46 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30DF761F23; Thu, 27 Jul 2023 20:43:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C880AC433C8; Thu, 27 Jul 2023 20:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690490623; bh=QlIHP8dhX5OJKYng0fljwWznF8dNsUY8Bn/VfqY1drk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dZyI1Xl51voxYvqt1b7E85tntZQ5XlSa5Ls6CckQJLCdMgznvnKbraiKe8MCHhYVf DrFwWDUwwoZ9KNsfdjh4jNrM/UkjjT4chmd64CdvouO15NN6LgcuRJ+cEgjG/UWkA3 0dKQm1OYI3mxScCV8kGX0g4SvK5S4t0FEUTqhArHzrugieUdAx36AXcoboDy6v364m T2mQ/Ei6DCnpT3TC+a0WyOKPRg+4BTbKs+ejkeSCI0qWD1OP2BSmT1+g3VuIgZJc0g PKNEKGfAxViz2VIsXv60rn6c0AEPlnT7t2Ii7UMCy4PP/SWbPFI+0T4mBTn+Cw77LJ 0WRtMZ0GcA+bw== Date: Thu, 27 Jul 2023 22:43:40 +0200 From: Andi Shyti To: Chengfeng Ye Cc: rjui@broadcom.com, sbranden@broadcom.com, wsa@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue Message-ID: <20230727204340.454cmkli5gotipmb@intel.intel> References: <20230707084941.28964-1-dg573847474@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230707084941.28964-1-dg573847474@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_134345_055832_E9E18E60 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Chengfeng, On Fri, Jul 07, 2023 at 08:49:41AM +0000, Chengfeng Ye wrote: > iproc_i2c_rd_reg() and iproc_i2c_wr_reg() are called from both > interrupt context (e.g. bcm_iproc_i2c_isr) and process context > (e.g. bcm_iproc_i2c_suspend). Therefore, interrupts should be > disabled to avoid potential deadlock. To prevent this scenario, > use spin_lock_irqsave(). > > Fixes: 9a1038728037 ("i2c: iproc: add NIC I2C support") > Signed-off-by: Chengfeng Ye Reviewed-by: Andi Shyti Thanks, Andi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel