From owner-svn-ports-all@freebsd.org Mon Feb 20 20:24:13 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7122CE689B; Mon, 20 Feb 2017 20:24:13 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7161A5A; Mon, 20 Feb 2017 20:24:13 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1KKOCAl069175; Mon, 20 Feb 2017 20:24:12 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KKOCS5069173; Mon, 20 Feb 2017 20:24:12 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201702202024.v1KKOCS5069173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Mon, 20 Feb 2017 20:24:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r434487 - in head/sysutils/flashrom: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2017 20:24:14 -0000 Author: tobik Date: Mon Feb 20 20:24:12 2017 New Revision: 434487 URL: https://svnweb.freebsd.org/changeset/ports/434487 Log: Add patch to turn off the IEXTEN local flag and fix serprog hangs PR: 214637 Submitted by: Michael Zhiling Approved by: lme (mentor), maintainer timeout (nukama+maintainer@gmail.com, 3 months) Differential Revision: https://reviews.freebsd.org/D9696 Added: head/sysutils/flashrom/files/ head/sysutils/flashrom/files/patch-serial.c (contents, props changed) Modified: head/sysutils/flashrom/Makefile Modified: head/sysutils/flashrom/Makefile ============================================================================== --- head/sysutils/flashrom/Makefile Mon Feb 20 20:20:32 2017 (r434486) +++ head/sysutils/flashrom/Makefile Mon Feb 20 20:24:12 2017 (r434487) @@ -3,6 +3,7 @@ PORTNAME= flashrom PORTVERSION= 0.9.9 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://download.flashrom.org/releases/ Added: head/sysutils/flashrom/files/patch-serial.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/flashrom/files/patch-serial.c Mon Feb 20 20:24:12 2017 (r434487) @@ -0,0 +1,28 @@ +Avoid hang of serprog under FreeBSD + +Use case is flashrom+serprog to read SPI flash (MX25L6406) via Arduino +Nano V3. Actual command is: + +/usr/local/bin/flashrom -p serprog:dev=/dev/cuaU0:57600 -c MX25L6406E/MX25L6408E -r tcw770.dump + +Using flashrom 0.9.9 it hangs after 5 seconds on read from tty ("ttyin"). +The problem is that kernel method "ttydisc_rint" ignore same bytes. It +happens due to enabled IEXTEN local flag of termios. TTY cuts few bytes, +Arduino reads 11264 bytes, but flashrom gets 11244 bytes (corrupted) and +waits for remaining 20 bytes. + +The fix is simple: turn off IEXTEN local flag. + +https://patchwork.coreboot.org/patch/4498/ + +--- serial.c.orig 2016-11-18 19:39:55 UTC ++++ serial.c +@@ -203,7 +203,7 @@ int serialport_config(fdtype fd, int bau + } + wanted.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS); + wanted.c_cflag |= (CS8 | CLOCAL | CREAD); +- wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); ++ wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG | IEXTEN); + wanted.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL | IGNCR | INLCR); + wanted.c_oflag &= ~OPOST; + if (tcsetattr(fd, TCSANOW, &wanted) != 0) {