Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp226385ybk; Tue, 12 May 2020 21:18:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjvGX8LBDPdXblLLNG3DguSOt02dfLKdaOtqDC8xo3HV+YzNQk99427wKUY8rx2GhrAw0D X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr12429274edb.156.1589343509411; Tue, 12 May 2020 21:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589343509; cv=none; d=google.com; s=arc-20160816; b=0DCd52JP7LjBYfahcoIOc+kWi6vRmvBpEDqTy37QIlUZD5ip2fwS4iHBy4gIHcAUMf 98/f0Ch4KUN2EG8Og+GrsFn2swuNzZdkjT4OdugV/FRZvbgwfp/9WHD6OpoptUS2KzQ0 2twUKJbcIzHDRGpsQyaz1SPjMtlSK4uNbEM1LHdeTtviK2k2o/LhinurtAgVMlLrEv1u alJ6DxzizIvNF3FymdEp+usXgDYYg4BJjTHvkpdmd0WFwkMMFuq3p2czaySx1FVfsTsg I6VHs09MUVya9lDHNdiKEkcSdhiNFESpe0VhmyyP0orInlJI6E5GnhxHQ8PgLoQJnwsl rUUw== 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=+ahCDXQiMHnFAjGQZFWa3EU/WYE096uPwzw+1hypJRg=; b=RzH0ngm3Dq1RNh6BAxtkoRN72kzqVawm6sul9B21RFmAx//4zHbqhK0oFbmC9EP8oX xmyWwLOEpwhEyR7Bwat455uB08UB5vQmU/DMr9z0w+7E9JBpvJmZacwMTMIuPJAtE1XU pEu4afWJi5E7IuRb7JYx6jFkHY+q031zLwx9V+CwEGeem341KoNOoKq46iXL1z0Nb2IN Pj+XnEf3ZEYbG0QHLF6DR2s5c5hhIaTvKuEN7TqtpBqE2/nvTzG510PayVjmyejPdIX5 04Gy5XWBNtqLKAKR5oN2sjOL/DMYvqGzLWYc+LclUQ7KHcFspiN2k02u2ykEyGvgzmoz PVxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OCY38xRS; 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 my6si4105953ejb.87.2020.05.12.21.18.06; Tue, 12 May 2020 21:18:29 -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=OCY38xRS; 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 S1726294AbgEMEOL (ORCPT + 99 others); Wed, 13 May 2020 00:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725943AbgEMEOK (ORCPT ); Wed, 13 May 2020 00:14:10 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BBBC061A0C; Tue, 12 May 2020 21:14:10 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id v5so8314803lfp.13; Tue, 12 May 2020 21:14:10 -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=+ahCDXQiMHnFAjGQZFWa3EU/WYE096uPwzw+1hypJRg=; b=OCY38xRSWj2F1o83KA4utovE82g3hXfBvZAV42sOUT2WA9xFgZgT+NHWcV49WqQcKH aAhUgSfdSoVmS1/uje+15mzUU3blIvZbNaYXNoayRZoR03Pmv17xa3vxfcwv/O0ON+24 O3L9o1FSlVXf8kSxrulqgNiC657j2A9Lm3880Bap+Zofwf8xkMygJcYrZxz645uLkGEP tqXoZ9EFyda421p5B/871cFHjm2HqyOEJVRO41Ibm1iOrenw6t68uAtxqilGiE2HiesN 9Qg4bAqV3VbqIoQyHLO1vBcE59+WLKUKX+UH/YVQVd93VCvgo9Fzq0n5b09yIXyABtfh nYdA== 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=+ahCDXQiMHnFAjGQZFWa3EU/WYE096uPwzw+1hypJRg=; b=lRQ+RbzB/LW4S2X4TOqDaDbVvHzbXcz7UDmNc7Tl+5MbJTamtFg8poIjoeNd6SuHTB 9tsfVTMPMSBZ5EqlZnHBpAjy7HfBa75/v/zxf8NTlfT8k1uvIsHunoY3SmD0boqv/+TW qKboSz5kjSCPav4TLnsxE6TJ2Xe9wnqCN8V/fpyorRhl/X/XXc+kcNWfpdXGqRtmF+D7 yQgNG6WEHvls9TWsuNI4L6b7VtgcO7/UpFDkQuutwiOMaBMIKEezguKX2VHC28/506aW WwcYGxGaP9OhRjrcw40XLOE4pKJq6yv/SRsHBcrr5GkjMdu37Q58C/i3dE6xkS9JEJUE Ss/A== X-Gm-Message-State: AOAM5319DxMzwdKJ4AhUUtAoMwxmxVXw0saRvitOLuOhI4SkmmN+665W DsYSHZEcM0NYZNSdSvhrFoI5ZB3bs+N6vhaXSzs= X-Received: by 2002:ac2:5293:: with SMTP id q19mr16863434lfm.90.1589343248887; Tue, 12 May 2020 21:14:08 -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: Wed, 13 May 2020 12:13:54 +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 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. -- Baolin Wang