From patchwork Tue Mar 27 21:06:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 132490 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp5560293ljb; Tue, 27 Mar 2018 14:06:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+92xvEKguIifepFpUc11exROyqmOLE6/C0cBCVxkZ6N5/LxrjSscOpFV3JD9nUpoc0c/sT X-Received: by 2002:a17:902:b288:: with SMTP id u8-v6mr828869plr.339.1522184810503; Tue, 27 Mar 2018 14:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522184810; cv=none; d=google.com; s=arc-20160816; b=ogNd+h03cEze+Zlw511z+5W+Ysfg+qgb3A62YAKktTZj4eMCXeFdwo2y+Hz4TWD0fk RPmUuvJBCVhgRamfr3l8BelmgUGXykuNxh5UGl1kTfGZ+ETwS65ucUfNk9VtTObZTFBT z8JQf22YGUyw1wql0Zm2uHl/eOyFsFBbMrS2/QesqLWsrWRl8Bc06+qP8YblGLjeT3MI pddqaYP1DI4mgsT/7K8NNSlLQDgbbQsd2zYglwvlBfnCAfLtBwEbF6PsTaEubTI/ZIQX v3svBqkpl7/HS5EBcHGXYmr4aEcm3HIP/3GvbMF/YG08GoM79Km++PZgO/FJMN+Uz2Up LOpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=bXWRy60EQuHBmeqnoa/Cmi5B6kTSN32yL1NvQsWuLpA=; b=erWSDWr4Xj9E4X+uJrNasZ98PUUtdAhpYqT2MNF7N+IehW8x+eG8w5153BRUb12nk8 v6kk3nDl5QkGBD+ZQwxpm1+wyDEqKkvsxVO6TpxqHa/suCl9QCjs8eKxO/TelZ01OKgA d7XCmtWEAzoVNU9NsMFzFyt+c6btLJtMmQGXQCocCXketZ8YACadU72Peu92zVJSjtS7 Gtpe7Ex/XnD1VOZAP2lzspTwppJvj6glzNY06RPfIBmGNcXUBr65MtQzEoeNkxh7faKo vQG4g5djzDaCcVd8CQmBriRRgQXOaTrEFZL+VI5tN/nztr5TQU/nX3uT5KTLQMyHzYxP AnUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NbTc08ry; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 b65si1569247pfk.265.2018.03.27.14.06.50; Tue, 27 Mar 2018 14:06:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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 header.s=google header.b=NbTc08ry; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1752384AbeC0VGs (ORCPT + 10 others); Tue, 27 Mar 2018 17:06:48 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33869 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeC0VGr (ORCPT ); Tue, 27 Mar 2018 17:06:47 -0400 Received: by mail-pl0-f68.google.com with SMTP id u11-v6so194936plq.1 for ; Tue, 27 Mar 2018 14:06:47 -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; bh=JOyCSxRCNwAGM9T8tAZ1j+Kqpdw7zZ+DwYKfNJeLmr0=; b=NbTc08rymChEv/x+W/CpZTdqUbiglUe78HU3IyCbMKOvxAUUNOZTmyOlGaKLmkOicA ykluPJIw8sFBB4faJq4sjn0+67jyyacTP+6HScPu8C7ACqlSMBA4bxFApcP4yjgrVcFA AfLoDQYnNBqr4FUE7K5H3rflGDQqZJuQVap00= 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; bh=JOyCSxRCNwAGM9T8tAZ1j+Kqpdw7zZ+DwYKfNJeLmr0=; b=G6imHHz+UvoeU9OPA/dGLRsn7nnA/1y2pmJSg0HeKs6lpHHUm/USTfEouNPR4u9SsK X5Ma/JpDUES83+Q5d5RMEhd0aqCfWypnJyTCVjNPGf70kCzv5hGrkSJsteTHU5o93/Kt AkKWqqDH3UaMwykJ48VYqK91O087s8Cp6kb7kJpXSjS59KUAB0VfOVAAp+uqiERwNL2X hl73H+/XKAXWtj8oHL/F4LX9N4Ovz0QJ2Do9GL3+Q9lEPRed2TumPNYj+XXP+XRJ3qoo xi23izmSaCmXnV7HItN9yyMzRXy8/INumY9ONc2IQoFNpL5l8bVecq3O4tFDNbn7DupP CtlQ== X-Gm-Message-State: AElRT7HhYHVOtNsT9C8QrTPtV8HBHKZVQkA4iAGhudaF+yN6vHnGHEpc Z3wO7NS5Au1dND9tdaUIwDj2vA== X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr850958plb.208.1522184807096; Tue, 27 Mar 2018 14:06:47 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b64sm4661907pfl.148.2018.03.27.14.06.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 14:06:46 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 0/3] rpmsg: smd: Redeliver messages after probe Date: Tue, 27 Mar 2018 14:06:40 -0700 Message-Id: <20180327210643.3436-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A race condition exists in SMD where incoming messages might be processed before we've finished executing the rpmsg device's probe function. The driver's callback function will in this case be unable to handle the incoming message and might return an error. Using the announce_create ops we can invoke the handler for incoming messages once again after probe returns, solving this issue. With SMD and QRTR this shows a high failure rate, but there are (at least theoretical) similar issues in glink and virtio-rpmsg, so this needs to be further investigated. Bjorn Andersson (3): rpmsg: smd: Fix container_of macros rpmsg: Only invoke announce_create for rpdev with endpoints rpmsg: smd: Use announce_create to process any receive work drivers/rpmsg/qcom_smd.c | 22 ++++++++++++++++++++-- drivers/rpmsg/rpmsg_core.c | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html