Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp849854pxb; Thu, 28 Jan 2021 01:34:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0fuKipjJo2mwPMRYgeocnwS97qUcQ0o0V1d/uQ4/gr8tn11st9lhnKxms5ZuEWtKaxlqm X-Received: by 2002:a05:6402:3552:: with SMTP id f18mr12937065edd.111.1611826462870; Thu, 28 Jan 2021 01:34:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611826462; cv=none; d=google.com; s=arc-20160816; b=mQUM7K6ThJX8J5kiHxX1AlfdcewdoxoP7z0RvsHP5HiyodHSx8cyyoJAFPcipOW5DF 4sJmSA0aVH3V9UiQYwwryOacTXsoaw9Lq/jPHIKLQlovwapX6GucdOEYcOmCykNx+mbF otYf31JGN9igrsZasCq1DsR7U0TOe9cfDE21pv2+KFGtc+3MEiG5dBoNiRzYGSq9C36N HDigWQOOvufWIo13B2Heg8oXBNannt3PkR4sU6/3v0DLd45sMVQs840ArJeEz006k5Ac xsBeD4nh3smloAvczc6i2AWqwsUB5NK7fZJbuB8B4Wu2u+H8q/LpsLY5sf+/zsrMDF6R k/Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=mwV3/xQMhtiXtLZ+Mq1qTsQwALfHyXZpg4s1y6TXkNg=; b=wCGcSvQx83cdrRTdBqwdECcoXlnNkkPnHLEzxi47Sd2rgAmJoIbNpXScbgspABWEGs GNYlHVxmopyLJyjvSFjrFS6XjaqVeQy/geD+xkvnJLhMGEQOjtn0xcVO+T4OQiPoOWwc FtdbKcWFnjz2STaaT6S8woV+ptPg+I6zCIGCpSZUJW3ll3N7C5AV9E+9OiX0IlDmxdIY Tl4JmF/QPp8Uo2b/HeHeUeOIOGsr6iH6NtKFk69mVy2mZKg053wf4x5CEwmvLe0NreSV y581xM/C8LG6E2uI73O1hBcoVQdYrrmWOovDxHirAk6LPN472rF+m1bRhAHDd8BpcmpL SGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="ZGBv/LYh"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si2251827eji.322.2021.01.28.01.33.58; Thu, 28 Jan 2021 01:34:22 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="ZGBv/LYh"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbhA1JaY (ORCPT + 99 others); Thu, 28 Jan 2021 04:30:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232501AbhA1JZW (ORCPT ); Thu, 28 Jan 2021 04:25:22 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BA6C061756; Thu, 28 Jan 2021 01:24:42 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id g3so3005773plp.2; Thu, 28 Jan 2021 01:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=mwV3/xQMhtiXtLZ+Mq1qTsQwALfHyXZpg4s1y6TXkNg=; b=ZGBv/LYhmLi4zaIKVJ9z9H+geH23aSQG0vsf8FRrIZ+UvcXjQ4lg4455ED6XHqcoP8 sxJ/johTeXwaXkY6ypXhyJMw6laXAw9xbV0l80IPwKtNeH9UN2qjNg34cY1iu3Osh/Vn s/IjvUrgN1r15m+hjCLG5UxqF6aB08Ms82dobBq4x+dCbiVyG6XIGE5YsZL/XYIPGEuv 57J+VDHvLnZ3MwozH5vvCKZX0dvLosotLjwrCe2cg7UDqDVJkY3mEfiHyVzTzmSmYu8s rJ0Kp5qBNKwmRRiHdWUB+BDLxywJdxyNgcSzcFG3mft66hCdL+jPLcEwksAlVppSvbyN 5/Ng== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=mwV3/xQMhtiXtLZ+Mq1qTsQwALfHyXZpg4s1y6TXkNg=; b=W66w7wGnmYr+i96YXuxKZbJRki46oK5TtoI5uHOCACas4gGnSxGt3NrJjwqXMfwm+w twSRymbUfX2DNMRKO2qIz3tttqyXTcPwnkmTIDRb8eUq9dCVJ9NuGIyJujY+VqslUBVF ZtnxNCUNHvvkgS87xlIolgg2yQfKbyEJuWDyOVVHAydQp1zPsJOiA3lBywgrVgkdcp3L +49e3pMH1Xu2ZmN6BI0LPBiGhd3Dv7a8Qvn0kyNtzxsxmpFUtPmfr5cauqLa9T+iYHQ1 hwtwqVGXw8WxXJ3YJZaQeZ7yyTx08XRLZfnZs8JlRaPb3PHn8m1Ol+IXtTnOnkJcwGw3 6xxw== X-Gm-Message-State: AOAM532szy7ZIAczTULy6cqmHZcw7cSyukaDrL9iCIP92lCKp5PQWCJZ eRLSPkk/A9DwtlsPDgyC1Q0= X-Received: by 2002:a17:90a:2f83:: with SMTP id t3mr10324593pjd.128.1611825882057; Thu, 28 Jan 2021 01:24:42 -0800 (PST) Received: from localhost ([103.220.76.197]) by smtp.gmail.com with ESMTPSA id gg22sm4538913pjb.24.2021.01.28.01.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 01:24:41 -0800 (PST) Date: Thu, 28 Jan 2021 17:24:35 +0800 From: carlis To: Kari Argillander Cc: gregkh@linuxfoundation.org, colin.king@canonical.com, oliver.graute@kococonnector.com, zhangxuezhi1@yulong.com, mh12gx2825@gmail.com, sbrivio@redhat.com, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect Message-ID: <20210128172435.00005643@gmail.com> In-Reply-To: <20210128065233.ji4b7ea54ihyu2l5@kari-VirtualBox> References: <1611754972-151016-1-git-send-email-zhangxuezhi3@gmail.com> <20210127223222.3lavtl3roc4cabso@kari-VirtualBox> <20210128094258.000012c3@gmail.com> <20210128065233.ji4b7ea54ihyu2l5@kari-VirtualBox> Organization: Tyzmig-ryrjum-8kedto X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Jan 2021 08:52:33 +0200 Kari Argillander wrote: > On Thu, Jan 28, 2021 at 09:42:58AM +0800, carlis wrote: > > On Thu, 28 Jan 2021 00:32:22 +0200 > > Kari Argillander wrote: > > > > #include "fbtft.h" > > > > > > > > #define DRVNAME "fb_st7789v" > > > > @@ -66,6 +69,32 @@ enum st7789v_command { > > > > #define MADCTL_MX BIT(6) /* bitmask for column address order */ > > > > #define MADCTL_MY BIT(7) /* bitmask for page address order */ > > > > > > > > +#define SPI_PANEL_TE_TIMEOUT 400 /* msecs */ > > > > +static struct mutex te_mutex;/* mutex for set te gpio irq > > > > status */ > > > > > > Space after ; > > hi, i have fix it in the patch v11 > > > > > Yeah sorry. I accidentally review wrong patch. But mostly stuff are > still relevant. > > > > > @@ -82,6 +111,33 @@ enum st7789v_command { > > > > */ > > > > static int init_display(struct fbtft_par *par) > > > > { > > > > + int rc; > > > > + struct device *dev = par->info->device; > > > > + > > > > + par->gpio.te = devm_gpiod_get_index_optional(dev, > > > > "te", 0, GPIOD_IN); > > > > + if (IS_ERR(par->gpio.te)) { > > > > + rc = PTR_ERR(par->gpio.te); > > > > + dev_err(par->info->device, "Failed to request > > > > te gpio: %d\n", rc); > > > > + return rc; > > > > + } > > > > > > You request with optinal and you still want to error out? We could > > > just continue and not care about that error. User will be happier > > > if device still works somehow. > > You mean i just delete this dev_err print ?! > > like this: > > par->gpio.te = devm_gpiod_get_index_optional(dev, "te", > > 0,GPIOD_IN); > > if (IS_ERR(par->gpio.te)) > > return PTR_ERR(par->gpio.te); > > Not exactly. I'm suggesting something like this. > > if (IS_ERR(par->gpio.te) == -EPROBE_DEFER) { > return -EPROBE_DEFER; > > if (IS_ERR(par->gpio.te)) > par-gpio.te = NULL; > > This like beginning of your patch series but the difference is that if > EPROBE_DEFER then we will try again later. Any other error and we will > just ignore TE gpio. But this is up to you what you want to do. To me > this just seems place where this kind of logic can work. > > > > > + if (par->gpio.te) { > > > > + set_spi_panel_te_irq_status(par, true); > > > > + reinit_completion(&spi_panel_te); > > > > + ret = > > > > wait_for_completion_timeout(&spi_panel_te, > > > > + > > > > msecs_to_jiffies(SPI_PANEL_TE_TIMEOUT)); > > > > + if (ret == 0) > > > > > > !ret > > > > > > > + dev_err(par->info->device, > > > > "wait panel TE time out\n"); > > > > + } > > > > + ret = par->fbtftops.write(par, par->txbuf.buf, > > > > + startbyte_size + > > > > to_copy > > > > * 2); > > > > + if (par->gpio.te) > > > > + set_spi_panel_te_irq_status(par, > > > > false); > > > > + if (ret < 0) > > > > + return ret; > > > > + remain -= to_copy; > > > > + } > > > > + > > > > + return ret; > > > > > > Do we want to return something over 0? If not then this can be > > > return 0. And then you do not need to even init ret value at the > > > beginning. > > > > > > Also wait little bit like Greg sayd before sending new version. > > > Someone might nack about what I say or say something more. > > > > > hi, i copy fbtft_write_vmem16_bus8 from file fbtft_bus.c and modify > > it ,just add te wait logic, i will take more time to check this > > original function. > > It might be ok or not. You should still check. hi, i will check more carefully, now i have a new problem, Is there a way to clear the interrupt pending state before opening it again?