Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5560212ybi; Tue, 4 Jun 2019 08:26:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIL7G1mnmDRpMEQdoklHWzVMKxpw3oZgA+9QWYcXXYJmwpHbC9cglbaLFjh0DCQlVBJbH4 X-Received: by 2002:a17:902:67:: with SMTP id 94mr37980207pla.64.1559662017290; Tue, 04 Jun 2019 08:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559662017; cv=none; d=google.com; s=arc-20160816; b=Yh7BieFwU3CGQU7+Y7rC9EJEvSGVMOHRMc/qbHO5YKRl6nPLdgnuod9CwdLhgOP79u 7hyoFhoN4PTviM8W4iDRDl7sHVnIt839EKNIw0jeiSrSJ2pKveYpdK4e7FIqN5XXY+MJ 8YgjJRm6YPIqYowJW4T685S+z1EQCg0XJFpzjtxAbKE2KhNWTN+38LdvlbJKj5MShDO4 O7vtiBYk5p+viHh7nYWH/O4c0Ajri/2CuLTzvWkbZCn4K1N1FziSrpMCsRf8HzYskH4p dG7AFxHyYP8QD4kmSvNh7cwtMqe8k4kMhDhYLlGLy9Lv9qv2gMhhm1ghYnTaNrSapPPd B+HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:subject:from:to:cc :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=Mrua8Se3/4ilWZJMy5h+Rrfq98YU9hLPDYoeq7tQAs0=; b=ywrZfv/0tWesX5HO7X7IQhR+wSFvbcNlzK9JtvbzDBAKnGvYe5+BYnM4EGvmdbDLgF Lc5WslTxcQ2iYElU6wRfPSOEBrBr7J+XNcC7Qk0nwNfMT0nViaUVyBPHuGdBU9kj9MBZ uU1Pg1UmWyCpK9UyHeHnx/a3++VF5/oSP0Qlrh5NrK8gqriUsyyxCYBFr9AKDppdrFgc 4tToClQjB66LyvBxbeEZX2yk5+MEDiLZV9mnPciEprUS6oUgQHdPa5ezQSjwCYrF9lSg PJAou8/849M8J5kbMGjxTxK3upEW1XjyIx6HAuuhTB+jrMBTQEaHnvoWvEQtPrW1+XWt Wgwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bwPYy4WK; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si23509149pgt.93.2019.06.04.08.26.38; Tue, 04 Jun 2019 08:26:57 -0700 (PDT) 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=@chromium.org header.s=google header.b=bwPYy4WK; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728127AbfFDPZR (ORCPT + 99 others); Tue, 4 Jun 2019 11:25:17 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36594 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbfFDPZQ (ORCPT ); Tue, 4 Jun 2019 11:25:16 -0400 Received: by mail-pf1-f193.google.com with SMTP id u22so12903413pfm.3 for ; Tue, 04 Jun 2019 08:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:cc:to:from:subject:user-agent:date; bh=Mrua8Se3/4ilWZJMy5h+Rrfq98YU9hLPDYoeq7tQAs0=; b=bwPYy4WKJZInqlQTDw1tRC2vfxgDnGkK0PChtQyEZsGS0topViNdNdWX6VaSl0HMrO qSz/UqMNTHg45ahUSDI9Xnc5tEuvAfrpjfMhBG14xZHMiUqJAKP4h78NdotF4VlIogzP UEi49SUP40Pyaut0+lMsfKNsgbjYpzHc2RCqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:date; bh=Mrua8Se3/4ilWZJMy5h+Rrfq98YU9hLPDYoeq7tQAs0=; b=B0uNJkOH0xVm9UMP6EbBTC6xT15UPI42VEPYnDmzKcJNNyFmZGzzY6SgcEmOoH/8BI 4AA42rGF1yNCCk7PJxWNs+9FhiArjCMlT3EREyGn+Ohvypo97t2ZvapofihB2B5geEgq 0ZMVYN83E4myrRVqYYgXDP1BpRMjVfd+7CMjCq2QBOOE2OYFn18orFW5T9M6KxuPMWDt Yr3uN5kgnpWOfNJILjZbeHzcs5pTZcCsJF5Jrk2d16RLHGb+qIMex7XAXibJ4rH/IT4H PIi9yDeKSpC0qnYdO0XBl2jba07Aqz0pLVvjZWdtpwhzNYFZsFEhzMDHSSSbf8y93hAG tQrg== X-Gm-Message-State: APjAAAXZzVJ4GKnWY6tKJXpaQn0XoQ/t+Fgh/OSxESYSB6mAlJhKQexi r0htPg+sZG3ZOwMcemarndHGRQ== X-Received: by 2002:a62:5c84:: with SMTP id q126mr12951772pfb.247.1559661915912; Tue, 04 Jun 2019 08:25:15 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id k6sm19398866pfi.86.2019.06.04.08.25.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 08:25:15 -0700 (PDT) Message-ID: <5cf68d5b.1c69fb81.281cd.5f93@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190604072001.9288-3-bjorn.andersson@linaro.org> References: <20190604072001.9288-1-bjorn.andersson@linaro.org> <20190604072001.9288-3-bjorn.andersson@linaro.org> Cc: Andy Gross , Linus Walleij , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org To: "James E.J. Bottomley" , "Martin K. Petersen" , Bjorn Andersson , Pedro Sousa From: Stephen Boyd Subject: Re: [PATCH 2/3] scsi: ufs: Allow resetting the UFS device User-Agent: alot/0.8.1 Date: Tue, 04 Jun 2019 08:25:14 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Bjorn Andersson (2019-06-04 00:20:00) > @@ -6104,6 +6105,25 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) > return err; > } > =20 > +/** > + ufshcd_device_reset() - toggle the (optional) device reset line > + * @hba: per-adapter instance > + * > + * Toggles the (optional) reset line to reset the attached device. > + */ > +static void ufshcd_device_reset(struct ufs_hba *hba) > +{ > + /* > + * The USB device shall detect reset pulses of 1us, sleep for 10u= s to This isn't usb though. Can we have a gpio reset driver and then implement this in the reset framework instead? Or did that not work out for some reason? > + * be on the safe side. > + */ > + gpiod_set_value_cansleep(hba->device_reset, 1); > + usleep_range(10, 15); > + > + gpiod_set_value_cansleep(hba->device_reset, 0); > + usleep_range(10, 15); > +} > + > /** > * ufshcd_host_reset_and_restore - reset and restore host controller > * @hba: per-adapter instance