From patchwork Mon May 18 15:02:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 48699 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C0D4921411 for ; Mon, 18 May 2015 15:02:27 +0000 (UTC) Received: by lagv1 with SMTP id v1sf12015682lag.1 for ; Mon, 18 May 2015 08:02:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=ddAYymRTUsAA0NtHhkAPoec3npq6QGzFdA+1v58LyQY=; b=UAngz0rmmCVBIhmLwmSPicIpJCtfAJAaYWlMKERQL0uU75oSc5+ENuxQPSkSWu1g/f Q8EGWSTA8EbtWHS4NxrdA6LpMq9DsDtDAmxcL8RJSX3YGsrUDMlJPCHz++fF6MSNaKat nA0BU0RUETSfKZHk8XpzCrq1tCRguJ2rcWBKqP2MMxbKOnu57EBSaJtwc3gVd1I9ePoL zA6Sos+2+mu7qv3IBBqGKoPUkBc7cnDs2yAa69hHyJjALIqgVLP9+EtNvM3RZln0rnWf sXgrvVcTeEw9GQAKuqD9g4Jnp1y64eGFj0pdMoiJrbB3YmAEaYfcdm1Fb5tMvfrysXdf Z2+Q== X-Gm-Message-State: ALoCoQk2ITmKlh+9I2HESYhfSJHfz0gqnYmfOTzXXs8kuwf5/T0ZsrpIr9QG3mJLfTN3kjmyKUw8 X-Received: by 10.152.206.36 with SMTP id ll4mr18177736lac.6.1431961346720; Mon, 18 May 2015 08:02:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.110 with SMTP id bf14ls705651lab.48.gmail; Mon, 18 May 2015 08:02:26 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr17436168lak.29.1431961346578; Mon, 18 May 2015 08:02:26 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id bb9si6839379lab.145.2015.05.18.08.02.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 08:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lagv1 with SMTP id v1so224510176lag.3 for ; Mon, 18 May 2015 08:02:26 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr17369863lbc.41.1431961346323; Mon, 18 May 2015 08:02:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp142502lbb; Mon, 18 May 2015 08:02:25 -0700 (PDT) X-Received: by 10.70.6.161 with SMTP id c1mr44618976pda.76.1431961344703; Mon, 18 May 2015 08:02:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si16388360pdd.111.2015.05.18.08.02.23; Mon, 18 May 2015 08:02:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752695AbbERPCW (ORCPT + 4 others); Mon, 18 May 2015 11:02:22 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:33284 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbbERPCV (ORCPT ); Mon, 18 May 2015 11:02:21 -0400 Received: by wgjc11 with SMTP id c11so30610068wgj.0 for ; Mon, 18 May 2015 08:02:20 -0700 (PDT) X-Received: by 10.180.231.40 with SMTP id td8mr23387373wic.9.1431961340184; Mon, 18 May 2015 08:02:20 -0700 (PDT) Received: from arch-late.dtvresearch.loc (a95-92-118-66.cpe.netcabo.pt. [95.92.118.66]) by mx.google.com with ESMTPSA id ju2sm12871468wid.12.2015.05.18.08.02.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 May 2015 08:02:19 -0700 (PDT) From: Rui Miguel Silva To: Felipe Balbi Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH] usb: gadget: f_fs: do not set cancel function on synchronous {read, write} Date: Mon, 18 May 2015 16:02:07 +0100 Message-Id: <1431961327-2712-1-git-send-email-rui.silva@linaro.org> X-Mailer: git-send-email 2.4.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rui.silva@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , do not try to set cancel function in synchronous operations in ffs_epfile_{read,write}_iter. Signed-off-by: Rui Miguel Silva --- drivers/usb/gadget/function/f_fs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 6bdb570..fa538fa 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -925,7 +925,8 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from) kiocb->private = p; - kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); + if (p->aio) + kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED) @@ -969,7 +970,8 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) kiocb->private = p; - kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); + if (p->aio) + kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED)