From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83D89A00C2; Tue, 3 Jan 2023 10:51:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 661BE40693; Tue, 3 Jan 2023 10:51:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 80F6140689 for ; Tue, 3 Jan 2023 10:51:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672739510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lgIn+3s+B6wYiywYxUbJETOcBjfxYZUH+DRPajIGR7Y=; b=iOOtPR4hvfY7eHq2QYydD7Af8UthcFgrsmdc3h8JVe1RQCaihg9BOPyy/By5KlsYtyuOSD R65DCUFk0fL//pcZ4mGjJ3Z6SRYwU0FdvqwodCJmjfSjz8kJ5SY6p+dIZxBZhCUjVrpOu7 JIs1d2E/S8yf+HfGN2t2CiAn7sl/Qj8= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-630-d9EtZMChPue5nNy5DF0kkA-1; Tue, 03 Jan 2023 04:51:49 -0500 X-MC-Unique: d9EtZMChPue5nNy5DF0kkA-1 Received: by mail-pl1-f199.google.com with SMTP id l15-20020a170903244f00b001927c3a0055so14839377pls.6 for ; Tue, 03 Jan 2023 01:51:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lgIn+3s+B6wYiywYxUbJETOcBjfxYZUH+DRPajIGR7Y=; b=V08skelI1v1/5ahL2lcAu4lMlgnsx++zfmE5AdaI/4BwdQcAiT8i2jNXiqBIxfjuM1 03xmxrJP2gA7bW+XF/SelyBXRFVl610F2Oh7XrmJ/tp3YPqUitb9qbvGd8xu/oWxi3C3 rvoqYHZgPOZAsimK+YtCAdbHQmvUX19/L9BElMErf6+tk44meaYRiDinQUyvh6J6eT1z +0CVhzkA1uDWMn9AvZPURekNqt7CqeBwVWdWlL77bHlKRB7ZNvprpJfF42amrhf9l6ET KXHHRC8GLhVH/twHrJZatxcHW/zIQlCSiNiEpoMx+geUc0egGoYTH4forCfboR0Skp+G WKzw== X-Gm-Message-State: AFqh2ko2qLf4tfUILK8hoJvJHzOcSikROpbmk/W6adtJxTBNZAcMR5U/ MZlM9hWDbLZ6qHYQMSqDH0InD8uS4TqWVgtdjd+EE48jX3VT111GjAcHHqvpEknSO7UI+29q5tr nkdFuIGqcqoBqrwW8YRY= X-Received: by 2002:a17:902:7681:b0:192:b5b1:eb25 with SMTP id m1-20020a170902768100b00192b5b1eb25mr873210pll.161.1672739508786; Tue, 03 Jan 2023 01:51:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXttWN737IiUO5Hd6iCbEbistce6PSYHP/Oq7A1ww8CXNBTrgKS7c5BJXZUdnjyJQt69Fei9XHMjlM61GBbyJHM= X-Received: by 2002:a17:902:7681:b0:192:b5b1:eb25 with SMTP id m1-20020a170902768100b00192b5b1eb25mr873207pll.161.1672739508513; Tue, 03 Jan 2023 01:51:48 -0800 (PST) MIME-Version: 1.0 References: <20221226074709.2432165-1-alvaro.karsz@solid-run.com> In-Reply-To: <20221226074709.2432165-1-alvaro.karsz@solid-run.com> From: David Marchand Date: Tue, 3 Jan 2023 10:51:37 +0100 Message-ID: Subject: Re: [PATCH v2] bus/fslmc: unlock spinlock in case of timeout To: Alvaro Karsz Cc: dev@dpdk.org, sachin.saxena@oss.nxp.com, hemant.agrawal@nxp.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Dec 26, 2022 at 8:47 AM Alvaro Karsz wrote: > > Bug in function mc_send_command, > A spinlock is not unlocked in case of timeouts. > > Fixes: 79711846f676 ("bus/fslmc: add timeout in MC send command") This is worth backporting to 22.11 LTS. Please add: Cc: stable@dpdk.org > Signed-off-by: Alvaro Karsz > -- > v2: > - Fix code indentation. > - Fix "Fixes: " tag format. > --- > drivers/bus/fslmc/mc/mc_sys.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/bus/fslmc/mc/mc_sys.c b/drivers/bus/fslmc/mc/mc_sys.c > index ab9a074835..018bd9990e 100644 > --- a/drivers/bus/fslmc/mc/mc_sys.c > +++ b/drivers/bus/fslmc/mc/mc_sys.c > @@ -77,8 +77,12 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd) > total_time = rte_get_timer_cycles() - start_time; > } while (status == MC_CMD_STATUS_READY && total_time <= time_to_wait); > > - if (status == MC_CMD_STATUS_READY) > + if (status == MC_CMD_STATUS_READY) { > + /* --- Call unlock function here in case portal is shared --- */ This comment is useless, but otherwise the fix lgtm. Reviewed-by: David Marchand > + rte_spinlock_unlock(&mc_portal_lock); > + > return mc_status_to_error(MC_CMD_STATUS_TIMEOUT); > + } > > /* Read the response back into the command buffer */ > mc_read_response(mc_io->regs, cmd); > -- > 2.32.0 > -- David Marchand