From patchwork Wed Apr 13 22:33:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwendal Grignou X-Patchwork-Id: 8829601 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 761249F3D1 for ; Wed, 13 Apr 2016 22:34:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB9A82020F for ; Wed, 13 Apr 2016 22:34:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C831620373 for ; Wed, 13 Apr 2016 22:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415AbcDMWeZ (ORCPT ); Wed, 13 Apr 2016 18:34:25 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34749 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754350AbcDMWeZ (ORCPT ); Wed, 13 Apr 2016 18:34:25 -0400 Received: by mail-pf0-f171.google.com with SMTP id c20so39264195pfc.1 for ; Wed, 13 Apr 2016 15:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=c5w02/FQwi0XBUf5QvFto6LoLiZHkfkRTmP2E3t4wog=; b=CGrllzbpQmDBXvaXJyy17VbeFtF4cvjm9zHVe1P2n3m7iavfxmhurnBymmOr4SE4nC zeoQBkQVjm4cDTLIvb8sK1LLtVaf5gM1W1zqIE9INw8593aE8KXnOkjMDaz68GKpDTdF ubdaKcx1DmTG3V9inca3B06NKEQPdb+N1zo4QODzG+kI1RP12lHWV4d0AwRkaGJ4bsUm cwviBx0klHlp8Xf4CxbLS49Vip/CcogOhscZkWFp6wrZFHQoThu0seaYbm1PcdTTi0vB tSy6NTCDsKIHWB5/QQzd4tgm7OSoxwn6dI+iuw0U0dWa571eMNL2uSO6uHZZDlL+lbuG cjnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=c5w02/FQwi0XBUf5QvFto6LoLiZHkfkRTmP2E3t4wog=; b=NmcDZI94kcYyOhTXh+0ZOmFeNSSO0F3E+ir5USAVdVQR3hfoQacqmKiqfFBNlAdGUZ H5N6q6vbd3KZTAV4jT0zT4xgOUTZDDNAwhLgCS0wmP/hrxngR8rWiJbd/Hd1N2Pmhu1J hHV64lHvsKd3l4II5MmJJCe1GXlVUhqafsKgg0UzsBYSg8fZqK1zUYS5+I3FIxyzH7ov QGlZ8XhxuZXKhTwKYqXCu1OGhTLOeUvAdYVnXn7GQxiWpLJnKFT8cIIAmazyAI9h5wyC m5yD7JhopNsusZ6Nyj31wUa+xiYLB6kzTI7iruwxQ7s1BSAQ7FBNvitiSjrNZ5ACIxoL PavQ== X-Gm-Message-State: AOPr4FVThuo324K4QI0K9+ZbEM2kToYIhHjUYDhzduWh2j9SD1PYCYrPGvz8ilIfXHgLfAAp X-Received: by 10.98.70.27 with SMTP id t27mr16186221pfa.107.1460586864231; Wed, 13 Apr 2016 15:34:24 -0700 (PDT) Received: from gwendal.mtv.corp.google.com ([172.22.64.242]) by smtp.gmail.com with ESMTPSA id 27sm53332998pfo.58.2016.04.13.15.34.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Apr 2016 15:34:22 -0700 (PDT) From: Gwendal Grignou To: ulf.hansson@linaro.org, Alex.Lemberg@sandisk.com, avi.shchislowski@sandisk.com, yaniv.agman@sandisk.com, holgerschurig@gmail.com, chris@printf.net, baolin.wang@linaro.org Cc: linux-mmc@vger.kernel.org Subject: [PATCH 4/6] mmc: add FFU support to card/block.c Date: Wed, 13 Apr 2016 15:33:42 -0700 Message-Id: <1460586824-40688-5-git-send-email-gwendal@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1460586824-40688-1-git-send-email-gwendal@chromium.org> References: <1460586824-40688-1-git-send-email-gwendal@chromium.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Grant Grundler Add special case in MMC_IOC_CMD to process FFU command from mmc tool. A FFU command is similar to a multi command, but it also require loading firmware and maybe reset the device. Signed-off-by: Gwendal Grignou --- drivers/mmc/card/block.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index c543dd9..dd266c0 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -610,6 +610,11 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, goto cmd_done; } + if (idata->ic.opcode == MMC_FFU_INVOKE_OP) { + err = mmc_ffu_invoke(card, (struct mmc_ffu_args *)idata->buf); + goto cmd_done; + } + mmc_get_card(card); ioc_err = __mmc_blk_ioctl_cmd(card, md, idata);