Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp507842ybz; Fri, 24 Apr 2020 04:26:58 -0700 (PDT) X-Google-Smtp-Source: APiQypL0BMfLUX9QOgT2S2MYx7KWPvVbt8ZkWKxR2RHJdpNy+nAH1P/EicF81LVE/dfKts9G6oq0 X-Received: by 2002:a50:da49:: with SMTP id a9mr6387031edk.388.1587727618811; Fri, 24 Apr 2020 04:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587727618; cv=none; d=google.com; s=arc-20160816; b=eJj/PxJHw4kNTVuApOx78KnCwwGXGeMpiMhTO0w/3bziZUL+k1wpG2VyxW7k3USRGW IR1OZMJeE9mgo+XFhQ5kxzNa7MmafmTFOdT8Mt03Tj4I7NvXEa1pp0AuqYfBaWyGcW+W 1wG18LpPXEZO0HZ/907B/q4katU3dg9cgyWqVGRwsR42NAVsN3K6+kMKkgf0NER5xBqv KBFhasyeVwj20cjGCB6Qkz7ZdorYl/Aie0r6+Xzty5Y35QOUvuMUkMNK95eGHcQarNmX GMwpVdU3B+2MxTz8HoXtblsZscXFtz5a9bbGFpJRuCY8LAm+D9/qGs61tGJqgM2HAXqs H/RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ToqCVoKWeMyLe4zxIu+ssYDh5PqojvZf/ODjgPShKvk=; b=dnoJtNVe27j5+f//coFeeuBM5he3S0AGEMPfKoEjIvDxnqtxqD6C6b4uSBSfC+r9iD FXpeqwkM6eCHjg1+49Hf87elU0RzYJdBEtr36GSbrt7izt+XkCDNZQu1p/CnvH7Wmo1L HbWYle+3vgaSU7UQjmIyF8pBt8ZLe3su6sO67aiApTghsmbPB7IXBvdefSNrHa4Oo4Ur gqmb+wbtEMNSfyOMQxs4uwOZLeEMEQE3MSEvgDv92u/YhM1AFMSkYCbYgmUEEapUywbl tRZtIHqHUAuzJ2TxSIkotjuww12f/jorA/mls/pTMUybVEaI75T0I8kLRUrC6IiiHeui ZAQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q7VhYJRY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h27si3039137eja.40.2020.04.24.04.26.34; Fri, 24 Apr 2020 04:26:58 -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=@kernel.org header.s=default header.b=q7VhYJRY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbgDXLZJ (ORCPT + 99 others); Fri, 24 Apr 2020 07:25:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:58590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgDXLZI (ORCPT ); Fri, 24 Apr 2020 07:25:08 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48B7B20736; Fri, 24 Apr 2020 11:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587727507; bh=jMRabbOYU0+i+Mp4IDehVLSW1V5c3YcEuzYz82B8Yuk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q7VhYJRYu2T4R8Z+FwEBdzfkZJaUQ697sedXWWcK80RJOIOIYHrPDacNCU1CL2hf4 PZMQ3B7egTzq8Ww/QMpP+mUwiJQ2yAn+8bVynnpTMCYjHrES57+RsVQMFSyivduqpA CL4L/bnhEGchXUCF/trNAU0YG8fShliPWsdWsJZc= Date: Fri, 24 Apr 2020 12:25:05 +0100 From: Mark Brown To: Dilip Kota Cc: robh@kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, daniel.schwierzeck@gmail.com, hauke@hauke-m.de, andriy.shevchenko@intel.com, cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com Subject: Re: [PATCH 1/4] spi: lantiq: Synchronize interrupt handlers and transfers Message-ID: <20200424112505.GD5850@sirena.org.uk> References: <3bf88d24b9cad9f3df1da8ed65bf55c05693b0f2.1587702428.git.eswara.kota@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lc9FT7cWel8HagAv" Content-Disposition: inline In-Reply-To: <3bf88d24b9cad9f3df1da8ed65bf55c05693b0f2.1587702428.git.eswara.kota@linux.intel.com> X-Cookie: Information is the inverse of entropy. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lc9FT7cWel8HagAv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 24, 2020 at 06:42:30PM +0800, Dilip Kota wrote: > Synchronize tx, rx and error interrupts by registering to the > same interrupt handler. Interrupt handler will recognize and process > the appropriate interrupt on the basis of interrupt status register. > Also, establish synchronization between the interrupt handler and > transfer operation by taking the locks and registering the interrupt > handler as thread IRQ which avoids the bottom half. > Fixes the wrongly populated interrupt register offsets too. This sounds like at least three different changes mixed together in one commit, it makes it quite hard to tell what's going on. If nothing else the conversion from a workqueue to threaded interrupts should probably be split out from merging the interrupts. > -static irqreturn_t lantiq_ssc_err_interrupt(int irq, void *data) > +static irqreturn_t lantiq_ssc_err_interrupt(struct lantiq_ssc_spi *spi) > { > - struct lantiq_ssc_spi *spi =3D data; > u32 stat =3D lantiq_ssc_readl(spi, LTQ_SPI_STAT); > =20 > - if (!(stat & LTQ_SPI_STAT_ERRORS)) > - return IRQ_NONE; > - Why drop this? > - err =3D devm_request_irq(dev, rx_irq, lantiq_ssc_xmit_interrupt, > - 0, LTQ_SPI_RX_IRQ_NAME, spi); > + err =3D devm_request_threaded_irq(dev, rx_irq, NULL, lantiq_ssc_isr, > + IRQF_ONESHOT, LTQ_SPI_RX_IRQ_NAME, spi); > if (err) > goto err_master_put; > =20 > - err =3D devm_request_irq(dev, tx_irq, lantiq_ssc_xmit_interrupt, > - 0, LTQ_SPI_TX_IRQ_NAME, spi); > + err =3D devm_request_threaded_irq(dev, tx_irq, NULL, lantiq_ssc_isr, > + IRQF_ONESHOT, LTQ_SPI_TX_IRQ_NAME, spi); > if (err) > goto err_master_put; > =20 > - err =3D devm_request_irq(dev, err_irq, lantiq_ssc_err_interrupt, > - 0, LTQ_SPI_ERR_IRQ_NAME, spi); > + err =3D devm_request_threaded_irq(dev, err_irq, NULL, lantiq_ssc_isr, > + IRQF_ONESHOT, LTQ_SPI_ERR_IRQ_NAME, spi); It's not clear to me that it's a benefit to combine all the interrupts unconditionally - obviously where they're shared we need to but could that be accomplished with IRQF_SHARED and even if it can't it seems like something conditional would be better. --lc9FT7cWel8HagAv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl6izJAACgkQJNaLcl1U h9A9gAf9EAGD07QOzDrXXolg+XQmkRiTF70XBpUwy3VJ1Xi6JMYAHUNA3/Z2ssS5 RrMUMyrJy+um1y4Zx+8+XV/+EfOmEPFVNeM+7cZ9hWrjtYpoIkaDonksboZz+T8h Q7cn2CDyQ4VRXbo8cc5Q4yApbKISswcMzf5UolZojAVWVNhMR7nQ5HUuwNWuuP7V 08pOBLsc3/GtOWuXA5OGLF287UuMsWkiK9ySbxw8ppLN9wvQOOs2t7izOFVeLGJE 4YnmncNquDPLjB9OdTEF/V2kmxvUoxNt8Nyn+kR/TX7xZYZ+i7L0Bb865IbaL0yl F17jaNiJyOzmR/CyFiyKoK+yq8GEvw== =2prX -----END PGP SIGNATURE----- --lc9FT7cWel8HagAv--