Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp323656imi; Thu, 21 Jul 2022 01:17:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uNrl1JGqcdaP8OUsAvtbKULp2vnODOi6bDXrrvqI3gIlFLUvNOHtfOMssSnPOCtBYW3782 X-Received: by 2002:a17:907:2ccb:b0:72b:52bb:fd51 with SMTP id hg11-20020a1709072ccb00b0072b52bbfd51mr38921291ejc.118.1658391436539; Thu, 21 Jul 2022 01:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658391436; cv=none; d=google.com; s=arc-20160816; b=eyLHQliIdM2/9NXiDIqUInrQTVSC39cHiiGK0r8hMopKUvN834EepCEn1+hgsAYV81 61qQuZCUQIuYaOfbPdGE7A75z0J3PA34kOTBjP3JKxFOaIVrvlr0zM1XY/ehzPvqdkt/ jknO6lvhNvqTNxdmu5BkRF2kM+XHsONht5UtMxj4P25R18ILPSEpZu6nlxm5DT1kEW2m UruL6eEh7JbFY/LH5QO5aISc7kFXRgs41GO8YrPJmetFmcTXKGyqq2fR99WJLcLlGqOr 9xkzef5QRtatS7B9HZC+yBvnUfIbhrKXdjVD3z3E1U7zF3Au6StKU9PsU0ntha6QHlKj muzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=OeXUgWfSBwMA0/mnxBHkh+G2d6QD85lH1tvWPe7kfmU=; b=SllXxRLaGzBQr/spajI2IsrjXOtsNSnOpPDPKFcRNLOkX0cliX3WpyLRa2zosdpn1s /XVwpbNDPMGABhvjlyQlBfRL58csMu+CpONjWrMR+ZaRBsYE9iQijeWyEg9xWX8M4cUx CCuSjg2dtL16a2I9w9kw/KbWoCM5q8dkWkty85jVOp5E+rK2Hbzwq6ZM5s6RvFG0LMG/ Ka6pv4vTLOFEQ25TLiNbxZFtYVwo1VJmCYVm+oJVjApVuGrnrGCqwli5yQCxA5RLbtsB USTnfKhBd/L52v7pgZ9H1utYFdYSDqhD+jnrVtsVdySXcpSbv3IzAsEt07+1tDKgkUjI FJ3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a0564021e8a00b0043a7b67ce58si1838378edf.107.2022.07.21.01.16.52; Thu, 21 Jul 2022 01:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231278AbiGUIHw (ORCPT + 99 others); Thu, 21 Jul 2022 04:07:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiGUIHt (ORCPT ); Thu, 21 Jul 2022 04:07:49 -0400 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC037D1CA; Thu, 21 Jul 2022 01:07:48 -0700 (PDT) Received: by mail-qt1-f182.google.com with SMTP id r24so729054qtx.6; Thu, 21 Jul 2022 01:07:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OeXUgWfSBwMA0/mnxBHkh+G2d6QD85lH1tvWPe7kfmU=; b=G8jYurc4SOoMRJRYTacFTd5Tpd+r/IknAy6t2pGlrwrBRj1qteES0bNDfFTdbw7EKX 5dXSHkSgzkQujYqGo+9q65qnRuHJj4ta8MGnvictj1TpCXlgjOaVtCQ6tbL8zRVy2nRz eFQ9PJRWMTJiGnu59wiTOzdnwIdLkaUOC9p+J+cyPS0nuYtBqSIfqouY/T9pbr7jm2FH f42NcRZDaX61vy/Mf+u58Kz2E8dLDvIYjgLnSGDh3e5mapX5j5jmwFWriJMLa0INIvH7 YopX+qvnnkWZpQbTcPAQHuFKDpUxEgARIYlwGSnmBEIsfEGie8AXj0QStfoE5Uo6az2F Yegg== X-Gm-Message-State: AJIora9e82AMSb9/E41bNHwOLAKFyZMgnxH/nNvJZFcLDI6R8vtzZ7EH qXG823Y/Icrl+RmUUqyCuut83AMeijec9Q== X-Received: by 2002:ac8:5b44:0:b0:31f:775:c2a2 with SMTP id n4-20020ac85b44000000b0031f0775c2a2mr5175880qtw.122.1658390867025; Thu, 21 Jul 2022 01:07:47 -0700 (PDT) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com. [209.85.219.182]) by smtp.gmail.com with ESMTPSA id h15-20020a05620a244f00b006af3bc9c6bbsm1127499qkn.52.2022.07.21.01.07.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 01:07:46 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id c131so1520302ybf.9; Thu, 21 Jul 2022 01:07:46 -0700 (PDT) X-Received: by 2002:a25:bc8e:0:b0:66e:fe43:645c with SMTP id e14-20020a25bc8e000000b0066efe43645cmr40553747ybk.202.1658390865825; Thu, 21 Jul 2022 01:07:45 -0700 (PDT) MIME-Version: 1.0 References: <20220630195703.10155-1-bvanassche@acm.org> <20220630195703.10155-3-bvanassche@acm.org> <506ca1a6-1122-5755-fc74-60f7c7bfbd0d@acm.org> <6f70e742-9d8a-f389-0482-0ba9696bf445@acm.org> In-Reply-To: <6f70e742-9d8a-f389-0482-0ba9696bf445@acm.org> From: Geert Uytterhoeven Date: Thu, 21 Jul 2022 10:07:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] scsi: sd: Rework asynchronous resume support To: Bart Van Assche Cc: "Martin K . Petersen" , Jaegeuk Kim , scsi , Ming Lei , Hannes Reinecke , John Garry , ericspero@icloud.com, jason600.groome@gmail.com, Linux-Renesas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hoi Bart, On Wed, Jul 20, 2022 at 8:04 PM Bart Van Assche wrote: > On 7/20/22 10:44, Geert Uytterhoeven wrote: > > On Wed, Jul 20, 2022 at 6:51 PM Bart Van Assche wrote: > >> I'm not familiar with the SATA code but from a quick look it seems like > >> the above code is only triggered from inside the ATA error handler > >> (ata_do_eh() -> ata_eh_recover() -> ata_eh_revalidate_and_attach() -> > >> schedule_work(&(ap->scsi_rescan_task) -> ata_scsi_dev_rescan()). It > >> doesn't seem normal to me that the ATA error handler gets invoked during > >> a resume. How about testing the following two code changes? > > > > Thanks for your suggestions! > > > >> * In sd_start_stop_device(), change "return sd_submit_start(sdkp, cmd, > >> sizeof(cmd))" into "sd_submit_start(sdkp, cmd, sizeof(cmd))" and below > >> that call add "flush_work(&sdkp->start_done_work)". This makes > >> sd_start_stop_device() again synchronous. This will learn us whether the > >> behavior change is caused by submitting the START command from another > >> context or by not waiting until the START command has finished. > > > > Unfortunately this doesn't have any impact. > > > >> * Back out the above change, change "return sd_submit_start(sdkp, cmd, > >> sizeof(cmd))" again into "sd_submit_start(sdkp, cmd, sizeof(cmd))" and > >> below that statement add a call to > >> scsi_run_queue(sdkp->device->request_queue). If this change helps it > > > > (that's the static scsi_run_queue() in drivers/scsi/scsi_lib.c?) > > > >> means that the scsi_run_queue() call is necessary to prevent reordering > >> of the START command with other SCSI commands. > > > > Unfortunately this doesn't have any impact either. > > That's surprising. Is there anything unusual about the test setup that I > should know, e.g. very small number of CPU cores or a very small queue > depth of the SATA device? How about adding pr_info() statements at the > start and end of the following functions and also before the return > statements in these functions to determine where execution of the START > command hangs? > * sd_start_done(). > * sd_start_done_work(). None of these functions seem to be called at all? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds