Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4070368ybi; Tue, 18 Jun 2019 11:14:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyISbGP9E/ecT4Hba/L1HdiIzFOcIj73F+LP8q2Z0Ls3vWkSU3J6mKz5a16WMJnGruwpElI X-Received: by 2002:a17:902:2ae7:: with SMTP id j94mr30845845plb.270.1560881646043; Tue, 18 Jun 2019 11:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560881646; cv=none; d=google.com; s=arc-20160816; b=Zt0tDAePMtVL6kGNPp3kJ93/qbIm2YfhoqZHPx8omK1PMFCM/YBxKlrj0FanNn+w8W KaQbZbWto31zhyPAeR4BaMINSWMGBD1CZwYxcmkdQLC8GUWCwSUchhuN2ObYQCfc6MAY +3gg3tKAr+bIAVbWPU2exjgUOEqSfATss9GWVo3qGWZG2j3I9/EtX2ReYarZVanBUvHN ly3XRFxBlZfs43ob6rK6z/ozRlgUCB3CanOBCTsVU4MWT6EMiXmt4e3yXEZ0KBi8YqPz d9FBeHwHA3+G13SlVSet3x6kYGs4lBuu5UGXsFvIxtrPvjpDm4kKSNvLi+Gi3Nso8J/B X0sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=u0LO1voIJdc5rwD/tpLzm7lno4EknpAahwh3tgnDyWQ=; b=zOUlV5sqciMaQRASFC7WGBAL7OZHGTXViuhMeguaGlV4/P9TFBxOHQR4o30oOjVR26 UmdjsS88dGqpVng7tYkNgTGElX2f4pvQTPhXssmyCs+Rgwt7yvwFQUuCxhz3EQrB8+Qw 4iVqIcxYcYFbtzhoJVSVvCTOkFh/STCpINTyEkWdM1fAdMkz/ipsyOTt8I8v7EWhsrq0 HY4+SlBaqDDnYKaJns1w2/ote1TgkVq3P7FmnrJ0Lkw3w9rEPljPEfOI0hOxENre0BCU 9eM8dBwfoP1jnqS00rfZdwL0IFuxFcZGlZyeBODV60n5Ric6eKOPFB2SatdNyMSeLmgY nBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ATAktAWz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e39si14186811plg.103.2019.06.18.11.13.50; Tue, 18 Jun 2019 11:14:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ATAktAWz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730290AbfFRSNM (ORCPT + 99 others); Tue, 18 Jun 2019 14:13:12 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43462 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727616AbfFRSNM (ORCPT ); Tue, 18 Jun 2019 14:13:12 -0400 Received: by mail-lj1-f194.google.com with SMTP id 16so473337ljv.10 for ; Tue, 18 Jun 2019 11:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u0LO1voIJdc5rwD/tpLzm7lno4EknpAahwh3tgnDyWQ=; b=ATAktAWzRWJqwtcElWQ3cEKWeBdAWybAa8BzjTELprX3qa5UtsSUFtLxLcl1e/YGPq g/Nd3wXZUBrBwPrePMRdUhamp6KDoHsnA5S5Mm3vsE1tUY9qOYmECzbTxLFpddgidmpX MQiRQ7a5kL8+Tm5W9xGYvvaSFgmsVo1CrptxXjZ2CQg1ZJdGE/K8oTWGCaie7xUJQBk2 eQAwDPPNBbH4wnMCtXAtXj0ZX62MuK5oqdIqNw9AxRBTIEpOVYoCtUOhhkev1elc5+qE Y0v+IBWbBwzDWuGCYPk/UM+VdbxJy54xZdsSgN8v1kEp3DfLVNy4I1QZrhWJye8sV2WM 2IYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u0LO1voIJdc5rwD/tpLzm7lno4EknpAahwh3tgnDyWQ=; b=uBwnK1BKhTeDag9SXyrWT0/g9gSggxGiiRHOGdTwM8X7WYiWiSlkgnQaPuturq8SIZ 7wpVzXIoQRRriK4QCYiBFDIohPJ08CQNlM1TWjJyP5WWJRKR6R9CI5eH5PXP6qaqu3FL LsB2B7wWxzIgD0ajGOSVdSHfM49T9lFeJXmHkVVprP/BkxM5h5U+tVkAXExen3sFFum2 fEXepZOFkZPc/PUstmtYwzf4D7USMpZnkdLfaLCoB6pF9T27czhEx8NeJRoOQ3Q+IPMf APYUYj7LbQ3FWFb8qmOOADq/nzomhaSxB2sXZbJzaxhI1aqbAHZC5Cnkjl9ernJz2fFv SJzw== X-Gm-Message-State: APjAAAUSKzM/HjGTBRMuRjoOlI8he6+naXaCTERmWNTKp9CcJMOwE7pw Naw1hQFIRu7PArIl36kos2UWH9OHiNBOkjQuFNuYOw== X-Received: by 2002:a2e:9dd7:: with SMTP id x23mr557672ljj.160.1560881589735; Tue, 18 Jun 2019 11:13:09 -0700 (PDT) MIME-Version: 1.0 References: <20190614194854.208436-1-fletcherw@chromium.org> <20190614194854.208436-4-fletcherw@chromium.org> <4e560e12-4c20-8d5d-b3f9-587a55da279d@intel.com> In-Reply-To: From: Curtis Malainey Date: Tue, 18 Jun 2019 11:12:58 -0700 Message-ID: Subject: Re: [PATCH v7 3/4] ASoC: rt5677: clear interrupts by polarity flip To: Fletcher Woodruff Cc: Cezary Rojewski , Linux Kernel Mailing List , Jaroslav Kysela , Liam Girdwood , Mark Brown , Oder Chiou , Takashi Iwai , Curtis Malainey , Ross Zwisler , ALSA development Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 18, 2019 at 11:01 AM Fletcher Woodruff wrote: > > On Sun, Jun 16, 2019 at 10:56 AM Cezary Rojewski > wrote: > > On 2019-06-14 21:48, Fletcher Woodruff wrote: > > > +static irqreturn_t rt5677_irq(int unused, void *data) > > > +{ > > > + struct rt5677_priv *rt5677 = data; > > > + int ret = 0, i, reg_irq, virq; > > > + bool irq_fired = false; > > > + > > > + mutex_lock(&rt5677->irq_lock); > > > + /* Read interrupt status */ > > > + ret = regmap_read(rt5677->regmap, RT5677_IRQ_CTRL1, ®_irq); > > > + if (ret) { > > > + pr_err("rt5677: failed reading IRQ status: %d\n", ret); > > > > The entire rt5677 makes use of dev_XXX with the exception of.. this very > > function. Consider reusing "component" field which is already part of > > struct rt5677_priv and removing pr_XXX. > > I was using dev_XXX, but I believe Curtis found that 'component' was > sometimes uninitialized when this function was called, so I switched > back to pr_XXX. I may be misremembering though, so I'll let Curtis > comment as well. > The issue here is that the IRQ is setup in the i2c probe and the component is setup in the codec probe. In theory if the hardware is in a bad state you can get an interrupt between the probes and have the interrupt called with the component being NULL. It might be worth considering migrating the IRQ setup to the codec probe so this condition cannot happen and then we can avoid using pr_XXX. > > > + if (ret) { > > > + dev_err(&i2c->dev, "Failed to request IRQ: %d\n", ret); > > > return ret; > > > > You may want to simplify this, similarly to how's it done in your > > rt5677_i2c_probe - leave message alone and return "ret" explicitly at > > the end. > > Good suggestion. I'll update that for the next patch.