Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1371413ybk; Thu, 21 May 2020 05:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVZnVF7ovrenCMe2PqLadAZrmHsjcvJ2/TjwhTRGwNGlFj3E3CkEvy3i4iPE7k4eQUPxWD X-Received: by 2002:a05:6402:1817:: with SMTP id g23mr7878322edy.132.1590064023380; Thu, 21 May 2020 05:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590064023; cv=none; d=google.com; s=arc-20160816; b=UJiPEdDbKRbue5v6JTnk7mQFGAjZIe3LRTMtzHs7+sVW7pxVOKm9AUWCJ/jff6yoEg K6L8vrw/MC52HFAnF+s7/wtl/lEAApVkA40mDgSZy71Y2FgLJKJPr+KjL3MUrSs1R3dy Cc85jwo3YFhyqVa5LnqtCZYYejs7Ui/WyWPMYcwCTD1DOt/nznJUh/JEAHnUySnhGn6Y eOsHfXDTyQ+LVSZA/KbJttfgyzwNEgzytjBrXgb5w8kdNorI8lUj3OSPqgltN0WdyJbq J88PRac72ugP9R2htZVjOaupTZjiECvyJUK1G5G1bTllKTeyzejOFcUYneyQ5JegTviv hf5A== 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=mDAJOLWg9mKjJNeVSHT8m8/Fhzt9bDgS8eqSCs7Dujc=; b=Fsm8QN9CHhLSKHuRJDJabYlOQqu5rhNtLL2H3JxG+C8zDLyfwldCMdJQlRdE7NeJR/ DM0w/f0Lj47UPFXd7OaAKtgMJRz6CRBUSZfM5a1XrhgB8Bi3XyjugGFJ9Q+0p8JPFYsH WttUMhICx+h6JdEEJJHpiBe2nnbu0Hmml1P6/Z0PaIR0e0wcSdos57GOBkCIROKFFJRr 81dit3kc8c9KRTqcxbE3pkpz+k6HaOZaJzOM4PV7LylB59wsgGJIba+ob/llDaT6w5Yo OxS4gcItEXaoB8EjEkQMSQQ1/GdcQ0rHzfDFsdcDFtb2IBhESUgc0SUjgiBbV+HyVtfI nUHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="LX8b5/50"; 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 w23si3140054eju.658.2020.05.21.05.26.40; Thu, 21 May 2020 05:27:03 -0700 (PDT) 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="LX8b5/50"; 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 S1729321AbgEUMYw (ORCPT + 99 others); Thu, 21 May 2020 08:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729304AbgEUMYw (ORCPT ); Thu, 21 May 2020 08:24:52 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B40FFC061A0E; Thu, 21 May 2020 05:24:51 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id e125so4356971lfd.1; Thu, 21 May 2020 05:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mDAJOLWg9mKjJNeVSHT8m8/Fhzt9bDgS8eqSCs7Dujc=; b=LX8b5/50+9+WTk2veYSl1B0zyuk4I/Z1GdM/3rM5S25W0ryPYoGWL4n2K3MUYaVBNj R1NmCkHJjJoWcICePlNevkQvtK/y3MNjvJvNFuW6i6Nrdrrqeo5bMUhT7+ltKY3UdaoM uq33UGp0tPTONkG6LTUkpXOeU+ESLmdH8XViwmeucGNNiDpRG1rpdQtQBq4TEPkA7DuW TLM4P1Tvi1wHeaugmMWtRxBQs/snHhp3P+sL18IYA6qH2GM15fky7jofEvv6F8XpBpiU 3sSn6wKmoU7Pl5OojnURTejuqqgcojGeGd7CjKhwzq08+tBwSqOGn+l/J24UlF0rNRBd kB5A== 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=mDAJOLWg9mKjJNeVSHT8m8/Fhzt9bDgS8eqSCs7Dujc=; b=TvlNrBQ2gTrPHEYoX8fJG2l5TjOuGRILJo+ctGSAE0jLwnC7hxfTvKyClqisEd03sl YusWFfY0qxVpJBMM1zpHLOXazoPwMz2zPA9PM5ixmhJa8i7/v4jH/yFnKqeFbWP/Gquf SJ2/wzJ+EVahRPa9+Pt80jpb7yuFJzeFwkKZ+XVKcYgp7VzLW5QDNIb0whWN6jvSk1mS 10JIc+DGx3L+PzAaSqfzYPRiChd8SOJwAOdDG3o7rCFIZ6uiuxMGVULMTVOEflxHBh1/ nv2hWkXKwo0bzWMImAs+f/GJXHbzK/hj8NUCbI0lASUP1u67cOxc5zYvSCQwMOBaMBxn 4q0g== X-Gm-Message-State: AOAM532LNAw+BNuoaCjTEyS3mB+ZSRThbrIGspIEVFqEkG6xYU70EAtn bUnHvBoqZP7cU7+7smAFRM55q57u5N2jLXB1IzM= X-Received: by 2002:ac2:51a7:: with SMTP id f7mr4816668lfk.13.1590063890126; Thu, 21 May 2020 05:24:50 -0700 (PDT) MIME-Version: 1.0 References: <8d29eba045ef18c5489e122b3668afc20431f15d.1588043236.git.baolin.wang7@gmail.com> <4b224e7bb703e15469e5cd79a54f7bc00a790fc5.1588043236.git.baolin.wang7@gmail.com> In-Reply-To: From: Baolin Wang Date: Thu, 21 May 2020 20:24:36 +0800 Message-ID: Subject: Re: [PATCH v4 2/2] mailbox: sprd: Add Spreadtrum mailbox driver To: Jassi Brar Cc: Rob Herring , Orson Zhai , Chunyan Zhang , Devicetree List , LKML 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 Hi Jassi, On Wed, May 13, 2020 at 2:32 PM Baolin Wang wrote: > > On Wed, May 13, 2020 at 2:05 PM Jassi Brar wrote: > > > > On Tue, May 12, 2020 at 11:14 PM Baolin Wang wrote: > > > > > > Hi Jassi, > > > > > > On Thu, May 7, 2020 at 11:23 AM Baolin Wang wrote: > > > > > > > > Hi Jassi, > > > > > > > > On Thu, May 7, 2020 at 7:25 AM Jassi Brar wrote: > > > > > > > > > > On Wed, May 6, 2020 at 8:29 AM Baolin Wang wrote: > > > > > > > > > > > > Hi Jassi, > > > > > > > > > > > > On Tue, Apr 28, 2020 at 11:10 AM Baolin Wang wrote: > > > > > > > > > > > > > > From: Baolin Wang > > > > > > > > > > > > > > The Spreadtrum mailbox controller supports 8 channels to communicate > > > > > > > with MCUs, and it contains 2 different parts: inbox and outbox, which > > > > > > > are used to send and receive messages by IRQ mode. > > > > > > > > > > > > > > Signed-off-by: Baolin Wang > > > > > > > Signed-off-by: Baolin Wang > > > > > > > --- > > > > > > > Changes from v3: > > > > > > > - Save the id in mbox_chan.con_priv and remove the 'sprd_mbox_chan' > > > > > > > > > > > > > > Changes from v2: > > > > > > > - None. > > > > > > > > > > > > > > Changes from v1: > > > > > > > - None > > > > > > > > > > > > Gentle ping, do you have any other comments? Thanks. > > > > > > > > > > > Yea, I am still not sure about the error returned in send_data(). It > > > > > will either never hit or there will be no easy recovery from it. The > > > > > api expects the driver to tell it the last-tx was done only when it > > > > > can send the next message. (There may be case like sending depend on > > > > > remote, which can't be ensured before hand). > > > > > > > > Actually this is an unusual case, suppose the remote target did not > > > > fetch the message as soon as possile, which will cause the FIFO > > > > overflow, so in this case we can not send messages to the remote > > > > target any more, otherwise messages will be lost. Thus we can return > > > > errors to users to indicate that something wrong with the remote > > > > target need to be checked. > > > > > > > > So this validation in send_data() is mostly for debugging for this > > > > abnormal case and we will not trigger this issue if the remote target > > > > works well. So I think it is useful to keep this validation in > > > > send_data(). Thanks. > > > > > > Any comments? Thanks. > > > > > Same as my last post. > > I think I've explained the reason why we need add this validation in > my previous email, I am not sure how do you think? You still want to > remove this validation? Gentle ping. As I explained in previous email, this validation is for an unusual case, suppose the remote target did not fetch the message as soon as possile, which will cause the FIFO overflow, so in this case we can not send messages to the remote target any more, otherwise messages will be lost. Thus we can return errors to users to indicate that something wrong with the remote target need to be checked. So this validation in send_data() is mostly for debugging for this abnormal case and we will not trigger this issue if the remote target works well. So I think it is useful to keep this validation in send_data(). What do you think? Thanks. -- Baolin Wang