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 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D4AC7618F for ; Mon, 15 Jul 2019 19:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C2C820659 for ; Mon, 15 Jul 2019 19:50:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="kvofDYs+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732152AbfGOTuj (ORCPT ); Mon, 15 Jul 2019 15:50:39 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39614 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730918AbfGOTui (ORCPT ); Mon, 15 Jul 2019 15:50:38 -0400 Received: by mail-pf1-f194.google.com with SMTP id f17so3925228pfn.6 for ; Mon, 15 Jul 2019 12:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lQwGFBSJrHwE56v+sMPF66PmP6cnKf9PXAh7/ixpFm8=; b=kvofDYs+CxOi4c6fxfaQSVUUMlY8Kie3qdAMQOhymbNdqrVlywpHwjG4tRgJE/LmHg zSn3iji6OYuYG5lYDY6q8aKvPyEfsXmeDDExSU01MwqkdAU3a4Pu0ketbzDOFszRfI+h yQtf0Vx3mZL2dySLvv0O4yVYJXK20aAu20fBo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lQwGFBSJrHwE56v+sMPF66PmP6cnKf9PXAh7/ixpFm8=; b=fiKkLWgeRl21+xtTk+xNsehDepo+Tjkf9uMahJ60b63jrZ59+xJ5MceJmpcVuItNXW pXCN4bh4afEX7PBpSe1IaBzPiqRiO0wFd6g7DdycRtekFei1g7TkKh5trJqeVzhO8FW4 XKboMZ8Z646QXhyt6LEO+homXfOnvX+4rGuO7Wo5aMvsu98VpYwjHRzQHTehmagZLbjb nADjaTmf30Lh/9Xy4LXY3jh5/ggF6gbZ/CCIkXo5AJicrbaeeCLtSFzd+AJCAZNDRxpy 50hA43lU7qhIRYYjFLnBUGotc5D2pv0e948hJ6dM9oi72MWqbVxTZ3IC8CRyvDaTKd1T KBtw== X-Gm-Message-State: APjAAAU0Yv1sAIz1ynkubUSdRkkvx75Eko4SbkusRpI/0H7hC4MB/tTb sM/CNEMlvsKHi+1wsHQlSUqGunphoI4= X-Google-Smtp-Source: APXvYqz4l02Bj/OF1K57cTxt0+V+l7ssKwbhcEzYZrCJfJvHbS1Dg7KWSl0MzEx8ubXag1rcxlgaAA== X-Received: by 2002:a17:90a:d151:: with SMTP id t17mr30870146pjw.60.1563220238045; Mon, 15 Jul 2019 12:50:38 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id k22sm18338251pfk.157.2019.07.15.12.50.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 12:50:37 -0700 (PDT) Date: Mon, 15 Jul 2019 12:50:23 -0700 From: Matthias Kaehlcke To: Doug Anderson Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , linux-iio , LKML , Gwendal Grignou Subject: Re: [PATCH] iio: cros_ec_accel_legacy: Always release lock when returning from _read() Message-ID: <20190715195023.GS250418@google.com> References: <20190715191017.98488-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 On Mon, Jul 15, 2019 at 12:40:42PM -0700, Doug Anderson wrote: > Hi, > > On Mon, Jul 15, 2019 at 12:10 PM Matthias Kaehlcke wrote: > > > > Before doing any actual work cros_ec_accel_legacy_read() acquires > > a mutex, which is released at the end of the function. However for > > 'calibbias' channels the function returns directly, without releasing > > the lock. The next attempt to acquire the lock blocks forever. Instead > > of an explicit return statement use the common return path, which > > releases the lock. > > > > Fixes: 11b86c7004ef1 ("platform/chrome: Add cros_ec_accel_legacy driver") > > Signed-off-by: Matthias Kaehlcke > > --- > > drivers/iio/accel/cros_ec_accel_legacy.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > See also > > Actually, the "Fixes" tag is wrong here, though. The problem only > exists because we have in our tree, AKA > ("FROMLIST: iio: cros_ec : Extend legacy support to ARM device"). > Before that there was no mutex. For upstream purposes this could > probably be squashed into the original patch. Oops, I didn't realize that upstream doesn't have the mutex. In this case the entire patch as is with it's commit message doesn't make much sense.