Received: by 10.223.164.202 with SMTP id h10csp312740wrb; Mon, 6 Nov 2017 07:04:02 -0800 (PST) X-Google-Smtp-Source: ABhQp+TSRHfSCHSsSQ/8Sk2iurGq5GRaGNTlKN05A4jVBN3Zy52npApkN84W7RqBGOwyNCBjgD7o X-Received: by 10.98.162.26 with SMTP id m26mr17360622pff.0.1509980642207; Mon, 06 Nov 2017 07:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509980642; cv=none; d=google.com; s=arc-20160816; b=u4KAN9ak8B/UZuE0ZiG8/5dgRe2zMR5o1w1cHxh7xQ+ihBN6ulpoJkpDkORaUjTHby DMlkQ1F+j1ISsn8g2ZS+1quXA482uhCTl4lyFeZkbZVWsBBGREKmWiJjo4oHO4jedu+s LrvFNgQHRGSwnxaMRK6lFKsF9e+54u6hcq473lO6h9ZjvzyHsKxtDBAVAnEJUo5yO5AI 65X37dulzNuhSkM33oSdeZMiPq+Ifr5T83H9fbC31Z/XtHbkJzKN6fb1h5EdwqaeKDvd Scjan3G9Bc+Df1zi7nwK/xN7sXoHS9CUBallYdyR+GHcqFc70ro6r0KiHwTUGep1/uZt fDpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LARZJpw96CZ7ifWrzzilsKvdj9cqKefpNhXGxNkCFIQ=; b=EpUSm9vnPzAO8AdusdmhKkKJUsSMxJBvFdDLMa6osCzTAPVZxGt0yN7LYZKyFctn5r aYy6G+ZREQp+04kHz6Cj5c3vGETt/d9edK37uX7CTI8epPTYGE5kOVZPzOstHb0tBuKw +zAqeQ8YJNtTIia83smLbUxCCl7EZYz0Lm0dsL62PFYQ5gA1k68GBJXMrnQMdEblaWBr R3Xiq7xtYJiJMEQjccXd4Lahr9joU9HGr8iDqTEVE0AkYPqM5lnvWiv6YgY02kzFrdaq xkqlWvO4pngzn5VehwnHBban6oU2fEo+Ear23jDKIgLjbtDkC6j5buo3P+l0FfnwV6S1 LVpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=IFnSND8V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si12452803pfa.362.2017.11.06.07.03.47; Mon, 06 Nov 2017 07:04:02 -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=@Mellanox.com header.s=selector1 header.b=IFnSND8V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932312AbdKFO2T (ORCPT + 97 others); Mon, 6 Nov 2017 09:28:19 -0500 Received: from mail-ve1eur01on0056.outbound.protection.outlook.com ([104.47.1.56]:29472 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932240AbdKFO2O (ORCPT ); Mon, 6 Nov 2017 09:28:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LARZJpw96CZ7ifWrzzilsKvdj9cqKefpNhXGxNkCFIQ=; b=IFnSND8V3pLx+w8DKPEc4BFcz/RcevRNu2SbIg4RaPRJXcZlxEz9VOd7lWAJc9E5y3sl526xq9Mt/Csy66ttpFZEf6u2kuK5jzIESm4qJTM+qnl9Gfj8KKeMifPRm7+DOyZ2y/bm/B3mBch8TKr/9IuLTh70M7lmrzloSlEC8OE= Received: from DB6PR0501MB2197.eurprd05.prod.outlook.com (10.168.55.142) by HE1PR05MB3339.eurprd05.prod.outlook.com (10.170.243.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Mon, 6 Nov 2017 14:28:08 +0000 Received: from DB6PR0501MB2197.eurprd05.prod.outlook.com ([fe80::2d11:739a:2eff:7c50]) by DB6PR0501MB2197.eurprd05.prod.outlook.com ([fe80::2d11:739a:2eff:7c50%14]) with mapi id 15.20.0197.017; Mon, 6 Nov 2017 14:28:08 +0000 From: Oleksandr Shamray To: Chip Bilbrey CC: "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "openbmc@lists.ozlabs.org" , "joel@jms.id.au" , "jiri@resnulli.us" , "tklauser@distanz.ch" , "linux-serial@vger.kernel.org" , "mec@shout.net" , "Vadim Pasternak" , system-sw-low-level , "robh+dt@kernel.org" , "openocd-devel-owner@lists.sourceforge.net" , "linux-api@vger.kernel.org" , "davem@davemloft.net" , "mchehab@kernel.org" , Jiri Pirko Subject: RE: [v11,1/4] drivers: jtag: Add JTAG core driver Thread-Topic: [v11,1/4] drivers: jtag: Add JTAG core driver Thread-Index: AQHTVoYZEAkiZu03y0GEL/O3ci1kT6MHUhTw Date: Mon, 6 Nov 2017 14:28:08 +0000 Message-ID: References: <1509724449-26221-2-git-send-email-oleksandrs@mellanox.com> <8760aoz78q.fsf@bilbrey.org> In-Reply-To: <8760aoz78q.fsf@bilbrey.org> Accept-Language: en-US, uk-UA Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandrs@mellanox.com; x-originating-ip: [80.90.224.13] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR05MB3339;6:5W0JQj9X1dDZYPzTTKhV9tGDUZlxFAV4VEGBAEC2Pm7GU9cg5jbAXofqGPS07kkFwwB1rvvXreXW7tLGmKlnDd9+6ofgpwB+PhfmbRI4/gKr+86mBWsbpnoAMHhzPvQWXacviZWj5Ch3y7HAGfhTpq++XckXONXIL69AUEcJ6HOw0aqyxam9J1Y6wxDkNCj5yEAOR6srfJgxtnw1dQ4uAPlXK1mTFKrjlQSQrZJdleXIdHyp1KiUajSjvML6vo1WDeAIexZVxxQBX06ZQP9rR4SoeYvlnAtdKDcBjbgx+iR7TD0BI1JVq1/vbwhbC2igbs+Ei+CbQydVZ+S2uWN5f4JTwUCOlXNSg74MTmg5DhU=;5:v7/5ZM+IvhdU67dCZ9W9VscvcxbMn7DsQUtzsQgn+0yttbU/aZ8kpDZ84o+vfLVNPZ2czopQuIjsjdGpa6LG3d69YjS6/rPmiCAXLlUArrcd0mwrq3fwhgkLt1Y3vcp77+utyia9OUAu294Y0m6VDuNg9IUL9iqYE+3UpaABd9o=;24:JG4imfq1ErQ4/5JDPz9XsYbe211/cs5C2AdFhG8pHEosI3RP9KmmCUXxcfc5mjtoxmWBdLyOsLk0flrzJkQH8U+XckqFFt0j5XItBIZXLSQ=;7:UVPYW29ZBG30pnKLXrkPBGjPlShC+/ACmZ6AnHmQteLmL0P9f6St2CVJudTKNtIV2aaraARAB6dfENpuwiIcdN+R4RssEzXWXm95SnABvV69At/7L7rDqCl9XCAWCxSYeb0W6iLabd52cwuYJ0wKWOkRhUOrYDYcL55tJBVreD+RPzD9emQ/OyT6pOuK/5X0UOw+gdcVk4Ak2ZSc5SEEx8DIK1zVD1rqzmqExbXKOp2vAu0MCIdWRYbyeHg2Nilo x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-correlation-id: dbdd934b-d5ec-4b9c-df12-08d5252299d3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:HE1PR05MB3339; x-ms-traffictypediagnostic: HE1PR05MB3339: x-exchange-antispam-report-test: UriScan:(143289334528602)(9452136761055)(65623756079841)(258649278758335)(42262312472803); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3231021)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR05MB3339;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR05MB3339; x-forefront-prvs: 048396AFA0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(189002)(13464003)(478600001)(8676002)(97736004)(66066001)(55016002)(316002)(53936002)(33656002)(81156014)(14454004)(81166006)(53546010)(8936002)(189998001)(7736002)(68736007)(7416002)(74316002)(7696004)(5660300001)(305945005)(9686003)(106356001)(105586002)(25786009)(229853002)(6916009)(2900100001)(2950100002)(6116002)(6506006)(3846002)(102836003)(6436002)(2906002)(3280700002)(54356999)(76176999)(101416001)(5250100002)(99286004)(4326008)(575784001)(50986999)(3660700001)(86362001)(54906003)(6246003)(107886003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB3339;H:DB6PR0501MB2197.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbdd934b-d5ec-4b9c-df12-08d5252299d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2017 14:28:08.1301 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3339 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi,=20 Thanks for review> > -----Original Message----- > From: Chip Bilbrey [mailto:chip@bilbrey.org] > Sent: Monday, November 6, 2017 12:33 AM > To: Oleksandr Shamray > Cc: gregkh@linuxfoundation.org; arnd@arndb.de; linux- > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > devicetree@vger.kernel.org; openbmc@lists.ozlabs.org; joel@jms.id.au; > jiri@resnulli.us; tklauser@distanz.ch; linux-serial@vger.kernel.org; > mec@shout.net; Vadim Pasternak ; system-sw-low- > level ; robh+dt@kernel.org; openocd- > devel-owner@lists.sourceforge.net; linux-api@vger.kernel.org; > davem@davemloft.net; mchehab@kernel.org; Jiri Pirko > Subject: Re: [v11,1/4] drivers: jtag: Add JTAG core driver >=20 >=20 > Oleksandr Shamray writes: > > diff --git a/include/uapi/linux/jtag.h b/include/uapi/linux/jtag.h new > > file mode 100644 index 0000000..0b25a83 > > --- /dev/null > > +++ b/include/uapi/linux/jtag.h > > [...] > > +/** > > + * enum jtag_xfer_mode: > > + * > > + * @JTAG_XFER_HW_MODE: hardware mode transfer > > + * @JTAG_XFER_SW_MODE: software mode transfer */ enum > jtag_xfer_mode > > +{ > > + JTAG_XFER_HW_MODE, > > + JTAG_XFER_SW_MODE, > > +}; >=20 > Is this essentially selecting between bit-bang mode or not? Is there a g= enerally > applicable reason to select SW mode over HW (or vice versa)? > This sounds like it's tied to device-specific capability which shouldn't = be exposed > in a generic user API. It is a mode of working some JTAG master devices. F.e Aspeed JTAG core can = work in fully automatic mode when all StateMachine=20 transitions and pin control done by hardware and in the more simpler mode w= hen JTAG pin control does by the user (like bit-bang).=20 It HW defined feature and can be applied not in all cases.=20 Seems it can be deleted from xfer option and controlled by separate like IO= CTL_SET_PARAM command. >=20 > > +/** > > + * struct jtag_xfer - jtag xfer: > > + * > > + * @mode: access mode > > + * @type: transfer type > > + * @direction: xfer direction > > + * @length: xfer bits len > > + * @tdio : xfer data array > > + * @endir: xfer end state > > + * > > + * Structure represents interface to Aspeed JTAG device for jtag sdr > > +xfer > > + * execution. >=20 > Probably should remove the reference to Aspeed here. Thanks, will remove it. >=20 > > +/* ioctl interface */ > > +#define __JTAG_IOCTL_MAGIC 0xb2 > > + > > +#define JTAG_IOCRUNTEST _IOW(__JTAG_IOCTL_MAGIC, 0,\ > > + struct jtag_run_test_idle) > > +#define JTAG_SIOCFREQ _IOW(__JTAG_IOCTL_MAGIC, 1, unsigned int) > > +#define JTAG_GIOCFREQ _IOR(__JTAG_IOCTL_MAGIC, 2, unsigned int) > > +#define JTAG_IOCXFER _IOWR(__JTAG_IOCTL_MAGIC, 3, struct > jtag_xfer) > > +#define JTAG_GIOCSTATUS _IOWR(__JTAG_IOCTL_MAGIC, 4, enum > > +jtag_endstate) >=20 > I notice the single-open()-per-device lock was dropped by request in an e= arlier > revision of your patches, but multiple processes trying to drive a single= JTAG > master could wreak serious havoc if transactions get interleaved. Would > something like an added JTAG_LOCKCHAIN/UNLOCKCHAIN > ioctl() for exclusive client access be reasonable to prevent this? Yes, it dropped by recommendation of Greg KH .= =20 Uer app should care about it. >=20 > -Chip Thanks for review. Oleksandr. From 1583267316077846129@xxx Sun Nov 05 22:36:15 +0000 2017 X-GM-THRID: 1583060999217857805 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread