Received: by 10.223.164.202 with SMTP id h10csp4940461wrb; Tue, 21 Nov 2017 02:07:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMYfWEgADQf6Oj/ugbHXZiqkvX0E2FBp15NVFXFFdnnb2tTCEw88AnwSSSR06IPAU/9crCea X-Received: by 10.99.136.198 with SMTP id l189mr17103448pgd.307.1511258855602; Tue, 21 Nov 2017 02:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511258855; cv=none; d=google.com; s=arc-20160816; b=YKfo5By5Ip/YqjKJVN1VpKR7pfPCyMJjEuXLemIWD0PFHlpzJofFzg5hvjTaDlN2V2 d/8iaZuZoUrPFl8kHhcm7fAA99p3crPwaU12bF79Tbpe383/ho9GeBLEwQgyBsWSllj3 lXIfnoER/OdRRE4IslOlyXp4LIwxWdl43n7sbQrvzX6jUPUkkuU4lqHMFJy0GAox/6uM yUldeCI7wxkp6yBn8wV3RDuw9KMId/zPiLWDRBdbxD00BIg3H8Yi3Vsoy0VwmMcuq2/g sMfUwCmBSoWXlQzOpelCWiGGsBuHV9E9QgNEqKh4FFfsxeJoLD/Gp/nNV74zywhkf8Gt QUuw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=VHTYU3mczbA/MwZGNvsVs7RayG2pyFulwEXJLfkrp/I=; b=F6ksJSKq2KiHylUU05IE6G3pHfXJRSYcNtdQBtUTqA0+OgJsXgI6+nIiOtELXVQpwb UI8gJsgw4MdGGZ+5krQbRQKeQavnyrmftmgmkxNi3/wvB7uQytCnWTCmBv1Kh4Ul7NJY 4tJBypoy2BSZFh8XjMT3FSOK3Y1FpOt/W960bObRPi2Xw/Q4Awx4pCesgCuz5U8QRlwd 7M5NM5lxbEwRCZojf5/Lp6cyE7fV+94543kbN9edG3dqVoh+DjoW33wgB567P4+pXzBH zUtceRXDpVXpIX43f/33itCVnf2sNLlGYrCLBx3vQBslCZhJSmRH0loKxxsrEB+ZDew/ iN3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=PI+zU5kh; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si10874899plu.228.2017.11.21.02.07.24; Tue, 21 Nov 2017 02:07:35 -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=@broadcom.com header.s=google header.b=PI+zU5kh; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751871AbdKUKF1 (ORCPT + 73 others); Tue, 21 Nov 2017 05:05:27 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:45035 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbdKUKFZ (ORCPT ); Tue, 21 Nov 2017 05:05:25 -0500 Received: by mail-it0-f65.google.com with SMTP id b5so1314979itc.3 for ; Tue, 21 Nov 2017 02:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VHTYU3mczbA/MwZGNvsVs7RayG2pyFulwEXJLfkrp/I=; b=PI+zU5khPi3sIebZ+B3IwGyxU2Db2K3DqRlbOsmnlFt/13B69dVqbHuZo2BSXsHwT6 jNLI2/gXrXbtwupOdkMFD0/dHbCbGKgXh5KcD5Gy0T81k5EnkF4KoLViUMJWoHAANl+W e7pSPgf7KJnvsnHxM8r3NpmssXF6XdW48GL2g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VHTYU3mczbA/MwZGNvsVs7RayG2pyFulwEXJLfkrp/I=; b=cC4pbOAe0HktDwrWFAVfHDQITPmFexHn+nj4rOPBKZmo9RrcvTF3b0lMv5kI5/hIw0 rMyOyV38u4eDkfUje6k+CxyvxbADI3e0KeVYG/IdeFyDe1ilJB+MohB/n94nvQtLLfdI 1+ckFVvSQRlCioCoynmuCkvX1EuEFTmmV/ToXWJ5xTAsNTtOIguGtP3w6U77sXfyMMHE 8tMEd3dR+QGoit0xy6ZuwIiTy4wMm8A/L3v5Ojl39AY9S3gkqslY47Ua/DqLaICGTiiZ bHrluWNI/tp+XXvJHkMbdAlRXrvYMTxOLP5XV3oGTGrLIfJkA0AzMd9vL8c/oZjt66J7 NYkA== X-Gm-Message-State: AJaThX5hBZYou03ki9AsOixkA6JAkR3dNr4eUSMhz3HrNYbywbbc+qTX oEElNdh4vxwsqW5UxWM9lgZd9isxb42d652fLA67aQ== X-Received: by 10.36.238.67 with SMTP id b64mr1111104iti.37.1511258724560; Tue, 21 Nov 2017 02:05:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.152.14 with HTTP; Tue, 21 Nov 2017 02:05:23 -0800 (PST) In-Reply-To: <20171121075125.GA6539@kroah.com> References: <20171119144311.441716251@linuxfoundation.org> <20171119144311.806904195@linuxfoundation.org> <20171121075125.GA6539@kroah.com> From: Raveendra Padasalagi Date: Tue, 21 Nov 2017 15:35:23 +0530 Message-ID: Subject: Re: [PATCH 4.13 07/28] crypto: brcm - Explicity ACK mailbox message To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Anup Patel , Scott Branden , Herbert Xu 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 Greg, Thanks for notifying the issue. This patch is supposed to be applied on top of the below patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.14&id=9166c44358346c0a92b11fd4e24925efff791648 which is not present in stable, I missed to keep stable mailing list in cc when this patch sent. It's ok if you drop this patch for now in 4.13-stable. For 4.14 stable release we need the current patch and the dependent patch is already present in 4.14. Regards, Raveendra On Tue, Nov 21, 2017 at 1:21 PM, Greg Kroah-Hartman wrote: > Nope, this patch breaks the build as it relies on a previous patch that > is not in 4.13-stable, so I'm dropping it. If anyone wants it there, > well, it really feels like it shouldn't be included in a stable tree > anyway... > > thanks, > > greg k-h > > On Sun, Nov 19, 2017 at 03:43:54PM +0100, Greg Kroah-Hartman wrote: >> 4.13-stable review patch. If anyone has any objections, please let me know. >> >> ------------------ >> >> From: raveendra padasalagi >> >> commit f0e2ce58f853634d7ad1a418a49bd5fbd556227c upstream. >> >> Add support to explicity ACK mailbox message >> because after sending message we can know >> the send status via error attribute of brcm_message. >> >> This is needed to support "txdone_ack" supported in >> mailbox controller driver. >> >> Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") >> Signed-off-by: Raveendra Padasalagi >> Reviewed-by: Anup Patel >> Reviewed-by: Scott Branden >> Signed-off-by: Herbert Xu >> Signed-off-by: Greg Kroah-Hartman >> >> --- >> drivers/crypto/bcm/cipher.c | 101 ++++++++++++++++++++------------------------ >> 1 file changed, 46 insertions(+), 55 deletions(-) >> >> --- a/drivers/crypto/bcm/cipher.c >> +++ b/drivers/crypto/bcm/cipher.c >> @@ -258,6 +258,44 @@ spu_ablkcipher_tx_sg_create(struct brcm_ >> return 0; >> } >> >> +static int mailbox_send_message(struct brcm_message *mssg, u32 flags, >> + u8 chan_idx) >> +{ >> + int err; >> + int retry_cnt = 0; >> + struct device *dev = &(iproc_priv.pdev->dev); >> + >> + err = mbox_send_message(iproc_priv.mbox[chan_idx], mssg); >> + if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) { >> + while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { >> + /* >> + * Mailbox queue is full. Since MAY_SLEEP is set, assume >> + * not in atomic context and we can wait and try again. >> + */ >> + retry_cnt++; >> + usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); >> + err = mbox_send_message(iproc_priv.mbox[chan_idx], >> + mssg); >> + atomic_inc(&iproc_priv.mb_no_spc); >> + } >> + } >> + if (err < 0) { >> + atomic_inc(&iproc_priv.mb_send_fail); >> + return err; >> + } >> + >> + /* Check error returned by mailbox controller */ >> + err = mssg->error; >> + if (unlikely(err < 0)) { >> + dev_err(dev, "message error %d", err); >> + /* Signal txdone for mailbox channel */ >> + } >> + >> + /* Signal txdone for mailbox channel */ >> + mbox_client_txdone(iproc_priv.mbox[chan_idx], err); >> + return err; >> +} >> + >> /** >> * handle_ablkcipher_req() - Submit as much of a block cipher request as fits in >> * a single SPU request message, starting at the current position in the request >> @@ -295,7 +333,6 @@ static int handle_ablkcipher_req(struct >> u32 pad_len; /* total length of all padding */ >> bool update_key = false; >> struct brcm_message *mssg; /* mailbox message */ >> - int retry_cnt = 0; >> >> /* number of entries in src and dst sg in mailbox message. */ >> u8 rx_frag_num = 2; /* response header and STATUS */ >> @@ -464,24 +501,9 @@ static int handle_ablkcipher_req(struct >> if (err) >> return err; >> >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); >> - if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { >> - while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { >> - /* >> - * Mailbox queue is full. Since MAY_SLEEP is set, assume >> - * not in atomic context and we can wait and try again. >> - */ >> - retry_cnt++; >> - usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], >> - mssg); >> - atomic_inc(&iproc_priv.mb_no_spc); >> - } >> - } >> - if (unlikely(err < 0)) { >> - atomic_inc(&iproc_priv.mb_send_fail); >> + err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); >> + if (unlikely(err < 0)) >> return err; >> - } >> >> return -EINPROGRESS; >> } >> @@ -712,7 +734,6 @@ static int handle_ahash_req(struct iproc >> u32 spu_hdr_len; >> unsigned int digestsize; >> u16 rem = 0; >> - int retry_cnt = 0; >> >> /* >> * number of entries in src and dst sg. Always includes SPU msg header. >> @@ -906,24 +927,10 @@ static int handle_ahash_req(struct iproc >> if (err) >> return err; >> >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); >> - if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { >> - while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { >> - /* >> - * Mailbox queue is full. Since MAY_SLEEP is set, assume >> - * not in atomic context and we can wait and try again. >> - */ >> - retry_cnt++; >> - usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], >> - mssg); >> - atomic_inc(&iproc_priv.mb_no_spc); >> - } >> - } >> - if (err < 0) { >> - atomic_inc(&iproc_priv.mb_send_fail); >> + err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); >> + if (unlikely(err < 0)) >> return err; >> - } >> + >> return -EINPROGRESS; >> } >> >> @@ -1322,7 +1329,6 @@ static int handle_aead_req(struct iproc_ >> int assoc_nents = 0; >> bool incl_icv = false; >> unsigned int digestsize = ctx->digestsize; >> - int retry_cnt = 0; >> >> /* number of entries in src and dst sg. Always includes SPU msg header. >> */ >> @@ -1560,24 +1566,9 @@ static int handle_aead_req(struct iproc_ >> if (err) >> return err; >> >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); >> - if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { >> - while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { >> - /* >> - * Mailbox queue is full. Since MAY_SLEEP is set, assume >> - * not in atomic context and we can wait and try again. >> - */ >> - retry_cnt++; >> - usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); >> - err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], >> - mssg); >> - atomic_inc(&iproc_priv.mb_no_spc); >> - } >> - } >> - if (err < 0) { >> - atomic_inc(&iproc_priv.mb_send_fail); >> + err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); >> + if (unlikely(err < 0)) >> return err; >> - } >> >> return -EINPROGRESS; >> } >> @@ -4534,7 +4525,7 @@ static int spu_mb_init(struct device *de >> mcl->dev = dev; >> mcl->tx_block = false; >> mcl->tx_tout = 0; >> - mcl->knows_txdone = false; >> + mcl->knows_txdone = true; >> mcl->rx_callback = spu_rx_callback; >> mcl->tx_done = NULL; >> >> From 1584661322943601757@xxx Tue Nov 21 07:53:23 +0000 2017 X-GM-THRID: 1584506071402832559 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread