Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2327558pxa; Mon, 3 Aug 2020 13:20:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKksm+rvzW/YZIGx4+cp/jwzeWp8egdNfJhLBPI8RwukCry8V2JFWRK1KNL/9yAzdyKoTZ X-Received: by 2002:a17:906:f14f:: with SMTP id gw15mr17624660ejb.245.1596486045365; Mon, 03 Aug 2020 13:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596486045; cv=none; d=google.com; s=arc-20160816; b=oJGA2vfHFHVt4fDkTRuaVUdWGA49syyYE1T6NHDuBAqeQvVSLQfva0ZkqC8e7s7xaK no2og4NxTxzFeBnFIMWrhwH3D/bHqnD616EEXny+DgdDAWIiPlozZl+QBFbhW2t84TfA 8OTM5gCg7r3o5R7/0mjz524/7/4LgNiaEdGdmqo1WTR9JqvAgsGBjfmSXbGHiWuLGx1B 8RBJLc2i+seD3ipJ0OZNUG7ewkdADzcfP2ZIgfcndbD8tp7IfB7tglWzswj4IAmIM4yY /5tXbY813KiYPH9dk6vbGQTG57mz5GQQx9DJgfVrR3cx0H91nQrWiTpMn31efjgLu5KW xVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=/aX/eZj8/olC+wQApjH5bdD9emyUAZYEpYAp8OBtpek=; b=EpJypYn/0PR65rluek5bVynmbyn/O9BVID9+7X0XWFGJA3iZp5v1Vbe8+CjqHP4wD/ uN9sie/aDzyayxcK1MLd5ISHnPI6+KR3U4q1br+w8v23tg/BBWSSr0LQgMSWUlsjtf1K 0JCd+7k91YiaTyMHlsvpImUAF5h/OIyhWoCJQj4FFg8Cj6E9bkwvONjAaM1x62Z2Fxv6 lB6lu5VkueL+UCeqs9TQCWn5Z4UmVdL0Kc7bdO08aeznb7SO9k5igEUsshxwgjjM6BK0 590/O0rdaBwKlMp7a5dERGXzbjDRyUi8tFndOOh9jQ0+jDuvjkgJJCxdmc2CnoRIFfrZ BOdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=dddKWnC4; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=PLDu4peJ; 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 ss14si10568474ejb.651.2020.08.03.13.20.22; Mon, 03 Aug 2020 13:20: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; dkim=pass header.i=@pobox.com header.s=sasl header.b=dddKWnC4; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=PLDu4peJ; 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 S1726767AbgHCUUS (ORCPT + 99 others); Mon, 3 Aug 2020 16:20:18 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:64517 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbgHCUUS (ORCPT ); Mon, 3 Aug 2020 16:20:18 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8731CF554D; Mon, 3 Aug 2020 16:20:16 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=PF90wNMuKpjCQ5V/5619nvwTLro=; b=dddKWn C44X0MRBNrallMp/OYIZNUaHHnSOD31wde63SYuclky+jvS7AokK5gpWV4ZpDQp8 1YS2JK/IY5WAZcq1jarHa6cRuFYp/jvIy4hyBAXdxB5LRAz+W4kPtznwOMHlWmc0 2aUvRMw7tYOPek0quk9K5ioEvcyKfG+qDDKrs= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 7F25CF554C; Mon, 3 Aug 2020 16:20:16 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=Q9xTu3Q7G6ybCTets5WU0b++RTe3jw3gfIDCaIw+Fog=; b=PLDu4peJV9GFqRgQ/gK3uKs6SclhX6iumGQpARWgslvZ828s41isyydhcY7iIHhe2e64FRi8PUaMlo1CFSRE4HJYWM8Dru0DeXAh61lbYkj3l5iYcA95R9VwQbau3alTvFj1CKrn/zpzhsFyb/bU85/IesAEyZdhQ/WtDqbkfjA= Received: from yoda.home (unknown [24.203.50.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 6E6C2F554B; Mon, 3 Aug 2020 16:20:13 -0400 (EDT) (envelope-from nico@fluxnic.net) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id 851B62DA0BFC; Mon, 3 Aug 2020 16:20:11 -0400 (EDT) Date: Mon, 3 Aug 2020 16:20:11 -0400 (EDT) From: Nicolas Pitre To: Miquel Raynal cc: Boris Brezillon , linux-i3c@lists.infradead.org, Thomas Petazzoni , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Culhane , Rajeev Huralikoppi , npitre@baylibre.com Subject: Re: [PATCH 3/4] i3c: master: svc: Add Silvaco I3C master driver In-Reply-To: <20200709080159.2178-3-miquel.raynal@bootlin.com> Message-ID: References: <20200709080159.2178-1-miquel.raynal@bootlin.com> <20200709080159.2178-3-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: BCB8755A-D5C6-11EA-B562-F0EA2EB3C613-78420484!pb-smtp20.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Jul 2020, Miquel Raynal wrote: > Add support for Silvaco I3C dual-role IP. The master role is supported > in SDR mode only. I2C transfers have not been tested but are shared > because they are so close to the I3C transfers in terms of registers > configuration. > > Signed-off-by: Miquel Raynal I'm worried by constructs like these: > +static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, > + struct i3c_dev_desc *dev) > +{ > + struct svc_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev); > + struct i3c_ibi_slot *slot; > + unsigned int count; > + u32 mdatactrl; > + u8 *buf; > + int ret; > + u32 reg; > + > + spin_lock(&master->ibi.lock); > + > + slot = i3c_generic_ibi_get_free_slot(data->ibi_pool); > + if (!slot) { > + ret = -ENOSPC; > + goto unlock; > + } > + > + slot->len = 0; > + buf = slot->data; > + > + ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, > + reg & SVC_I3C_MINT_RXPEND, 0, 1000); Here you're in atomic context due to the lock, and readl_poll_timeout(() is built using usleep() which may ... sleep. Also, is it actually possible for execution to reach this point if SVC_I3C_MINT_RXPEND is not set? The rest looks reasonable to me. Nicolas