Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5623168imu; Mon, 26 Nov 2018 03:08:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0r6S6uHh88MN/27f9RdElUmcF/AsiDo6PT4Bv3P4O9oo5fhSKzadlA2aAeORjKTtdeUFr X-Received: by 2002:a17:902:622:: with SMTP id 31mr18084104plg.171.1543230517029; Mon, 26 Nov 2018 03:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543230517; cv=none; d=google.com; s=arc-20160816; b=w+wxRIVNRLu4P5cddrzYh7aBygopBESyTxAHKkIyk3do5LePo1u8GDEMGOe+0gdD87 1wrtSs06wwWlvBiVvMyhhFPQ1/WqNNq5gxPUl8u7Tu/+FEb7ED3txKrhPteb09W5YSBV pu2++1F3w5R4/tGPtVPflaiBqZQ3TyaCgDzgwRLQdu+uG3clzKgIDTNk2cswaXBb20IZ KRjLfIH9EHk+peISF8SO0GaGgq1jJ1lvSl0uZQbnBxmthh1JZGgIphcWDe+BgCTnvA5B /y/hv2f91WGKa3P34g5ah9GOzN1K2V1br/LYhgGFSkyKveMQCsXZSMwJyoHYbP1/WXTh aS8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RMk0LW9M2zbVkyJLyl7wDrOIlNLjvazmlRrPwBcxzPc=; b=G6/T7v5ByVM44KX9i0ngHzhH7XEOC/HS0W9Cox0tXOlypEujYm9MT98l7AJf4Af0WE 2jYaPyODPVEQ/PBgO73jSLk9g5ELhle8k6tMvKB9l81jBWvlT8a89n2I67LTPa46TRko BfpV55mrnL59vT6iOI86gC1IrYXX14w3RYZ3Lh7Pl7U9e4U04M8S3mhG9cP/g1y5/DEW 8n8jofGuLx0OL7ws6u3BYHhhNTlr0BG5kQSl2p4JkC2SBCvH1z0yc9t9dMre7j+Tp/nZ gTER5BCOVtMBzlsImbgWrpVU0lEPqtm7lcoGREfVhp/v+44sCkbD22dhdLAX4k66rHqi 74Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zu5pjX7h; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 35si33974378pgn.278.2018.11.26.03.08.00; Mon, 26 Nov 2018 03:08:37 -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=@kernel.org header.s=default header.b=Zu5pjX7h; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731500AbeKZV77 (ORCPT + 99 others); Mon, 26 Nov 2018 16:59:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:46502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729543AbeKZV76 (ORCPT ); Mon, 26 Nov 2018 16:59:58 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 510E820645; Mon, 26 Nov 2018 11:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230372; bh=Rcy/ACfKQ6TajDXJlT/RXg9Kq3AX1Qp9M1AAcnlXc+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zu5pjX7h594sdiSNyg6s+EhdJ/5KyL6IcpCew0GVIyAc2U1Z/vIPlnyEdEJzdIdu0 KQXl5F5g/GOb7M/1QIOa9iN+1B40/KeJtn6tguZvIE6ntBYZgQO9P1d7oZBsKtJt08 ZOGVLvQpelHqY5hDjRT97kMbcapEzTZApH7GrVDk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.19 110/118] gnss: sirf: fix synchronous write timeout Date: Mon, 26 Nov 2018 11:51:44 +0100 Message-Id: <20181126105106.149092316@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105059.832485122@linuxfoundation.org> References: <20181126105059.832485122@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 1decef370456870bf448a565be95db636428e106 upstream. Passing a timeout of zero to the synchronous serdev_device_write() helper does currently not imply to wait forever (unlike passing zero to serdev_device_wait_until_sent()). Instead, if there's insufficient room in the write buffer, we'd end up with an incomplete write. Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers") Cc: stable # 4.19 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/gnss/sirf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gnss/sirf.c +++ b/drivers/gnss/sirf.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,7 @@ static int sirf_write_raw(struct gnss_de int ret; /* write is only buffered synchronously */ - ret = serdev_device_write(serdev, buf, count, 0); + ret = serdev_device_write(serdev, buf, count, MAX_SCHEDULE_TIMEOUT); if (ret < 0) return ret;