Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp340509ybc; Tue, 12 Nov 2019 02:17:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzYRrUfuSorl4O3ykKn6QKMP2QfbIrADyrQyaHEJVVuHvzMmeI7p0EZcmp/OtZAb7EzjglN X-Received: by 2002:a05:6402:168b:: with SMTP id a11mr32028488edv.107.1573553867625; Tue, 12 Nov 2019 02:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573553867; cv=none; d=google.com; s=arc-20160816; b=OBSQ+XXZSph8OD1+tUxbraeZAmqgngq0D/HBnpSnQTPFkwQC6BzmM3JQsgI6jWnKLH 1jOLkCZAfvZBYfMuwhuShW8wXsy2NF46cYjXL6jE4rr/az2d96Uoegup/oNxOPExBeU7 ctSCgaAnb6IDYpDjSnLemCSkkeRG/D+UG4NHOJ+XIkRdYVKM6FjKns1Qk/N8aAgRUZ7f lN/HbZTlO4J5gTohdsHlb3Be2pt8o2rl1OmunHvT8xeQug/KbTrDKDB2aWwLED8Kbmol JnWcURL12QEFCOlQY5bYYCec/dh59nFjBhoMQu3PjV0W/YYKt2jBO3TNKkkFplbyLjzm vDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AKZO0OAzyyYGtpbwsEj0QOcTH8vqhFRIVBhgV2yDI1g=; b=gM/f/+9UaqhozEcCx37xe/vghDNe3nwhXNgM4dy3QSOT+Bkoqpxj6ld8OGtnOYWdCl /LR9Rv8co4qEMdiOG3fiknkuzvOEPdpuRoVgErfUUWzInDgF/T+732UGuH7ZU9C04sKq iDVrL/tndqIYYQ4ibRALdoiG5PVOQrCgLSXXGpZGQdNmLsQWeAquPNK6aoLEg8fnVYb/ qmWzLul7Ej8Ex6jpHRoZXdRQAZEh0anrTv+hnW0TJ3n6EndCS0ZIfOy0n2YY0xJXrPIu upIHBeMUXcZCrg60rzZIiXCHj7S6KOcCepi2tE6G4KoKb9Oe5H/thb4hMpvLoARZ5sWN e3iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MKkc4UyN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28si13248601edg.327.2019.11.12.02.17.20; Tue, 12 Nov 2019 02:17:47 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MKkc4UyN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726008AbfKLKQV (ORCPT + 99 others); Tue, 12 Nov 2019 05:16:21 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:40875 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbfKLKQV (ORCPT ); Tue, 12 Nov 2019 05:16:21 -0500 Received: by mail-ot1-f65.google.com with SMTP id m15so13815080otq.7 for ; Tue, 12 Nov 2019 02:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AKZO0OAzyyYGtpbwsEj0QOcTH8vqhFRIVBhgV2yDI1g=; b=MKkc4UyNjo46K6JpSwpbGmcYcHb694jLXJxKceHuu01hTDC6t0f3f7w4XAQlrwJdLI +0dpUVgiYRfD4m4UTM61GbEUvKzH+cV+RCj5NHe8Ym6pLVsHUgofeIn6/UVh62vDPLdW geQPN19YcJozX+8NZpNEJ64YZU94tHhcp/ZvYALtrAMHUIKgbjcPvWpoGlKS9By3QvV2 PaUsCD112vgto4G5Y3Hhh1JqsctWluEZv3TN5zcfcd4b03LIPzifxELba/ah9UlNNXnO BXVWVzzx6j9S7294+QI3B6uAjGfFuOu0yHiZAvweTQKDOBjSX4c/1R1uAIrvt0MQCDFk sHcg== 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:content-transfer-encoding; bh=AKZO0OAzyyYGtpbwsEj0QOcTH8vqhFRIVBhgV2yDI1g=; b=GBa546LT5tchkylNnf3X9MjPWbdYDaBd51yE0I1V0hoBRXWxILjXKZ6rWdqDojM/Y7 QcV7nVAMhBIEejHHonVIFPrSVRT9lCQ5fx6YyvhiEWTuf5N+f38+vjdp9Z19jzea1GKh zjLEqeU4vy2NiY7U35vy5CfpKBXboWwVQg9djlYkSq2Ra6Gs8YQIg1BMfQ0VJSPtVUlT QrrqjncyWtdXHfOzbMsYLdw0AN5prlXOB1apEZ8Om2s9NO3DmgoBY8gYDe7yGEH7+6Ld k/8MYzILvoApWnBvaqEnQ+m3eu6+7gww1xisZOzqvUaJN7WsZXSq5NkVcHHk7DYpB2Tq up8A== X-Gm-Message-State: APjAAAUjWKVGSapcgr8f9bsT21fBXUAY7D6jTX4CVAFoJFu8uxgVQPZB 3j9eZel2g7VkzDGfAZlwZahi6M5+dq9QAJnWNs3s6tWJ X-Received: by 2002:a9d:344a:: with SMTP id v68mr25496129otb.85.1573553780649; Tue, 12 Nov 2019 02:16:20 -0800 (PST) MIME-Version: 1.0 References: <20191108160747.3274377-1-thierry.reding@gmail.com> <20191108205407.GE23750@amd> In-Reply-To: <20191108205407.GE23750@amd> From: Bartosz Golaszewski Date: Tue, 12 Nov 2019 11:16:10 +0100 Message-ID: Subject: Re: [PATCH 1/2] gpio: max77620: Fixup debounce delays To: Pavel Machek Cc: Thierry Reding , Linus Walleij , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 8 lis 2019 o 21:54 Pavel Machek napisa=C5=82(a): > > On Fri 2019-11-08 17:07:46, Thierry Reding wrote: > > From: Thierry Reding > > > > When converting milliseconds to microseconds in commit fffa6af94894 > > ("gpio: max77620: Use correct unit for debounce times") some ~1 ms gaps > > were introduced between the various ranges supported by the controller. > > Fix this by changing the start of each range to the value immediately > > following the end of the previous range. This way a debounce time of, > > say 8250 us will translate into 16 ms instead of returning an -EINVAL > > error. > > > > Typically the debounce delay is only ever set through device tree and > > specified in milliseconds, so we can never really hit this issue becaus= e > > debounce times are always a multiple of 1000 us. > > > > The only notable exception for this is drivers/mmc/host/mmc-spi.c where > > the CD GPIO is requested, which passes a 1 us debounce time. According > > to a comment preceeding that code this should actually be 1 ms (i.e. > > 1000 us). > > > > Reported-by: Pavel Machek > > Signed-off-by: Thierry Reding > > Thanks for doing this! > > Acked-by: Pavel Machek > > And I guess this should be cc: stable, as the commit this fixes was > making its way there. > > Best regards, > Pavel > > > > @@ -198,13 +198,13 @@ static int max77620_gpio_set_debounce(struct max7= 7620_gpio *mgpio, > > case 0: > > val =3D MAX77620_CNFG_GPIO_DBNC_None; > > break; > > - case 1000 ... 8000: > > + case 1 ... 8000: > > val =3D MAX77620_CNFG_GPIO_DBNC_8ms; > > break; > > - case 9000 ... 16000: > > + case 8001 ... 16000: > > val =3D MAX77620_CNFG_GPIO_DBNC_16ms; > > break; > > - case 17000 ... 32000: > > + case 16001 ... 32000: > > val =3D MAX77620_CNFG_GPIO_DBNC_32ms; > > break; > > default: > > -- > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Applied for fixes and marked for stable. Thanks