From patchwork Tue May 9 19:47:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 98953 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1991544qge; Tue, 9 May 2017 12:47:52 -0700 (PDT) X-Received: by 10.98.35.142 with SMTP id q14mr1821277pfj.220.1494359272689; Tue, 09 May 2017 12:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494359272; cv=none; d=google.com; s=arc-20160816; b=sYNRFQr42l3R4BFuS0TMPb5X/jqZ33UhAcKyPWCPJLfGG8lmzEQhxXp1AWbA0SaFtj E7jAVNw4oQskD5SPdGyJ7c2VrhrooBQZ9iwpytykGTKrt3eppbrugD0Bl3Z5UpCTqFxh 0gSlZqF3gipscAtno2Fp9V/z2fbgHIEiTWfXf6AaScC0kvldDxWyMnEXW1z5zEHh8BUl 2bkccH+UScpFBJmrMt0DyFfHnmLyWyGJiaCzJXTi3+kmRjLq/qYHN5c48hNEL8A6VtWw CMC+m8oTdIZoZam5gS85SYc0+dvO1M+dZSkQsVvwmzH/sFtz1ULFg/TiJRzDzP3ohwFq o/ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VdVgYiMDlaG19GWomrYqtTrsNb9OKiW7YlA1zi0/BP4=; b=P+QF+Ivcgkb5d/9YjMVtlmdn85UtBauNBw9H8XWfJnpyNBDBpLnFi+wVl1KGZUaF0/ CIVEw6+HxhhMUsraI8iTCcSaPychtpVTjiFQnJaNHOYAN7sjx/RfOeaD39RgVRWfee7p n8n0IXvwLccr0bMF9fFqDWNsunS0DQR2TS4osbiJzhi8Vgvr46F//NBRrkDm/IVFxl9P yQ4ap6G2eDpRFUQMApf6ajTZprshAxLcBJcvqKqH4j95tz/12ckltV7F1r1pvh0RpJ1c x/BZB3O3edC3YrQiqZ/Kvt6g2Q54J4jGJffbSaXfgND+9PIVZex9IS6U5M5udRU708jA Ui2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (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 h64si831757pfh.8.2017.05.09.12.47.52; Tue, 09 May 2017 12:47:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754182AbdEITrv (ORCPT + 7 others); Tue, 9 May 2017 15:47:51 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:34472 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbdEITrJ (ORCPT ); Tue, 9 May 2017 15:47:09 -0400 Received: by mail-pg0-f48.google.com with SMTP id u28so4753902pgn.1 for ; Tue, 09 May 2017 12:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/vaA+sfDIzHZsDYgB70gHBpVIvIUeezmcA2N5c4V4t0=; b=iApMSVr1xF63jdX3t6XeAkk52smOB8bhoN3N2JWtylNddtAKA3sLGyeu/SC0u30b+p 5dzLEwVI/EbUmUEN7M02yx9QyIG4OkWHJElzBqwnisSqLeiFvebND1ZjF2S3ArgLuOrZ dfylPpnjinHPJUFSNEiBxA/DQpOSfNrZmK7RI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/vaA+sfDIzHZsDYgB70gHBpVIvIUeezmcA2N5c4V4t0=; b=e1f7yWirfXJvVeztoN4n3fmNv7PUOXMTUt5rWjPG3R3pAVUKpGmFnExREH49/pMcaP hK2SNd0rxf/feGFaBbILUmHOPHs554PAslUe8g1vEL8PEQo4uCBGudAcVIQUpk29zwTM 4UKzE8YfsNn0LXSq85L4rZO4lqEyjL5RjKMPF47Ww417OM6IS7HC4g+F99fEN6UBn+/b wwm8OWeLeFeUOT9l4V+oxo1PV1WdpX1z3Ea/+3X6hHJfXA8pOPwF2VbXbuiCCqlNqOJ2 NN8PMu7W0y0z0cDqmuGUuJTjRevaFo3IKEXNK601qhDHSXJ7AKPbNkefWbYc6AuBYuV4 ecew== X-Gm-Message-State: AODbwcDxYVrATUYzt6+RruPsRAtRa+if4BSTWJKOD0YUOl4Y34s/znGq +rFdGbORSMIzbyffjax96g== X-Received: by 10.84.237.8 with SMTP id s8mr2521949plk.163.1494359228188; Tue, 09 May 2017 12:47:08 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id x2sm1279236pfi.80.2017.05.09.12.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 12:47:07 -0700 (PDT) From: Bjorn Andersson To: Jassi Brar Cc: Rob Herring , Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Subject: [PATCH v6 2/4] mailbox: Support stateless mailboxes without txdone Date: Tue, 9 May 2017 12:47:01 -0700 Message-Id: <20170509194703.28871-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170509194703.28871-1-bjorn.andersson@linaro.org> References: <20170509194703.28871-1-bjorn.andersson@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org For some types of doorbell-like mailbox hardware there is no mechanism for delivery notification and the only possible message is an identity element; i.e. the mailbox is stateless and writing any number of messages to the mailbox is equivalent to writing a single message. Support this type of mailbox hardware by introducing the "none" tx done method, which means that neither the hardware nor the client is expected to tick the mailbox state machine. Signed-off-by: Bjorn Andersson --- Changes since v5: - New patch drivers/mailbox/mailbox.c | 2 ++ drivers/mailbox/mailbox.h | 1 + include/linux/mailbox_controller.h | 2 ++ 3 files changed, 5 insertions(+) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 505651ce9dcc..bf224c7c8f58 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -453,6 +453,8 @@ int mbox_controller_register(struct mbox_controller *mbox) txdone = TXDONE_BY_IRQ; else if (mbox->txdone_poll) txdone = TXDONE_BY_POLL; + else if (mbox->txdone_none) + txdone = TXDONE_NONE; else /* It has to be ACK then */ txdone = TXDONE_BY_ACK; diff --git a/drivers/mailbox/mailbox.h b/drivers/mailbox/mailbox.h index 456ba68513bb..708c8bb822fe 100644 --- a/drivers/mailbox/mailbox.h +++ b/drivers/mailbox/mailbox.h @@ -7,6 +7,7 @@ #ifndef __MAILBOX_H #define __MAILBOX_H +#define TXDONE_NONE 0 /* mailbox provides no means of flow control */ #define TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */ #define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */ #define TXDONE_BY_ACK BIT(2) /* S/W ACK recevied by Client ticks the TX */ diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h index 74deadb42d76..43fa4ab9b3e1 100644 --- a/include/linux/mailbox_controller.h +++ b/include/linux/mailbox_controller.h @@ -58,6 +58,7 @@ struct mbox_chan_ops { * @ops: Operators that work on each communication chan * @chans: Array of channels * @num_chans: Number of channels in the 'chans' array. + * @txdone_none: The controller has no sense of TX done * @txdone_irq: Indicates if the controller can report to API when * the last transmitted data was read by the remote. * Eg, if it has some TX ACK irq. @@ -78,6 +79,7 @@ struct mbox_controller { int num_chans; bool txdone_irq; bool txdone_poll; + bool txdone_none; unsigned txpoll_period; struct mbox_chan *(*of_xlate)(struct mbox_controller *mbox, const struct of_phandle_args *sp);