Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4802016imm; Fri, 18 May 2018 10:53:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrFYESL3/nYavk7Y9zEP4kLF+eMMveygEeSziiCXjW8UXgzzqmVPfl00OIeGLhFPInWMdwt X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr2551598plc.294.1526666001646; Fri, 18 May 2018 10:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526666001; cv=none; d=google.com; s=arc-20160816; b=judXjnZ5HfStmUXV8k6oZooGND7vB7ir33c6Gltnzu0EBBGUqHG0d24Ohg2J62Zl8P 83GM4MrBLDngtmZAQEwSW68tuRPu0LcTguTY23VPf5DfABGGzRIiuw1+UFyiR0+0oNXX aCnVBOry+VH8kGprLAi0mqSG7Fd+YbLt0wchqjSWWG1FnUgEXim/Ei+v4X2kBIIOAaRR 5HfRAfX49O9IIfula1c7WpaX+Dra77DXmiYoorHD51d/ss6ALje+Uyp+fdeW1gQ6hD2N nW9Xnt2AxgZ1l7YaOBErID/Hr8Ger+fYIbVsVaUJp1YpIu2n9crunvuW0IlQP9o1trbO dpYw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:arc-authentication-results; bh=33iFcurgHveRkfOG5BY1prPzhCbyTGzu5XtQ6/FRA1I=; b=aWfc88KWVmC71ElujUXkbeGifM1Nv9M+gB7Lm1h3iwxZbNVNNZFlH02R4hWPsA/l1y SJRgaEG562kzRQY9zF6vNcy4W6FDSYtWk/gFK7Xz9u0V3HC2wGsf1VCOy0nMLYcChgbe jwZfbXM7xBS9CGBuV7gVlvZFa8MBh5Jifd9u6PfghxoHzGOs/FNYGXRYqn7mYM1xsruM hiOsu56zyhohaVEGwn/07rhbKpGejti9g3K0074n1LpQ3HJOwrocqxL3TY233hFZHgeh 4Ka8zK+Hc57Wx6BneXrZzOWts7fOna0keV0frI6OCuzxjdEP0x4QykdS1sYUMar56dun 8lbQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g10-v6si6343310pgq.302.2018.05.18.10.53.07; Fri, 18 May 2018 10:53:21 -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; 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 S1752273AbeERRvd (ORCPT + 99 others); Fri, 18 May 2018 13:51:33 -0400 Received: from s18231873.onlinehome-server.info ([217.160.179.168]:60828 "EHLO godking.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751909AbeERRva (ORCPT ); Fri, 18 May 2018 13:51:30 -0400 Received: from [192.168.3.100] (localhost [127.0.0.1]) by godking.net (Postfix) with ESMTPA id 7C4FF1D2AE90C; Fri, 18 May 2018 12:51:27 -0500 (CDT) From: Alexander Kappner Subject: Re: [PATCH] usb-storage: Add quirks to make G-Technology "G-Drive" work To: Alan Stern Cc: Oliver Neukum , gregkh@linuxfoundation.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org References: Message-ID: Date: Fri, 18 May 2018 10:51:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Was this tested with uas or usb-storage? On both. dd works either way. > Are you certain Oliver's new code was executed? If you put > US_FL_NO_WP_DETECT only in unusual_devs.h and not in ususual_uas.h then > it would not affect the uas driver. Yes, the code ran. Further debugging shows that the code that causes the device to hang is in drivers/scsi/sd.c:2698. So the reason why usb-storage works and UAS does not is because the device setting both skip_ms_page_3f=1 and skip_ms_page_8=1 is required. The US_FL_NO_WP_DETECT flag does the former, and usb-storage (but not UAS) by default does the latter (drivers/usb/storage/scsiglue.c:198): /* * A number of devices have problems with MODE SENSE for * page x08, so we will skip it. */ sdev->skip_ms_page_8 = 1; Forcing both skip_ms_page_3f and skip_ms_page_8 to 1 results in UAS and usb-storage working. Oliver's code only set skip_ms_page_3f. Do we want a patch to introduce a quirk flag for skip_ms_page_8, similar to the US_FL_NO_WP_DETECT quirk bit for skip_ms_page_3f? This may even resolve the issues with other devices in unusual_uas.h that currently have all UAS support disabled. I'd be happy to write the patch, but I'm not sure we want to reserve a quirk bit for what's currently only a single device known to have this issue. Please advise. On 05/17/2018 12:13 PM, Alan Stern wrote: > On Thu, 17 May 2018, Alexander Kappner wrote: > >> Oliver and Alan, >> >> thank for investigating. >> >>> this is suspicious. You do not actually whether US_FL_NO_WP_DETECT >>> by itself would make the device work. Can you please test that? >> >> US_FL_NO_WP_DETECT without US_FL_IGNORE_UAS does not make a difference, >> even with the patch you included applied: > > Are you certain Oliver's new code was executed? If you put > US_FL_NO_WP_DETECT only in unusual_devs.h and not in ususual_uas.h then > it would not affect the uas driver. > >>> That's bizarre too. Even though the only difference is a MODE SENSE >>> command, the command that actually faliled was WRITE(16). >> It looks to me like the MODE SENSE simply hangs the drive, so anything >> issued after that will fail. Of course the drive says it's the "current >> command" that caused the failure, but I wouldn't give too much credence to >> that. FYI -- this device is a consumer grade rotational drive that you can >> get for less than $200, so I wouldn't be surprised if the implementations >> have issues. >> >> Also, I noticed that copying onto the drive with dd works fine, whereas >> trying to mount a filesystem immediately crashes it. I suspect this is >> because check_disk_change is called on mount (which eventually calls down >> to sd_read_write_protect_flag, which is where the US_FL_NO_WP_DETECT flag >> comes into play). > > Was this tested with uas or usb-storage? > > Alan Stern > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >