Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3678012imm; Mon, 1 Oct 2018 02:39:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV60E+aP31cRAVzDtu3r6hRPz4lnD8lKIVH4kB3jAG3QcFf1Lz4zvjobo6+NN3VxA7q4S2GFD X-Received: by 2002:a17:902:7402:: with SMTP id g2-v6mr10830287pll.321.1538386749126; Mon, 01 Oct 2018 02:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538386749; cv=none; d=google.com; s=arc-20160816; b=UyRwBHHCevGGzQ6CiNFopd8NqfL6kq+W1GzmzbgCWRH4OEJV24NQ9ZwaqafzvVuRpd gm42foIuLjLY4PodPkyQ+zXRwxWdxE9gZmuoBoobDjBNdQd0cGu+YVv1OnfF2kApdpVD L9+/S8bVahIdUSYBPMXgv+MViF/EO5chfGdhVunfp06Wl4xr5+NYGXA8n4HddvCwiiqT DNUhR4/cX0gRK5WYVZHNSNFWu3tNOTD8iIsUDih2plAy+WhcvzeKKrMSRM3PUXG8gIw8 uDxuBAQr52QzwCawpRqra6noy1/DSwRR94v8QeX/EJKFc97qEFOXGdztn6syAslOvpH1 0MtA== 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=GFGkcHfSSnFsq77VIiNh0Sw17nrKeRJtSpTksHNrfYA=; b=ATN0lAYVg7uzvyNtasbQQoL+OD8p8hhWCRo6x6Q3/mX31spYKWqZel96Z3pu0fOQJJ xksvWgkbHef8NS8kk1mjkXixn/t9w3yyp1VOlMNjFCAm3c6ozOG77CbWP4RYZmtiVk/O 1a3gF3uy+QUe18NQj57pp/kdD7exLNweWCpHR9z7jL4VV0IZWM2BsOs2hENWujdojV7Y PoGipl0V8Yjoc/p2ZhcqFZ7YVQvkHtdRDsR0j9ItkXlZqmJNaosOvzjpyMGDAqrFHVdl bMdtO4VdBOqoR0Ynhgc2K/4vIk8B9v02vz6li1Vp6E2RYvJsiO1Pwu/b5CAKu1d1Hhr5 w74A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XPkUhAbs; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si11718129pgc.659.2018.10.01.02.38.53; Mon, 01 Oct 2018 02:39:09 -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=@linaro.org header.s=google header.b=XPkUhAbs; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbeJAQOR (ORCPT + 99 others); Mon, 1 Oct 2018 12:14:17 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37333 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbeJAQOO (ORCPT ); Mon, 1 Oct 2018 12:14:14 -0400 Received: by mail-io1-f67.google.com with SMTP id v14-v6so8839448iob.4 for ; Mon, 01 Oct 2018 02:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GFGkcHfSSnFsq77VIiNh0Sw17nrKeRJtSpTksHNrfYA=; b=XPkUhAbsWjLPi4cldzhftETrgVm2nOxcmVBzU1MlVsEiqdUCHmOrfhzoPT/K33Hw5r E3EVfs8zHMxayfCUcdci9li0HXx2SvCMq6A25rDpoyfjm0H0d0qixHp/zNHnU8/IcHlr nz3gP27lyIkGlcADshu4N/DBs48yuCccnLaw4= 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=GFGkcHfSSnFsq77VIiNh0Sw17nrKeRJtSpTksHNrfYA=; b=OiVLWnFfHtTY4fkXFhIrjKsaZEqXQ1n8UDG14DSyGgH+FwXhURkhlnMDbFfH7fgDIb U21damr3FoJy/uxGDVPegIgM8QDrdWYedVnRKomhobhd4Bk3ML4oZJWuYeQEqV4Na/5m ZDIZb9SqbFPecrK6Nd34bXSwY6Pxn1mlEqSJSogmCvTROf0RQ91iIro0hSd+voRN2lHB uyEQCpe9fLcdwv+LZXDw5ACTLAGVDHdGoL8n9BAJR+dt7EPNRIMDglpF9Qq0w6MgT78H Uh9eHWoqA6rtJqokvqXVxKgQovodq74ilpzLy8GyXlgTiWUXT9VsXwn7vLvgFcA3WUCi Wz2g== X-Gm-Message-State: ABuFfogy1LljakQGXMzHobLZyb6pkq8G8AndLFl+PV5qyrKNmyg9779b FZdB8XoDdETvuo6rt/4p5AjzcWtbdU0MX/QANE6QPA== X-Received: by 2002:a6b:c3c4:: with SMTP id t187-v6mr6232305iof.304.1538386639694; Mon, 01 Oct 2018 02:37:19 -0700 (PDT) MIME-Version: 1.0 References: <20180923235336.22148-2-jmkrzyszt@gmail.com> <20180929122022.6825-1-jmkrzyszt@gmail.com> In-Reply-To: <20180929122022.6825-1-jmkrzyszt@gmail.com> From: Linus Walleij Date: Mon, 1 Oct 2018 11:37:07 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: Fix incorrect use of find_next_zero_bit() To: Janusz Krzysztofik Cc: Miguel Ojeda Sandonis , Peter Korsgaard , Peter Rosin , Ulf Hansson , Andrew Lunn , Florian Fainelli , "David S. Miller" , Dominik Brodowski , Greg KH , kishon@ti.com, Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald , Jiri Slaby , Willy Tarreau , Geert Uytterhoeven , Sebastien Bourdelin , Lukas Wunner , Rojhalat Ibrahim , Russell King , ext Tony Lindgren , Yegor Yefremov , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Marek Szyprowski , Krzysztof Kozlowski , "open list:GPIO SUBSYSTEM" , linux-i2c@vger.kernel.org, linux-mmc , netdev , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-serial@vger.kernel.org, linux-samsung-soc , "linux-kernel@vger.kernel.org" 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 Sat, Sep 29, 2018 at 2:19 PM Janusz Krzysztofik wrote: > Commit b17566a6b08b ("gpiolib: Implement fast processing path in > get/set array"), already fixed to some extent with commit 5d581d7e8cdc > ("gpiolib: Fix missing updates of bitmap index"), introduced a new mode > of processing bitmaps where bits applicable for fast bitmap processing > path are supposed to be skipped while iterating bits which don't apply. > Unfortunately, find_next_zero_bit() function supposed to skip over > those fast bits is always called with a 'start' argument equal to an > index of last zero bit found and returns that index value again an > again, causing an infinite loop. > > Fix it by incrementing the index uncoditionally before > find_next_zero_bit() is optionally called. > > Reported-by: Marek Szyprowski > Signed-off-by: Janusz Krzysztofik Patch applied with Marek's Tested-by. Thanks to both of you for digging in and fixing this up! Now we are in good shape for the v4.20 cycle :) Yours, Linus Walleij