Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp771432pxv; Thu, 15 Jul 2021 15:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3z9C8DWQPjIwP57wlwbkhYTwZ1hKsdDZP3pZ7sePOrHgZAtZbaYgliCrjCIdAIwY9R0st X-Received: by 2002:a05:6638:2656:: with SMTP id n22mr5927410jat.64.1626389625293; Thu, 15 Jul 2021 15:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626389625; cv=none; d=google.com; s=arc-20160816; b=HJ+JKlSrKNBczIRmPsCQJF58D8VanoxU7n29Et9eb3iCo0KuMV6uGHlRjKYabcaMn3 G1Mx+rgt+qeCvLj6PonKa7xq+MjF8CgNgZsRMMpRNwV+VBTbQuvj8G2Su4Wrq4M/bLY0 n8LoZfDPIOkmUbmtJfh7HGO3jEol3r3nO5NiXHLzwR9bfXNzOaqkNdjwIg4eRkiFOUkL NrwqbBtk3OAmnlXCAu4nqtIXP4pYF8lvgXV1NqSThOwJZdWINtiSkQEVBiW9Ue4EG/zh 1NkyTgqNVk2u5dHu57b72sKba+QNXnq4YXEn3xMC6+agTS4u7SSI3nc5lBKIabPk2/Zt a/Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=FWqN34kNTMLTDYOi7+8W9VhUVByKrNmjiWc6/dg78vk=; b=1F6vnrOztXQYs6FUYIRxI8R3B4OxAWmNbbQofsj/gesG4W9qtHac/0IJdodEdjMTJZ FJKE12uIukOhxXKXFEsYiHuURgExczu+IZfWXE8aljYuNEQiwKNWE39sd+lf9DtdXS30 gMHQQtNAACcMdBua7X7a46IGCTmwK/bfegcZzpPadMSKXFF8JTDJc+YP2O4S+GdTaoe6 ewANmIndSL+gMTntKo7X5P5UCGNeaBWk9eOjPtauQEg0Fw0kUqM0sr/AKvVRU+xUTM1Y oE76WL00U8C7tJgbKYi3mQ8aE57GRE3+ICt9za/zTBFRLPuQZ9g5xeUairObJSSSl/cU +e9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si7694188ile.132.2021.07.15.15.53.27; Thu, 15 Jul 2021 15:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbhGOWzC convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Jul 2021 18:55:02 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:33071 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbhGOWzB (ORCPT ); Thu, 15 Jul 2021 18:55:01 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 7C2E51C0002; Thu, 15 Jul 2021 22:52:06 +0000 (UTC) Date: Fri, 16 Jul 2021 00:52:05 +0200 From: Miquel Raynal To: Clark Wang Cc: conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, vitor.soares@synopsys.com, boris.brezillon@bootlin.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] i3c: master: svc: fix atomic issue Message-ID: <20210716005205.5e218d47@xps13> In-Reply-To: <20210715082413.3042149-3-xiaoning.wang@nxp.com> References: <20210715082413.3042149-1-xiaoning.wang@nxp.com> <20210715082413.3042149-3-xiaoning.wang@nxp.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Clark, Clark Wang wrote on Thu, 15 Jul 2021 16:24:11 +0800: > do_daa_locked() function is in a spin lock environment, use > readl_poll_timeout_atomic() to replace the origin > readl_poll_timeout(). > > Signed-off-by: Clark Wang > --- > drivers/i3c/master/svc-i3c-master.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > index c25a372f6820..9d80435638ea 100644 > --- a/drivers/i3c/master/svc-i3c-master.c > +++ b/drivers/i3c/master/svc-i3c-master.c > @@ -656,7 +656,7 @@ static int svc_i3c_master_readb(struct svc_i3c_master *master, u8 *dst, > u32 reg; > > for (i = 0; i < len; i++) { > - ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, > + ret = readl_poll_timeout_atomic(master->regs + SVC_I3C_MSTATUS, reg, > SVC_I3C_MSTATUS_RXPEND(reg), 0, 1000); You forgot to align the parameters of the function here and below. Otherwise, Reviewed-by: Miquel Raynal > if (ret) > return ret; > @@ -687,7 +687,7 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, > * Either one slave will send its ID, or the assignment process > * is done. > */ > - ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, > + ret = readl_poll_timeout_atomic(master->regs + SVC_I3C_MSTATUS, reg, > SVC_I3C_MSTATUS_RXPEND(reg) | > SVC_I3C_MSTATUS_MCTRLDONE(reg), > 1, 1000); > @@ -744,7 +744,7 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, > } > > /* Wait for the slave to be ready to receive its address */ > - ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, > + ret = readl_poll_timeout_atomic(master->regs + SVC_I3C_MSTATUS, reg, > SVC_I3C_MSTATUS_MCTRLDONE(reg) && > SVC_I3C_MSTATUS_STATE_DAA(reg) && > SVC_I3C_MSTATUS_BETWEEN(reg), Thanks, Miquèl